WO2022205838A1 - Sensor time synchronization system-based time synchronization method, medium and apparatus - Google Patents

Sensor time synchronization system-based time synchronization method, medium and apparatus Download PDF

Info

Publication number
WO2022205838A1
WO2022205838A1 PCT/CN2021/124749 CN2021124749W WO2022205838A1 WO 2022205838 A1 WO2022205838 A1 WO 2022205838A1 CN 2021124749 W CN2021124749 W CN 2021124749W WO 2022205838 A1 WO2022205838 A1 WO 2022205838A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
time synchronization
synchronization signal
node
child node
Prior art date
Application number
PCT/CN2021/124749
Other languages
French (fr)
Chinese (zh)
Inventor
郁茂旺
王颖
李仁芳
Original Assignee
杭州涂鸦信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州涂鸦信息技术有限公司 filed Critical 杭州涂鸦信息技术有限公司
Publication of WO2022205838A1 publication Critical patent/WO2022205838A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/38Services specially adapted for particular environments, situations or purposes for collecting sensor information
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the technical field of sensor communication, in particular to a time synchronization method, medium and device based on a sensor time synchronization system.
  • sensors to obtain the status of the home environment, such as temperature and humidity, brightness, gas concentration, door and window opening and closing status, etc.
  • These sensors are basically distributed systems, and they require sensors to work together. Time synchronization between nodes. Due to cost and volume constraints, sensors generally rely on their own crystal oscillators to provide the clock reference source. However, the frequency offset and temperature drift of the crystal oscillators lead to time differences between sensors. The accumulation of such differences will lead to unreliable time.
  • NTP Network Time Protocol
  • PTP Precision Time Protocol, high-precision time synchronization protocol
  • the technical problem mainly solved by the present invention is to provide a time synchronization method, medium and device based on a sensor time synchronization system, which has low power consumption for time synchronization and can improve time synchronization accuracy.
  • the first technical solution adopted by the present invention is to provide a time synchronization method based on a sensor time synchronization system.
  • the system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used for
  • the time synchronization system provides the reference time
  • the child nodes include sensors
  • the methods include:
  • the child node receives the first time synchronization signal sent by the broadcast node
  • the child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node;
  • the child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
  • the second technical solution adopted by the present invention is to provide a time synchronization method based on a sensor time synchronization system.
  • the system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used for Provide a reference time for the time synchronization system, the child nodes include sensors, and the methods include:
  • the reference node receives the first time synchronization signal sent by the broadcast node
  • the reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is the same as the reference time, wherein the child node A first time synchronization signal sent by a broadcast node is received.
  • the third technical solution adopted by the present invention is to provide a storage medium, wherein a computer program is stored in the storage medium, and the computer program is used to be executed to realize the above-mentioned time synchronization method based on the sensor time synchronization system .
  • the fourth technical solution adopted by the present invention is: including at least one processing unit and at least one storage unit, the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is made to execute the above sensor-based method.
  • the beneficial effects of the present invention are: different from the situation in the prior art, the time synchronization method based on the sensor time synchronization system according to the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving the time synchronization signal broadcast twice, and reduces the alarm time.
  • the time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, and eliminates the need for The time synchronization error introduced by the sending time and the access time can better cope with complex wireless environments and improve the accuracy of time synchronization.
  • Fig. 1 is the topological schematic diagram of the sensor time synchronization system of the present application
  • FIG. 2 is a schematic flowchart of a first embodiment of a time synchronization method based on a sensor time synchronization system of the present application
  • FIG. 3 is a schematic flowchart of a second embodiment of a time synchronization method based on a sensor time synchronization system of the present application
  • FIG. 4 is a schematic flowchart of a third embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
  • FIG. 5 is a schematic flowchart of a fourth embodiment of a time synchronization method based on a sensor time synchronization system of the present application
  • FIG. 6 is a schematic flowchart of a fifth embodiment of a time synchronization method based on a sensor time synchronization system of the present application
  • FIG. 7 is a schematic flowchart of a sixth embodiment of a time synchronization method based on a sensor time synchronization system of the present application.
  • FIG. 8 is a schematic flowchart of a seventh embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
  • FIG. 9 is a schematic flowchart of an eighth embodiment of a time synchronization method based on a sensor time synchronization system of the present application.
  • FIG. 10 is a schematic structural diagram of an embodiment of a computer storage medium of the present application.
  • FIG. 11 is a schematic structural diagram of an embodiment of a computer apparatus of the present application.
  • the sensor time synchronization system of the embodiment of the present application includes a broadcast node 10, a reference node 20, and two or more sub-nodes 30, wherein the reference node 20 is used to provide a reference time for the time synchronization system, and the sub-nodes 30 include sensor.
  • the sensors in the embodiments of the present application are wireless sensors, and the number of sub-nodes 30 in the embodiments of the present application may be two, three, four, or more than five.
  • the sub-nodes 30 include the first The child node 31 , the second child node 32 , the third child node 33 , the fourth child node 34 , and the nth child node 35
  • the sensor in the embodiment of the present application belongs to a distributed system.
  • the reference node 20 in the embodiment of the present application is used as the reference clock source of the entire distributed system, and the local clock of the reference node 20 is calibrated in the form of an RTC (Real Time Clock, real-time clock) chip.
  • RTC Real Time Clock, real-time clock
  • NTP or PTP can also be used.
  • the protocol enables the reference node 20 to maintain time synchronization with the external network.
  • the reference node 20 is a gateway, and the reference node 20 is a long-term power supply device; in other embodiments, the reference node 20 can also be a sensor, which can be powered for a long time. sensor.
  • the sub-node 30 is a wireless sensor, the sub-node 30 does not have an RTC chip, and cannot maintain time synchronization with the external network through the NTP or PTP protocol.
  • the wireless sensor of the sub-node 30 has a data collection function and only performs sensing Information exchange of data, power supply for low-power batteries.
  • the broadcast node 10 in the embodiment of the present application may be a gateway-type long power supply device, or may be a wireless sensor.
  • a time synchronization method based on a sensor time synchronization system specifically includes:
  • Step 110 The broadcast node sends a first time synchronization signal to the reference node and the child nodes.
  • the first time synchronization signal includes the first reference time.
  • the sending time is the sending time of the broadcasting node, and the broadcasting node sends through the radio frequency circuit, and The time it takes for the speed of light to propagate to the reference node or child node;
  • the access time is when the reference node or child node receives the first time synchronization signal and other signals, the first time synchronization signal at this time is an analog signal, and the reference node or child node After receiving the analog signal, it is converted into a digital signal, stored in a register, and the digital signal is read from the register.
  • the broadcast node when the broadcast node sends the first time synchronization signal to the reference node or multiple sub-nodes, there is a difference between the sending time and the access time.
  • Step 120 After receiving the first time synchronization signal, the reference node sends a second time synchronization signal to the child node.
  • the second time synchronization signal includes the operation relationship of the second local time, including the reference time.
  • the reference node when the reference node sends the second time synchronization signal to multiple sub-nodes, there are also differences in the sending time and the access time of the multiple sub-nodes receiving the second time synchronization signal;
  • Step 130 The child node adjusts the local time according to the received first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
  • the local time of the child node after receiving the first time synchronization signal and the second time synchronization signal, the local time of the child node can be calculated and adjusted so that the local time of the child node is the same as the reference time of the reference node, so that multiple child nodes The local time between nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
  • the time synchronization method based on the sensor time synchronization system realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors
  • the time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
  • the embodiment of the present application provides a time synchronization method based on a sensor time synchronization system, and the method includes:
  • Step 210 The child node receives the first time synchronization signal sent by the broadcast node.
  • two or more sub-nodes respectively receive the first time synchronization signal sent by the broadcast node, and there is a certain difference in the local time when the two or more sub-nodes receive the first time synchronization signal sent by the broadcast node. Received at the same time, but received in sequence, so that there is a certain difference in the local time; or because there is no RTC chip in the child node, it is impossible to maintain time synchronization with the external network through the NTP or PTP protocol, and the local clock of the wireless sensor of the child node may exist.
  • the local clocks of the wireless sensors of each sub-node are different due to frequency offset and temperature drift.
  • the broadcast node may send the first time synchronization signal to the child node, and the child node may receive the first time synchronization signal sent by the broadcast node.
  • Step 220 The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node.
  • the child node receives the second time synchronization signal broadcast by the reference node, wherein the second time synchronization signal broadcast by the reference node includes the second local time at which the reference node receives the first time synchronization signal, so that the child node receives the second time synchronization signal.
  • the second time synchronization signal includes the operational relationship of the second local time, including the reference time.
  • Step 230 The child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
  • the child node after receiving the first time synchronization signal and the second time synchronization signal, calculates and adjusts the local time of the child node, so that the local time of the child node is the same as the reference time of the reference node, so that more The local time between the child nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
  • the time synchronization method based on the sensor time synchronization system realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors
  • the time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
  • a time synchronization method based on a sensor time synchronization system includes:
  • Step 310 The child node receives the first time synchronization signal sent by the broadcast node, and records the first local time when the first time synchronization signal is received, where the first time synchronization signal includes the first reference time.
  • the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node.
  • the local clocks of the wireless sensors are different; or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal sent by the broadcast node, and two or more sub-nodes receive the local time synchronization signal of the first time synchronization signal sent by the broadcast node.
  • There is a certain difference in time For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
  • the broadcast node sends the first time synchronization signal to the child node
  • the first time synchronization signal includes the first reference time T 0
  • the child node can receive the first time synchronization signal sent by the broadcast node, and record the received first time synchronization signal.
  • the first local time of a time synchronization signal for example, there are n child nodes, where n is a positive integer greater than or equal to 2, which are the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, the first local time at which each child node receives the first time synchronization signal is T 1 , T 2 , T 3 , T 4 , ..., T n respectively .
  • Step 320 the child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value,
  • the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
  • the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node.
  • the reference node when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 ,
  • Step 330 The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
  • the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal
  • the time is T 1 , T 2 , T 3 , T 4 , .
  • the first time difference value and the second time difference value Adjust the first local time of the child node, so that the local time of the child node is synchronized with the reference time, and is synchronized with the reference time of the reference node;
  • the first local time of the child node is adjusted according to the first time difference and the second time difference, that is, the first local time is subtracted from the difference between the first time difference and the second time difference, so that the adjustment
  • the local time of each child node can be synchronized with the reference time of the reference node through the above method.
  • a time synchronization method based on a sensor time synchronization system includes:
  • Step 410 The child node receives the first time synchronization signal periodically sent by the broadcast node, and records the first local time when the first time synchronization signal is received, where the first time synchronization signal includes a first reference time and a time synchronization period.
  • the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node.
  • the local clocks of the wireless sensors or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal periodically sent by the broadcast node, and two or more sub-nodes receive the first time synchronization signal sent by the broadcast node.
  • the local time For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
  • the broadcasting node periodically sends the first time synchronization signal to the child nodes, and the first reference time of the first time synchronization signal is represented by Time.
  • Time T 0 ;
  • the time synchronization period is represented by Cycle, which is used to mark the basic period to which the current time synchronization signal belongs.
  • the broadcast node periodically sends the first time synchronization signal, so that the local time of the sub-nodes can be synchronized regularly, so that the local time of multiple sub-nodes is synchronized.
  • the child node can receive the first time synchronization signal regularly, and adjust the first time synchronization signal regularly, so as to ensure that the local time of the child node is in a synchronized state for a long time.
  • the child node may receive the first time synchronization signal sent by the broadcast node, and record the first local time when the first time synchronization signal is received.
  • n is greater than or equal to 2 Positive integers, respectively the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, each child node receives the first time synchronization signal of the first time synchronization signal.
  • the local times are T 1 , T 2 , T 3 , T 4 , . . . , T n , respectively.
  • Step 420 The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value and In the time synchronization period, the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
  • the time synchronization period of the second time synchronization signal is the same as the first time synchronization period sent by the broadcast node.
  • the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node.
  • the reference node when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 ,
  • the first time difference ⁇ j when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 ,
  • the first time difference value ⁇ j is calculated, and the first time difference value is the difference between the second local time and the first reference time, that is
  • Step 421 According to the time synchronization period, determine that the first time synchronization signal and the second time synchronization signal belong to the same period.
  • Step 330 can be performed only with the first time synchronization signal and the second time synchronization signal.
  • Step 430 The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
  • the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal
  • the time is T 1 , T 2 , T 3 , T 4 , .
  • the local time of each child node can be synchronized with the reference time of the reference node through the above method.
  • a time synchronization method based on a sensor time synchronization system includes:
  • Step 510 The child node receives the first time synchronization signal periodically sent by the broadcast node, and records the first local time when the first time synchronization signal is received, wherein the first time synchronization signal includes the first reference time, the time synchronization period, the time Synchronization indications, time synchronization domains, and functional roles.
  • the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node.
  • the local clocks of the wireless sensors or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal periodically sent by the broadcast node, and two or more sub-nodes receive the first time synchronization signal sent by the broadcast node.
  • the local time For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
  • the broadcast node periodically sends a first time synchronization signal to the child nodes
  • the first time synchronization signal includes a first reference time Time, a time synchronization period Cycle, a time synchronization indication Flag, a time synchronization domain Domain, and a functional role Role
  • the first time synchronization signal may further include a physical address Mac_Address.
  • the time synchronization indication Flag is used to indicate that the first time synchronization signal is used for time synchronization; the time synchronization cycle Cycle is used to mark the basic cycle to which the current time synchronization belongs; the time synchronization domain Domain is used in the same synchronization domain. Only the child nodes can perform time synchronization; the functional role Role is used to distinguish the broadcast node from the reference node; in other embodiments, the physical address Mac_Address is used to identify the device address in the network.
  • the child node may receive the first time synchronization signal sent by the broadcast node, and record the first local time when the first time synchronization signal is received.
  • n is greater than or equal to 2 Positive integers, respectively the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, each child node receives the first time synchronization signal of the first time synchronization signal.
  • the local times are T 1 , T 2 , T 3 , T 4 , . . . , T n , respectively.
  • Step 520 The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value, Time synchronization period, time synchronization indication, time synchronization domain and functional role, the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
  • the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node
  • the second time synchronization signal includes the first time difference value, Time synchronization period, time synchronization indication, time synchronization domain and functional role
  • the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
  • the reference node sends a second time synchronization signal to the child node, where the second time synchronization signal includes a first time difference value Time_Difference, a time synchronization period Cycle, a time synchronization indication Flag, a time synchronization domain Domain, and a functional role Role.
  • the second time synchronization signal may also include a physical address Mac_Address.
  • the time synchronization indication Flag of the second time synchronization signal is used to indicate that the second time synchronization signal is used for time synchronization; the time synchronization cycle Cycle of the second time synchronization signal, the time synchronization domain Domain and the received broadcast
  • the first time synchronization cycle Cycle and time synchronization domain Domain sent by the node are the same.
  • the functional role Role represents that the signal is emitted by the base node.
  • the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node.
  • Step 521 Determine the first time synchronization signal and the second time synchronization signal as synchronization signals according to the time synchronization instruction, the time synchronization period, the time synchronization domain and the functional role.
  • the time synchronization indication is used to indicate that the signal is used for time synchronization, and only when the first time synchronization signal and the second time synchronization signal are synchronization signals, that is, the first time synchronization signal and the second time synchronization signal can be used for in time synchronization.
  • the first time synchronization signal and the second time synchronization signal belong to the same period
  • the first time synchronization signal and the second time synchronization signal are synchronization signals and can be used for time synchronization, and then step 530 can be executed.
  • Step 530 The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
  • the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal
  • the time is T 1 , T 2 , T 3 , T 4 , .
  • the The first local time of the node, so that the local times of multiple child nodes are synchronized and synchronized with the reference time of the reference node; specifically, in the embodiment of the present application, the first time difference value and the second time difference value of the first child node are The difference is ⁇ 1 ⁇ 1 - ⁇ j , the difference between the first time difference value of the second child node
  • the adjusted local time of the second child node T 2 ' T 2 - ⁇ 2
  • the adjusted local time of the third child node T 3 ' T 3 ⁇ 3
  • the adjusted local time of the third child node T 4 ′ T 4 ⁇ 4 , . . .
  • the adjusted local time of the nth child node Tn′ T n ⁇ n .
  • the local time of each child node can be synchronized with the reference time of the reference node through the above method.
  • the first time synchronization signal and the second time synchronization signal are determined as synchronization signals according to the time synchronization instruction, the time synchronization period, the time synchronization domain, and the functional role, and whether the signal received by the child node can be used for time is determined.
  • the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of messages and reduces energy consumption, and can be applied to low-power wireless sensors;
  • the time synchronization method of the application embodiment receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the transmission time and the access time, and can better cope with complex wireless environment, improve the accuracy of time synchronization.
  • the sixth embodiment of the present application provides a time synchronization method based on a sensor time synchronization system, including:
  • Step 610 The reference node receives the first time synchronization signal sent by the broadcast node.
  • the broadcast node sends the first time synchronization signal to the reference node and the child nodes simultaneously, so that the reference node can receive the first time synchronization signal sent by the broadcast node, and the first time synchronization signal is used for time synchronization.
  • Step 620 The reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is the same as the reference time, wherein , the child node receives the first time synchronization signal sent by the broadcast node.
  • the reference node after receiving the first time synchronization signal, the reference node sends a second time synchronization signal to the child node, wherein the second time synchronization signal includes the operation relationship of the second local time of the reference node.
  • the child node After the child node receives the second time synchronization signal sent by the reference node and the first time synchronization signal sent by the broadcast node, it calculates and adjusts the local time of the child node, so that the local time of the child node is the same as the reference time of the reference node, so that The local time between multiple child nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
  • the time synchronization method based on the sensor time synchronization system realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors
  • the time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
  • the first time synchronization signal includes the first reference time
  • the method includes:
  • Step 710 The reference node receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the first time difference according to the second local time and the first reference time.
  • the broadcast node sends the first time synchronization signal to the reference node, so that the reference node receives the first time synchronization signal sent by the broadcast node.
  • the first time synchronization signal includes the first reference time T 0
  • the reference node receives the first time synchronization signal.
  • Step 720 The reference node sends the second time synchronization signal to the child node, and records the first local time of receiving the first time synchronization signal, so that the child node adjusts the first local time of the child node according to the first local time and the first time difference. time, so that the local times of multiple child nodes are the same; wherein, the child nodes receive the first time synchronization signal sent by the broadcast node.
  • the broadcast node sends the first time synchronization signal to the reference node, and also sends the first time synchronization signal to the child node.
  • the first time synchronization signal includes the first reference time T0, so that the child node receives the transmission from the broadcast node. and record the first local time when the first time synchronization signal is received. For example, there are n child nodes, where n is a positive integer greater than or equal to 2, which are the first child node and the second child node respectively.
  • the first local time at which each child node receives the first time synchronization signal is T 1 , T 2 , T 3 , T 4 , ..., T n .
  • the reference node after receiving the first time synchronization signal, the reference node sends the second time synchronization signal to the child node.
  • the second time synchronization signal includes the first time difference value ⁇ j .
  • the adjusted first local time T 1 ' T 1 - ⁇ 1 of a child node
  • the adjusted first local time T 2 ' T 2 - ⁇ 2 of the second child node
  • the local time of each child node can be synchronized with the reference time of the reference node through the above method.
  • both the first time synchronization signal and the second time synchronization signal further include a time synchronization period
  • Step 810 The reference node regularly receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the first time difference according to the second local time and the first reference time.
  • the reference node regularly receives the first time synchronization signal sent by the broadcast node, so that the child nodes can perform time synchronization regularly, so that the reference node can regularly receive the first time synchronization signal sent by the broadcast node.
  • the first time synchronization signal includes a time synchronization period, which can determine which basic period the first time synchronization signal belongs to, so as to avoid errors in selecting the first time synchronization signal during operation.
  • the reference node when the reference node receives the first time synchronization signal, the reference node records the second local time when the first time synchronization signal is received, and obtains the first time difference by making a difference between the second local time and the first reference time value, so that the reference node includes the first time difference value when sending the second time synchronization signal.
  • Step 820 The reference node sends the second time synchronization signal to the child node, and records the first local time when the first time synchronization signal is received, so that the child node determines that the first time synchronization signal and the second time synchronization signal belong to each other according to the time synchronization period. In the same period, the child node adjusts the first local time of the child node according to the first local time and the first time difference, so that the local times of the multiple child nodes are the same.
  • a time synchronization method based on a sensor time synchronization system includes: broadcasting a first time synchronization signal sent by a node to a reference node and child nodes, so that the reference node sends the first time synchronization signal when receiving the first time synchronization signal
  • the second time synchronization signal is sent to the child node, further enabling the child node to adjust the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
  • a time synchronization method based on a sensor time synchronization system includes: broadcasting a first time synchronization signal sent by a node to a reference node and child nodes, so that the reference node is used for receiving the first time synchronization signal when the first time synchronization signal is received, record the first local time when the first time synchronization signal is received, calculate the first time difference according to the second local time and the first reference time, send the second time synchronization signal to the child node, and further make the child node according to the first time synchronization signal.
  • the time difference value adjusts the first local time so that the first local time of the child node is synchronized with the reference time, wherein the first time synchronization signal includes the first reference time, and the second time synchronization signal includes the first time difference value.
  • the first time synchronization signal may also include a first reference time, a time synchronization period, a time synchronization indication, a time synchronization domain, and a functional role.
  • the second time synchronization signal includes a first time difference, a time synchronization period, a time synchronization indication, a time synchronization domain, and a functional role.
  • the first time synchronization signal and the second time synchronization signal may also include physical addresses.
  • the embodiment of the present application also includes a second technical solution, as shown in FIG. 10 , a computer storage medium 900, where a computer program 910 is stored inside the computer storage medium 900, and the computer program is used to be executed to realize the above-mentioned sensor-based time synchronization The system's time synchronization method.
  • the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through the computer program 910.
  • the computer program 910 can be stored in a computer-readable storage medium, and the computer When the program 910 is executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program 910 includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
  • ROM Read-Only Memory
  • RAM random access Memory
  • electric carrier signal telecommunication signal and software distribution medium, etc.
  • computer-readable media may be appropriately increased or decreased in accordance with the requirements of legislation and patent practice in the jurisdiction.
  • computer-readable media does not include Electrical carrier signals and telecommunication signals.
  • a computer device 1000 includes at least one processing unit 1010 and at least one storage unit 1020.
  • the storage unit 1020 stores a computer program, and when the program is executed by the processing unit , so that the processing unit 1010 executes the steps of the above-mentioned time synchronization method based on the sensor time synchronization system.
  • the so-called processing unit 1010 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general processing unit 1010 can be a microprocessor or the processing unit 1010 can also be any conventional processor, etc.
  • the processing unit 1010 is the control center for setting the display name of the parameter information item in the monitor, and uses various interfaces and lines to connect the whole system. The various equipment parts of the monitor.
  • the storage unit 1020 can be used to store computer programs and/or modules, and the processing unit 1010 realizes the parameters in the monitor by running or executing the computer programs and/or modules stored in the storage unit 1020 and calling the data stored in the storage unit 1020. Display name settings for information items.
  • the storage unit 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone.
  • the storage unit 1020 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) ) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • non-volatile memory such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) ) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • Computer apparatus 1000 may also include a power supply assembly configured to perform power management of the computer device, a wired or wireless network interface configured to connect the device to a network, and an input output (I/O) interface.
  • the device can operate based on an operating system stored in memory, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus implementations described above are only illustrative, for example, the division of modules or units is only a logical function division, and other divisions may be used in actual implementation, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this implementation manner.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software functional units.
  • the integrated unit if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of the various embodiments of the present application.
  • the solutions provided by the embodiments of the present application can be applied to the technical field of sensor communication.
  • the time synchronization method, medium and device based on the sensor time synchronization system are adopted, so that the power consumption of the time synchronization is low, and the time can be improved.
  • the technical effect of synchronization accuracy is adopted.

Abstract

The present invention relates to the technical field of sensor communications, and in particular relates to a sensor time synchronization system-based time synchronization method, a medium and an apparatus. The system comprises a broadcast node, a reference node and more than two child nodes, wherein the reference node is used for providing a reference time for a time synchronization system, and each child node comprises a sensor. The method comprises: the child nodes receive a first time synchronization signal sent by the broadcast node; the child nodes receive a second time synchronization signal, wherein the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node; and the child nodes adjust the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child nodes is synchronized with the reference time.

Description

基于传感器时间同步系统的时间同步方法、介质及装置Time synchronization method, medium and device based on sensor time synchronization system 技术领域technical field
本发明涉及传感器通讯技术领域,特别是涉及基于传感器时间同步系统的时间同步方法、介质及装置。The present invention relates to the technical field of sensor communication, in particular to a time synchronization method, medium and device based on a sensor time synchronization system.
背景技术Background technique
智能家居行业越来越多的使用传感器去获取家居环境的状态,比如温湿度、亮度、燃气浓度、门窗开合状态等等,这些传感器基本上属于分布式系统,它们之间的协同工作需要传感器节点间的时间同步。传感器由于成本和体积的限制,一般依靠本身的晶振提供时钟参考源,但是晶振的频偏及温漂导致了各传感器之间时间的差异,这种差异积累后会导致时间的不可信。The smart home industry is increasingly using sensors to obtain the status of the home environment, such as temperature and humidity, brightness, gas concentration, door and window opening and closing status, etc. These sensors are basically distributed systems, and they require sensors to work together. Time synchronization between nodes. Due to cost and volume constraints, sensors generally rely on their own crystal oscillators to provide the clock reference source. However, the frequency offset and temperature drift of the crystal oscillators lead to time differences between sensors. The accumulation of such differences will lead to unreliable time.
目前大多数时间同步技术都是通过NTP(Network Time Protocol,网络时间协议)协议或者PTP(Precision Time Protocol,高精度时间同步协议)协议实现分布式节点间的时间同步,但是该技术计算复杂,耗电量大,不适用于低功耗的传感器,在复杂的无线环境下可能会导致时间同步的精度大大降低。At present, most time synchronization technologies use the NTP (Network Time Protocol, Network Time Protocol) protocol or the PTP (Precision Time Protocol, high-precision time synchronization protocol) protocol to achieve time synchronization between distributed nodes, but this technology is computationally complex and consumes The power is large, and it is not suitable for sensors with low power consumption. In a complex wireless environment, the accuracy of time synchronization may be greatly reduced.
发明内容SUMMARY OF THE INVENTION
本发明主要解决的技术问题是提供一种基于传感器时间同步系统的时间同步方法、介质及装置,该方法进行时间同步的功耗较低,可以提升时间同步精度。The technical problem mainly solved by the present invention is to provide a time synchronization method, medium and device based on a sensor time synchronization system, which has low power consumption for time synchronization and can improve time synchronization accuracy.
为解决上述技术问题,本发明采用的第一个技术方案是:提供一种基于传感器时间同步系统的时间同步方法,系统包括广播节点、基准节点和两个以上子节点,其中基准节点用于为时间同步系统提供基准时间,子节点包括传感器,方法包括:In order to solve the above technical problems, the first technical solution adopted by the present invention is to provide a time synchronization method based on a sensor time synchronization system. The system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used for The time synchronization system provides the reference time, the child nodes include sensors, and the methods include:
子节点接收广播节点发送的第一时间同步信号;The child node receives the first time synchronization signal sent by the broadcast node;
子节点接收第二时间同步信号,其中,第二时间同步信号为基准节点在接收广播节点发送的第一时间同步信号之后发送的信号;The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node;
子节点依据第一时间同步信号和第二时间同步信号调整本地时间,使得子节点的本地时间与基准时间同步。The child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
为解决上述技术问题,本发明采用的第二个技术方案是:提供一种基于传感器时间同步系统的时间同步方法,系统包括广播节点、基准节点和两个以上子节点,其中,基准节点用于为时间同步系统提供基准时间,子节点包括传感器,方法包括:In order to solve the above technical problem, the second technical solution adopted by the present invention is to provide a time synchronization method based on a sensor time synchronization system. The system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used for Provide a reference time for the time synchronization system, the child nodes include sensors, and the methods include:
基准节点接收广播节点发送的第一时间同步信号;The reference node receives the first time synchronization signal sent by the broadcast node;
基准节点发送第二时间同步信号至子节点,以使得子节点依据第一时间同步信号和第二时间同步信号调整子节点的本地时间,使得子节点的本地时间与基准时间相同,其中,子节点接收有广播节点发送的第一时间同步信号。The reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is the same as the reference time, wherein the child node A first time synchronization signal sent by a broadcast node is received.
为解决上述技术问题,本发明采用的第三个技术方案是:提供一种存储介质,存储介质内部存储有计算机程序,计算机程序用于被执行以实现上述的基于传感器时间同步系统的时间同步方法。In order to solve the above-mentioned technical problems, the third technical solution adopted by the present invention is to provide a storage medium, wherein a computer program is stored in the storage medium, and the computer program is used to be executed to realize the above-mentioned time synchronization method based on the sensor time synchronization system .
为解决上述技术问题,本发明采用的第四个技术方案是:包括至少一个处理单元和至少一个存储单元,存储单元存储有计算机程序,当程序被处理单元执行时,使得处理单元执行上述基于传感器时间同步系统的时间同步方法的步骤。In order to solve the above-mentioned technical problem, the fourth technical solution adopted by the present invention is: including at least one processing unit and at least one storage unit, the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is made to execute the above sensor-based method. The steps of the time synchronization method of the time synchronization system.
本发明的有益效果是:区别于现有技术的情况,本申请实施例的基于传感器时间同步系统的时间同步方法,通过接收两次广播的时间同步信号,实现多个子节点的时间同步,降低报文次数减少能量消耗,可以适用于低功耗的无线传感器;本申请实施例的时间同步方法通过单向广播的方式接收时间同步信号,并不依赖上行、下行链路延迟的一致性,消除了发送时间和访问时间引入的时间同步误差,能够更好的应对复杂的无线环境,提升时间同步的精度。The beneficial effects of the present invention are: different from the situation in the prior art, the time synchronization method based on the sensor time synchronization system according to the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving the time synchronization signal broadcast twice, and reduces the alarm time. The time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, and eliminates the need for The time synchronization error introduced by the sending time and the access time can better cope with complex wireless environments and improve the accuracy of time synchronization.
附图说明Description of drawings
图1是本申请传感器时间同步系统的拓扑示意图;Fig. 1 is the topological schematic diagram of the sensor time synchronization system of the present application;
图2是本申请基于传感器时间同步系统的时间同步方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图3是本申请基于传感器时间同步系统的时间同步方法第二实施例的流程示意图;3 is a schematic flowchart of a second embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图4是本申请基于传感器时间同步系统的时间同步方法第三实施例的流程示意图;4 is a schematic flowchart of a third embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图5是本申请基于传感器时间同步系统的时间同步方法第四实施例的流程示意图;5 is a schematic flowchart of a fourth embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图6是本申请基于传感器时间同步系统的时间同步方法第五实施例的流程示意图;6 is a schematic flowchart of a fifth embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图7是本申请基于传感器时间同步系统的时间同步方法第六实施例的流程示意图;7 is a schematic flowchart of a sixth embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图8是本申请基于传感器时间同步系统的时间同步方法第七实施例的流程示意图;8 is a schematic flowchart of a seventh embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图9是本申请基于传感器时间同步系统的时间同步方法第八实施例的流程示意图;9 is a schematic flowchart of an eighth embodiment of a time synchronization method based on a sensor time synchronization system of the present application;
图10是本申请计算机存储介质一实施例的结构示意图;10 is a schematic structural diagram of an embodiment of a computer storage medium of the present application;
图11是本申请计算机装置一实施例的结构示意图。FIG. 11 is a schematic structural diagram of an embodiment of a computer apparatus of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案及效果更加清楚、明确,以下参照附图并举实施例对本申请进一步详细说明。In order to make the objectives, technical solutions and effects of the present application clearer and clearer, the present application will be further described in detail below with reference to the accompanying drawings and examples.
如图1所示,本申请实施例的传感器时间同步系统包括广播节点10、基准节点20和两个以上子节点30,其中,基准节点20用于为时间同步系统提供基准时间,子节点30包括传感器。本申请实施例中的传感器为无线传感器,本申请实施例中的子节点30可以是两个、三个、四个或五个以上等,例如,本申请实施例中,子节点30包括第一子节点31、 第二子节点32、第三子节点33、第四子节点34以及第n子节点35,本申请实施例的传感器属于分布式系统。本申请实施例的基准节点20作为整个分布式系统的基准时钟源,采用RTC(Real Time Clock,实时时钟)芯片的形式校准基准节点20的本地时钟,在其他实施例中也可以通过NTP或PTP协议使得基准节点20与外网保持时间同步,本申请实施例中基准节点20为网关,基准节点20为长供电设备;在其他实施例中,基准节点20也可以为传感器,为可以长供电的传感器。而本申请实施例中,子节点30为无线传感器,子节点30没有RTC芯片,也无法通过NTP或PTP协议与外网保持时间同步,子节点30的无线传感器具有数据采集功能,仅进行传感数据的信息交互,为低功耗的电池供电。本申请实施例中的广播节点10可以是网关类长供电设备,也可以是无线传感器。As shown in FIG. 1 , the sensor time synchronization system of the embodiment of the present application includes a broadcast node 10, a reference node 20, and two or more sub-nodes 30, wherein the reference node 20 is used to provide a reference time for the time synchronization system, and the sub-nodes 30 include sensor. The sensors in the embodiments of the present application are wireless sensors, and the number of sub-nodes 30 in the embodiments of the present application may be two, three, four, or more than five. For example, in the embodiments of the present application, the sub-nodes 30 include the first The child node 31 , the second child node 32 , the third child node 33 , the fourth child node 34 , and the nth child node 35 , the sensor in the embodiment of the present application belongs to a distributed system. The reference node 20 in the embodiment of the present application is used as the reference clock source of the entire distributed system, and the local clock of the reference node 20 is calibrated in the form of an RTC (Real Time Clock, real-time clock) chip. In other embodiments, NTP or PTP can also be used. The protocol enables the reference node 20 to maintain time synchronization with the external network. In the embodiment of this application, the reference node 20 is a gateway, and the reference node 20 is a long-term power supply device; in other embodiments, the reference node 20 can also be a sensor, which can be powered for a long time. sensor. In the embodiment of the present application, the sub-node 30 is a wireless sensor, the sub-node 30 does not have an RTC chip, and cannot maintain time synchronization with the external network through the NTP or PTP protocol. The wireless sensor of the sub-node 30 has a data collection function and only performs sensing Information exchange of data, power supply for low-power batteries. The broadcast node 10 in the embodiment of the present application may be a gateway-type long power supply device, or may be a wireless sensor.
本申请第一实施例中,如图2所示,一种基于传感器时间同步系统的时间同步方法,具体包括:In the first embodiment of the present application, as shown in FIG. 2 , a time synchronization method based on a sensor time synchronization system specifically includes:
步骤110:广播节点发送第一时间同步信号至基准节点和子节点。Step 110: The broadcast node sends a first time synchronization signal to the reference node and the child nodes.
本申请实施例中,第一时间同步信号包括第一参考时间。In this embodiment of the present application, the first time synchronization signal includes the first reference time.
本申请实施例中,广播节点发送第一时间同步信号至基准节点和子节点的过程中,存在发送时间和访问时间,具体地,发送时间是广播节点发送的时间,广播节点通过射频电路发送,以及光速传播至基准节点或子节点等所耗用的时间;访问时间为基准节点或子节点接收第一时间同步信号等信号时,此时的第一时间同步信号为模拟信号,基准节点或子节点在接收到模拟信号后,转换为数字信号,存储于寄存器中,并从寄存器中读取该数字信号。In the embodiment of the present application, in the process that the broadcast node sends the first time synchronization signal to the reference node and the sub-nodes, there is a sending time and an access time. Specifically, the sending time is the sending time of the broadcasting node, and the broadcasting node sends through the radio frequency circuit, and The time it takes for the speed of light to propagate to the reference node or child node; the access time is when the reference node or child node receives the first time synchronization signal and other signals, the first time synchronization signal at this time is an analog signal, and the reference node or child node After receiving the analog signal, it is converted into a digital signal, stored in a register, and the digital signal is read from the register.
本申请实施例中,广播节点发送第一时间同步信号至基准节点或多个子节点时,发送时间和访问时间存在差异。In the embodiment of the present application, when the broadcast node sends the first time synchronization signal to the reference node or multiple sub-nodes, there is a difference between the sending time and the access time.
步骤120:基准节点在接收到第一时间同步信号后发送第二时间同步信号至子节点。Step 120: After receiving the first time synchronization signal, the reference node sends a second time synchronization signal to the child node.
本申请实施例中,第二时间同步信号包含了第二本地时间的运算关系,包含了基准时间。In the embodiment of the present application, the second time synchronization signal includes the operation relationship of the second local time, including the reference time.
本申请实施例中,基准节点在发送第二时间同步信号至多个子节点时,多个子节点接收第二时间同步信号的发送时间和访问时间也存在差异;In the embodiment of the present application, when the reference node sends the second time synchronization signal to multiple sub-nodes, there are also differences in the sending time and the access time of the multiple sub-nodes receiving the second time synchronization signal;
广播节点发送至子节点的第一时间同步信号,与基准节点发送至子节点第二时间同步信号的发送时间和访问时间也存在差异。There is also a difference between the sending time and the access time of the first time synchronization signal sent by the broadcast node to the child node and the second time synchronization signal sent by the reference node to the child node.
步骤130:子节点依据接收到的第一时间同步信号和第二时间同步信号调整本地时间,使得子节点的本地时间与基准时间同步。Step 130: The child node adjusts the local time according to the received first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
本申请实施例中,可以通过接收到第一时间同步信号和第二时间同步信号后,以计算并调整子节点的本地时间,使得子节点的本地时间与基准节点的基准时间相同,使得多个子节点之间的本地时间相同,实现子节点的传感器时间同步的效果。In this embodiment of the present application, after receiving the first time synchronization signal and the second time synchronization signal, the local time of the child node can be calculated and adjusted so that the local time of the child node is the same as the reference time of the reference node, so that multiple child nodes The local time between nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
本申请实施例的基于传感器时间同步系统的时间同步方法,通过接收两次广播的时间同步信号,实现多个子节点的时间同步,降低报文次数减少能量消耗,可以适用于低功耗的无线传感器;本申请实施例的时间同步方法通过单向广播的方式接收时间同步信号,并不依赖上行、下行链路延迟的一致性,消除了发送时间和访问时间引入的时间同步误差,能够更好的应对复杂的无线环境,提升时间同步的精度。The time synchronization method based on the sensor time synchronization system according to the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors The time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
本申请第二实施例中,如图3所示,本申请实施例提供一种基于传感器时间同步系统的时间同步方法,该方法包括:In the second embodiment of the present application, as shown in FIG. 3 , the embodiment of the present application provides a time synchronization method based on a sensor time synchronization system, and the method includes:
步骤210:子节点接收广播节点发送的第一时间同步信号。Step 210: The child node receives the first time synchronization signal sent by the broadcast node.
本申请实施例中两个以上子节点分别接收广播节点发送的第一时间同步信号,两个以上子节点接收广播节点发送的第一时间同步信号的本地时间存在一定差异,例如,出现接收信号并非同时接收,而是依次接收,使得本地时间存在一定差异;或由于子节点内未设置RTC芯片,也无法通过NTP或PTP协议与外网保持时间同步,而子节点的无线传感器的本地时钟可能存在频偏及温漂所导致的各子节点的无线传感器的本地时钟存在差异。In the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal sent by the broadcast node, and there is a certain difference in the local time when the two or more sub-nodes receive the first time synchronization signal sent by the broadcast node. Received at the same time, but received in sequence, so that there is a certain difference in the local time; or because there is no RTC chip in the child node, it is impossible to maintain time synchronization with the external network through the NTP or PTP protocol, and the local clock of the wireless sensor of the child node may exist. The local clocks of the wireless sensors of each sub-node are different due to frequency offset and temperature drift.
本申请实施例中,广播节点可以向子节点发送第一时间同步信号,子节点可以接收广播节点发送的第一时间同步信号。In this embodiment of the present application, the broadcast node may send the first time synchronization signal to the child node, and the child node may receive the first time synchronization signal sent by the broadcast node.
步骤220:子节点接收第二时间同步信号,其中,第二时间同步信号为基准节点在接收广播节点发送的第一时间同步信号之后发送的信号。Step 220: The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node.
本申请实施例中,子节点接收基准节点广播的第二时间同步信号,其中,基准节点广播的第二时间同步信号包含基准节点接收第一时间同步信号的第二本地时间,使得子节点接收到第二时间同步信号包含了第二本地时间的运算关系,包含了基准时间。In this embodiment of the present application, the child node receives the second time synchronization signal broadcast by the reference node, wherein the second time synchronization signal broadcast by the reference node includes the second local time at which the reference node receives the first time synchronization signal, so that the child node receives the second time synchronization signal. The second time synchronization signal includes the operational relationship of the second local time, including the reference time.
步骤230:子节点依据第一时间同步信号和第二时间同步信号调整本地时间,使得子节点的本地时间与基准时间同步。Step 230: The child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
本申请实施例中,子节点在接收到第一时间同步信号和第二时间同步信号后,以计算并调整子节点的本地时间,使得子节点的本地时间与基准节点的基准时间相同,使得多个子节点之间的本地时间相同,实现子节点的传感器时间同步的效果。In the embodiment of the present application, after receiving the first time synchronization signal and the second time synchronization signal, the child node calculates and adjusts the local time of the child node, so that the local time of the child node is the same as the reference time of the reference node, so that more The local time between the child nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
本申请实施例的基于传感器时间同步系统的时间同步方法,通过接收两次广播的时间同步信号,实现多个子节点的时间同步,降低报文次数减少能量消耗,可以适用于低功耗的无线传感器;本申请实施例的时间同步方法通过单向广播的方式接收时间同步信号,并不依赖上行、下行链路延迟的一致性,消除了发送时间和访问时间引入的时间同步误差,能够更好的应对复杂的无线环境,提升时间同步的精度。The time synchronization method based on the sensor time synchronization system according to the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors The time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
如图4所示,在本申请第三实施例中,基于传感器时间同步系统的时间同步方法,包括:As shown in FIG. 4 , in the third embodiment of the present application, a time synchronization method based on a sensor time synchronization system includes:
步骤310:子节点接收广播节点发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,其中,第一时间同步信号包括第一参考时间。Step 310: The child node receives the first time synchronization signal sent by the broadcast node, and records the first local time when the first time synchronization signal is received, where the first time synchronization signal includes the first reference time.
本申请实施例中由于子节点内未设置RTC芯片,也无法通过NTP或PTP协议与外网保持时间同步,而子节点的无线传感器的本地时钟可能存在频偏及温漂所导致的各子节点的无线传感器的本地时钟存在差异;或本申请实施例中,两个以上子节点分别接收广播节点发送的第一时间同步信号,两个以上子节点接收广播节点发送的第一时间同步信号 的本地时间存在一定差异,例如,出现接收信号并非同时接收,而是依次接收,使得本地时间存在一定差异。In the embodiment of the present application, since the RTC chip is not set in the sub-node, and the time synchronization cannot be maintained with the external network through the NTP or PTP protocol, and the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node. The local clocks of the wireless sensors are different; or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal sent by the broadcast node, and two or more sub-nodes receive the local time synchronization signal of the first time synchronization signal sent by the broadcast node. There is a certain difference in time. For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
本申请实施例中,广播节点向子节点发送第一时间同步信号,第一时间同步信号包括第一参考时间T 0,子节点可以接收广播节点发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,例如,子节点有n个,其中n为大于等于2的正整数,分别为第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,各个子节点接收到第一时间同步信号的第一本地时间分别为T 1、T 2、T 3、T 4、......、T nIn the embodiment of the present application, the broadcast node sends the first time synchronization signal to the child node, the first time synchronization signal includes the first reference time T 0 , the child node can receive the first time synchronization signal sent by the broadcast node, and record the received first time synchronization signal. The first local time of a time synchronization signal, for example, there are n child nodes, where n is a positive integer greater than or equal to 2, which are the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, the first local time at which each child node receives the first time synchronization signal is T 1 , T 2 , T 3 , T 4 , ..., T n respectively .
步骤320:子节点接收第二时间同步信号,其中,第二时间同步信号为基准节点在接收广播节点发送的第一时间同步信号之后发送的信号,第二时间同步信号包括第一时间差值,第一时间差值为基准节点在接收到广播节点发送的第一时间同步信号时的第二本地时间与第一参考时间的差值。Step 320: the child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value, The first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
本申请实施例中,广播节点在向子节点发送第一时间同步信号的同时,也向基准节点发送第一时间同步信号,使得子节点和基准节点都可以接收到广播节点发送的第一时间同步信号,其中,基准节点在接收到第一时间同步信号时,记录接收到第一时间同步信号时的第二本地时间T j,基准节点依据第二本地时间T j和第一参考时间T 0,计算出第一时间差值δ j,第一时间差值为第二本地时间与第一参考时间的差值,即δ j=T j-T 0;即子节点接收到基准节点发送过来的第一时间差值δ jIn this embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node. signal, wherein, when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 , The first time difference value δ j is calculated, and the first time difference value is the difference between the second local time and the first reference time, that is, δ j =T j -T 0 ; that is, the child node receives the first time sent by the reference node. A time difference δ j .
步骤330:子节点依据第一时间差值调整第一本地时间,使得子节点的本地时间与基准时间同步。Step 330: The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
本申请实施例中,第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,分别接收到第一时间同步信号的第一本地时间为T 1、T 2、T 3、T 4、......、T n,本申请实施例中,子节点依据第一本地时间与第一参考时间,计算第二时间差值;具体地的,第二时间差值δn为第一本地时间与第一参考时间的差值,即子节点的第二时间差值δn=T n-T 0;具体地,第一子节点、第二子节点、第三子节点、第四子节 点、......、第n子节点的第二时间差值δ 1=T 1-T 0、δ 2=T 2-T 0、δ 3=T 3-T 0、δ 4=T 3-T 0、......、δn=T n-T 0;本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得子节点的本地时间与基准时间同步,且与基准节点的基准时间同步;具体地,本申请实施例中,第一子节点的第一时间差值和第二时间差值之差为Δ 1=δ 1j,第二子节点的第一时间差值和第二时间差值之差为Δ 2=δ 2j,第三子节点的第一时间差值和第二时间差值之差为Δ 3=δ 3j,第四子节点的第一时间差值和第二时间差值之差为Δ 4=δ 4j,......,第n子节点的第一时间差值和第二时间差值之差为Δ n=δ nj。本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,即将第一本地时间减去第一时间差值与第二时间差值之差,使得调节后的子节点的本地时间与基准时间相同,即调节后的子节点的本地时间为T n’=T nn,具体地,第一子节点的调节后的本地时间T 1’=T 11,第二子节点的调节后的本地时间T 2’=T 22,第三子节点的调节后的本地时间T 3’=T 33,第三子节点的调节后的本地时间T 4’=T 44,......,第n子节点的调节后的本地时间Tn’=T nnIn this embodiment of the present application, the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal The time is T 1 , T 2 , T 3 , T 4 , . Specifically, the second time difference value δn is the difference between the first local time and the first reference time, that is, the second time difference value of the child node δn=T n −T 0 ; The second time difference value of the second child node, the third child node, the fourth child node, ..., the nth child node δ 1 =T 1 -T 0 , δ 2 =T 2 -T 0 , δ 3 =T 3 -T 0 , δ 4 =T 3 -T 0 ,..., δn=T n -T 0 ; in the embodiment of the present application, according to the first time difference value and the second time difference value Adjust the first local time of the child node, so that the local time of the child node is synchronized with the reference time, and is synchronized with the reference time of the reference node; The difference between the two time difference values is Δ 11j , the difference between the first time difference value and the second time difference value of the second child node is Δ 22j , and the first time difference value of the third child node is Δ 2 =δ 2 -δ j . The difference between the first time difference value and the second time difference value is Δ 33j , the difference between the first time difference value and the second time difference value of the fourth child node is Δ 44j , ......, the difference between the first time difference value and the second time difference value of the nth child node is Δ nnj . In this embodiment of the present application, the first local time of the child node is adjusted according to the first time difference and the second time difference, that is, the first local time is subtracted from the difference between the first time difference and the second time difference, so that the adjustment The local time of the child node after adjustment is the same as the reference time, that is, the local time of the adjusted child node is T n '=T nn , specifically, the adjusted local time of the first child node T 1 '=T 11 , the adjusted local time of the second child node T 2 '=T 22 , the adjusted local time of the third child node T 3 '=T 33 , the adjusted local time of the third child node The adjusted local time T 4 ′=T 4 −Δ 4 , . . . , the adjusted local time of the nth child node Tn′=T n −Δ n .
其中,T 1’=T 11=T 1-(δ 1j)=T 1-[(T 1-T 0)-(T j-T 0)]=T jWherein, T 1 '=T 11 =T 1 -(δ 1j )=T 1 -[(T 1 -T 0 )-(T j -T 0 )]=T j ;
T 2’=T 22=T 2-(δ 2j)=T 2-[(T 2-T 0)-(T j-T 0)]=T jT 2 '=T 22 =T 2 -(δ 2j )=T 2 -[(T 2 -T 0 )-(T j -T 0 )]=T j ;
T 3’=T 33=T 3-(δ 3j)=T 3-[(T 3-T 0)-(T j-T 0)]=T jT 3 ′=T 33 =T 3 -(δ 3j )=T 3 -[(T 3 -T 0 )-(T j -T 0 )]=T j ;
T 4’=T 44=T 4-(δ 4j)=T 4-[(T 4-T 0)-(T j-T 0)]=T jT 4 ′=T 44 =T 4 -(δ 4j )=T 4 -[(T 4 -T 0 )-(T j -T 0 )]=T j ;
............
Tn’=T nn=T n-(δ nj)=T n-[(T n-T 0)-(T j-T 0)]=T jTn'=Tn- Δn = Tn- ( δn - δj)=Tn - [(Tn - T0 )-(Tj- T0 )] = Tj .
即,本申请实施例可以通过上述方法使得各个子节点的本地时间与基准节点的基准时间同步。That is, in this embodiment of the present application, the local time of each child node can be synchronized with the reference time of the reference node through the above method.
如图5所示,在本申请第四实施例中,基于传感器时间同步系统的时间同步方法,该方法包括:As shown in FIG. 5 , in the fourth embodiment of the present application, a time synchronization method based on a sensor time synchronization system includes:
步骤410:子节点接收广播节点定时发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,其中,第一时间同步信号包括第一参考时间和时间同步周期。Step 410: The child node receives the first time synchronization signal periodically sent by the broadcast node, and records the first local time when the first time synchronization signal is received, where the first time synchronization signal includes a first reference time and a time synchronization period.
本申请实施例中由于子节点内未设置RTC芯片,也无法通过NTP或PTP协议与外网保持时间同步,而子节点的无线传感器的本地时钟可能存在频偏及温漂所导致的各子节点的无线传感器的本地时钟存在差异;或本申请实施例中,两个以上子节点分别接收广播节点定时发送的第一时间同步信号,两个以上子节点接收广播节点发送的第一时间同步信号的本地时间存在一定差异,例如,出现接收信号并非同时接收,而是依次接收,使得本地时间存在一定差异。In the embodiment of the present application, since the RTC chip is not set in the sub-node, and the time synchronization cannot be maintained with the external network through the NTP or PTP protocol, and the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node. There is a difference in the local clocks of the wireless sensors; or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal periodically sent by the broadcast node, and two or more sub-nodes receive the first time synchronization signal sent by the broadcast node. There is a certain difference in the local time. For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
本申请实施例中,广播节点定时向子节点发送第一时间同步信号,第一时间同步信号的第一参考时间用Time表示,本申请实施例中,Time=T 0;第一时间同步信号的时间同步周期用Cycle表示,用于标记目前的时间同步信号所属基本周期。本申请实施例通过广播节点定时发送第一时间同步信号,可以定时同步子节点的本地时间,使得多个子节点的本地时间同步。通过广播节点定时发送第一时间同步信号,可以使得子节点定时接收第一时间同步信号,定时调整第一时间同步信号,以保证子节点的本地时间长期处于同步状态。 In the embodiment of the present application, the broadcasting node periodically sends the first time synchronization signal to the child nodes, and the first reference time of the first time synchronization signal is represented by Time. In the embodiment of the present application, Time=T 0 ; The time synchronization period is represented by Cycle, which is used to mark the basic period to which the current time synchronization signal belongs. In this embodiment of the present application, the broadcast node periodically sends the first time synchronization signal, so that the local time of the sub-nodes can be synchronized regularly, so that the local time of multiple sub-nodes is synchronized. By sending the first time synchronization signal regularly by the broadcast node, the child node can receive the first time synchronization signal regularly, and adjust the first time synchronization signal regularly, so as to ensure that the local time of the child node is in a synchronized state for a long time.
本申请实施例中,子节点可以接收广播节点发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,例如,子节点有n个,其中n为大于等于2的正整数,分别为第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,各个子节点接收到第一时间同步信号的第一本地时间分别为T 1、T 2、T 3、T 4、......、T nIn this embodiment of the present application, the child node may receive the first time synchronization signal sent by the broadcast node, and record the first local time when the first time synchronization signal is received. For example, there are n child nodes, where n is greater than or equal to 2 Positive integers, respectively the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, each child node receives the first time synchronization signal of the first time synchronization signal. The local times are T 1 , T 2 , T 3 , T 4 , . . . , T n , respectively.
步骤420:子节点接收第二时间同步信号,其中,第二时间同步信号为基准节点在接收广播节点发送的第一时间同步信号之后发送的信号,第二时间同步信号包括第一时间差值和时间同步周期,第一时间差值为基准节点在接收到广播节点发送的第一时间同步信号时的第二本地时间与第一参考时间的差值。Step 420: The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value and In the time synchronization period, the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
本申请实施例中,第二时间同步信号的时间同步周期与接收到广播节点发送的第一时间同步周期相同。In this embodiment of the present application, the time synchronization period of the second time synchronization signal is the same as the first time synchronization period sent by the broadcast node.
本申请实施例中,广播节点在向子节点发送第一时间同步信号的同时,也向基准节点发送第一时间同步信号,使得子节点和基准节点都可 以接收到广播节点发送的第一时间同步信号,其中,基准节点在接收到第一时间同步信号时,记录接收到第一时间同步信号时的第二本地时间T j,基准节点依据第二本地时间T j和第一参考时间T 0,计算出第一时间差值δ j,第一时间差值为第二本地时间与第一参考时间的差值,即δ j=T j-T 0;即,子节点接收到基准节点发送过来的第一时间差值δ jIn this embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node. signal, wherein, when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 , The first time difference value δ j is calculated, and the first time difference value is the difference between the second local time and the first reference time, that is, δ j =T j -T 0 ; that is, the child node receives the data sent by the reference node. The first time difference δ j .
步骤421:依据时间同步周期,确定第一时间同步信号和第二时间同步信号属于同一周期。Step 421: According to the time synchronization period, determine that the first time synchronization signal and the second time synchronization signal belong to the same period.
本申请实施例,判断第一时间同步信号中的时间周期和第二时间同步信号中的时间同步周期是否为同一周期,可以确定该第一时间同步信号和第二时间同步信号是否属于同一周期,只有在第一时间同步信号中的时间周期和第二时间同步信号中的时间同步周期为同一周期时,才可以确定第一时间同步信号和第二时间同步信号属于同一周期,只有在同一周期的第一时间同步信号和第二时间同步信号才可以执行步骤330。In this embodiment of the present application, judging whether the time period in the first time synchronization signal and the time synchronization period in the second time synchronization signal are the same period, it can be determined whether the first time synchronization signal and the second time synchronization signal belong to the same period, Only when the time period in the first time synchronization signal and the time synchronization period in the second time synchronization signal are the same period, it can be determined that the first time synchronization signal and the second time synchronization signal belong to the same period. Step 330 can be performed only with the first time synchronization signal and the second time synchronization signal.
步骤430:子节点依据第一时间差值调整第一本地时间,使得子节点的本地时间与基准时间同步。Step 430: The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
本申请实施例中,第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,分别接收到第一时间同步信号的第一本地时间为T 1、T 2、T 3、T 4、......、T n,本申请实施例中,子节点依据第一本地时间与第一参考时间,计算第二时间差值;具体地的,第二时间差值δn为第一本地时间与第一参考时间的差值,即子节点的第二时间差值δn=T n-T 0;具体地,第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点的第二时间差值δ 1=T 1-T 0、δ 2=T 2-T 0、δ 3=T 3-T 0、δ 4=T 3-T 0、......、δn=T n-T 0;本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得子节点的本地时间与基准时间同步;具体地,本申请实施例中,第一子节点的第一时间差值和第二时间差值之差为Δ 1=δ 1j,第二子节点的第一时间差值和第二时间差值之差为Δ 2=δ 2j,第三子节点的第一时间差值和第二时间差值之差为Δ 3=δ 3j,第四子节点的第一时间差值和第二时间差值之差为Δ 4=δ 4j,......,第n子节点的第一时间差值和第二时间差值之差为 Δ n=δ nj。本申请实施例中,依据第一时间差值和第二时间差值之差调整子节点的第一本地时间,即将第一本地时间减去第一时间差值与第二时间差值之差,使得调节后的子节点的本地时间与基准时间相同,即调节后的子节点的本地时间为T n’=T nn,具体地,第一子节点的调节后的本地时间T 1’=T 11,第二子节点的调节后的本地时间T 2’=T 22,第三子节点的调节后的本地时间T 3’=T 33,第三子节点的调节后的本地时间T 4’=T 44,......,第n子节点的调节后的本地时间Tn’=T nnIn this embodiment of the present application, the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal The time is T 1 , T 2 , T 3 , T 4 , . Specifically, the second time difference value δn is the difference between the first local time and the first reference time, that is, the second time difference value of the child node δn=T n −T 0 ; The second time difference value of the second child node, the third child node, the fourth child node, ..., the nth child node δ 1 =T 1 -T 0 , δ 2 =T 2 -T 0 , δ 3 =T 3 -T 0 , δ 4 =T 3 -T 0 ,..., δn=T n -T 0 ; in the embodiment of the present application, according to the first time difference value and the second time difference value Adjust the first local time of the child node so that the local time of the child node is synchronized with the reference time; specifically, in the embodiment of the present application, the difference between the first time difference value and the second time difference value of the first child node is Δ 11j , the difference between the first time difference and the second time difference of the second child node is Δ 22j , the first time difference and the second time difference of the third child node The difference between the values is Δ 33j , and the difference between the first time difference and the second time difference of the fourth child node is Δ 44j , . . . , the nth The difference between the first time difference value and the second time difference value of the child node is Δ nnj . In this embodiment of the present application, the first local time of the child node is adjusted according to the difference between the first time difference and the second time difference, that is, the first local time is subtracted from the difference between the first time difference and the second time difference, Make the local time of the adjusted child node the same as the reference time, that is, the adjusted local time of the child node is T n '=T nn , specifically, the adjusted local time T 1 ' of the first child node =T 11 , the adjusted local time of the second child node T 2 '=T 22 , the adjusted local time of the third child node T 3 '=T 33 , the third child The adjusted local time of the node T 4 ′=T 4 −Δ 4 , . . . , the adjusted local time of the nth child node Tn′=T n −Δ n .
其中,T 1’=T 11=T 1-(δ 1j)=T 1-[(T 1-T 0)-(T j-T 0)]=T jWherein, T 1 '=T 11 =T 1 -(δ 1j )=T 1 -[(T 1 -T 0 )-(T j -T 0 )]=T j ;
T 2’=T 22=T 2-(δ 2j)=T 2-[(T 2-T 0)-(T j-T 0)]=T jT 2 '=T 22 =T 2 -(δ 2j )=T 2 -[(T 2 -T 0 )-(T j -T 0 )]=T j ;
T 3’=T 33=T 3-(δ 3j)=T 3-[(T 3-T 0)-(T j-T 0)]=T jT 3 ′=T 33 =T 3 -(δ 3j )=T 3 -[(T 3 -T 0 )-(T j -T 0 )]=T j ;
T 4’=T 44=T 4-(δ 4j)=T 4-[(T 4-T 0)-(T j-T 0)]=T jT 4 ′=T 44 =T 4 -(δ 4j )=T 4 -[(T 4 -T 0 )-(T j -T 0 )]=T j ;
............
Tn’=T nn=T n-(δ nj)=T n-[(T n-T 0)-(T j-T 0)]=T jTn'=Tn- Δn = Tn- ( δn - δj)=Tn - [(Tn - T0 )-(Tj- T0 )] = Tj .
即,本申请实施例可以通过上述方法使得各个子节点的本地时间与基准节点的基准时间同步。That is, in this embodiment of the present application, the local time of each child node can be synchronized with the reference time of the reference node through the above method.
如图6所示,在本申请第五实施例中,基于传感器时间同步系统的时间同步方法,包括:As shown in FIG. 6 , in the fifth embodiment of the present application, a time synchronization method based on a sensor time synchronization system includes:
步骤510:子节点接收广播节点定时发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,其中,第一时间同步信号包括第一参考时间、时间同步周期、时间同步指示、时间同步域和功能角色。Step 510: The child node receives the first time synchronization signal periodically sent by the broadcast node, and records the first local time when the first time synchronization signal is received, wherein the first time synchronization signal includes the first reference time, the time synchronization period, the time Synchronization indications, time synchronization domains, and functional roles.
本申请实施例中由于子节点内未设置RTC芯片,也无法通过NTP或PTP协议与外网保持时间同步,而子节点的无线传感器的本地时钟可能存在频偏及温漂所导致的各子节点的无线传感器的本地时钟存在差异;或本申请实施例中,两个以上子节点分别接收广播节点定时发送的第一时间同步信号,两个以上子节点接收广播节点发送的第一时间同步信号的本地时间存在一定差异,例如,出现接收信号并非同时接收,而是依次接收,使得本地时间存在一定差异。In the embodiment of the present application, since the RTC chip is not set in the sub-node, and the time synchronization cannot be maintained with the external network through the NTP or PTP protocol, and the local clock of the wireless sensor of the sub-node may have frequency offset and temperature drift caused by each sub-node. There is a difference in the local clocks of the wireless sensors; or in the embodiment of the present application, two or more sub-nodes respectively receive the first time synchronization signal periodically sent by the broadcast node, and two or more sub-nodes receive the first time synchronization signal sent by the broadcast node. There is a certain difference in the local time. For example, the received signals are not received at the same time, but are received in sequence, so that there is a certain difference in the local time.
本申请实施例中,广播节点定时向子节点发送第一时间同步信号, 第一时间同步信号包括第一参考时间Time、时间同步周期Cycle、时间同步指示Flag、时间同步域Domain和功能角色Role,在其他实施例中,第一时间同步信号还可以包括物理地址Mac_Address。In the embodiment of the present application, the broadcast node periodically sends a first time synchronization signal to the child nodes, and the first time synchronization signal includes a first reference time Time, a time synchronization period Cycle, a time synchronization indication Flag, a time synchronization domain Domain, and a functional role Role, In other embodiments, the first time synchronization signal may further include a physical address Mac_Address.
其中,时间同步指示Flag,用于指明该条第一时间同步信号用于时间同步;时间同步周期Cycle,用于标记目前的时间同步所属基本周期;时间同步域Domain,在同一个同步域下的子节点才可以进行时间同步;功能角色Role,用于区分广播节点和基准节点;在其他实施例中,物理地址Mac_Address,用于在网络中用于标识设备地址。第一参考时间Time,为该条第一时间同步信号的第一本地时间,假设第一次的第一时间同步信号Time=T 0Among them, the time synchronization indication Flag is used to indicate that the first time synchronization signal is used for time synchronization; the time synchronization cycle Cycle is used to mark the basic cycle to which the current time synchronization belongs; the time synchronization domain Domain is used in the same synchronization domain. Only the child nodes can perform time synchronization; the functional role Role is used to distinguish the broadcast node from the reference node; in other embodiments, the physical address Mac_Address is used to identify the device address in the network. The first reference time Time is the first local time of the first time synchronization signal, and it is assumed that the first time synchronization signal Time=T 0 for the first time.
本申请实施例中,子节点可以接收广播节点发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,例如,子节点有n个,其中n为大于等于2的正整数,分别为第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,各个子节点接收到第一时间同步信号的第一本地时间分别为T 1、T 2、T 3、T 4、......、T nIn this embodiment of the present application, the child node may receive the first time synchronization signal sent by the broadcast node, and record the first local time when the first time synchronization signal is received. For example, there are n child nodes, where n is greater than or equal to 2 Positive integers, respectively the first child node, the second child node, the third child node, the fourth child node, ..., the nth child node, each child node receives the first time synchronization signal of the first time synchronization signal. The local times are T 1 , T 2 , T 3 , T 4 , . . . , T n , respectively.
步骤520:子节点接收第二时间同步信号,其中,第二时间同步信号为基准节点在接收广播节点发送的第一时间同步信号之后发送的信号,第二时间同步信号包括第一时间差值、时间同步周期、时间同步指示、时间同步域和功能角色,第一时间差值为基准节点在接收到广播节点发送的第一时间同步信号时的第二本地时间与第一参考时间的差值。Step 520: The child node receives a second time synchronization signal, where the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node, and the second time synchronization signal includes the first time difference value, Time synchronization period, time synchronization indication, time synchronization domain and functional role, the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node.
基准节点向子节点发送第二时间同步信号,第二时间同步信号包括第一时间差值Time_Difference、时间同步周期Cycle、时间同步指示Flag、时间同步域Domain和功能角色Role,在其他实施例中,第二时间同步信号还可以包括物理地址Mac_Address。The reference node sends a second time synchronization signal to the child node, where the second time synchronization signal includes a first time difference value Time_Difference, a time synchronization period Cycle, a time synchronization indication Flag, a time synchronization domain Domain, and a functional role Role. In other embodiments, The second time synchronization signal may also include a physical address Mac_Address.
本申请实施例中,第二时间同步信号的时间同步指示Flag用于指明该条第二时间同步信号用于时间同步;第二时间同步信号的时间同步周期Cycle、时间同步域Domain与接收到广播节点发送的第一时间同步周期Cycle、时间同步域Domain相同。功能角色Role代表该信号由基准节点发出。In this embodiment of the present application, the time synchronization indication Flag of the second time synchronization signal is used to indicate that the second time synchronization signal is used for time synchronization; the time synchronization cycle Cycle of the second time synchronization signal, the time synchronization domain Domain and the received broadcast The first time synchronization cycle Cycle and time synchronization domain Domain sent by the node are the same. The functional role Role represents that the signal is emitted by the base node.
本申请实施例中,广播节点在向子节点发送第一时间同步信号的同时,也向基准节点发送第一时间同步信号,使得子节点和基准节点都可以接收到广播节点发送的第一时间同步信号,其中,基准节点在接收到第一时间同步信号时,记录接收到第一时间同步信号时的第二本地时间T j,基准节点依据第二本地时间T j和第一参考时间T 0,计算出第一时间差值δ j,第一时间差值Time_Difference为第二本地时间与第一参考时间的差值,即δ j=T j-T 0;即,子节点接收到基准节点发送过来的第一时间差值δ jIn this embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node while sending the first time synchronization signal to the child node, so that both the child node and the reference node can receive the first time synchronization signal sent by the broadcast node. signal, wherein, when the reference node receives the first time synchronization signal, it records the second local time T j when the first time synchronization signal is received, and the reference node records the second local time T j according to the second local time T j and the first reference time T 0 , The first time difference value δ j is calculated, and the first time difference value Time_Difference is the difference between the second local time and the first reference time, that is, δ j =T j -T 0 ; that is, the child node receives the transmission from the reference node. The first time difference δ j of .
步骤521:依据时间同步指示、时间同步周期、时间同步域和功能角色,确定第一时间同步信号和第二时间同步信号为同步信号。Step 521: Determine the first time synchronization signal and the second time synchronization signal as synchronization signals according to the time synchronization instruction, the time synchronization period, the time synchronization domain and the functional role.
本申请实施例,时间同步指示用于指明该信号用于时间同步,只有在第一时间同步信号和第二时间同步信号为同步信号时,即第一时间同步信号和第二时间同步信号可以用于时间同步。In this embodiment of the present application, the time synchronization indication is used to indicate that the signal is used for time synchronization, and only when the first time synchronization signal and the second time synchronization signal are synchronization signals, that is, the first time synchronization signal and the second time synchronization signal can be used for in time synchronization.
判断第一时间同步信号中的时间周期和第二时间同步信号中的时间同步周期是否为同一周期;判断第一时间同步信号中的时间同步域和第二时间同步信号中的时间同步域是否相同;判断第一时间同步信号的功能角色是否代表该信号由广播节点发出,判断第二时间同步信号的功能角色是否代表该信号由基准节点发出。从而可以确定子节点接收的信号为第一时间同步信号和第二时间同步信号,当确定该第一时间同步信号和第二时间同步信号属于同一周期时,第一时间同步信号和第二时间同步信号的时间同步域相同时,第一时间同步信号和第二时间同步信号为同步信号,可以用于时间同步,才可以执行步骤530。Determine whether the time period in the first time synchronization signal and the time synchronization period in the second time synchronization signal are the same period; determine whether the time synchronization field in the first time synchronization signal and the time synchronization field in the second time synchronization signal are the same ; determine whether the functional role of the first time synchronization signal represents that the signal is sent by the broadcast node, and determine whether the functional role of the second time synchronization signal represents that the signal is sent by the reference node. Therefore, it can be determined that the signals received by the child node are the first time synchronization signal and the second time synchronization signal. When it is determined that the first time synchronization signal and the second time synchronization signal belong to the same period, the first time synchronization signal and the second time synchronization signal When the time synchronization domains of the signals are the same, the first time synchronization signal and the second time synchronization signal are synchronization signals and can be used for time synchronization, and then step 530 can be executed.
步骤530:子节点依据第一时间差值调整第一本地时间,使得子节点的本地时间与基准时间同步。Step 530: The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
本申请实施例中,第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,分别接收到第一时间同步信号的第一本地时间为T 1、T 2、T 3、T 4、......、T n,本申请实施例中,子节点依据第一本地时间与第一参考时间,计算第二时间差值;具体地的,第二时间差值δn为第一本地时间与第一参考时间的差值,即子节点的第二时间差值 δn=T n-T 0;具体地,第一子节点、第二子节点、第三子节点、第四子节点......第n子节点的第二时间差值δ 1=T 1-T 0、δ 2=T 2-T 0、δ 3=T 3-T 0、δ 4=T 3-T 0、......、δn=T n-T 0;本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得多个子节点的本地时间同步,且与基准节点的基准时间同步;具体地,本申请实施例中,第一子节点的第一时间差值和第二时间差值之差为Δ 1=δ 1j,第二子节点的第一时间差值和第二时间差值之差为Δ 2=δ 2j,第三子节点的第一时间差值和第二时间差值之差为Δ 3=δ 3j,第四子节点的第一时间差值和第二时间差值之差为Δ 4=δ 4j,......,第n子节点的第一时间差值和第二时间差值之差为Δ n=δ nj。本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得调节后的本地时间T n’=T nn,具体地,第一子节点的调节后的本地时间T 1’=T 11,第二子节点的调节后的本地时间T 2’=T 22,第三子节点的调节后的本地时间T 3’=T 33,第三子节点的调节后的本地时间T 4’=T 44,......,第n子节点的调节后的本地时间Tn’=T nnIn this embodiment of the present application, the first sub-node, the second sub-node, the third sub-node, the fourth sub-node, ..., the n-th sub-node respectively receive the first local time synchronization signal The time is T 1 , T 2 , T 3 , T 4 , . Specifically, the second time difference value δn is the difference between the first local time and the first reference time, that is, the second time difference value of the child node δn=T n −T 0 ; The second time difference value of the second child node, the third child node, the fourth child node...the nth child node δ 1 =T 1 -T 0 , δ 2 =T 2 -T 0 , δ 3 = T 3 -T 0 , δ 4 =T 3 -T 0 ,..., δn=T n -T 0 ; in this embodiment of the present application, the The first local time of the node, so that the local times of multiple child nodes are synchronized and synchronized with the reference time of the reference node; specifically, in the embodiment of the present application, the first time difference value and the second time difference value of the first child node are The difference is Δ 11j , the difference between the first time difference value of the second child node and the second time difference value is Δ 22j , the first time difference value of the third child node The difference between the time difference and the second time difference is Δ 33j , and the difference between the first time difference and the second time difference of the fourth child node is Δ 44j , . . . .., the difference between the first time difference value and the second time difference value of the nth child node is Δ nn −δ j . In this embodiment of the present application, the first local time of the child node is adjusted according to the first time difference value and the second time difference value, so that the adjusted local time T n ′=T n −Δ n . Specifically, the first child node The adjusted local time T 1 '=T 11 , the adjusted local time of the second child node T 2 '=T 22 , the adjusted local time of the third child node T 3 '= T 3 −Δ 3 , the adjusted local time of the third child node T 4 ′=T 4 −Δ 4 , . . . , the adjusted local time of the nth child node Tn′=T n −Δ n .
其中,T 1’=T 11=T 1-(δ 1j)=T 1-[(T 1-T 0)-(T j-T 0)]=T jWherein, T 1 '=T 11 =T 1 -(δ 1j )=T 1 -[(T 1 -T 0 )-(T j -T 0 )]=T j ;
T 2’=T 22=T 2-(δ 2j)=T 2-[(T 2-T 0)-(T j-T 0)]=T jT 2 '=T 22 =T 2 -(δ 2j )=T 2 -[(T 2 -T 0 )-(T j -T 0 )]=T j ;
T 3’=T 33=T 3-(δ 3j)=T 3-[(T 3-T 0)-(T j-T 0)]=T jT 3 ′=T 33 =T 3 -(δ 3j )=T 3 -[(T 3 -T 0 )-(T j -T 0 )]=T j ;
T 4’=T 44=T 4-(δ 4j)=T 4-[(T 4-T 0)-(T j-T 0)]=T jT 4 ′=T 44 =T 4 -(δ 4j )=T 4 -[(T 4 -T 0 )-(T j -T 0 )]=T j ;
............
Tn’=T nn=T n-(δ nj)=T n-[(T n-T 0)-(T j-T 0)]=T jTn'=Tn- Δn = Tn- ( δn - δj)=Tn - [(Tn - T0 )-(Tj- T0 )] = Tj .
即,本申请实施例可以通过上述方法使得各个子节点的本地时间与基准节点的基准时间同步。That is, in this embodiment of the present application, the local time of each child node can be synchronized with the reference time of the reference node through the above method.
本申请实施例的通过依据时间同步指示、时间同步周期、时间同步域和功能角色,确定第一时间同步信号和第二时间同步信号为同步信号,通过确定子节点接收的信号是否可以用于时间同步,避免或减少错误的出现,本申请实施例通过接收两次广播的时间同步信号,实现多个子节点的时间同步,降低报文次数减少能量消耗,可以适用于低功耗的无线传感器;本申请实施例的时间同步方法通过单向广播的方式接收时 间同步信号,并不依赖上行、下行链路延迟的一致性,消除了发送时间和访问时间引入的时间同步误差,能够更好的应对复杂的无线环境,提升时间同步的精度。In this embodiment of the present application, the first time synchronization signal and the second time synchronization signal are determined as synchronization signals according to the time synchronization instruction, the time synchronization period, the time synchronization domain, and the functional role, and whether the signal received by the child node can be used for time is determined. Synchronization, avoiding or reducing the occurrence of errors, the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of messages and reduces energy consumption, and can be applied to low-power wireless sensors; The time synchronization method of the application embodiment receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the transmission time and the access time, and can better cope with complex wireless environment, improve the accuracy of time synchronization.
如图7所示,本申请第六实施例提供一种基于传感器时间同步系统的时间同步方法,包括:As shown in FIG. 7 , the sixth embodiment of the present application provides a time synchronization method based on a sensor time synchronization system, including:
步骤610:基准节点接收广播节点发送的第一时间同步信号。Step 610: The reference node receives the first time synchronization signal sent by the broadcast node.
本申请实施例中,广播节点向基准节点和子节点同时发送第一时间同步信号,使得基准节点可接收到广播节点发送的第一时间同步信号,第一时间同步信号用于时间同步。In the embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node and the child nodes simultaneously, so that the reference node can receive the first time synchronization signal sent by the broadcast node, and the first time synchronization signal is used for time synchronization.
步骤620:基准节点发送第二时间同步信号至子节点,以使得子节点依据第一时间同步信号和第二时间同步信号调整子节点的本地时间,使得子节点的本地时间与基准时间相同,其中,子节点接收有广播节点发送的第一时间同步信号。Step 620: The reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is the same as the reference time, wherein , the child node receives the first time synchronization signal sent by the broadcast node.
本申请实施例中,基准节点在接收到第一时间同步信号后,发送第二时间同步信号至子节点,其中第二时间同步信号中包含有基准节点的第二本地时间的运算关系。In the embodiment of the present application, after receiving the first time synchronization signal, the reference node sends a second time synchronization signal to the child node, wherein the second time synchronization signal includes the operation relationship of the second local time of the reference node.
子节点接收到基准节点发出的第二时间同步信号和广播节点发送的第一时间同步信号后,以计算并调整子节点的本地时间,使得子节点的本地时间与基准节点的基准时间相同,使得多个子节点之间的本地时间相同,实现子节点的传感器时间同步的效果。After the child node receives the second time synchronization signal sent by the reference node and the first time synchronization signal sent by the broadcast node, it calculates and adjusts the local time of the child node, so that the local time of the child node is the same as the reference time of the reference node, so that The local time between multiple child nodes is the same, and the effect of the sensor time synchronization of the child nodes is realized.
本申请实施例的基于传感器时间同步系统的时间同步方法,通过接收两次广播的时间同步信号,实现多个子节点的时间同步,降低报文次数减少能量消耗,可以适用于低功耗的无线传感器;本申请实施例的时间同步方法通过单向广播的方式接收时间同步信号,并不依赖上行、下行链路延迟的一致性,消除了发送时间和访问时间引入的时间同步误差,能够更好的应对复杂的无线环境,提升时间同步的精度。The time synchronization method based on the sensor time synchronization system according to the embodiment of the present application realizes the time synchronization of multiple sub-nodes by receiving two broadcast time synchronization signals, reduces the number of packets and reduces energy consumption, and can be applied to low-power wireless sensors The time synchronization method of the embodiment of the present application receives the time synchronization signal by means of unidirectional broadcasting, does not depend on the consistency of uplink and downlink delays, eliminates the time synchronization error introduced by the sending time and the access time, and can better To cope with complex wireless environments, improve the accuracy of time synchronization.
如图8所示,在本申请第七实施例中,基于传感器时间同步系统的时间同步方法,本申请实施例中,第一时间同步信号包括第一参考时间,方法包括:As shown in FIG. 8 , in the seventh embodiment of the present application, based on the time synchronization method of the sensor time synchronization system, in the embodiment of the present application, the first time synchronization signal includes the first reference time, and the method includes:
步骤710:基准节点接收广播节点发送的第一时间同步信号,记录接收到第一时间同步信号的第二本地时间,依据第二本地时间与第一参考时间计算第一时间差值。Step 710: The reference node receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the first time difference according to the second local time and the first reference time.
本申请实施例中,广播节点向基准节点发送第一时间同步信号,使得基准节点接收到广播节点发送的第一时间同步信号,第一时间同步信号包括第一参考时间T 0,基准节点在接收到第一时间同步信号时,记录接收到第一时间同步信号时的第二本地时间T j,基准节点依据第二本地时间T j和第一参考时间T 0,计算出第一时间差值δ j,第一时间差值为第二本地时间与第一参考时间的差值,即δ j=T j-T 0In the embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node, so that the reference node receives the first time synchronization signal sent by the broadcast node. The first time synchronization signal includes the first reference time T 0 , and the reference node receives the first time synchronization signal. When the first time synchronization signal is reached, record the second local time T j when the first time synchronization signal is received, and the reference node calculates the first time difference δ according to the second local time T j and the first reference time T 0 j , the first time difference is the difference between the second local time and the first reference time, that is, δ j =T j −T 0 .
步骤720:基准节点发送第二时间同步信号至子节点,并记录接收第一时间同步信号的第一本地时间,使得子节点依据第一本地时间和第一时间差值调整子节点的第一本地时间,使得多个子节点的本地时间相同;其中,子节点接收有广播节点发送的第一时间同步信号。Step 720: The reference node sends the second time synchronization signal to the child node, and records the first local time of receiving the first time synchronization signal, so that the child node adjusts the first local time of the child node according to the first local time and the first time difference. time, so that the local times of multiple child nodes are the same; wherein, the child nodes receive the first time synchronization signal sent by the broadcast node.
本申请实施例中,广播节点向基准节点发送第一时间同步信号的同时,也向子节点发送第一时间同步信号,第一时间同步信号包括第一参考时间T0,使得子节点接收广播节点发送的第一时间同步信号,并记录接收到第一时间同步信号的第一本地时间,例如,子节点有n个,其中n为大于等于2的正整数,分别为第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点,各个子节点接收到第一时间同步信号的第一本地时间分别为T 1、T 2、T 3、T 4、......、T nIn this embodiment of the present application, the broadcast node sends the first time synchronization signal to the reference node, and also sends the first time synchronization signal to the child node. The first time synchronization signal includes the first reference time T0, so that the child node receives the transmission from the broadcast node. and record the first local time when the first time synchronization signal is received. For example, there are n child nodes, where n is a positive integer greater than or equal to 2, which are the first child node and the second child node respectively. node, the third child node, the fourth child node, ..., the nth child node, the first local time at which each child node receives the first time synchronization signal is T 1 , T 2 , T 3 , T 4 , ..., T n .
本申请实施例中,基准节点在接收到第一时间同步信号后,发送第二时间同步信号至子节点。第二时间同步信号包括第一时间差值δ jIn this embodiment of the present application, after receiving the first time synchronization signal, the reference node sends the second time synchronization signal to the child node. The second time synchronization signal includes the first time difference value δ j .
本申请实施例中,子节点依据第一本地时间与第一参考时间,计算第二时间差值;具体地的,第二时间差值δn为第一本地时间与第一参考时间的差值,即子节点的第二时间差值δn=T n-T 0;具体地,第一子节点、第二子节点、第三子节点、第四子节点、......、第n子节点的第二时间差值δ 1=T 1-T 0、δ 2=T 2-T 0、δ 3=T 3-T 0、δ 4=T 3-T 0、......、δ n=T n-T 0;本申请实施例中,使得子节点依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得多个子节点的本地时间同步,且与基准节点的基 准时间同步;具体地,本申请实施例中,第一子节点的第一时间差值和第二时间差值之差为Δ 1=δ 1j,第二子节点的第一时间差值和第二时间差值之差为Δ 2=δ 2j,第三子节点的第一时间差值和第二时间差值之差为Δ 3=δ 3j,第四子节点的第一时间差值和第二时间差值之差为Δ 4=δ 4j,......,第n子节点的第一时间差值和第二时间差值之差为Δ n=δ nj。本申请实施例中,依据第一时间差值和第二时间差值调整子节点的第一本地时间,使得调节后的子节点的本地时间T n’=T nn,具体地,第一子节点的调节后的第一本地时间T 1’=T 11,第二子节点的调节后的第一本地时间T 2’=T 22,第三子节点的调节后的第一本地时间T 3’=T 33,第三子节点的调节后的第一本地时间T 4’=T 44,......,第n子节点的调节后的第一本地时间Tn’=T nnIn this embodiment of the present application, the child node calculates the second time difference according to the first local time and the first reference time; specifically, the second time difference δn is the difference between the first local time and the first reference time, That is, the second time difference value of the child node δn=T n -T 0 ; specifically, the first child node, the second child node, the third child node, the fourth child node, ..., the nth child The second time difference values of the nodes δ 1 =T 1 -T 0 , δ 2 =T 2 -T 0 , δ 3 =T 3 -T 0 , δ 4 =T 3 -T 0 ,..., δ n =T n -T 0 ; in this embodiment of the present application, the child node is made to adjust the first local time of the child node according to the first time difference value and the second time difference value, so that the local times of the multiple child nodes are synchronized and are The reference time of the reference node is synchronized; specifically, in this embodiment of the present application, the difference between the first time difference value and the second time difference value of the first child node is Δ 11j , and the first time difference value of the second child node is Δ 1 =δ 1 -δ j , The difference between the first time difference value and the second time difference value is Δ 22j , the difference between the first time difference value and the second time difference value of the third child node is Δ 33j , The difference between the first time difference value and the second time difference value of the fourth child node is Δ 44j , ......, the first time difference value and the second time difference value of the nth child node The difference in values is Δn = δn - δj. In the embodiment of the present application, the first local time of the child node is adjusted according to the first time difference value and the second time difference value, so that the adjusted local time of the child node T n ′=T n −Δ n , specifically, the first local time of the child node is adjusted. The adjusted first local time T 1 '=T 11 of a child node, the adjusted first local time T 2 '=T 22 of the second child node, the adjusted first local time of the third child node The first local time T 3 ′= T 3 3 of After the first local time Tn'=Tn - Δn .
其中,T 1’=T 11=T 1-(δ 1j)=T 1-[(T 1-T 0)-(T j-T 0)]=T jWherein, T 1 '=T 11 =T 1 -(δ 1j )=T 1 -[(T 1 -T 0 )-(T j -T 0 )]=T j ;
T 2’=T 22=T 2-(δ 2j)=T 2-[(T 2-T 0)-(T j-T 0)]=T jT 2 '=T 22 =T 2 -(δ 2j )=T 2 -[(T 2 -T 0 )-(T j -T 0 )]=T j ;
T 3’=T 33=T 3-(δ 3j)=T 3-[(T 3-T 0)-(T j-T 0)]=T jT 3 ′=T 33 =T 3 -(δ 3j )=T 3 -[(T 3 -T 0 )-(T j -T 0 )]=T j ;
T 4’=T 44=T 4-(δ 4j)=T 4-[(T 4-T 0)-(T j-T 0)]=T jT 4 ′=T 44 =T 4 -(δ 4j )=T 4 -[(T 4 -T 0 )-(T j -T 0 )]=T j ;
............
Tn’=T nn=T n-(δ nj)=T n-[(T n-T 0)-(T j-T 0)]=T jTn'=Tn- Δn = Tn- ( δn - δj)=Tn - [(Tn - T0 )-(Tj- T0 )] = Tj .
即,本申请实施例可以通过上述方法使得各个子节点的本地时间与基准节点的基准时间同步。That is, in this embodiment of the present application, the local time of each child node can be synchronized with the reference time of the reference node through the above method.
在本申请第八实施例中,如图9所示,基于传感器时间同步系统的时间同步方法,第一时间同步信号和第二时间同步信号均进一步包括时间同步周期,In the eighth embodiment of the present application, as shown in FIG. 9 , based on the time synchronization method of the sensor time synchronization system, both the first time synchronization signal and the second time synchronization signal further include a time synchronization period,
步骤810:基准节点定时接收广播节点发送的第一时间同步信号,记录接收到第一时间同步信号的第二本地时间,依据第二本地时间与第一参考时间计算第一时间差值。Step 810: The reference node regularly receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the first time difference according to the second local time and the first reference time.
在其他实施例中,基准节点定时接收广播节点发送的第一时间同步信号,以使得子节点可以定时进行时间同步,使得基准节点可以定时接收广播节点发送的第一时间同步信号。本申请实施例中,第一时间同步信号中包含了时间同步周期,可以确定第一时间同步信号属于哪个基本 周期,避免运算时选择第一时间同步信号出现错误。In other embodiments, the reference node regularly receives the first time synchronization signal sent by the broadcast node, so that the child nodes can perform time synchronization regularly, so that the reference node can regularly receive the first time synchronization signal sent by the broadcast node. In the embodiment of the present application, the first time synchronization signal includes a time synchronization period, which can determine which basic period the first time synchronization signal belongs to, so as to avoid errors in selecting the first time synchronization signal during operation.
本申请实施例在,基准节点接收到第一时间同步信号时,记录接收到第一时间同步信号的第二本地时间,通过将第二本地时间与第一参考时间做差,获得第一时间差值,以便于基准节点发送第二时间同步信号时包含第一时间差值。In this embodiment of the present application, when the reference node receives the first time synchronization signal, the reference node records the second local time when the first time synchronization signal is received, and obtains the first time difference by making a difference between the second local time and the first reference time value, so that the reference node includes the first time difference value when sending the second time synchronization signal.
步骤820:基准节点发送第二时间同步信号至子节点,并记录接收第一时间同步信号的第一本地时间,使得子节点依据时间同步周期,确定第一时间同步信号和第二时间同步信号属于同一周期,子节点依据第一本地时间和第一时间差值调整子节点的第一本地时间,使得多个子节点的本地时间相同。Step 820: The reference node sends the second time synchronization signal to the child node, and records the first local time when the first time synchronization signal is received, so that the child node determines that the first time synchronization signal and the second time synchronization signal belong to each other according to the time synchronization period. In the same period, the child node adjusts the first local time of the child node according to the first local time and the first time difference, so that the local times of the multiple child nodes are the same.
本申请一实施例中,一种基于传感器时间同步系统的时间同步方法,包括:广播节点发送的第一时间同步信号至基准节点和子节点,以使得基准节点在接收到第一时间同步信号时发送第二时间同步信号至子节点,进一步使得子节点依据第一时间同步信号和第二时间同步信号调整本地时间,使得子节点的本地时间与基准时间同步。In an embodiment of the present application, a time synchronization method based on a sensor time synchronization system includes: broadcasting a first time synchronization signal sent by a node to a reference node and child nodes, so that the reference node sends the first time synchronization signal when receiving the first time synchronization signal The second time synchronization signal is sent to the child node, further enabling the child node to adjust the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
本申请一实施例中,一种基于传感器时间同步系统的时间同步方法,包括:广播节点发送的第一时间同步信号至基准节点和子节点,以使得基准节点用于在接收到第一时间同步信号时,记录接收到第一时间同步信号的第一本地时间,依据第二本地时间与第一参考时间计算第一时间差值,发送第二时间同步信号至子节点,进一步使得子节点依据第一时间差值调整第一本地时间,使得子节点的第一本地时间与基准时间同步,其中第一时间同步信号包括第一参考时间,第二时间同步信号包括第一时间差值。In an embodiment of the present application, a time synchronization method based on a sensor time synchronization system includes: broadcasting a first time synchronization signal sent by a node to a reference node and child nodes, so that the reference node is used for receiving the first time synchronization signal when the first time synchronization signal is received, record the first local time when the first time synchronization signal is received, calculate the first time difference according to the second local time and the first reference time, send the second time synchronization signal to the child node, and further make the child node according to the first time synchronization signal. The time difference value adjusts the first local time so that the first local time of the child node is synchronized with the reference time, wherein the first time synchronization signal includes the first reference time, and the second time synchronization signal includes the first time difference value.
在其他实施例中,第一时间同步信号也可以是包括第一参考时间、时间同步周期、时间同步指示、时间同步域和功能角色。第二时间同步信号包括第一时间差值、时间同步周期、时间同步指示、时间同步域和功能角色。在另一实施例中,第一时间同步信号和第二时间同步信号还可以包括物理地址。In other embodiments, the first time synchronization signal may also include a first reference time, a time synchronization period, a time synchronization indication, a time synchronization domain, and a functional role. The second time synchronization signal includes a first time difference, a time synchronization period, a time synchronization indication, a time synchronization domain, and a functional role. In another embodiment, the first time synchronization signal and the second time synchronization signal may also include physical addresses.
本申请实施例还包括第二种技术方案,如图10所示,一种计算机 存储介质900,计算机存储介质900内部存储有计算机程序910,计算机程序用于被执行以实现上述的基于传感器时间同步系统的时间同步方法。The embodiment of the present application also includes a second technical solution, as shown in FIG. 10 , a computer storage medium 900, where a computer program 910 is stored inside the computer storage medium 900, and the computer program is used to be executed to realize the above-mentioned sensor-based time synchronization The system's time synchronization method.
基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序910来指令相关的硬件来完成,的计算机程序910可存储于一计算机可读存储介质中,该计算机程序910在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序910包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。Based on this understanding, the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through the computer program 910. The computer program 910 can be stored in a computer-readable storage medium, and the computer When the program 910 is executed by the processor, the steps of the foregoing method embodiments can be implemented. The computer program 910 includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer-readable media may be appropriately increased or decreased in accordance with the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include Electrical carrier signals and telecommunication signals.
本申请还包括第三种技术方案,如图11所示,一种计算机装置1000,包括至少一个处理单元1010和至少一个存储单元1020,存储单元1020存储有计算机程序,当程序被处理单元执行时,使得处理单元1010执行上述基于传感器时间同步系统的时间同步方法的步骤。The present application also includes a third technical solution. As shown in FIG. 11, a computer device 1000 includes at least one processing unit 1010 and at least one storage unit 1020. The storage unit 1020 stores a computer program, and when the program is executed by the processing unit , so that the processing unit 1010 executes the steps of the above-mentioned time synchronization method based on the sensor time synchronization system.
所称处理单元1010可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理单元1010可以是微处理器或者该处理单元1010也可以是任何常规的处理器等,处理单元1010是监护仪中参数信息项的显示名称设置的控制中心,利用各种接口和线路连接整个监护仪的各个设备部分。The so-called processing unit 1010 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general processing unit 1010 can be a microprocessor or the processing unit 1010 can also be any conventional processor, etc. The processing unit 1010 is the control center for setting the display name of the parameter information item in the monitor, and uses various interfaces and lines to connect the whole system. The various equipment parts of the monitor.
存储单元1020可用于存储计算机程序和/或模块,处理单元1010通 过运行或执行存储在存储单元1020内的计算机程序和/或模块,以及调用存储在存储单元1020内的数据,实现监护仪中参数信息项的显示名称设置。存储单元1020可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据手机的使用所创建的数据等。此外,存储单元1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The storage unit 1020 can be used to store computer programs and/or modules, and the processing unit 1010 realizes the parameters in the monitor by running or executing the computer programs and/or modules stored in the storage unit 1020 and calling the data stored in the storage unit 1020. Display name settings for information items. The storage unit 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone. In addition, the storage unit 1020 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) ) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
计算机装置1000还可以包括一个电源组件被配置为执行计算机设备的电源管理,一个有线或无线网络接口被配置为将设备连接到网络,和一个输入输出(I/O)接口。设备可以操作基于存储在存储器中的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。 Computer apparatus 1000 may also include a power supply assembly configured to perform power management of the computer device, a wired or wireless network interface configured to connect the device to a network, and an input output (I/O) interface. The device can operate based on an operating system stored in memory, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
在本申请所提供的几个实施方式中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus implementations described above are only illustrative, for example, the division of modules or units is only a logical function division, and other divisions may be used in actual implementation, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this implementation manner.
另外,在本申请各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可 以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of the various embodiments of the present application.
以上仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the embodiments of the present application, and are not intended to limit the scope of the patent of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields, All are similarly included in the scope of patent protection of the present invention.
工业实用性Industrial Applicability
本申请实施例提供的方案可应用于传感器通讯技术领域,在本申请实施例中,采用基于传感器时间同步系统的时间同步方法、介质及装置,取得了时间同步的功耗较低,可以提升时间同步精度的技术效果。The solutions provided by the embodiments of the present application can be applied to the technical field of sensor communication. In the embodiments of the present application, the time synchronization method, medium and device based on the sensor time synchronization system are adopted, so that the power consumption of the time synchronization is low, and the time can be improved. The technical effect of synchronization accuracy.

Claims (10)

  1. 一种基于传感器时间同步系统的时间同步方法,所述系统包括广播节点、基准节点和两个以上子节点,其中,所述基准节点用于为所述时间同步系统提供基准时间,所述子节点包括传感器,所述方法包括:A time synchronization method based on a sensor time synchronization system, the system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used to provide a reference time for the time synchronization system, the sub-nodes Including a sensor, the method includes:
    所述子节点接收所述广播节点发送的第一时间同步信号;receiving, by the child node, the first time synchronization signal sent by the broadcast node;
    所述子节点接收第二时间同步信号,其中,所述第二时间同步信号为所述基准节点在接收所述广播节点发送的第一时间同步信号之后发送的信号;the child node receives a second time synchronization signal, wherein the second time synchronization signal is a signal sent by the reference node after receiving the first time synchronization signal sent by the broadcast node;
    所述子节点依据所述第一时间同步信号和所述第二时间同步信号调整本地时间,使得所述子节点的本地时间与所述基准时间同步。The child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time.
  2. 根据权利要求1所述的基于传感器时间同步系统的时间同步方法,其中,所述第一时间同步信号包括第一参考时间,所述第二时间同步信号包括第一时间差值,The time synchronization method based on a sensor time synchronization system according to claim 1, wherein the first time synchronization signal includes a first reference time, and the second time synchronization signal includes a first time difference value,
    所述子节点接收所述广播节点发送的第一时间同步信号,包括:The child node receives the first time synchronization signal sent by the broadcast node, including:
    所述子节点接收所述广播节点发送的第一时间同步信号,并记录接收到所述第一时间同步信号的第一本地时间;The child node receives the first time synchronization signal sent by the broadcast node, and records the first local time when the first time synchronization signal is received;
    其中,所述第一时间差值为所述基准节点在接收到所述广播节点发送的第一时间同步信号时的第二本地时间与所述第一参考时间的差值;Wherein, the first time difference is the difference between the second local time and the first reference time when the reference node receives the first time synchronization signal sent by the broadcast node;
    所述子节点依据所述第一时间同步信号和所述第二时间同步信号调整本地时间,使得所述子节点的本地时间与所述基准时间同步,包括:The child node adjusts the local time according to the first time synchronization signal and the second time synchronization signal, so that the local time of the child node is synchronized with the reference time, including:
    所述子节点依据所述第一时间差值调整所述第一本地时间,使得所述子节点的本地时间与所述基准时间同步。The child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time.
  3. 根据权利要求2所述的基于传感器时间同步系统的时间同步方法,其中,所述子节点依据所述第一时间差值调整所述第一本地时间,使得所述子节点的本地时间与所述基准时间同步,包括:The time synchronization method based on a sensor time synchronization system according to claim 2, wherein the child node adjusts the first local time according to the first time difference, so that the local time of the child node is the same as the Base time synchronization, including:
    所述子节点依据所述第一本地时间与所述第一参考时间,计算第二时间差值;The child node calculates a second time difference according to the first local time and the first reference time;
    依据所述第一时间差值和所述第二时间差值调整子节点的本地时 间,使得所述子节点的本地时间与所述基准时间同步。The local time of the child node is adjusted according to the first time difference value and the second time difference value, so that the local time of the child node is synchronized with the reference time.
  4. 根据权利要求2或3所述的基于传感器时间同步系统的时间同步方法,其中,所述第一时间同步信号和所述第二时间同步信号均进一步包括时间同步周期,The time synchronization method based on a sensor time synchronization system according to claim 2 or 3, wherein both the first time synchronization signal and the second time synchronization signal further comprise a time synchronization period,
    所述子节点接收所述广播节点发送的第一时间同步信号,包括:The child node receives the first time synchronization signal sent by the broadcast node, including:
    所述子节点接收所述广播节点定时发送的第一时间同步信号;receiving, by the child node, a first time synchronization signal periodically sent by the broadcast node;
    所述子节点依据所述第一时间差值调整所述第一本地时间,使得所述子节点的本地时间与所述基准时间同步之前,包括:Before the child node adjusts the first local time according to the first time difference, so that the local time of the child node is synchronized with the reference time, the steps include:
    依据所述时间同步周期,确定所述第一时间同步信号和所述第二时间同步信号属于同一周期。According to the time synchronization period, it is determined that the first time synchronization signal and the second time synchronization signal belong to the same period.
  5. 根据权利要求4所述的基于传感器时间同步系统的时间同步方法,其中,The time synchronization method based on a sensor time synchronization system according to claim 4, wherein,
    所述第一时间同步信号和所述第二时间同步信号均进一步包括时间同步指示、时间同步域和功能角色;Both the first time synchronization signal and the second time synchronization signal further include a time synchronization indication, a time synchronization domain and a functional role;
    所述依据所述时间同步周期,确定所述第一时间同步信号和所述第二时间同步信号属于同一周期,包括:The determining, according to the time synchronization period, that the first time synchronization signal and the second time synchronization signal belong to the same period, including:
    依据所述时间同步指示、时间同步周期、时间同步域和功能角色,确定所述第一时间同步信号和所述第二时间同步信号为同步信号。According to the time synchronization indication, the time synchronization period, the time synchronization domain and the functional role, the first time synchronization signal and the second time synchronization signal are determined as synchronization signals.
  6. 一种基于传感器时间同步系统的时间同步方法,所述系统包括广播节点、基准节点和两个以上子节点,其中,所述基准节点用于为所述时间同步系统提供基准时间,所述子节点包括传感器,所述方法包括:A time synchronization method based on a sensor time synchronization system, the system includes a broadcast node, a reference node and two or more sub-nodes, wherein the reference node is used to provide a reference time for the time synchronization system, the sub-nodes Including a sensor, the method includes:
    所述基准节点接收所述广播节点发送的第一时间同步信号;receiving, by the reference node, a first time synchronization signal sent by the broadcast node;
    所述基准节点发送第二时间同步信号至所述子节点,以使得所述子节点依据所述第一时间同步信号和所述第二时间同步信号调整所述子节点的本地时间,使得所述子节点的本地时间与所述基准时间相同,其中,所述子节点接收有所述广播节点发送的所述第一时间同步信号。The reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the child node The local time of the child node is the same as the reference time, wherein the child node receives the first time synchronization signal sent by the broadcast node.
  7. 根据权利要求6所述的基于传感器时间同步系统的时间同步方法,其中,所述第一时间同步信号包括第一参考时间,The time synchronization method based on a sensor time synchronization system according to claim 6, wherein the first time synchronization signal comprises a first reference time,
    所述基准节点接收所述广播节点发送的第一时间同步信号,包括:The reference node receives the first time synchronization signal sent by the broadcast node, including:
    所述基准节点接收所述广播节点发送的第一时间同步信号,记录接收到所述第一时间同步信号的第二本地时间,依据所述第二本地时间与所述第一参考时间计算第一时间差值;The reference node receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the first time according to the second local time and the first reference time. time difference;
    所述基准节点发送第二时间同步信号至所述子节点,以使得所述子节点依据所述第一时间同步信号和所述第二时间同步信号调整所述子节点的本地时间,使得所述子节点的本地时间与所述基准时间相同,包括:The reference node sends a second time synchronization signal to the child node, so that the child node adjusts the local time of the child node according to the first time synchronization signal and the second time synchronization signal, so that the child node The local time of the child node is the same as the reference time, including:
    所述基准节点发送第二时间同步信号至所述子节点,所述第二时间同步信号包括所述第一时间差值,并记录接收所述第一时间同步信号的第一本地时间,使得所述子节点依据所述第一本地时间和所述第一时间差值调整所述子节点的第一本地时间,使得多个所述子节点的本地时间相同。The reference node sends a second time synchronization signal to the child node, the second time synchronization signal includes the first time difference value, and records the first local time when the first time synchronization signal is received, so that all The child node adjusts the first local time of the child node according to the first local time and the first time difference, so that the local times of a plurality of the child nodes are the same.
  8. 根据权利要求7所述的基于传感器时间同步系统的时间同步方法,其中,所述第一时间同步信号和所述第二时间同步信号均进一步包括时间同步周期,The time synchronization method based on a sensor time synchronization system according to claim 7, wherein both the first time synchronization signal and the second time synchronization signal further comprise a time synchronization period,
    所述基准节点接收所述广播节点发送的第一时间同步信号,包括:The reference node receives the first time synchronization signal sent by the broadcast node, including:
    所述基准节点定时接收所述广播节点发送的第一时间同步信号,记录接收到所述第一时间同步信号的第二本地时间,依据所述第二本地时间与所述第一参考时间计算所述第一时间差值;The reference node regularly receives the first time synchronization signal sent by the broadcast node, records the second local time when the first time synchronization signal is received, and calculates the time synchronization according to the second local time and the first reference time. the first time difference;
    所述基准节点发送第二时间同步信号至所述子节点,所述第二时间同步信号包括所述第一时间差值,并记录接收所述第一时间同步信号的第一本地时间,使得所述子节点依据所述第一本地时间和所述第一时间差值调整所述子节点的第一本地时间,使得多个所述子节点的本地时间相同,包括:The reference node sends a second time synchronization signal to the child node, the second time synchronization signal includes the first time difference value, and records the first local time when the first time synchronization signal is received, so that all The child node adjusts the first local time of the child node according to the first local time and the first time difference, so that the local times of a plurality of the child nodes are the same, including:
    所述基准节点发送第二时间同步信号至所述子节点,所述第二时间同步信号包括所述第一时间差值,并记录接收所述第一时间同步信号的第一本地时间,使得所述子节点依据所述时间同步周期,确定所述第一时间同步信号和所述第二时间同步信号属于同一周期,使得所述子节点依据所述第一本地时间和所述第一时间差值调整所述子节点的第一本 地时间,使得多个所述子节点的本地时间相同。The reference node sends a second time synchronization signal to the child node, the second time synchronization signal includes the first time difference, and records the first local time when the first time synchronization signal is received, so that all The child node determines, according to the time synchronization period, that the first time synchronization signal and the second time synchronization signal belong to the same period, so that the child node determines, according to the first local time and the first time difference, The first local time of the child nodes is adjusted so that the local times of the multiple child nodes are the same.
  9. 一种存储介质,所述存储介质内部存储有计算机程序,所述计算机程序用于被执行以实现权利要求1-8任一项所述的基于传感器时间同步系统的时间同步方法。A storage medium, wherein a computer program is stored in the storage medium, and the computer program is used to be executed to realize the time synchronization method based on the sensor time synchronization system of any one of claims 1-8.
  10. 一种计算机装置,包括至少一个处理单元和至少一个存储单元,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行权例要求1-8任一项所述的基于传感器时间同步系统的时间同步方法的步骤。A computer device, comprising at least one processing unit and at least one storage unit, the storage unit stores a computer program, when the program is executed by the processing unit, the processing unit is made to execute any one of claims 1-8. Steps of a time synchronization method based on a sensor time synchronization system.
PCT/CN2021/124749 2021-03-30 2021-10-19 Sensor time synchronization system-based time synchronization method, medium and apparatus WO2022205838A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110341766.6A CN113259037B (en) 2021-03-30 2021-03-30 Time synchronization method, medium, and apparatus based on sensor time synchronization system
CN202110341766.6 2021-03-30

Publications (1)

Publication Number Publication Date
WO2022205838A1 true WO2022205838A1 (en) 2022-10-06

Family

ID=77181455

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124749 WO2022205838A1 (en) 2021-03-30 2021-10-19 Sensor time synchronization system-based time synchronization method, medium and apparatus

Country Status (2)

Country Link
CN (1) CN113259037B (en)
WO (1) WO2022205838A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259037B (en) * 2021-03-30 2022-12-23 杭州涂鸦信息技术有限公司 Time synchronization method, medium, and apparatus based on sensor time synchronization system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101588628A (en) * 2009-06-19 2009-11-25 山东省计算中心 Clock synchronizing method for wireless sensor network
CN108259105A (en) * 2016-12-28 2018-07-06 中国移动通信有限公司研究院 A kind of time synchronizing method, apparatus and synchronizing network
CN111372307A (en) * 2018-12-25 2020-07-03 江苏中桥信息技术有限公司 Time synchronization data acquisition system based on wireless multi-hop network
EP3681171A1 (en) * 2019-01-10 2020-07-15 Fujitsu Limited Information processing apparatus, time synchronization method, and time synchronization program
CN113259037A (en) * 2021-03-30 2021-08-13 杭州涂鸦信息技术有限公司 Time synchronization method, medium, and apparatus based on sensor time synchronization system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008283242A (en) * 2007-05-08 2008-11-20 Nec Tokin Corp Measurement time synchronizing method of radio communication system
CN104968043B (en) * 2015-04-29 2018-04-27 重庆邮电大学 A kind of clock synchronizing frequency deviation estimating method suitable for WIA-PA network
WO2019098898A1 (en) * 2017-11-20 2019-05-23 Telefonaktiebolaget Lm Ericsson (Publ) Nodes and methods for determining and enabling a synchronized time reference in a wireless communications network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101588628A (en) * 2009-06-19 2009-11-25 山东省计算中心 Clock synchronizing method for wireless sensor network
CN108259105A (en) * 2016-12-28 2018-07-06 中国移动通信有限公司研究院 A kind of time synchronizing method, apparatus and synchronizing network
CN111372307A (en) * 2018-12-25 2020-07-03 江苏中桥信息技术有限公司 Time synchronization data acquisition system based on wireless multi-hop network
EP3681171A1 (en) * 2019-01-10 2020-07-15 Fujitsu Limited Information processing apparatus, time synchronization method, and time synchronization program
CN113259037A (en) * 2021-03-30 2021-08-13 杭州涂鸦信息技术有限公司 Time synchronization method, medium, and apparatus based on sensor time synchronization system

Also Published As

Publication number Publication date
CN113259037A (en) 2021-08-13
CN113259037B (en) 2022-12-23

Similar Documents

Publication Publication Date Title
Yoon et al. Tiny-sync: Tight time synchronization for wireless sensor networks
Sommer et al. Gradient clock synchronization in wireless sensor networks
CN109683130B (en) Positioning method, positioning device, storage medium and processor
US7447237B2 (en) Radio access network system, radio communication method, synchronous server and node
Sridhar et al. Cheepsync: a time synchronization service for resource constrained bluetooth le advertisers
EP3564921A1 (en) Sensing system and time synchronization method
US20150092640A1 (en) Wireless sensor time synchronization
JP5518191B2 (en) Method and system for optical transmission network carrying time synchronization protocol
CN112866098B (en) Gateway time service method, device, electronic equipment and computer readable medium
Elsts et al. Temperature-resilient time synchronization for the internet of things
Chen et al. An implementation of IEEE 1588 protocol for IEEE 802.11 WLAN
WO2022205838A1 (en) Sensor time synchronization system-based time synchronization method, medium and apparatus
CN113574813B (en) Network entity and method for a wireless network system for determining time information
WO2020063420A1 (en) Synchronization cycle determination method, device, and system
CN110719135A (en) Time calibration method and system and electronic device
CN110572230A (en) correction method and device for realizing time synchronization
CN101541073A (en) Method for compensating network node crystal oscillation frequency error of wireless sensor
Gong et al. On the accuracy of pairwise time synchronization
Hwang A network clock model for time awareness in the Internet of things and artificial intelligence applications
Upadhyay et al. Maximum probable clock offset estimation (MPCOE) to reduce time synchronization problems in wireless sensor networks
Zong et al. Simulation and evaluation of pulse-coupled oscillators in wireless sensor networks
CN114285514B (en) Clock synchronization method and device
Dalwadi et al. An insight into time synchronization algorithms in IoT
CN111726450B (en) Control method of intelligent express cabinet and intelligent express cabinet
CN107959968B (en) High-precision low-overhead wireless sensor network clock synchronization method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21934474

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21934474

Country of ref document: EP

Kind code of ref document: A1