Disclosure of Invention
The invention mainly aims to provide a time management method, equipment and a readable storage medium for an intelligent single-fire switch, which can dynamically adjust the sleep time of the intelligent single-fire switch according to the use habit of a user and lower the power consumption of the intelligent single-fire switch to the maximum extent.
In order to achieve the above object, the present invention provides a time management method for an intelligent single fire switch, the method comprising:
counting the switch use times of a user in a specified time period in one day;
calculating a reference sleep time of the designated time period of each day in one time period according to the switch use times of the designated time period of each day in one time period;
and calculating the actual sleep time of the specified time period of each day in the current time period according to the reference sleep time of the specified time period of each day in the time periods of continuously set number before the current time period.
Optionally, the calculating a reference sleep time of the designated time period of each day in a time cycle according to the number of switch usages of the designated time period of each day in a time cycle includes:
accumulating the switch use times of the appointed time period every day in a time period to obtain the accumulated switch use times of the appointed time period in the time period;
and calculating the reference sleep time of the designated time period every day in a time period according to the accumulated switch use times of the designated time period in the time period.
Optionally, the calculating the reference sleep time of the designated time period for each day in a time period according to the accumulated switch usage times of the designated time period in the time period includes:
if the accumulated switch usage number of the nth time period in the mth time period is set as f, the reference sleep time T of the nth time period in each day in the mth time period is calculated according to the following formulamn:
Tmn=a×f+b;
Wherein a is a set coefficient;
b is a set constant;
f. m and n are natural integers.
Optionally, the calculating, according to the reference sleep time of the designated time period of each day in the time periods of the continuously set number before the current time period, the actual sleep time of the designated time period of each day in the current time period includes:
if the current time period is the mth time period and the set number is k, calculating the actual sleep time T 'of the nth time period of each day in the current period according to the following formula'mn:
Wherein, T0nIs an initial reference sleep time for the nth period.
Optionally, after calculating the actual sleep time of the designated time period for each day in the current time period, the method further includes:
if the actual sleep time is less than a preset minimum actual sleep time, setting the actual sleep time as a minimum actual sleep time; or,
and if the actual sleep time is greater than the preset maximum actual sleep time, setting the actual sleep time as the maximum actual sleep time.
Optionally, before counting the number of switch usages of the user in each time period, the method further includes:
receiving setting information transmitted by a mobile terminal, the setting information including: an initial reference sleep time, a minimum actual sleep time, and a maximum actual sleep time for each period.
In addition, in order to achieve the above object, the present invention further provides a time management device of an intelligent single fire switch, the device including: a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the time management program of the intelligent single fire switch stored in the memory so as to realize the following steps:
counting the switch use times of a user in a specified time period in one day;
calculating a reference sleep time of the designated time period of each day in one time period according to the switch use times of the designated time period of each day in one time period;
and calculating the actual sleep time of the specified time period of each day in the current time period according to the reference sleep time of the specified time period of each day in the time periods of continuously set number before the current time period.
Optionally, when the processor performs the step of calculating the reference sleep time of the designated time period of each day in a time period according to the number of times of switch usage of the designated time period of each day in the time period, the method specifically includes:
accumulating the switch use times of the appointed time period every day in a time period to obtain the accumulated switch use times of the appointed time period in the time period;
and calculating the reference sleep time of the designated time period every day in a time period according to the accumulated switch use times of the designated time period in the time period.
Optionally, the processor is further configured to execute a time management program of the intelligent single fire switch stored in the memory, so as to implement the following steps:
after the actual sleep time of the appointed time period every day in the current time period is obtained through calculation, if the actual sleep time is smaller than the preset minimum actual sleep time, the actual sleep time is set as the minimum actual sleep time; or if the actual sleep time is greater than a preset maximum actual sleep time, setting the actual sleep time as the maximum actual sleep time.
In addition, in order to achieve the above object, the present invention further provides a computer-readable storage medium storing a time management program of the intelligent single fire switch;
when executed by at least one processor, causes the at least one processor to perform the steps of the intelligent single fire switch time management method described above.
According to the time management method, the time management equipment and the readable storage medium of the intelligent single fire switch, the sleep time of the time period in the next time period is calculated according to the switch use times of the user in the same time period in a plurality of time periods, so that the power consumption of the intelligent single fire switch is reduced to the maximum extent under the condition that good user use experience is guaranteed. By repeatedly learning the use times of the past switch, the future use habits of the user are predicted, and the value of the sleep time is automatically adjusted, so that the effect of reducing the power consumption of the intelligent single-fire switch is achieved.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the intended purpose, the present invention will be described in detail with reference to the accompanying drawings and preferred embodiments.
The first embodiment of the present invention provides a time management method for an intelligent single live switch, which is applied to the intelligent single live switch, and as shown in fig. 1, the method specifically includes the following steps:
step S101: and counting the switch use times of the user in a specified time period in one day.
Wherein 24 hours a day is divided into one or more time periods. Because the frequency that the user used intelligent single fire switch is different at different time quantums, the user can be as required with 24 hours a day divide into a plurality of time quantums to set up different dormancy time to different time quantums. For example, a 24-hour day is divided into 4 time segments, which are: a first time period, 0 o 'clock to 6 o' clock; a second time period, 6 o 'clock to 12 o' clock; a third time period, 12 o 'clock to 18 o' clock; and a fourth time period, 18 o 'clock to 24 o' clock.
Specifically, the switch use times of the user in each time period in one day are respectively counted.
Step S102: calculating a reference sleep time for the designated time period for each day of a time period based on the number of switch usages for the designated time period for each day of a time period.
Wherein a time period comprises one or more days. In each time period, the sleep time of the intelligent single fire switch in different time periods of each day in the current time period is reset according to the frequency of the intelligent single fire switch used by the user in a plurality of previous time periods.
Specifically, step S102 includes:
step A1: and accumulating the switch use times of the appointed time period every day in a time period to obtain the accumulated switch use times of the appointed time period in the time period.
For example, if a time period is set to 7 days, and the specified time period is from 0 to 6 points, the switch use times from 0 to 6 points in each day in the time period are sequentially accumulated to obtain the sum of the switch use times in all the time periods from 0 to 6 points in 7 days.
Step A2: and calculating the reference sleep time of the designated time period every day in a time period according to the accumulated switch use times of the designated time period in the time period.
Further, the calculating the reference sleep time of the designated time period for each day in a time period according to the accumulated switch usage number of the designated time period in the time period includes:
if the accumulated switch usage number of the nth time period in the mth time period is set as f, the reference sleep time T of the nth time period in each day in the mth time period is calculated according to the following formulamn:
Tmn=a×f+b;
Wherein a is a set coefficient;
b is a set constant;
f. m and n are natural integers.
Accumulating the switch use times f and the reference sleep time TmnInversely proportional, and the sleep time of a given time period each day in a future time period is affected by the cumulative number of switch uses of that time period over a plurality of previous time periods. The larger the accumulated switch use times of the specified time period in one time period is, the more frequent the use demands of the user on the intelligent single fire switch in the specified time period every day in one time period is, and therefore, the sleep time of the specified time period every day in the future time period needs to be set to be relatively short.
Step S103: and calculating the actual sleep time of the specified time period of each day in the current time period according to the reference sleep time of the specified time period of each day in the time periods of continuously set number before the current time period.
It should be noted that the reference sleep time is different from the actual sleep time. The reference sleep time is a reference sleep time of the designated time period per day in one time period calculated based on an accumulated number of switch usages of the designated time period in one time period, and the reference sleep times of the designated time period per day in one time period are all the same. And the actual sleep time is the sleep time used by the intelligent single fire switch in actual use, and the actual sleep time of the specified time period of each day in a time period is the same.
Specifically, step S103 includes:
if the current time period is the mth time period and the set number is k, calculating the actual sleep time T 'of the nth time period of each day in the current period according to the following formula'mn:
Wherein, T0nIs an initial reference sleep time for the nth period. The initial reference sleep time for each period may be the same or different.
Since the time period closest to the current time period can reflect the current user habit of the user most, the time period closer to the current time period has a higher weight, and the time period longer from the current time period has a lower weight. When the number of the time periods exceeds the set number, the correlation between the data acquired in the early stage and the future time period is weaker, and k is set as the maximum effective time period number for acquiring in order to reduce the complexity of the later operation. That is, the actual sleep time of the current time period is calculated only by data of k time periods before the current time period.
Further, after calculating the actual sleep time of the designated time period for each day in the current time period, the method further includes:
if the actual sleep time is less than a preset minimum actual sleep time, setting the actual sleep time as a minimum actual sleep time; or,
and if the actual sleep time is greater than the preset maximum actual sleep time, setting the actual sleep time as the maximum actual sleep time.
The minimum actual sleep time is set for ensuring the smaller power consumption of the intelligent single fire switch, and the maximum actual sleep time is set for ensuring the response speed of the intelligent single fire switch. In order to avoid too slow response of the intelligent single fire switch, the actual sleep time of each time segment of each day in each time period cannot be greater than the maximum actual sleep time. To ensure that less power is avoided in the intelligent single fire switch, the actual sleep time of each time segment of each day in each time cycle cannot be less than the minimum actual sleep time.
Further, before counting the switch usage times of the user in each time period, the method further comprises:
receiving setting information transmitted by a mobile terminal, the setting information including: an initial reference sleep time, a minimum actual sleep time, and a maximum actual sleep time for each period.
Install the application program APP of control intelligence single live switch in mobile terminal, through the APP that corresponds, can send information to intelligence single live switch to control intelligence single live switch. Specifically, in the implementation process, the APP sends the setting message to the server, the server forwards the setting message to the intelligent gateway where the intelligent single fire switch is located, and finally the intelligent gateway forwards the setting message to the intelligent single fire switch.
A second embodiment of the present invention provides a time management device for an intelligent single fire switch, which is applied to the intelligent single fire switch, and as shown in fig. 2, the time management device specifically includes: a processor 201, a memory 202, and a communication bus;
the communication bus is used for realizing connection communication between the processor 201 and the memory 202;
the processor 201 is configured to execute a program stored in the memory 202 for controlling the downstream optical signal in the passive optical network to implement the following steps:
counting the switch use times of a user in a specified time period in one day;
calculating a reference sleep time of the designated time period of each day in one time period according to the switch use times of the designated time period of each day in one time period;
and calculating the actual sleep time of the specified time period of each day in the current time period according to the reference sleep time of the specified time period of each day in the time periods of continuously set number before the current time period.
Specifically, when the processor 201 performs the step of calculating the reference sleep time of the designated time period of each day in a time period according to the number of switch usages of the designated time period of each day in the time period, the method specifically includes:
accumulating the switch use times of the appointed time period every day in a time period to obtain the accumulated switch use times of the appointed time period in the time period;
and calculating the reference sleep time of the designated time period every day in a time period according to the accumulated switch use times of the designated time period in the time period.
Further, when the processor 201 performs the step of calculating the reference sleep time of the designated time period in each day in a time period according to the accumulated switch usage times of the designated time period in the time period, the method specifically includes:
if the accumulated switch usage number of the nth time period in the mth time period is set as f, the reference sleep time T of the nth time period in each day in the mth time period is calculated according to the following formulamn:
Tmn=a×f+b;
Wherein a is a set coefficient;
b is a set constant;
f. m and n are natural integers.
Further, when the processor 201 performs the step of calculating the actual sleep time of the designated time period of each day in the current time period according to the reference sleep time of the designated time period of each day in the time periods of the continuously set number of time periods before the current time period, the method specifically includes:
if the current time period is set asAnd in the mth time period, if the set number is k, calculating the actual sleep time T 'of the nth time period of each day in the current period according to the following formula'mn:
Wherein, T0nIs an initial reference sleep time for the nth period.
Further, the processor 201 is further configured to execute the time management program of the intelligent single fire switch stored in the memory to implement the following steps:
after the actual sleep time of the appointed time period every day in the current time period is obtained through calculation, if the actual sleep time is smaller than the preset minimum actual sleep time, the actual sleep time is set as the minimum actual sleep time; or if the actual sleep time is greater than a preset maximum actual sleep time, setting the actual sleep time as the maximum actual sleep time.
Further, the processor 201 is further configured to execute the time management program of the intelligent single fire switch stored in the memory to implement the following steps:
before counting the switch use times of each time period in each time period of a user, receiving setting information sent by a mobile terminal, wherein the setting information comprises: an initial reference sleep time, a minimum actual sleep time, and a maximum actual sleep time for each period.
A third embodiment of the present invention proposes a computer-readable storage medium applied to an intelligent one-fire switch, the computer-readable storage medium storing a time management program of the intelligent one-fire switch;
when executed by at least one processor, the time management program of the intelligent single fire switch causes the at least one processor to:
counting the switch use times of a user in a specified time period in one day;
calculating a reference sleep time of the designated time period of each day in one time period according to the switch use times of the designated time period of each day in one time period;
and calculating the actual sleep time of the specified time period of each day in the current time period according to the reference sleep time of the specified time period of each day in the time periods of continuously set number before the current time period.
According to the time management method, the time management device and the readable storage medium of the intelligent single fire switch, the sleep time of the time period in the next time period is calculated according to the switch use times of the user in the same time period in a plurality of time periods, and therefore the power consumption of the intelligent single fire switch is reduced to the maximum extent under the condition that good user use experience is guaranteed. By repeatedly learning the use times of the past switch, the future use habits of the user are predicted, and the value of the sleep time is automatically adjusted, so that the effect of reducing the power consumption of the intelligent single-fire switch is achieved.
While the invention has been described in connection with specific embodiments thereof, it is to be understood that it is intended by the appended drawings and description that the invention may be embodied in other specific forms without departing from the spirit or scope of the invention.