CN114269012A - Time synchronization method, device and storage medium - Google Patents

Time synchronization method, device and storage medium Download PDF

Info

Publication number
CN114269012A
CN114269012A CN202111465385.5A CN202111465385A CN114269012A CN 114269012 A CN114269012 A CN 114269012A CN 202111465385 A CN202111465385 A CN 202111465385A CN 114269012 A CN114269012 A CN 114269012A
Authority
CN
China
Prior art keywords
time
wireless
wireless node
signal message
wireless signal
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111465385.5A
Other languages
Chinese (zh)
Inventor
俞光宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Easylinkin Technology Co ltd
Original Assignee
Wuhan Easylinkin Technology Co ltd
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 Wuhan Easylinkin Technology Co ltd filed Critical Wuhan Easylinkin Technology Co ltd
Priority to CN202111465385.5A priority Critical patent/CN114269012A/en
Publication of CN114269012A publication Critical patent/CN114269012A/en
Pending legal-status Critical Current

Links

Images

Abstract

An embodiment of the invention provides a time synchronization method, a time synchronization device and a storage medium, which are executed by a first wireless node, wherein the method comprises the following steps: setting a synchronization period; receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway; determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message; calibrating self time according to the receiving time; synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.

Description

Time synchronization method, device and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a time synchronization method, apparatus, and storage medium.
Background
Currently, the technology of internet of things is rapidly developed, and whether it is a wired network system or a wireless network system, it connects a plurality of subsystems or devices distributed at different locations together through network connection. Each subsystem or equipment not only needs to perform its own job and is independently responsible for respective work task, but also needs to be in close fit with each other by virtue of work division and cooperation; time synchronization is an important prerequisite for the cooperative work of many systems, especially in the field of communications.
The current time synchronization technology comprises two types of wired network synchronization and artificial time service synchronization; in the wire network synchronization, a standard clock reference source (such as an NTP wireless gateway) exists in a wire network synchronization system, and the reference source of the standard clock reference source is connected with a GPS through a standard clock signal of a Beidou satellite. The standard clock signal is synchronized with each subsystem and equipment in the system through cables or optical fibers, but because the transmission of the electric signal in the cables needs time, under the condition of extremely high requirement on time precision, the length of the cable from each subsystem to a standard time reference source in the system needs to be recorded, so that the time compensation correction is carried out;
in the artificial time service synchronization method, an operator uses a standard clock reference to carry out point-to-point time service on each independent system and equipment; the method is commonly used in a decentralized system, i.e., the system has low coupling of components, high communication difficulty, or higher cost limit. In such a system, since each sub-system or device (e.g., watch, desk clock, etc.) has its own timing accuracy difference (e.g., crystal oscillator accuracy, temperature drift, aging, etc.), the accuracy error will become larger and larger as time goes on.
Disclosure of Invention
The embodiment of the invention provides a time synchronization method, a time synchronization device and a storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
an embodiment of the present invention provides a time synchronization method, which is performed by a first wireless node, and includes:
setting a synchronization period;
receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message;
calibrating self time according to the receiving time;
synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
In the foregoing solution, the determining the receiving time of the wireless signal packet based on the system time of the wireless gateway in the wireless signal packet includes:
determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node;
and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
In the foregoing solution, the synchronizing the calibrated self time to the second wireless node includes:
determining a device address of at least one second wireless node;
and sending the self time to the second wireless node according to the equipment address of the second wireless node.
The embodiment of the invention provides another time synchronization method, which is executed by a wireless gateway and comprises the following steps:
setting an update time interval;
updating the system time according to the updating time interval;
generating a wireless signal message according to the system time;
broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
In the foregoing solution, the updating the system time according to the update time interval includes:
receiving a GPS signal sent by a GPS system according to the updating time interval;
according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal;
and updating the system time of the wireless gateway according to the standard time.
In the foregoing solution, the broadcasting the wireless signal packet includes:
setting a first preset time;
broadcasting the wireless signal message according to first preset time;
the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
An embodiment of the present invention further provides a time synchronization apparatus, where the apparatus is executed by a first wireless node, and the apparatus includes: the device comprises a first setting device, a receiving device, a determining device, a calibrating device and a synchronizing device;
the first setting device is used for setting a synchronization period;
the receiving device is used for receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
the determining device is configured to determine a receiving time of the wireless signal packet based on the system time of the wireless gateway in the wireless signal packet;
the calibration device is used for calibrating self time according to the receiving time;
the synchronization device is used for synchronizing the self time after calibration to the second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
In the foregoing solution, the determining apparatus is specifically configured to:
determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node;
and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
In the foregoing solution, the synchronization apparatus is specifically configured to:
determining a device address of at least one second wireless node;
and sending the self time to the second wireless node according to the equipment address of the second wireless node.
An embodiment of the present invention further provides another time synchronization apparatus, where the apparatus is executed by a wireless gateway, and the apparatus includes: second setting means, updating means, generating means, and broadcasting means;
the second setting device is used for setting an updating time interval;
the updating device is used for updating the system time according to the updating time interval;
the generating device is used for generating a wireless signal message according to the system time;
the broadcasting device is used for broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
In the foregoing solution, the updating apparatus is specifically further configured to:
receiving a GPS signal sent by a GPS system according to the updating time interval;
according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal;
and updating the system time of the wireless gateway according to the standard time.
In the foregoing solution, the broadcasting apparatus is specifically configured to:
setting a first preset time;
broadcasting the wireless signal message according to first preset time;
the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
An embodiment of the present invention further provides a time synchronization apparatus, where the apparatus includes: a processor and a memory for storing a computer program capable of running on the processor;
wherein the processor is configured to execute the steps of any one of the time synchronization methods when running the computer program.
The embodiment of the invention also provides a computer storage medium, which is characterized in that the computer storage medium stores computer executable instructions; the computer-executable instructions, when executed by a processor, enable the steps of a time synchronization method as described above.
In the embodiment, the first wireless node receives a wireless signal message which is broadcasted by a wireless gateway and contains wireless gateway system time according to a set synchronization period, calibrates the self-time after determining the receiving time of the wireless signal message based on the wireless gateway system time, and transmits time information through wireless signal transmission, so that the coverage distance is long, optical fibers or cables do not need to be laid, and the construction cost and the construction difficulty are reduced; the calibrated self time is synchronized to a second wireless node which is positioned in the same time synchronization system with the first wireless node, so that real-time synchronization among all wireless nodes in the time synchronization system is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic flow chart of a time synchronization method according to the present invention;
fig. 2 is a schematic diagram illustrating a calculation method for determining, by a first wireless node, a receiving time for receiving a wireless signal packet according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of another time synchronization method provided in the present invention;
fig. 4 is a schematic system structure diagram of a time synchronization method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a wireless gateway according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a component module of a wireless gateway in an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a time synchronization apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another time synchronization apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another time synchronization apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an application of an urban rail transit transportation automation system according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an application of the school time synchronization system according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an application of the bank time synchronization system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions in communication related to the embodiments of the present invention are described.
An embodiment of the present invention provides a time synchronization method, which is performed by a first wireless node. As shown in fig. 1, the method includes:
step S101: setting a synchronization period;
step S102: receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
step S103: determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message;
step S104: calibrating self time according to the receiving time;
step S105: synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
In the above step S101, the synchronization period may be a fixed duration period, or a duration period dynamically adjusted by the user, in short, a predetermined duration period.
Specifically, in step S102, the first wireless node includes two operation modes: the power supply state is in a power supply state and the power supply state is not in a power supply state;
in one embodiment, when the first wireless node is connected with a power supply for supplying power, the first wireless node is in a working state for a long time without considering the problem of power consumption; the first wireless node can receive the wireless signal message broadcasted by the wireless gateway according to the set synchronous period, and can also be in a receiving state all the time, so as to ensure that the wireless signal message broadcasted by the wireless gateway can be received in time.
In another embodiment, when the first wireless node is not connected to a power supply, i.e. in a state without power supply, the power consumption problem in a long-term working state cannot be ignored. At this time, the first wireless node may receive a wireless signal message broadcast by the wireless gateway according to the set synchronization period; after time synchronization is finished, a timing task is set, and a task of receiving a wireless signal message broadcast by a wireless gateway is awakened before the next time synchronization task is carried out; therefore, the power consumption of the wireless node can be reduced, and the working time of the first wireless node in the state without power supply is prolonged.
Here, in order to ensure that the wireless signal message broadcasted by the wireless gateway and including the system time of the wireless gateway is not missed, the setting of the timing duration of the timing task takes into account the duration of a task for waking up to receive the wireless signal message broadcasted by the wireless gateway, and is always smaller than the duration of the synchronization period; therefore, the power consumption of the wireless node is reduced, a sufficient time window is reserved for awakening a task of receiving the wireless signal message broadcast by the wireless gateway, and the accuracy and timeliness of the time synchronization of the wireless node are guaranteed.
In step S105, the second wireless node may be a device in the same local area network as the first wireless node, or may be a device using the same server as the first wireless node.
It should be noted that, the first wireless node receives a wireless signal message which is broadcasted by the wireless gateway and contains wireless gateway system time according to the set synchronization period, and corrects the self time after determining the receiving time of the wireless signal message based on the wireless gateway system time, and transmits time information through wireless signal transmission, so that the coverage distance is long, optical fibers or cables do not need to be laid, and the construction cost and the construction difficulty are reduced; the calibrated self time is synchronized to a second wireless node which is positioned in the same time synchronization system with the first wireless node, so that real-time synchronization among all wireless nodes in the time synchronization system is realized.
Further, the determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message includes: determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node; and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
Specifically, the receiving time of the wireless signal packet is marked as T, and the system time of the wireless gateway is marked as T1The transmission time stamp is Δ T.
Specifically, the sending of the wireless signal packet to the first wireless node by the wireless gateway, where a transmission time Δ T of the wireless signal packet in the air is related to a physical parameter of wireless transmission, includes: bandwidth, modulation mode, spreading factor, data message length, coding efficiency and the like; after determining the system time of the wireless gateway, the wireless gateway combines the system time information of the wireless gateway into a wireless signal message and sends the wireless signal message to the first wireless node. Here, the system time T of the wireless gateway1Namely the time of broadcasting the wireless signal message by the wireless gateway; the receiving time T for receiving the wireless signal message is equal to: system time T of the wireless gateway1And the sum of the transmission time at, as shown in fig. 2.
The first wireless node takes the determined receiving time of the received wireless signal message as a basis for calibrating the self time, corrects the receiving time according to the transmission time of the wireless signal message from the wireless gateway to the first wireless node and the received system time of the wireless gateway, and ensures the time precision of the time synchronization system.
Further, the synchronizing the calibrated self time to the second wireless node includes: determining a device address of at least one second wireless node; and sending the self time to the second wireless node according to the equipment address of the second wireless node.
Specifically, the device address of the second wireless node may be an IP address of the second wireless node device, a MAC address or a device serial number of the second wireless node device, or a same number or an identification code assigned by the time synchronization system to the second wireless node device, which is not specifically limited herein.
Specifically, after the first wireless node calibrates its own time system, it acquires an equipment address of at least one second wireless node from a time synchronization system; sending the self-time after calibration to the second wireless node so that the second wireless node can update the time; here, the second wireless node may be added to the time synchronization system according to requirements and application scenarios, and compared with wired network synchronization, the time synchronization method in this embodiment is better in scalability, and may add a new wireless node at any time for time synchronization, and the network has scalability.
It should be noted that, the first wireless node receives a wireless signal message which is broadcasted by the wireless gateway and contains wireless gateway system time according to the set synchronization period, and corrects the self time after determining the receiving time of the wireless signal message based on the wireless gateway system time, and transmits time information through wireless signal transmission, so that the coverage distance is long, optical fibers or cables do not need to be laid, and the construction cost and the construction difficulty are reduced; the calibrated self time is synchronized to a second wireless node which is positioned in the same time synchronization system with the first wireless node, so that real-time synchronization among all wireless nodes in the time synchronization system is realized.
The embodiment of the invention provides another time synchronization method which is executed by a wireless gateway. FIG. 3 is a flow chart of another method of time synchronization provided by the present invention; as shown in fig. 3, the method includes:
step S301: setting an update time interval;
step S302: updating the system time according to the updating time interval;
step S303: generating a wireless signal message according to the system time;
step S304: broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
Specifically, in step S301, the update time interval is a time interval when the wireless gateway starts to receive a GPS signal task sent by a GPS system; here, the update time interval may be a default time interval value of the wireless gateway, or may be a time interval value customized according to a usage scenario.
Further, in step S302, the updating the system time according to the update time interval includes: receiving a GPS signal sent by a GPS system according to the updating time interval; according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal; and updating the system time of the wireless gateway according to the standard time.
Specifically, a satellite in the GPS system sends a clock reference signal to the outside at regular intervals, where the clock reference signal at least includes the accurate time of the clock reference signal sending time node, that is, the standard time.
Specifically, in this embodiment, according to a set update time interval, the wireless gateway starts a task of receiving a GPS signal sent by a GPS system every other update time interval, and receives the GPS signal; and updating the system time of the user based on the standard time of the GPS system sending the GPS signal time contained in the received GPS signal.
In other embodiments, the wireless gateway may obtain network time from a server via the network communication interface when the GPS system fails to transmit, the network time being less accurate than standard time in GPS signals, but providing emergency, low time accuracy time synchronization in scenarios without satellite coverage.
It should be noted that, after updating the system time of the wireless gateway according to the standard time in the received GPS signal, the wireless gateway broadcasts the system time to the first wireless node in a wireless signal message manner, so that the first wireless node calibrates the time of the first wireless node and synchronizes the time of the first wireless node to the second wireless node, and thus, transmission of time information is performed through wireless signal transmission, which not only covers a long distance, but also does not require laying of optical fibers or cables, thereby reducing the construction cost and the construction difficulty; meanwhile, real-time synchronization among all wireless nodes in the time synchronization system is realized, and compared with a point-to-point time synchronization method in manual time service, the time synchronization method ensures the time precision of the time synchronization system and realizes unattended operation and automation of time synchronization.
Further, the broadcasting the wireless signal packet includes: setting a first preset time; broadcasting the wireless signal message according to first preset time; the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
Specifically, the duration of the first preset time may be a system default duration of the wireless gateway, such as 0 second, or may be a duration dynamically adjusted by the user according to a usage scenario; here, it is not particularly limited.
Specifically, in this embodiment, the first preset time is 0 second, and the wireless gateway generates a wireless signal packet according to the system time, that is, broadcasts the wireless signal packet, so that the first wireless node calibrates its own time and then synchronizes to the second wireless node.
Fig. 4 is a schematic system structure diagram of a time synchronization method according to an embodiment of the present invention; as shown in fig. 4, the time synchronization system according to the embodiment of the present invention includes: the system comprises a server, a wireless gateway, a wireless node and a GPS system;
the server generally operates a network protocol stack, is used for coordinating the high-efficient stable operation of all subsystems and equipment in the time synchronization system, is the central brain of the reliable stable operation of the whole wireless network time synchronization system, and comprises: controlling the wireless gateway to communicate with the satellite system; controlling a wireless gateway to transmit and receive data; coordinating network loads between different wireless gateways; and dynamically controlling communication frequency, rate, etc. between the wireless nodes and the wireless gateway in the network, making tradeoffs between power consumption and rate, automatic rate adjustment, etc.
The wireless gateway is mainly used for executing the instructions issued by the server, and receiving and transmitting data and instructions; another important role is: the method comprises the steps of receiving a standard clock signal sent by a GPS system at fixed time, namely the standard time of the GPS system at the moment of sending the GPS signal; calibrating the system time of the user according to the standard time; in the network communication process, the calibrated time is sent to the wireless node through a wireless signal message; fig. 5 is a schematic structural diagram of a wireless gateway according to an embodiment of the present invention; as shown in fig. 5, the wireless gateway includes: the embedded control system comprises an embedded control mainboard, a clock synchronization module, a wireless radio frequency module and a power supply module;
the embedded control mainboard generally runs a linux operating system and is a core control unit of the whole wireless gateway device. The network communication module is responsible for controlling the network communication module to carry out network communication with the server and executing the transceiving work of data and commands; in addition, the clock synchronization chip is controlled to perform time synchronization with the GPS system at regular time; controlling the wireless radio frequency module to perform data and command receiving and sending actions, and coordinating the cooperative operation of each task in the whole time synchronization system;
the clock synchronization module generally comprises a GPS antenna, a GPS module and the like, and is used for receiving a GPS signal which is sent by a GPS system and contains standard time, correcting the system time through digital signal processing and calculation, and updating the system time;
the wireless radio frequency module is mainly used for receiving and transmitting data and commands in a network system, receiving data messages from wireless nodes, transmitting the data messages from a server, converting the network messages into wireless messages, and transmitting the wireless messages according to set parameters such as frequency points, bandwidth and modulation, wherein the wireless radio frequency module also comprises the receiving and transmitting of signals and commands related to time synchronization;
the power supply module is used for providing power supply for each system in the whole wireless gateway equipment;
the network communication module, generally 4G, WiFi or an ethernet interface, is mainly used for communicating with the server in an IP protocol.
The wireless node mainly receives data and instructions sent by the server and uploads the data state of the subsystem and the communication mechanism of the equipment. In the system, the wireless node can be a wireless module or a wireless terminal; the main functions of the first wireless node include, besides receiving and sending data and executing actions, acquiring the calibrated system time of the wireless gateway from a wireless signal message sent by the wireless gateway to recover the time information, calibrate and update the time of the first wireless node, and applying the calibrated time to a second wireless node in a time synchronization system where the first wireless node is located.
Fig. 6 is a schematic structural diagram of a component module of a wireless gateway in an embodiment of the present invention; as shown in fig. 6, the core module of the wireless node includes a wireless radio frequency module, a power module, a microprocessor control board, a power interface and a communication interface;
the microprocessor control board is a core control unit of the whole wireless node, is mainly used for scheduling all modules in the wireless node to cooperatively work, and comprises data receiving and transmitting of a wireless radio frequency module, data receiving and transmitting and action execution of a communication interface, network protocol package and time sequence control, so that a protocol stack at a node side is realized, and also comprises tasks related to time synchronization, receiving and processing signals and instructions related to time synchronization, calculating the transmission time of a wireless signal message from the wireless gateway to the first wireless node, and performing time correction;
the power supply module is used for providing power supply for each module in the wireless node;
the power supply interface is a wireless module, and the interface is used as a uniform power supply input port and acquires electric power when being in butt joint with other systems;
the communication interface is a wireless module, and is used for carrying out communication butt joint with other systems, and the interface is generally GPIO, UART, IIC, SPI and the like.
A time synchronization method according to an embodiment of the present invention is described with a specific example;
step 1: satellites in the GPS system transmit clock reference signals.
The satellite in the GPS system sends a clock reference signal outwards at fixed intervals, and the clock reference signal at least comprises the accurate time of the clock reference signal sending time node, namely standard time.
Step 2: and the wireless gateway updates the system time according to the updating time interval.
Step 2.1: setting an update time interval;
step 2.2: receiving a GPS signal sent by a GPS system according to the updating time interval, and updating the system time of the wireless gateway;
specifically, according to a set updating time interval, the wireless gateway starts a task of receiving a GPS signal sent by a GPS system every other updating time interval, and receives the GPS signal; performing signal processing through a GPS module so as to update the system time of the GPS system based on the standard time of the GPS signal sending time contained in the received GPS signal and ensure the precision of the time system of the GPS system;
when the GPS system fails, the wireless gateway may obtain network time from the server via the network communication interface, which may be less accurate than standard time in GPS signals, but may provide emergency, less time accurate time synchronization in scenarios without satellite coverage.
And step 3: the wireless gateway broadcasts the system time of the wireless gateway to the first wireless node through a wireless signal message.
Step 3.1: generating a wireless signal message according to the system time;
step 3.2: setting the first preset time to be 0 s;
step 3.3: broadcasting the wireless signal message according to first preset time;
specifically, after generating a wireless signal message according to the system time, the wireless gateway broadcasts the wireless signal message to the first wireless node, so that the first wireless node can calibrate its own time and then synchronize to the second wireless node.
And 4, step 4: and the first wireless node receives the wireless signal message broadcasted by the wireless gateway and updates the time of the first wireless node.
Step 4.1: setting a synchronization period; the synchronization period can be a fixed duration period or a duration period dynamically adjusted by a user; here, the synchronization period is set to 1 second;
step 4.2: receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
specifically, the first wireless node receives a wireless signal message broadcast by the wireless gateway through the radio frequency module every 1 second, and performs message analysis on the received wireless signal message to obtain the system time t1 of the wireless gateway in the wireless signal message;
it should be noted that the first wireless node includes two operation modes: the power supply state is in a power supply state and the power supply state is not in a power supply state;
when the first wireless node is connected with a power supply for power supply, the first wireless node is in a working state for a long time without considering the problem of power consumption; the first wireless node can receive the wireless signal message broadcasted by the wireless gateway according to the set synchronous period, and can also be in a receiving state all the time, so as to ensure that the wireless signal message broadcasted by the wireless gateway can be received in time.
When the first wireless node is not connected with a power supply for supplying power, namely in a power supply-free state, the power consumption problem of long-term working state cannot be ignored; at this time, the first wireless node may receive a wireless signal message broadcast by the wireless gateway according to the set synchronization period; after time synchronization is finished, a timing task is set, and a task of receiving a wireless signal message broadcast by a wireless gateway is awakened before the next time synchronization task is carried out; therefore, the power consumption of the wireless node can be reduced, and the working time of the first wireless node in the state without power supply is prolonged.
Step 4.3: determining the transmission time of a wireless signal message from the wireless gateway to the first wireless node, and further determining the receiving time of receiving the wireless signal message;
and determining the transmission time delta T of the wireless signal message transmitted from the wireless gateway to the first wireless node, wherein the receiving time T2 of the first wireless node for receiving the wireless signal message is equal to the sum of T1 and delta T.
Step 4.4: calibrating the self time according to the receiving time of the wireless signal message;
and 5: and the first wireless node synchronizes the self time after calibration to the second wireless node to realize time synchronization.
Step 5.1: determining a device address of at least one second wireless node;
the second wireless node is a device located in the same time synchronization system as the first wireless node; after the first wireless node calibrates a self time system, acquiring an equipment address of at least one second wireless node from a time synchronization system;
step 5.2: sending the self time to the second wireless node according to the equipment address of the second wireless node;
the wireless node transmits its own time to other devices and apparatuses in the subsystem, i.e., the second wireless node, via the communication interface.
The time synchronization method in the embodiment can be applied to a plurality of scenes; specifically, in some embodiments, as shown in fig. 10, the time synchronization system is one of important components, and not only provides an accurate standard time signal for the rail transit automation system to synchronize the timing devices of the systems with the system, so as to provide a unified time standard for realizing rail transit networked operation, but also can provide an intuitive time display sub-clock device as a passenger and a subway worker, so that people can obtain accurate time information conveniently, and further operation efficiency and service quality are improved. The patrol and maintenance work of the time synchronization system is finished by communication workers, in order to ensure the punctuality and stability of the subway, the communication workers can check the time of the master and slave primary clocks of each station with the control center every day, check whether the master clock can receive the GPS signal issued by the control center, ensure the uniform and accurate time of the whole line, and perform patrol inspection on the secondary clocks of each place such as a station hall, a platform, a vehicle control room, a large warehouse and the like. In another embodiment, a school time synchronization system as shown in FIG. 11; the society pursues a complete balance mechanism, the assessment of the mechanism needs relatively uniform standards, the unified coordination of the examination room realization time is the base of the standardized examination room, and the automatic receiving synchronous clock system of the standardized examination room is the core of the base and develops around the core to achieve effective unification. In recent years, education institutions such as schools and the like have obvious rising trend for the need of automatic time correction synchronous clocks, except for examination mechanism systems, in the middle of ordinary learning and work, time unification of work and rest bells, campus broadcasts, television stations, network center machine rooms, offices, dormitories and dining halls is beneficial for students and teachers to reasonably arrange time. In yet another embodiment, such as the bank time synchronization system shown in fig. 12, the bank time synchronization system is constructed to provide a uniform time scale for the information system, and when all devices operate at a uniform time, not only is a safe and rigorous business process harvested. In the future, the ecology of the information system of the bank is continuously improved, and the requirement for accurate Time is further improved, so that a clock synchronization system based on a Network clock Protocol (NTP) can be positioned as an infrastructure for ecological construction of the information system of the commercial bank for construction and application.
As shown in fig. 7, fig. 7 is a schematic structural diagram of a time synchronization apparatus according to an embodiment of the present invention, where the apparatus is executed by a first wireless node, and includes: a first setting means 701, a receiving means 702, a determining means 703, a calibrating means 704 and a synchronizing means 705;
the first setting device 701 is configured to set a synchronization period;
the receiving device 702 is configured to receive a wireless signal packet broadcast by a wireless gateway according to the synchronization cycle; the wireless signal message at least comprises the system time of the wireless gateway;
the determining device 703 is configured to determine, based on the system time of the wireless gateway in the wireless signal packet, a receiving time of receiving the wireless signal packet;
the calibration device 704 is configured to calibrate its own time according to the receiving time;
the synchronization device 705 is configured to synchronize the calibrated self time to the second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
Specifically, the determining device 703 is specifically configured to determine a transmission time of the wireless signal packet from the wireless gateway to the first wireless node; and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
In particular, the synchronization means 705 is specifically configured to determine a device address of at least one second wireless node; and sending the self time to the second wireless node according to the equipment address of the second wireless node.
As shown in fig. 8, a schematic structural diagram of another time synchronization apparatus provided in an embodiment of the present invention, where the apparatus is executed by a wireless gateway, the time synchronization apparatus includes: second setting means 801, updating means 802, generating means 803, and broadcasting means 804;
the second setting device 801 is configured to set an update time interval;
the updating device 802 is configured to update the system time according to the update time interval;
the generating device 803 is configured to generate a wireless signal message according to the system time;
the broadcasting device 804 is configured to broadcast the wireless signal packet; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
Specifically, the updating apparatus 802 is further configured to receive a GPS signal sent by a GPS system according to the time interval; according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal; and updating the system time of the wireless gateway according to the standard time.
Specifically, the broadcasting device 804 is specifically configured to set a first preset time; broadcasting the wireless signal message according to first preset time; the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
To implement the method of the embodiment of the present invention, the embodiment of the present invention provides another time synchronization apparatus, and specifically, as shown in fig. 9, the apparatus 90 includes a processor 901 and a memory 902 for storing a computer program capable of running on the processor;
the processor 901 is configured to, when running the computer program, execute: setting a synchronization period; receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway; determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message; calibrating self time according to the receiving time; synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
In an embodiment, the processor 901 is further configured to execute, when running the computer program, the following: determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node; and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
In an embodiment, the processor 901 is further configured to execute, when running the computer program, the following: determining a device address of at least one second wireless node; and sending the self time to the second wireless node according to the equipment address of the second wireless node.
In an embodiment, the processor 901 is further configured to execute, when running the computer program, the following: setting an update time interval; updating the system time according to the updating time interval; generating a wireless signal message according to the system time; broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
In an embodiment, the processor 901 is further configured to execute, when running the computer program, the following: receiving a GPS signal sent by a GPS system according to the time interval; according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal; and updating the system time of the wireless gateway according to the standard time.
In an embodiment, the processor 901 is further configured to execute, when running the computer program, the following: setting a first preset time; broadcasting the wireless signal message according to first preset time; the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
It should be noted that: the time synchronization device and the time synchronization method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
Of course, in practical applications, as shown in fig. 9, the apparatus 90 may further include: at least one network interface 903. The various components of the time synchronizer 90 are coupled together by a bus system 904. It is understood that the bus system 904 is used to enable communications among the components. The bus system 904 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration the various buses are labeled as bus system 904 in figure 9. The number of the processors 901 may be at least one. The network interface 903 is used for communication between the time synchronizer 90 and other devices in a wired or wireless manner.
The memory 902 in the present embodiment is used to store various types of data to support the operation of the time synchronization apparatus 90.
The method disclosed in the above embodiments of the present invention may be applied to the processor 901, or implemented by the processor 901. The processor 901 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 901. The Processor 901 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 901 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 902, and the processor 901 reads the information in the memory 902 and performs the steps of the aforementioned methods in combination with its hardware.
In an exemplary embodiment, the time synchronizer 90 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
In an exemplary embodiment, the present invention further provides a computer readable storage medium, such as a memory 902, comprising a computer program, which is executable by a processor 901 of the time synchronization apparatus 90 to perform the steps of the aforementioned method.
Specifically, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs: setting a synchronization period; receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway; determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message; calibrating self time according to the receiving time; synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
In one embodiment, the computer program, when executed by the processor, performs: determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node; and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
In one embodiment, the computer program, when executed by the processor, performs: determining a device address of at least one second wireless node; and sending the self time to the second wireless node according to the equipment address of the second wireless node.
In one embodiment, the computer program, when executed by the processor, performs: setting an update time interval; updating the system time according to the updating time interval; generating a wireless signal message according to the system time; broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
In one embodiment, the computer program, when executed by the processor, performs: receiving a GPS signal sent by a GPS system according to the time interval; according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal; and updating the system time of the wireless gateway according to the standard time.
In one embodiment, the computer program, when executed by the processor, performs: setting a first preset time; broadcasting the wireless signal message according to first preset time; the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
It should be noted that: the computer-readable storage medium provided by the embodiment of the invention can be memories such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (14)

1. A method of time synchronization, performed by a first wireless node, the method comprising:
setting a synchronization period;
receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
determining the receiving time of the wireless signal message based on the system time of the wireless gateway in the wireless signal message;
calibrating self time according to the receiving time;
synchronizing the calibrated self time to a second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
2. The method according to claim 1, wherein the determining the receiving time of the wireless signal packet based on the system time of the wireless gateway in the wireless signal packet comprises:
determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node;
and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
3. The method according to claim 1 or 2, wherein the synchronizing the calibrated self time to the second wireless node comprises:
determining a device address of at least one second wireless node;
and sending the self time to the second wireless node according to the equipment address of the second wireless node.
4. A method of time synchronization, performed by a wireless gateway, the method comprising:
setting an update time interval;
updating the system time according to the updating time interval;
generating a wireless signal message according to the system time;
broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
5. The method according to claim 4, wherein the updating the system time according to the update time interval comprises:
receiving a GPS signal sent by a GPS system according to the updating time interval;
according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal;
and updating the system time of the wireless gateway according to the standard time.
6. The method according to claim 4 or 5, wherein the broadcasting the wireless signal packet comprises:
setting a first preset time;
broadcasting the wireless signal message according to first preset time;
the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
7. An apparatus for time synchronization, the apparatus being performed by a first wireless node and comprising: the device comprises a first setting device, a receiving device, a determining device, a calibrating device and a synchronizing device;
the first setting device is used for setting a synchronization period;
the receiving device is used for receiving a wireless signal message broadcasted by the wireless gateway according to the synchronization period; the wireless signal message at least comprises the system time of the wireless gateway;
the determining device is configured to determine a receiving time of the wireless signal packet based on the system time of the wireless gateway in the wireless signal packet;
the calibration device is used for calibrating self time according to the receiving time;
the synchronization device is used for synchronizing the self time after calibration to the second wireless node; wherein the second wireless node is located in the same time synchronization system as the first wireless node.
8. The apparatus according to claim 7, wherein the determining means is specifically configured to:
determining a transmission time of the wireless signal message from the wireless gateway to the first wireless node;
and determining the receiving time for receiving the wireless signal message according to the transmission time and the system time of the wireless gateway.
9. The device according to claim 7 or 8, wherein the synchronization means are specifically configured to:
determining a device address of at least one second wireless node;
and sending the self time to the second wireless node according to the equipment address of the second wireless node.
10. An apparatus for time synchronization, the apparatus being performed by a wireless gateway, comprising: second setting means, updating means, generating means, and broadcasting means;
the second setting device is used for setting an updating time interval;
the updating device is used for updating the system time according to the updating time interval;
the generating device is used for generating a wireless signal message according to the system time;
the broadcasting device is used for broadcasting the wireless signal message; the wireless signal message is used for the first wireless node to calibrate the self time and synchronize the self time to the second wireless node.
11. The apparatus according to claim 10, wherein the updating means is further configured to:
receiving a GPS signal sent by a GPS system according to the updating time interval;
according to the GPS signal, determining the standard time of the GPS system at the moment of sending the GPS signal;
and updating the system time of the wireless gateway according to the standard time.
12. The apparatus according to claim 10 or 11, wherein the broadcasting apparatus is specifically configured to:
setting a first preset time;
broadcasting the wireless signal message according to first preset time;
the wireless signal message is used for the first wireless node to synchronize to the second wireless node after calibrating the self time.
13. A time synchronization apparatus, characterized in that the apparatus comprises: a processor and a memory for storing a computer program capable of running on the processor;
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 3 or to perform the steps of the method of claims 4 to 6 when running the computer program.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of one of claims 1 to 3 or carries out the steps of the method of one of claims 4 to 6.
CN202111465385.5A 2021-12-03 2021-12-03 Time synchronization method, device and storage medium Pending CN114269012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111465385.5A CN114269012A (en) 2021-12-03 2021-12-03 Time synchronization method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111465385.5A CN114269012A (en) 2021-12-03 2021-12-03 Time synchronization method, device and storage medium

Publications (1)

Publication Number Publication Date
CN114269012A true CN114269012A (en) 2022-04-01

Family

ID=80826198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111465385.5A Pending CN114269012A (en) 2021-12-03 2021-12-03 Time synchronization method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114269012A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019205498A1 (en) * 2018-04-28 2019-10-31 广州供电局有限公司 Clock synchronization method and device for electric energy meter, computer device and storage medium
CN110677212A (en) * 2019-10-30 2020-01-10 武汉慧联无限科技有限公司 Time synchronization method, device and system and computer storage medium
CN110690953A (en) * 2019-12-06 2020-01-14 武汉慧联无限科技有限公司 Downlink gateway selection method, device and computer storage medium
CN111756499A (en) * 2019-03-29 2020-10-09 中国移动通信有限公司研究院 Method for adjusting wideband part timer, terminal and storage medium
CN112367138A (en) * 2020-09-30 2021-02-12 芜湖酷哇机器人产业技术研究院有限公司 CAN bus equipment synchronization method and system based on time service system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019205498A1 (en) * 2018-04-28 2019-10-31 广州供电局有限公司 Clock synchronization method and device for electric energy meter, computer device and storage medium
CN111756499A (en) * 2019-03-29 2020-10-09 中国移动通信有限公司研究院 Method for adjusting wideband part timer, terminal and storage medium
CN110677212A (en) * 2019-10-30 2020-01-10 武汉慧联无限科技有限公司 Time synchronization method, device and system and computer storage medium
CN110690953A (en) * 2019-12-06 2020-01-14 武汉慧联无限科技有限公司 Downlink gateway selection method, device and computer storage medium
CN112367138A (en) * 2020-09-30 2021-02-12 芜湖酷哇机器人产业技术研究院有限公司 CAN bus equipment synchronization method and system based on time service system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李伟章: "《城市轨道交通系列丛书 城市轨道交通通信 第2版》", pages: 335 *
袁博华: "基于主站GPS无线广播重发精确同步校时方案的实现", 计算机测量与控制, pages 1 - 2 *

Similar Documents

Publication Publication Date Title
CN108605301B (en) Synchronization method for nodes in a cellular network
KR100695074B1 (en) Time synchronizing method in wireless sensor networks
TW202025808A (en) Inter-working between a time-sensitive network and a cellular communication network
CN104145514B (en) Method, apparatus and system for synchronization
RU2010126640A (en) TEMPORARY SYNCHRONIZATION SYSTEM AND METHOD OF TEMPORARY SYNCHRONIZATION IN RAILWAY COMPOSITION
US10444788B2 (en) Device, system, and method for synchronizing time partition windows
CN111818614B (en) UWB-based dynamic distributed ad hoc network scheduling method and system
KR101565345B1 (en) Method and apparatus for providing black-box for vehicle diagnosis using in-vehicle time synchronization message
WO2020043181A1 (en) Clock synchronization method and apparatus, system, storage medium, and electronic device
EP3352392A1 (en) Time synchronization packet processing method and device
CN103166729A (en) Clock synchronization method and equipment
JP2015068806A (en) Time synchronization system and time synchronization device
CN102820941A (en) Clock synchronization method and device of communication network
CN107682925A (en) A kind of determination method and device of access time
CN115699624A (en) Apparatus and method for transmitting synchronization information in communication system
CN105207733B (en) The wireless access of integrated voice and data and transmission method
CN104836654A (en) Clock synchronizing method based on Ethernet POWERLINK
CN104993898A (en) Method for monitoring-type time synchronization among cluster nodes in WIA-PA network
CN114269012A (en) Time synchronization method, device and storage medium
CN102892194A (en) Wireless mobile simulcast system, synchronizing method and synchronizing equipment
CN112104432B (en) Time verification method, system, base station and bearing network in mobile communication network
CN111083776B (en) TTE time synchronization method based on 1588 and AS6802 protocol
WO2021159508A1 (en) Clock information synchronization method and device, and first node, terminal, and storage medium
CN112583508B (en) Clock synchronization communication system and method for rail train
JPWO2012056633A1 (en) Wireless communication apparatus and wireless communication method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination