1460719306-800925fb-601a-4b2e-9bba-82bf96ba57ca

1. A light emitting diode (LED) controller comprising:
a current sensor coupled to a dimmer, the current sensor configured to detect a dimmer current;
a current controller coupled to an output of the current sensor, the current controller comprising a dimmer control unit configured to:
determine a dimmer operating mode based on the detected dimmer current, wherein a first dimmer operating mode corresponds to conditions at the beginning of operation after the dimmer is triggered and a second dimmer operating mode corresponds to conditions that the detected dimmer current is maintained within a predetermined tolerance range of a threshold dimmer current,
compare the detected dimmer current to a threshold dimmer current value, and
generate a control signal during the first dimmer operating mode and during the second dimmer operating mode for regulating the dimmer current based at least in part on a difference between the threshold current value and the detected dimmer current, and the determined dimmer operating mode; and

a switch coupled to the current controller, the switch configured to receive the control signal generated by the dimmer control unit and regulate an amount of additional dimmer current to be supplied to the dimmer through an additional current path based on the control signal, the amount of additional current supplied to the dimmer based on the difference between the threshold dimmer current value and the detected dimmer current.
2. The LED controller of claim 1, wherein the current controller adjusts a duty cycle of the control signal based on the determined dimmer operating mode to regulate the amount of additional dimmer current to be supplied to the dimmer through the additional current path.
3. The LED controller of claim 2, wherein during the first dimmer operating mode, the current controller adjusts the duty cycle of the control signal between a range of one hundred percent and forty percent based on the difference between the detected dimmer current and the threshold dimmer current.
4. The LED controller of claim 2, wherein during the second dimmer operating mode, the current controller adjusts the duty cycle of the control signal between a range from forty percent to zero percent based on the difference between the detected dimmer current and the threshold dimmer current.
5. The LED controller of claim 1, wherein the threshold dimmer current value is based on a value of the dimmer current when the dimmer stops conducting after being triggered.
6. The LED controller of claim 1, wherein the threshold dimmer current value is based on a value of a programmable circuit element, the value of the programmable element being accessible by the LED controller.
7. The LED controller of claim 6, wherein the programmable circuit element comprises a resistive circuit element.
8. The LED controller of claim 1, wherein the additional dimmer current is equal to the difference between the threshold dimmer current value and the detected dimmer input current.
9. The LED controller of claim 1, wherein the dimmer control unit is further configured to determine when to transition from the first dimmer operating mode to the second dimmer operating mode, wherein in the case of the first dimmer operating mode, the current controller transitions from the first dimmer operating mode to the second dimmer operating mode when the current controller determines that the detected dimmer current is equal to the threshold dimmer current within the predetermined tolerance range.
10. A method of controlling dimming of an LED lamp, the method comprising:
detecting, by a current sensor, a dimmer current;
determining, by a dimmer control unit, a dimmer operating mode based on the detected dimmer current, wherein a first determined dimmer operating mode corresponds to conditions at the beginning of operation after the dimmer is triggered and a second determined dimmer operating mode corresponds to conditions when the detected dimmer current is maintained within a predetermined tolerance range of the threshold dimmer current;
comparing the detected dimmer current to a threshold dimmer current value;
generating a control signal during the first dimmer operating mode and during the second dimmer operating mode to regulate the dimmer current based at least in part on a difference between the threshold current value and the detected dimmer current and the determined dimmer operating mode; and
regulating an amount of additional dimmer current to be supplied to the dimmer through an additional current path based on a duty cycle of the control signal, the amount of additional current supplied to the dimmer through the additional current path based on the difference between the threshold dimmer current value and the detected dimmer current.
11. The method of claim 10, further comprising adjusting the duty cycle of the control signal based on the determined dimmer operating mode to regulate the amount of additional dimmer input current to be supplied to the dimmer through the additional current path.
12. The method of claim 10, further comprising, during the first dimmer operating mode, modifying the control signal by adjusting the duty cycle of the control signal between a range of one hundred percent and forty percent based on the difference between the detected dimmer current and the threshold dimmer current.
13. The method of claim 12, further comprising, during the first dimmer operating mode, regulating the amount of additional dimmer current to be supplied to the dimmer through the additional current path based on the modified control signal.
14. The method of claim 13, further comprising, generating the modified control signal to turn on and to turn off a switch to regulate the amount of additional dimmer current to be supplied to the dimmer through the additional current path based on the modified control signal.
15. The method of claim 10, further comprising, during the second dimmer operating mode, modifying the control signal by adjusting the duty cycle of the control signal between a range from forty percent to zero percent based on the difference between the detected dimmer current and the threshold dimmer current.
16. The method of claim 15, further comprising, during the second dimmer operating mode, regulating the amount of additional dimmer current to be supplied to the dimmer through the additional current path based on the modified control signal.
17. The method of claim 16, further comprising generating the modified control signal to turn on and to turn off a switch to regulate the amount of additional dimmer current to be supplied to the dimmer through the additional current path based on the modified control signal.
18. The method of claim 10, further comprising:
determining a value of the dimmer current when the dimmer stops conducting after being triggered; and
modifying the threshold dimmer current based on the determined value of the dimmer current when the dimmer stops conducting after being triggered.
19. The method of claim 10, wherein the threshold dimmer current value is based on a value of a programmable circuit element, the value of the programmable element being accessible by the LED controller.
20. The method of claim 19, wherein the programmable circuit element comprises a resistive circuit element.
21. The method of claim 10, wherein detecting the dimmer current comprise sensing the dimmer current at a specified interval.
22. The method of claim 10, further comprising determining when to transition from the first dimmer operating mode to the second dimmer operating mode, wherein in the case of the first dimmer operating mode, transitioning from the first dimmer operating mode to the second dimmer operating mode responsive to a determination that the detected dimmer current is equal to the threshold dimmer current within the predetermined tolerance range.

The claims below are in addition to those above.
All refrences to claim(s) which appear below refer to the numbering after this setence.

1. A method for implementing database queries for a plurality of streams of data, comprising:
receiving a plurality of streams of data, for storage in a database;
for each of the plurality of streams of data, sampling that stream of data at a plurality of time intervals to capture a plurality of samples, wherein each sample corresponds to a portion of that stream of data captured during that time interval;
providing a plurality of equations and equation coefficients stored in an equation analysis unit;
for each of the plurality of samples, approximating that sample by selecting an equation and equation coefficients that optimally fits that sample, wherein the equation and equation coefficients for each of the plurality of samples is selected from the plurality of equations and equation coefficients stored in the equation analysis unit;
storing the plurality of streams of data in the database;
storing the equations and equation coefficients approximating the plurality of samples in the equation analysis unit;
subsequently receiving, by a database query arbiter, a query for data which includes a join over two or more of the streams of data, for a particular time interval;
determining whether to respond to the query by retrieving data from the database, or by using the equations, and when it is determined to respond using the equations, then
forwarding the query to the equation analysis unit,
determining, for each of the two or more streams of data, the particular time interval the query is directed to,
determining, based on the particular time interval the query is directed to for each of the two or more streams of data, which equation and equation coefficients from the plurality of equation and equation coefficients fit that stream of data for that particular time interval,
selecting, based on the particular time interval the query is directed to for each of the two or more streams of data, the equation and equation coefficients that fit that stream of data for that particular time interval, and
simultaneously solving the selected equations to determine a response to the query; and

wherein the method steps are performed by at least one processor.
2. The method of claim 1, wherein the database query is a SQL query.
3. The method of claim 1, wherein multiple streams are modeled using multiple equations.
4. The method of claim 3, wherein the database query is a join query on a numerical condition using the multiple equations.
5. The method of claim 1, wherein the equation is produced using an ARIMA model.
6. The method of claim 1, wherein multiple models are used to produce multiple equations to approximate a single stream of data to select a model and equation that produces a good fit to the stream of data.
7. The method of claim 1, wherein coefficients for the equation are calculated iteratively and maintained.
8. The method of claim 1, wherein the equation and coefficients for the equation are updated as more of the stream of data is received.
9. The method of claim 1, wherein a probabilistic technique is applied towards correcting data losses and provides the response to the query with a quantified accuracy.
10. The method of claim 1, wherein the step of selecting an equation and equation coefficients that optimally fits that sample further includes
testing a plurality of equations in parallel for said sample, and selecting the equation and equation coefficients that optimally fits said sample.
11. A computer implemented system for implementing database queries for a plurality of streams of data comprising:
one or more processors to execute code;
code to a plurality of streams of data, for storage in a database;
code that for each of the plurality of streams of data, sampling that stream of data at a plurality of time intervals to capture a plurality of samples, wherein each sample corresponds to a portion of that stream of data captured during that time interval; code to provide a plurality of equations and equation coefficients stored in an equation analysis unit;
code that for each of the plurality of samples, approximating that sample by selecting an equation and equation coefficients that optimally fits that sample, wherein the equation and equation coefficients for each of the plurality of samples is selected from a plurality of equations and equation coefficients stored in the equation analysis unit;
code for storing the plurality of streams of data in the database;
code for storing the equations and equation coefficients approximating the plurality of samples in the equation analysis unit;
code that subsequently receives, by a database query arbiter, a query for data which includes a join over two or more of the streams of data, for a particular time interval;
code that determines whether to respond to the query by retrieving data from the database, or by using the equations, and when it is determined to respond using the equations, then
code that forwards the query to the equation analysis unit,
code that determines, for each of the two or more streams of data, the particular time interval the query is directed to,
code that determines, based on the particular time interval the query is directed to for each of the two or more streams of data, which equation and equation coefficients from the plurality of equation and equation coefficients fit that stream of data for that particular time interval,
code that selects, based on the particular time interval the query is directed to for each of the two or more streams of data, the equation and equation coefficients that fit that stream of data for that particular time interval, and
code that simultaneously solves the selected equations to determine a response to the query; and
wherein the codes are executed on the one or more processors of the computer implemented system.
12. The computer implemented system of claim 11, wherein the database queries are SQL queries.
13. The computer implemented system of claim 11, wherein multiple streams are modeled using multiple equations.
14. The computer implemented system of claim 13, wherein the database queries include join queries done using the simultaneous solution of multiple equations.
15. The computer implemented system of claim 11, wherein the equation is produced using an ARIMA model.
16. The computer implemented system of claim 11, wherein multiple models are used to produce multiple equations to approximate a single stream of data to select the model and the equation that produces a good fit to the stream of data.
17. The computer implemented system of claim 11, wherein coefficients for the equation are maintained.
18. The computer implemented system of claim 11, wherein the equation and coefficients for the equation are updated as more of the stream of data is received.
19. The computer implemented system of claim 11, wherein a probabilistic technique is applied towards correcting data losses and provides the response to the query with a quantified accuracy.
20. The computer implemented system of claim 11, wherein the step of selecting an equation and equation coefficients that optimally fits that sample further includes
testing a plurality of equations in parallel for said sample, and selecting the equation and equation coefficients that optimally fits said sample.
21. A non-transitory computer readable storage medium including one or more sequences of instructions, said one or more sequences of instructions when executed by one or more processors, cause the one or more processors to carry out the steps of:
receiving a plurality of streams of data, for storage in a database;
for each of the plurality of streams of data, sampling that stream of data at a plurality of time intervals to capture a plurality of samples, wherein each sample corresponds to a portion of that stream of data captured during that time interval;
providing a plurality of equations and equation coefficients stored in an equation analysis unit;
for each of the plurality of samples, approximating that sample by selecting an equation and equation coefficients that optimally fits that sample, wherein the equation and equation coefficients for each of the plurality of samples is selected from a plurality of equations and equation coefficients stored in an equation analysis unit;
storing the plurality of streams of data in the database;
storing the equations and equation coefficients approximating the plurality of samples in the equation analysis unit;
subsequently receiving, by a database query arbiter, a query for data which includes a join over two or more of the streams of data, for a particular time interval;
determining whether to respond to the query by retrieving data from the database, or by using the equations, and when it is determined to respond using the equations, then
forwarding the query to the equation analysis unit,
determining, for each of the two or more streams of data, the particular time interval the query is directed to,
determining, based on the particular time interval the query is directed to for each of the two or more streams of data, which equation and equation coefficients from the plurality of equation and equation coefficients fit that stream of data for that particular time interval,
selecting, based on the particular time interval the query is directed to for each of the two or more streams of data, the equation and equation coefficients that fit that stream of data for that particular time interval, and

simultaneously solving the selected equations to determine a response to the query.
22. The non-transitory computer readable storage medium of claim 21, wherein the database query is a SQL query.
23. The non-transitory computer readable storage medium of claim 21, wherein multiple streams are modeled using multiple equations.
24. The non-transitory computer readable storage medium of claim 23, wherein the database query is a join query done using the multiple equations.
25. The non-transitory computer readable storage medium of claim 21, wherein the equation is produced using an ARIMA model.
26. The non-transitory computer readable storage medium of claim 21, wherein multiple models are used to produce multiple equations to approximate a single stream of data to select a model and equation that produces a good fit to the stream of data.
27. The non-transitory computer readable storage medium of claim 21, wherein coefficients for the equation are maintained.
28. The non-transitory computer readable storage medium of claim 21, wherein the equation and coefficients for the equation are updated as more of the stream of data is received.
29. The non-transitory computer readable storage medium of claim 21, wherein a probabilistic technique is applied towards correcting data losses and provides the response to the query with a quantified accuracy.
30. The non-transitory computer readable storage medium of claim 21, wherein the step of selecting an equation and equation coefficients that optimally fits that sample further includes
testing a plurality of equations in parallel for said sample, and selecting the equation and equation coefficients that optimally fits said sample.
31. A method for implementing database queries for a data stream, comprising:
receiving a stream of data, for storage in a database;
sampling the stream of data at a plurality of time intervals to capture a plurality of samples, wherein each sample corresponds to a portion of that stream of data captured during that time interval;
providing a plurality of equations and equation coefficients stored in an equation analysis unit;
for each of the plurality of samples, approximating that sample by selecting an equation and equation coefficients that optimally fits that sample, wherein the equation and equation coefficients for each of the plurality of samples is selected from a plurality of equations and equation coefficients stored in the equation analysis unit;
storing the stream of data in the database;
storing the equations and equation coefficients approximating the plurality of samples in the equation analysis unit;
subsequently receiving, by a database query arbiter, a query for data for a particular time interval;
determining whether to respond to the query by retrieving data from the database, or by using the equations, and when it is determined to respond using the equations, then
forwarding the query to the equation analysis unit,
determining the particular time interval the query is directed to,
determining, based on the particular time interval the query is directed to, which equation and equation coefficients from the plurality of equation and equation coefficients fit the stream of data for that particular time interval,
selecting, based on the particular time interval the query is directed to, the equation and equation coefficients that fit the stream of data for that particular time interval, and
using the equation and equation coefficients for that particular time interval to determine a response to the query; and

wherein the method steps are performed by at least one processor.
32. A method for implementing database queries for a data stream, comprising:
receiving a stream of data;
sampling the stream of data at a plurality of time intervals to capture a plurality of samples, wherein each sample corresponds to a portion of the stream of data captured during that time interval;
providing a plurality of equations and equation coefficients stored in an equation analysis unit;
for each of the plurality of samples, approximating that sample by selecting an equation and equation coefficients that optimally fits that sample, wherein the equation and equation coefficients is selected from a plurality of equations and equation coefficients stored in the equation analysis unit;
storing the equations and equation coefficients approximating the samples in the equation analysis unit;
subsequently receiving a query for data for a particular time interval;
responding to the query by
forwarding the query to the equation analysis unit,
determining the particular time interval the query is directed to,
determining, based on the particular time interval the query is directed to, which equation and equation coefficients from the plurality of equation and equation coefficients fit the stream of data for that particular time interval,
selecting, based on the particular time interval the query is directed to, the equation and equation coefficients that fit the stream of data for that particular time interval, and
using the equation and equation coefficients for that particular time interval to determine a response to the query; and

wherein the method steps are performed by at least one processor.