Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
The wireless time-setting method provided by the application can be applied to the wireless time-setting process of the power system. The wireless time setting process is carried out through a convergence module and a plurality of sensors, the convergence module is responsible for sending time setting information for time service, a time setting device in the sensors is used for generating time setting pulse when receiving the time setting information, and the sensors synchronously carry out acquisition, calculation and communication work under the time setting pulse.
In one embodiment, as shown in fig. 1, a wireless time synchronization method is provided, which is applied to a sensor and includes the following steps:
step S101, in the quasi-synchronous state of the current wheel, a wireless receiving window is opened according to a variable time interval, and after a quasi-synchronous frame sent by the convergence module is received in a certain wireless receiving window, the current wheel is in a successful synchronous state and enters into dormancy waiting.
In the time setting process, the sensor sequentially enters a quasi-synchronous state and a synchronous state, if the sensor is synchronized again, the sensor enters the quasi-synchronous state and the synchronous state again, and in order to distinguish the quasi-synchronous state and the synchronous state which are entered each time, the sensor regards the quasi-synchronous state and the synchronous state as one round.
Specifically, the time setting information sent by the aggregation module consists of two parts, namely a function code and time information. The two types of quasi-synchronous frames and synchronous frames are classified according to the difference of the function codes. Before the time of time setting, the convergence module uses a fixed time interval Transmitting a plesiochronous frame carrying the remaining time from arrival of the synchronous frame>。
After the sensor is started, the sensor defaults to a quasi-synchronous state. In the quasi-synchronous state of the current wheel, the sensor is at variable time intervalsStarting the receiver of the radio frequency communication module, wherein the starting duration of the receiver of the radio frequency communication module is as followsThe radio frequency communication modules are in a sleep waiting state in the rest time. The wireless receiving window means that the receiver keeps on state, and the working time of the window is the on duration of the receiver +.>. By adjusting the time interval of the starting of the receiver, the receiver can receive the quasi-synchronous frames sent by the convergence module at fixed time intervals in a certain wireless receiving window. After the quasi-synchronous frame sent by the convergence module is successfully received in a certain wireless receiving window, the current round of synchronous success state is entered and the dormancy waiting is entered. Time interval->Calculated from the following formula:
wherein,,for a fixed interval base time, +.>For a fixed interval random number maximum, < >>The sensor is a random number with the size of 0-1, and is obtained by random generation of a random number module of the sensor.
Step S102, when the duration of the sleep waiting reaches the residual time of the arrival of the synchronization frame carried by the quasi-synchronization frame in the successful synchronization state of the current wheel, opening a wireless receiving window.
Specifically, after receiving the quasi-synchronization frame sent by the aggregation module in a certain receiving window, extracting the remaining time from the arrival of the synchronization frame carried in the quasi-synchronization frame. When the duration of sleep waiting arrives +.>And opening a wireless receiving window.
Step S103, if a plurality of synchronization frames sent by the aggregation module are received in a plurality of wireless receiving windows, time synchronization is performed according to time synchronization information carried by the plurality of synchronization frames.
Specifically, under the action of the second pulse of the Beidou time setting module, the convergence module uses a fixed time intervalAnd transmitting the synchronous frame. And in the successful synchronization state of the current wheel, the synchronization is carried out in a mode of receiving the synchronization frame sent by the aggregation module in the wireless receiving window. Only one sync frame can be received within one radio reception window. And if a plurality of synchronous frames sent by the aggregation module are received in a plurality of wireless receiving windows, the time synchronization is carried out according to the time synchronization information carried by the plurality of synchronous frames. The specific process of the sensor pair may be: each time a sync frame is received, it is generatedThe time pulse is paired, the time pin level is pulled up at the same time, and after a period of time, the time pin level is pulled down again, so that a control module of the sensor can timely respond to the receiving condition of the synchronous frame, and further time setting accuracy is improved. Under the condition of neglecting the air transmission delay, all the sensors can generate time-setting pulses at the same time, and accordingly, sensing services such as sampling, calculating and sending are started.
According to the wireless time synchronization method, the working state of the sensor in the time synchronization process is divided into a quasi-synchronous state and a synchronous success state. Under the quasi-synchronous state of the current wheel, opening a wireless receiving window according to a variable time interval, and entering a synchronous success state of the current wheel and entering a sleep waiting after receiving a quasi-synchronous frame sent by the aggregation module in a certain wireless receiving window; and in the successful synchronization state of the current wheel, when the duration of dormancy waiting reaches the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, opening a wireless receiving window. By entering sleep waiting after receiving the quasi-synchronization frame, the wireless receiving window is opened to receive the synchronization frame immediately before the synchronization frame arrives according to the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, thereby reducing the power consumption of the sensor. And if a plurality of synchronous frames sent by the aggregation module are received in a plurality of wireless receiving windows, the time synchronization is carried out according to the time synchronization information carried by the plurality of synchronous frames. The power consumption of the sensor is reduced, the time setting requirement of the sensor can be met, and the problem that the sensor is halted due to insufficient power taking capability is avoided.
In one embodiment, as shown in FIG. 2, the wireless receive window is of a radio frequency communication module; in the successful synchronization state of the current wheel, when the duration of the sleep waiting reaches the remaining time from the arrival of the synchronization frame carried by the quasi-synchronization frame, after the wireless receiving window is opened, the method provided by the application further comprises the following steps:
Step S201, if the synchronous frame sent by the convergence module is not received in the wireless receiving window, the synchronous state is lost and the radio frequency communication module is self-checked.
Step S202, if the self-checking is successful, entering a quasi-synchronous state of the next round.
Step S203, if the self-checking fails, restarting and self-checking the radio frequency communication module again.
Step S204, if the self-checking again fails, a wireless time-setting function fault prompt is sent out.
Specifically, in the successful synchronization state, if the synchronization frame is not received in the wireless receiving window, the radio frequency communication module enters the out-of-synchronization state and performs self-checking on the radio frequency communication module. The self-checking means may be to send an instruction to the radio frequency communication module to check whether the radio frequency communication module can reply and transmit/receive normally. If the self-checking is successful, that is, the radio frequency communication module can recover and transmit normally, the next round of quasi-synchronous state is entered, and the wireless receiving window is opened according to the variable time interval to receive the quasi-synchronous frame. If the self-checking fails, namely the frequency communication module can not normally recover and transmit, restarting and self-checking the radio frequency module communication module again. If the self-checking fails again, confirming that the radio frequency communication module has faults, and sending out wireless time setting function fault reminding. Further, the number of repeated self-tests can be adjusted in combination with the actual situation.
In this embodiment, if the synchronization frame is not received in the wireless receiving window, the synchronization state is lost and the self-checking is performed, so that the radio frequency communication module is restarted in time or a wireless time-setting function fault prompt is sent out under the condition that the radio frequency communication module is abnormal in operation, the time-setting reliability of the wireless time-setting method is improved, and management personnel can conveniently know and replace a sensor with a fault in time.
In one embodiment, the number of synchronization frames includes a first synchronization frame of the current wheel and a second synchronization frame of the current wheel; a step of receiving a first sync frame of a current wheel and a second sync frame of the current wheel, comprising: when the waiting time length reaches the residual time from the arrival of the synchronous frame carried by the quasi-synchronous frame, opening the synchronous frame received by the wireless receiving window to be used as the first synchronous frame of the current wheel; if the synchronization interval duration is extracted from the first synchronization frame of the current wheel, entering into dormancy waiting, starting with the receiving time point of the first synchronization frame of the current wheel, and opening the wireless receiving window again according to whether the time reaches the synchronization interval duration so as to receive the second synchronization frame of the current wheel.
Specifically, in the pair of the current wheel, the plurality of synchronization frames includes a first synchronization frame of the current wheel and a second synchronization frame of the current wheel. And when the duration of the dormancy waiting reaches the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, opening a wireless receiving window, and taking the synchronization frame received in the wireless receiving window as the first synchronization frame of the current wheel. If the synchronization interval duration is extracted from the first synchronization frame of the current wheel Entering sleep waiting, starting with the receiving time point of the first synchronous frame of the current wheel, according to whether the time reaches the synchronous interval duration +.>The wireless reception window is opened again to receive the second sync frame of the current wheel. And in this cycle, time synchronization is performed according to the time synchronization information carried by the received plurality of synchronization frames.
In this embodiment, when the synchronization interval duration is extracted from the first synchronization frame of the current wheel, the sleep wait is entered, and the wireless receiving window is opened again according to whether the time reaches the synchronization interval duration or not, starting from the receiving time point of the first synchronization frame of the current wheel, so that the power consumption of the sensor can be reduced.
In one embodiment, the step of opening the wireless receiving window again according to whether the time reaches the synchronization interval duration from the receiving time point of the first synchronization frame of the current wheel comprises: taking the difference value between the synchronization interval duration carried by the first synchronization frame of the current wheel and the set advance awakening time as the synchronization interval duration; starting with the receiving time point of the first synchronous frame of the current wheel, opening the wireless receiving window again when the time reaches the synchronous interval duration.
Specifically, the synchronization interval duration carried by the first synchronization frame of the current wheel is . At the receiving sideBy the first sync frame of the current wheel, the sync interval duration is +.>And the set advance wake-up time->Difference of (i.e.)>As is the synchronization interval duration. Starting from the reception time point of the first synchronization frame of the current wheel, at +.>Before the moment comesAt this point, the wireless reception window is opened again. Optionally, the operating time of the wireless receiving window of the sensor is +.>. Advanced wake-up time->The setting of (2) needs to fully consider the error of the low-power consumption clock of the sensor and leave a certain margin.
In this embodiment, by setting the early wake-up time, the wireless receiving window can be opened in time before the synchronization frame arrives, so that the probability of receiving the synchronization frame can be improved, and the time setting precision of the wireless time setting method provided by the application is further improved.
In one embodiment, the number of synchronization frames includes a first synchronization frame of a current wheel, a first synchronization frame of each of the number of wheels subsequent to the current wheel, and a second synchronization frame of a last of the number of wheels; a step of receiving a second sync frame of a last of the number of rounds, comprising: if the synchronization interval duration cannot be extracted from the first synchronization frame of the current wheel, recording a receiving time point of the first synchronization frame of the current wheel, exiting the synchronization success state of the current wheel, sequentially entering a plurality of wheels, repeatedly entering a plurality of quasi-synchronization states to the synchronization success state, and recording the receiving time point of the first synchronization frame of each wheel in the plurality of wheels; obtaining a plurality of initial synchronization interval duration according to the difference value between the receiving time points of the first synchronization frames of the two adjacent rounds; determining a synchronization interval duration according to a plurality of initial synchronization interval durations; starting at the receiving time point of the first synchronous frame of the last round in the plurality of rounds, opening the wireless receiving window again according to whether the time reaches the synchronous interval duration so as to receive the second synchronous frame of the last round in the plurality of rounds.
Specifically, the synchronization frame sent by the convergence module may not include time information. If the synchronization interval duration cannot be set from the first synchronization frame of the current wheel, recording the receiving time point of the first synchronization frame of the current wheelAnd exiting the successful synchronization state of the current wheel and entering the quasi-synchronization state of the next wheel of the current wheel. And in the quasi-synchronous state of the next wheel of the current wheel, after receiving the quasi-synchronous frame of the next wheel of the current wheel, entering the successful synchronous state of the next wheel of the current wheel. The method comprises the steps of recording a receiving time point of a first synchronous frame of a next round of a current round when the first synchronous frame of the next round of the current round is received. And then, the next round of synchronous successful state of the current round is exited, and the quasi-synchronous state of the next round of the current round is entered. And in the quasi-synchronous state of the lower wheel of the current wheel, after receiving the quasi-synchronous frame of the lower wheel of the current wheel, entering the successful synchronous state of the lower wheel of the current wheel. When the first synchronous frame of the lower wheel of the current wheel is received, the receiving time point of the first synchronous frame of the lower wheel of the current wheel is recorded.
With reference to the above process, a plurality of rounds of synchronization are sequentially entered, a plurality of times of quasi-synchronization is repeatedly entered to a synchronization success state, and a reception time point of a first synchronization frame of each round of the plurality of rounds is recorded. And obtaining a plurality of initial synchronization interval duration according to the difference value between the receiving time points of the first synchronization frames of the two adjacent rounds. Exemplary, assume that the reception time point of the first sync frame of the next round of the current round is The initial synchronization interval duration between the two rounds is +.>。
And determining the synchronization interval duration according to the plurality of initial synchronization interval durations. Starting at the receiving time point of the first synchronous frame of the last round in the plurality of rounds, opening the wireless receiving window again according to whether the time reaches the synchronous interval duration so as to receive the second synchronous frame of the last round in the plurality of rounds. With this loop, the remaining sync frames of the last round are received for sensor timing.
In this embodiment, by reducing the frame length of the synchronization frame, the encoding and decoding time of the radio frequency communication module can be shortened, so as to reduce the time delay of time synchronization transmission and reception between the convergence module and the sensor, and improve the time synchronization precision of the wireless time synchronization method of the present application.
In one embodiment, the step of determining the synchronization interval duration according to a number of initial synchronization interval durations includes: sequencing a plurality of initial synchronization interval duration according to the sequence from big to small to obtain a synchronization interval duration sequence; removing edge data at two ends of the synchronization interval duration sequence, and calculating average synchronization interval duration of the synchronization interval duration sequence after removing the edge data; and determining that the initial synchronization interval time length closest to the average synchronization interval time length in the synchronization interval time length sequence after the edge data is removed is the synchronization interval time length.
Specifically, according to the difference between the receiving time points of the first synchronous frames of two adjacent rounds, a plurality of initial synchronous interval duration are obtained, and the initial synchronous interval duration is sequenced according to the sequence from big to small to obtain a synchronous interval duration sequence。
Rejecting sequences located at sync intervalsEdge data at two ends, wherein the edge data can be the data of the first 20% and the last 20% in the synchronization interval duration sequence; calculating a synchronous interval duration sequence after removing edge dataAverage value of (2) to obtain average synchronization interval duration +.>The method comprises the steps of carrying out a first treatment on the surface of the Determining a synchronization interval duration sequence after removing edge dataIn synchronization with the average synchronization interval duration +.>The closest initial synchronization interval duration is taken as the synchronization interval duration。
In this embodiment, the accuracy of the value of the synchronization interval duration can be ensured by integrating a plurality of initial synchronization interval durations to obtain the synchronization interval duration, so that the opening time point of the wireless receiving window is accurately controlled, and the time setting precision of the wireless time setting method is further improved.
In one embodiment, when the duration of the sleep wait reaches the remaining time of arrival of the out-of-sync frame carried by the quasi-sync frame, the step of opening the wireless receiving window includes: extracting the residual time from the arrival of the synchronous frame carried by the quasi-synchronous frame, starting a low-power-consumption clock, and setting the overtime of the low-power-consumption clock according to the residual time; and when the working time of the low-power consumption clock reaches the overtime, the wireless receiving window is opened.
Specifically, by means of the interrupt wake-up function of the low-power consumption clock of the sensor, the sensor can control the opening and closing of the wireless receiving window according to the quasi-synchronous frame and the time information carried by the synchronous frame so as to keep the working modes of long-term dormancy and intermittent wake-up. To receive sleep latency prior to the first sync frameFor example, the remaining time from the arrival of the synchronization frame carried by the quasi-synchronization frame is extractedStarting a low power clock according to the remaining time +.>And setting the timeout time of the low-power consumption clock. Optionally, the timeout time of the low-power clock is set to +.>. When the working time of the low-power consumption clock reaches the overtime, the sensor is interrupted and waken up, and the wireless receiving window is opened. It should be noted that, in the synchronization success state, the method in the embodiment is also adopted, and the sensor is controlled to enter sleep waiting and the wireless receiving window is opened.
In this embodiment, the timeout time of the low-power-consumption clock of the sensor is set according to the time information, and the opening and closing of the wireless receiving window of the sensor are controlled, so that the sensor can maintain the working modes of long-term dormancy and intermittent awakening, and the power consumption of the sensor is remarkably reduced.
For a better understanding of the above method, an example of the application of the wireless time synchronization method of the present application is described in detail below with reference to fig. 3.
First, the convergence module calculates a convergence time intervalTransmitting a quasi-synchronous frame and adding at fixed time intervals under the action of second pulse of the Beidou time setting module>And transmitting the synchronous frame. After the sensor is started, the sensor defaults to a quasi-synchronous state. In the quasi-synchronous state of the current wheel, the sensor is at variable time intervals +.>Starting the receiver of the radio frequency communication module, wherein the starting duration of the receiver of the radio frequency communication module is as follows/>The radio frequency communication modules are in a sleep waiting state in the rest time. By adjusting the time interval of the starting of the receiver, the receiver can receive the quasi-synchronous frames sent by the convergence module at fixed time intervals in a certain wireless receiving window. After the quasi-synchronous frame sent by the convergence module is successfully received in a certain wireless receiving window, the current round of synchronous success state is entered and the dormancy waiting is entered.
Extracting the remaining time from the arrival of a synchronization frame carried in a quasi-synchronization frame. Starting a low power clock according to the remaining time +.>Setting a timeout time of a low-power clock, e.g., to +. >. When the duration of sleep waiting arrivesWhen the sensor is awakened by the low-power-consumption clock interrupt, the wireless receiving window is opened.
Secondly, in the successful synchronization state, according to whether a synchronization frame is received or not and the difference of the types of the synchronization frames, the method can be specifically divided into three cases.
In the first case, if the synchronization frame is not received within the wireless receiving window, the radio frequency communication module enters an out-of-synchronization state and performs self-checking. If the self-checking is successful, entering a quasi-synchronous state of the next round; if the self-checking fails, restarting and self-checking the radio frequency communication module again; and if the self-checking again fails, sending out a wireless time-setting function fault reminder.
In the second case, the synchronization frames sent by the convergence module include both the function code and the time information. When the time length of dormancy waiting reaches the residual time from the arrival of the synchronous frame carried by the quasi-synchronous frame, opening a wireless receiving windowAnd the port takes the synchronous frame received in the wireless receiving window as the first synchronous frame of the current wheel. Extracting synchronization interval duration from first synchronization frame of current wheelAnd entering into sleep waiting. Synchronization interval duration +.>And the set advance wake-up time- >Difference of (i.e.)>As is the synchronization interval duration. Starting a low-power-consumption clock, and setting the timeout time of the low-power-consumption clock as. Starting from the reception time point of the first synchronization frame of the current wheel, at +.>Before the moment comes->At the moment, the sensor is awakened by the low-power-consumption clock interrupt, and the wireless receiving window is opened again to receive the second synchronous frame of the current wheel. Optionally, the operating time of the wireless receiving window of the sensor is +.>. And in this cycle, time synchronization is performed according to the time synchronization information carried by the received plurality of synchronization frames.
In the third case, the sync frame sent by the convergence module includes only the function code and does not include the time information. And when the duration of the dormancy waiting reaches the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, opening a wireless receiving window, and taking the synchronization frame received in the wireless receiving window as the first synchronization frame of the current wheel. If the synchronization is not proposed from the first synchronization frame of the current wheelThe time length of the interval is recorded at the time point of receiving the first synchronous frame of the current wheelAnd exiting the successful synchronization state of the current wheel and entering the quasi-synchronization state of the next wheel of the current wheel. And in the quasi-synchronous state of the next wheel of the current wheel, after receiving the quasi-synchronous frame of the next wheel of the current wheel, entering the successful synchronous state of the next wheel of the current wheel. The method comprises the steps of recording a receiving time point of a first synchronous frame of a next round of a current round when the first synchronous frame of the next round of the current round is received. And then, the next round of synchronous successful state of the current round is exited, and the quasi-synchronous state of the next round of the current round is entered. And in the quasi-synchronous state of the lower wheel of the current wheel, after receiving the quasi-synchronous frame of the lower wheel of the current wheel, entering the successful synchronous state of the lower wheel of the current wheel. When the first synchronous frame of the lower wheel of the current wheel is received, the receiving time point of the first synchronous frame of the lower wheel of the current wheel is recorded.
With reference to the above process, a plurality of rounds of synchronization are sequentially entered, a plurality of times of quasi-synchronization is repeatedly entered to a synchronization success state, and a reception time point of a first synchronization frame of each round of the plurality of rounds is recorded.
And obtaining a plurality of initial synchronization interval duration according to the difference value between the receiving time points of the first synchronization frames of the two adjacent rounds. Exemplary, when it is assumed that the reception time point of the first sync frame of the next round of the current round isThe initial synchronization interval duration between the two rounds is +.>. Sequencing a plurality of initial synchronization interval duration sequences according to the sequence from big to small to obtain a synchronization interval duration sequence +.>. Rejecting sequences located at sync intervalsEdge data at two ends, wherein the edge data can be the data of the first 20% and the last 20% in the synchronization interval duration sequence; calculating synchronization interval duration sequence after removing edge data>Average of (2) to obtain average synchronization interval durationThe method comprises the steps of carrying out a first treatment on the surface of the Determining synchronization interval duration sequence after removing edge data>In synchronization with the average synchronization interval duration +.>The closest initial synchronization interval duration as synchronization interval duration +.>。
Starting a low-power-consumption clock, and setting the timeout time of the low-power-consumption clock as. Starting from the reception time point of the first synchronization frame of the last one of the several rounds, according to whether the time has reached the synchronization interval duration +. >The radio reception window is opened again to receive the second synchronization frame of the last of the several rounds. With this loop, the remaining sync frames of the last round are received for sensor timing.
And finally, generating a time setting pulse when receiving the synchronous frame each time, simultaneously pulling the time setting pin level high, and pulling the time setting pin level low after lasting for a period of time. Under the condition of neglecting the air transmission delay, all the sensors can generate time-setting pulses at the same time, and accordingly, sensing services such as sampling, calculating and sending are started.
In this embodiment, the working states of the sensors in the time synchronization process are divided into a quasi-synchronization state and a synchronization success state. Under the quasi-synchronous state of the current wheel, opening a wireless receiving window according to a variable time interval, and entering a synchronous success state of the current wheel and entering a sleep waiting after receiving a quasi-synchronous frame sent by the aggregation module in a certain wireless receiving window; and in the successful synchronization state of the current wheel, when the duration of dormancy waiting reaches the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, opening a wireless receiving window. By entering sleep waiting after receiving the quasi-synchronization frame, the wireless receiving window is opened to receive the synchronization frame immediately before the synchronization frame arrives according to the residual time from the arrival of the synchronization frame carried by the quasi-synchronization frame, thereby reducing the power consumption of the sensor. And if a plurality of synchronous frames sent by the aggregation module are received in a plurality of wireless receiving windows, the time synchronization is carried out according to the time synchronization information carried by the plurality of synchronous frames. The power consumption of the sensor is reduced, the time setting requirement of the sensor can be met, and the problem that the sensor is halted due to insufficient power taking capability is avoided.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
In one embodiment, as shown in fig. 4, there is provided a wireless time tick applied to a sensor, comprising:
the quasi-synchronization unit 401 is configured to open a wireless receiving window at variable time intervals in a quasi-synchronization state of the current wheel, and enter a synchronization success state of the current wheel and enter a sleep waiting after receiving a quasi-synchronization frame sent by the aggregation module in a certain wireless receiving window;
A synchronization unit 402, configured to open a wireless receiving window when a duration of sleep waiting reaches a remaining time from arrival of a synchronization frame carried by a quasi-synchronization frame in a state that synchronization of a current wheel is successful;
and the time setting unit 403 is configured to, if a plurality of synchronization frames sent by the aggregation module are received in a plurality of wireless receiving windows, set time according to time setting information carried by the plurality of synchronization frames.
In one embodiment, the device further includes a desynchronizing unit, configured to enter a desynchronizing state and perform self-checking on the radio frequency communication module if the synchronous frame sent by the convergence module is not received in the wireless receiving window; if the self-checking is successful, entering a quasi-synchronous state of the next round; if the self-checking fails, restarting and self-checking the radio frequency communication module again; and if the self-checking again fails, sending out a wireless time-setting function fault reminder.
In one embodiment, the device further comprises a synchronous frame receiving unit, which is used for opening the synchronous frame received by the wireless receiving window when the time length of dormancy waiting reaches the residual time from the arrival of the synchronous frame carried by the quasi-synchronous frame, and taking the synchronous frame as the first synchronous frame of the current wheel; if the synchronization interval duration is extracted from the first synchronization frame of the current wheel, entering into dormancy waiting, starting with the receiving time point of the first synchronization frame of the current wheel, and opening the wireless receiving window again according to whether the time reaches the synchronization interval duration so as to receive the second synchronization frame of the current wheel.
In one embodiment, the synchronization frame receiving unit is further configured to use a difference value between a synchronization interval duration carried by a first synchronization frame of the current wheel and a set advanced wakeup time as the synchronization interval duration; starting with the receiving time point of the first synchronous frame of the current wheel, opening the wireless receiving window again when the time reaches the synchronous interval duration.
In one embodiment, the synchronization frame receiving unit is further configured to record a receiving time point of the first synchronization frame of the current wheel if the synchronization interval duration cannot be extracted from the first synchronization frame of the current wheel, exit the synchronization success state of the current wheel, enter a plurality of wheels in sequence, repeatedly enter a plurality of quasi-synchronization states to the synchronization success state, and record the receiving time point of the first synchronization frame of each of the plurality of wheels; obtaining a plurality of initial synchronization interval duration according to the difference value between the receiving time points of the first synchronization frames of the two adjacent rounds; determining a synchronization interval duration according to a plurality of initial synchronization interval durations; starting at the receiving time point of the first synchronous frame of the last round in the plurality of rounds, opening the wireless receiving window again according to whether the time reaches the synchronous interval duration so as to receive the second synchronous frame of the last round in the plurality of rounds.
In one embodiment, the synchronization frame receiving unit is further configured to sort a plurality of initial synchronization interval durations according to a sequence from large to small, to obtain a synchronization interval duration sequence; removing edge data at two ends of the synchronization interval duration sequence, and calculating average synchronization interval duration of the synchronization interval duration sequence after removing the edge data; and determining that the initial synchronization interval time length closest to the average synchronization interval time length in the synchronization interval time length sequence after the edge data is removed is the synchronization interval time length.
In one embodiment, the synchronization unit 402 is further configured to extract a remaining time from arrival of the synchronization frame carried by the quasi-synchronization frame, start the low-power clock, and set a timeout time of the low-power clock according to the remaining time; and when the working time of the low-power consumption clock reaches the overtime, the wireless receiving window is opened.
For specific limitations of the wireless time setting device, reference may be made to the above limitation of the wireless time setting method, and no further description is given here. The various units in the wireless time setting device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The units can be embedded in hardware or independent of a processor in the computer equipment, and can also be stored in a memory in the computer equipment in a software mode, so that the processor can call and execute the operations corresponding to the units.
In one embodiment, the primary constituent modules of the sensor and convergence module are shown in FIG. 5. The sensor mainly comprises a control module, a sensing element, a random number module, a low-power consumption clock and a radio frequency communication module, wherein the modules are integrated in a multi-element discrete or chip integrated mode. The sensing element is used for collecting data; the random number module is used for generating random numbers and changing the time interval of a wireless receiving window of the sensor in a quasi-synchronous state; the low-power consumption clock is used for interrupting and waking up the sensor according to the overtime; the radio frequency communication module is used for receiving the time setting information sent by the convergence module. The convergence module mainly comprises a control module, a Beidou time setting module and a radio frequency communication module. The Beidou time setting module is responsible for acquiring global time and second pulse, and the second pulse is used for triggering the radio frequency communication module to send a synchronous frame; the radio frequency communication module is used for sending time setting information to the sensor.
In one embodiment, a time counter is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
under the quasi-synchronous state of the current wheel, opening a wireless receiving window according to a variable time interval, and entering a synchronous success state of the current wheel and entering a sleep waiting after receiving a quasi-synchronous frame sent by the aggregation module in a certain wireless receiving window;
In the successful synchronization state of the current wheel, when the duration of the dormancy waiting reaches the residual time of the arrival of the synchronization frame carried by the quasi-synchronization frame, opening the wireless receiving window;
and if a plurality of synchronous frames sent by the aggregation module are received in a plurality of wireless receiving windows, the time is set according to time setting information carried by the synchronous frames.
Further, the wireless receiving window is of a radio frequency communication module; the processor when executing the computer program also implements the steps of:
if the synchronous frame sent by the convergence module cannot be received in the wireless receiving window, the synchronous frame is in a desynchronized state, and the radio frequency communication module is subjected to self-checking;
if the self-checking is successful, entering a quasi-synchronous state of the next round;
if the self-checking fails, restarting and self-checking the radio frequency communication module again;
and if the self-checking again fails, sending out a wireless time-setting function fault reminder.
Further, the plurality of synchronization frames includes a first synchronization frame of the current wheel and a second synchronization frame of the current wheel; the step of receiving the first synchronization frame of the current wheel and the second synchronization frame of the current wheel when the processor executes the computer program comprises the following steps:
The synchronization frame received by the wireless receiving window is opened when the dormancy waiting time reaches the rest time from the arrival of the synchronization frame carried by the quasi-synchronization frame, and the synchronization frame is used as the first synchronization frame of the current wheel;
if the synchronization interval duration is extracted from the first synchronization frame of the current wheel, entering into dormancy waiting, starting with the receiving time point of the first synchronization frame of the current wheel, and opening the wireless receiving window again according to whether the time reaches the synchronization interval duration so as to receive the second synchronization frame of the current wheel.
Further, when the processor executes the computer program to implement the step of opening the wireless receiving window again according to whether the time reaches the synchronization interval duration from the receiving time point of the first synchronization frame of the current wheel, the method specifically includes:
taking the difference value between the synchronization interval duration carried by the first synchronization frame of the current wheel and the set advance awakening time as the synchronization interval duration;
starting with the receiving time point of the first synchronous frame of the current wheel, opening the wireless receiving window again when the time reaches the synchronous interval duration.
Further, the plurality of synchronization frames includes a first synchronization frame of the current wheel, a first synchronization frame of each of the plurality of wheels subsequent to the current wheel, and a second synchronization frame of a last of the plurality of wheels; the step of receiving the second synchronization frame of the next round is realized when the processor executes the computer program, and specifically includes:
If the synchronization interval duration cannot be extracted from the first synchronization frame of the current wheel, recording a receiving time point of the first synchronization frame of the current wheel, exiting the synchronization success state of the current wheel, sequentially entering a plurality of wheels, repeatedly entering a plurality of quasi-synchronization states to the synchronization success state, and recording the receiving time point of the first synchronization frame of each wheel in the plurality of wheels;
obtaining a plurality of initial synchronization interval duration according to the difference value between the receiving time points of the first synchronization frames of the two adjacent rounds;
determining a synchronization interval duration according to a plurality of initial synchronization interval durations;
starting at the receiving time point of the first synchronous frame of the last round in the plurality of rounds, opening the wireless receiving window again according to whether the time reaches the synchronous interval duration so as to receive the second synchronous frame of the last round in the plurality of rounds.
Further, when the processor executes the computer program to implement the step of determining the synchronization interval duration according to a plurality of initial synchronization interval durations, the method specifically includes:
sequencing a plurality of initial synchronization interval duration according to the sequence from big to small to obtain a synchronization interval duration sequence;
removing edge data at two ends of the synchronization interval duration sequence, and calculating average synchronization interval duration of the synchronization interval duration sequence after removing the edge data;
And determining that the initial synchronization interval time length closest to the average synchronization interval time length in the synchronization interval time length sequence after the edge data is removed is the synchronization interval time length.
Further, when the processor executes the computer program to realize the step of opening the wireless receiving window when the duration of the sleep waiting reaches the remaining time of the arrival of the synchronization frame carried by the quasi-synchronization frame, the method specifically comprises the following steps:
extracting the residual time from the arrival of the synchronous frame carried by the quasi-synchronous frame, starting a low-power-consumption clock, and setting the overtime of the low-power-consumption clock according to the residual time;
and when the working time of the low-power consumption clock reaches the overtime, the wireless receiving window is opened.
In one embodiment, a sensor is provided, the sensor comprising the above-described timer.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the respective method embodiments described above.
In one embodiment, a computer program product is provided, on which a computer program is stored, which computer program is executed by a processor for performing the steps of the various method embodiments described above.
The user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (DynamicRandom Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.