Time synchronization method and apparatus for internet of things device, and electronic device
Patent Information
- Application Number
- CN202611130172.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-20
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of time synchronization technology, specifically to a time synchronization method for an Internet of Things (IoT) device, a time synchronization device for an IoT device, an electronic device, a storage medium, and a computer program product. Background Technology
[0002] The power system is a critical infrastructure, vital to national economy and security. Given its geographically dispersed nature, achieving continuous monitoring and sensing of the power grid's operational status, rapid fault identification and location, and timely response and repair requires convenient access to standard time across a large scale to maintain time synchronization within the power system.
[0003] Existing technologies include using local communication networks to broadcast time synchronization to meters, switches, and other equipment within the distribution area from the terminal, thereby achieving precise clock synchronization across the entire area. However, the time calibration and synchronization of meters within the distribution area faces challenges due to the complex electromagnetic environment of existing power line carrier signal transmission, signal attenuation, and interference from neighboring cells. This results in large fluctuations in communication delays, with relay nodes forwarding data at each level, leading to significant time synchronization deviations and accumulated errors at each level. Other literature addresses this by extending the data field of beacon frames in the carrier communication media access medium layer protocol and adding downlink step-by-step time synchronization acknowledgment frames. This achieves estimation of carrier communication transmission delays while reducing the impact of protocol processing delays and carrier signal sampling time deviations. Synchronization accuracy can reach 30 microseconds. Existing data acquisition methods employ question-and-answer or buffered reporting, with the former exhibiting extremely low communication efficiency and the latter poor timeliness.
[0004] A high-precision and reliable time source is the foundation and guarantee for time synchronization in power distribution terminals. Existing technologies suffer from poor time synchronization accuracy, difficulty in accurately scheduling the time synchronization cycle, and inability to achieve full-time time synchronization. Summary of the Invention
[0005] The purpose of this application is to provide a time synchronization method, apparatus, and electronic device for Internet of Things (IoT) devices. It proposes a cross-level time synchronization method based on wired or wireless beacons for time calibration and synchronization of terminals within a distribution area to each node device, which solves the problem that the accuracy of time synchronization of nodes in the distribution area is affected by the cumulative error propagation at different levels. At the same time, it also proposes a low-power time synchronization and communication method based on the maximum tolerance period of the node, which reduces the frequency of sleep wake-up and communication frequency in the distribution area, so as to at least solve some of the problems in the background art.
[0006] To achieve the above objectives, this application provides a time synchronization method for IoT devices, applied to a system including a master node and several slave nodes. The method includes: after receiving a time broadcast beacon frame, a slave node obtains the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence; determines a common-view node based on the intersection of the sending nodes in the information set sequence of the slave node and the information set sequence of the upper-level node of the slave node; determines a time synchronization reference node based on the common-view node and the sending node level; and synchronizes the slave node's time based on the time difference between the local reception time of the common-view node and the time synchronization reference node.
[0007] Optionally, obtaining the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence includes: after a node receives a time broadcast beacon frame, obtaining the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set; and assembling the information set sequence by combining all the information sets obtained within a timing period.
[0008] Optionally, the information set sequence of the upper-level node is received by the slave node after the upper-level node sends it to the lower-level node via broadcast.
[0009] Optionally, the transmission of the time broadcast beacon frame and the transmission of the information set sequence are synchronized with the service data transmission process; the broadcast beacon frame is divided into local broadcast frame or global broadcast frame according to the time synchronization time slot interval and the service data transmission, based on the time synchronization range.
[0010] Optionally, determining the time synchronization reference node based on the common-view node and the sending node hierarchy includes: selecting an information set sequence that includes common-view nodes; obtaining the corresponding upper-level node based on the selected information set sequence; selecting the upper-level node with the smallest sending node hierarchy from the obtained upper-level nodes as the time synchronization reference node; the smallest sending node hierarchy means having the fewest hops with the master node.
[0011] Optionally, time synchronization of the slave node is performed based on the time difference between the local reception times of the slave node and the time synchronization reference node based on their shared viewing nodes. This includes: obtaining the local reception time of the slave node receiving the time broadcast beacon frame from the shared viewing node; obtaining the local reception time of the time broadcast beacon frame received by the time synchronization reference node from the shared viewing node; obtaining the difference between the two local reception times; and calibrating the local time of the slave node based on the difference.
[0012] Optionally, the propagation of the time broadcast beacon frame within the system is triggered by the master node, and the time interval for triggering the start is determined based on the maximum allowable time error value, the maximum time synchronization period value, the time synchronization error margin, and the maximum time synchronization error within the system.
[0013] Optionally, the maximum allowable time error value and the maximum synchronization period value are determined according to the time synchronization requirements of the power service.
[0014] Optionally, the maximum time synchronization error within the system is determined based on the maximum value among the time synchronization errors of all slave nodes.
[0015] Optionally, the master node uses time division multiple access to allocate a corresponding time slot to each slave node in the system for data reporting; the master node performs time synchronization with the slave nodes, and each slave node only wakes up the radio frequency module to report data within the allocated time slot, and remains in sleep mode at other times; the relay node allocates its own working time slot according to the reporting time slots of all subordinate nodes to ensure that it receives the reporting information from subordinate nodes.
[0016] Optionally, the length of the time slot is determined based on service requirement information and dynamically adjusted according to network load status; the service requirement information includes at least one of the following: service type, period, data length, and latency tolerance.
[0017] This application also provides a time synchronization device for an Internet of Things (IoT) device, applied in a system including a master node and several slave nodes. The device includes: a sequence generation module, used by each slave node to obtain the sending node ID, sending node level, and local reception time of the time broadcast beacon frame after receiving it, thereby obtaining an information set sequence; a node determination module, used to determine a common-view node based on the intersection of the sending nodes in the information set sequence of the slave node and the information set sequence of the upper-level node, and to determine a time synchronization reference node based on the common-view node and the sending node level; and a synchronization calculation module, used to perform time synchronization on the slave node based on the time difference between the local reception time of the common-view node and the time synchronization reference node.
[0018] This application also provides an electronic device, including: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the aforementioned time synchronization method for an Internet of Things device by executing the instructions stored in the memory.
[0019] This application also provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the aforementioned time synchronization method for an Internet of Things device.
[0020] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned time synchronization method for Internet of Things (IoT) devices.
[0021] The above technical solution has the following beneficial effects: The beacon-based time synchronization method proposed in this application, compared with the single-mode time transmission method, forms a fast, efficient, and accurate time synchronization channel, solves the problems of accumulated errors in multi-level time synchronization and time synchronization reliability, improves the accuracy and reliability of time synchronization, and saves costs.
[0022] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0023] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings: Figure 1 This illustration schematically shows the steps of a time synchronization method for an Internet of Things (IoT) device according to an embodiment of this application. Figure 2 This schematic diagram illustrates a system architecture including a CCO and several STAs according to an embodiment of this application; Figure 3 The diagram illustrates a time-division multiple access scheme based on low-power acquisition and reporting with precise synchronization. Figure 4 This illustration schematically shows a structural diagram of a time synchronization device for an Internet of Things (IoT) device according to an embodiment of this application; Figure 5 The diagram schematically illustrates the internal structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0024] The specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the embodiments of this application.
[0025] Figure 1 The illustration schematically depicts the steps of a time synchronization method for an Internet of Things (IoT) device according to an embodiment of this application. For example... Figure 1As shown, a time synchronization method for IoT devices includes a system with a master node and several slave nodes. In an example scenario, the entire station adopts a tree or star network structure, with the CCO as the master node and several STA nodes as branches and leaves. First, all communication modules use the same hardware circuit to implement transmit and receive control. The physical layer transmit and receive delays are the same for the same communication mode. All nodes have high-precision timers to record the reception time value of received frames. The time synchronization method includes: S01. After receiving the time broadcast beacon frame, the slave node obtains the sending node ID, sending node level and local reception time of the time broadcast beacon frame to obtain the information set sequence; S02. Determine the common-view node based on the intersection of the information set sequence of the slave node and the information set sequence of the upper-level node of the slave node, and determine the time synchronization reference node based on the common-view node and the sending node hierarchy. S03. Synchronize the slave node's time based on the time difference between the slave node and the time synchronization reference node based on the local reception time of their shared viewing node.
[0026] Through the above implementation methods, compared with the single-mode time transmission and synchronization method, a fast, efficient and accurate time synchronization channel is formed, which solves the problems of cumulative error of multi-level time synchronization and time synchronization reliability, improves the accuracy and reliability of time synchronization, and saves costs.
[0027] In some embodiments of this application, obtaining the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence includes: after receiving a time broadcast beacon frame, a slave node obtains the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set; and all information sets obtained within a timing period are combined to form the information set sequence. For example, taking the aforementioned system with CCO as the master node and STA as the slave node as an example, the CCO master node initiates a time broadcast beacon frame to all STA nodes in the entire station area, and STA node i forwards the time broadcast beacon frame to its neighboring nodes. At this time, STA node j uses a local time counter to record the time value of receiving the time broadcast beacon frame from STA node i, and parses the time broadcast beacon frame to obtain a set {ID} consisting of the sending node i's ID code, level H, and time value t. i,j H i,j , t i,j Let {ID} be the set of all beacons received by STA node j within a certain time period. i,j H i,j , t i,j The sequence formed by} is Q rj That is, a sequence of information sets.
[0028] In some embodiments of this application, the information set sequence of the upper-level node is received by the slave node after being broadcast by the upper-level node to the lower-level node. The upper-level node broadcasts its information set sequence. Broadcasting means that all lower-level nodes within its signal coverage area, such as multiple STAs, can receive the information simultaneously without establishing a one-to-one connection. Subsequently, the STA, as one of the lower-level nodes, successfully receives this broadcast information and performs subsequent operations to determine the common-view node and time synchronization reference node. This process embodies an efficient one-to-many propagation method of information from top to bottom in the network hierarchy.
[0029] In some embodiments of this application, the transmission of the time broadcast beacon frame and the transmission of the information set sequence are synchronized with the service data transmission process. In this embodiment, the beacon broadcast process and the time synchronization set sequence broadcast exchange process can be synchronized with the service data transmission process, eliminating the need for a dedicated beacon cycle design and reducing design complexity and time slot overhead.
[0030] In some embodiments of this application, determining the time synchronization reference node based on the common-view node and the sending node hierarchy includes: selecting an information set sequence including common-view nodes; obtaining the corresponding upper-level node based on the selected information set sequence; selecting the upper-level node with the smallest sending node hierarchy from the obtained upper-level nodes as the time synchronization reference node; the smallest sending node hierarchy means having the fewest hops with the master node. For example, taking STA node k as an example, the information set sequence it collects is Q. rk The sequence of information sets received by the upper-layer STA node j is Q. rj Based on Q rk and Q rj Perform an ID lookup and record {{ IDs} with the same ID value. m,j H m,j , t m,j}, { ID m,k H m,k , t m,k Sequence pairs, where ID m,j ID m,k Let {H, Q} be the IDs of the same node m received by nodes j and k, respectively, denoted as m shared by j and k. In this case, STA node j is the parent node of STA node k that shares a common view of node m. When node k receives {H, Q} from multiple different nodes (including CCO nodes and STA nodes), ... rIn the sequence, the smaller H is, the closer it is to the CCO end, indicating the best propagation error. The node with the smallest H and co-visibility with k is selected as the time calibration reference node. In the selection of the time calibration reference node, the proposed method of prioritizing direct time transmission from lower-level nodes to higher-level nodes reduces the time error problem introduced by intermediate nodes and improves the accuracy and efficiency of node time calibration compared to the existing method of transmitting time level by level.
[0031] In some embodiments of this application, time synchronization of the slave node is performed based on the time difference between the local reception times of the slave node and the time synchronization reference node, which are based on their shared viewing nodes. Specifically, this can be implemented in the following way: Taking nodes j and k as shared viewing nodes m, with node j as the time synchronization reference node and time error correction of node k as an example, the local reception time of the time broadcast beacon frame received by this STA from the shared viewing node is obtained, i.e. ; Obtain the local reception time of the time broadcast beacon frame received by the time synchronization reference node from the co-view node, i.e. ; Obtain the difference between two local reception times, and calibrate the local time of this STA based on the difference, i.e., the following formula:
[0032] in, for and The difference between the two local reception times, For the calibration time of STA node k, This is the calibration time for STA node k.
[0033] Figure 2 A schematic diagram illustrating a system architecture including a CCO and several STAs according to an embodiment of this application is shown below. Figure 2 Taking the system in the example, the implementation of the time synchronization method for IoT devices in this application is explained.
[0034] In one embodiment provided in this application, within a timing period, the sending node ID, sending node level, and local reception time of the received time broadcast beacon frame are recorded to obtain a first information set sequence; STA6 sends a time broadcast beacon frame, and CCO0, STA3, STA7, STA9, and STA10 receive the beacon frame from STA6 and record the reception sets as {6, 2, t} respectively. 6,0 { 6, 2, t} 6,3 { 6, 2, t} 6,7 { 6, 2, t} 6,9}、{6, 3, t 6,10 At this point, STA9 will receive {6, 2, t} from STA6.6,9}, the {6, 2, t} 6,9 It will be included in the first information set sequence.
[0035] Obtain the second information set sequence of the upper-layer node, the second information set sequence including the sending node ID, sending node level, and local reception time of the received time broadcast beacon frames recorded by the upper-layer node within the timing period; when STA9 receives the information {0, {6, 2, t} collected from the lower-level nodes broadcast by CCO0... 6,0 When}}, STA9 obtains {6, 2, t} from it. 6,0}, the {6, 2, t} 6,0} represents part or all of the second information set sequence.
[0036] The sending node that exists simultaneously in both the first and second information set sequences is designated as the common-view node. The node with the lowest sending node level among the upper-layer nodes in the second information set sequence to which the common-view node belongs is selected as the time synchronization reference node. STA9 detects that STA9 and CCO0 have a common-view node STA6, and CCO0's level H is 0. Over a period of time, STA9 may detect multiple common-view nodes and obtain multiple upper-layer nodes based on them. However, even if STA9 detects other common-view nodes and other upper-layer nodes corresponding to those common-view nodes, it will still select CCO0 as the time synchronization reference node due to its level H. When multiple upper-layer nodes with the same level exist, one can be selected as the time synchronization reference node according to user-preset rules. For example, the user-preset rules here may select the upper-layer node with the earliest reception time as the time synchronization reference node to shorten the overall synchronization period.
[0037] Time synchronization is performed based on the time error between the local reception time of the time broadcast beacon frame received by the common-view node and the local reception time of the time broadcast beacon frame received by the time synchronization reference node from the common-view node, including:
[0038] The above time synchronization process, through the first-level time synchronization steps, allows direct time synchronization of STA9 from CCO0, reducing the error caused by intermediate time synchronization steps.
[0039] In some embodiments of this application, a low-power time synchronization method based on clock tolerance period is also provided. The propagation of the time broadcast beacon frame within the system is triggered by the master node, and the triggering time interval is determined based on the maximum allowable time error value, the maximum time synchronization period value, the time synchronization error margin, and the maximum time synchronization error within the system. For example, to address the low-power communication requirements of wireless nodes within a distribution area, a time synchronization method based on the node's maximum clock tolerance period is used to optimize node power consumption. When the CCO node... T C0 Based on the above time synchronization process, the equipment within the distribution area is synchronized. STA node k records the time synchronization error between STA node k and the reference time synchronization node j. The CCO node collects the time synchronization errors of all STA nodes. The calculation area extends from CCO node 0 to the final STA node p. k The time synchronization error values for k=0,1,…n
[0040] The maximum permissible time error value is determined based on the time synchronization requirements of power services. Select the largest synchronization period value T c1 Ensure that the time synchronization error of all nodes is less than 1. This minimizes the power consumption during time synchronization; among which T th The time interval is the margin for time synchronization error to be retained. T C0 The following constraints must be met:
[0041] In the above implementation, the maximum allowable time error value and the maximum time synchronization period value are determined according to the time synchronization requirements of power services. The maximum time synchronization error within the system is determined based on the maximum value among the time synchronization errors of all slave nodes. This implementation proposes a method for collecting time synchronization errors using the time synchronization process, and calculates the maximum time synchronization period based on the maximum allowable time synchronization accuracy requirement, thereby reducing the frequency of sleep / wake-up, improving time synchronization efficiency, and reducing time synchronization power consumption.
[0042] In some embodiments of this application, a low-power acquisition and reporting method based on precise synchronization is also provided. Figure 3 This schematically illustrates a time-division multiple access (TDMA) diagram based on low-power acquisition and reporting with precise synchronization. For example... Figure 3As shown, the master node uses Time Division Multiple Access (TDMA) to allocate corresponding time slots for data reporting to each slave node in the system. The master node synchronizes the slave nodes with the time, and each slave node only wakes up its radio frequency module to report data within its allocated time slot, remaining in sleep mode at other times. The relay node allocates its own working time slot according to the reporting time slots of all its subordinate nodes to ensure that it receives the reported information from its subordinate nodes. A dedicated time slot resource is pre-allocated to each node using the TDMA mechanism. During data acquisition and reporting, nodes do not need to compete for channel space; they only wake up their radio frequency module to report data within the specified time slot window, remaining in deep sleep mode at other times, thereby reducing power consumption.
[0043] In some embodiments of this application, the length of the time slot is determined based on service demand information and dynamically adjusted according to network load status. The service demand information includes at least one of the following: service type, period, data length, and latency tolerance. The CCO node accurately allocates service time slot resources based on the communication service demands of the power equipment where the STA node is located, using the time synchronization period as the scheduling unit. The service demand information includes at least one or more of the following: service type, period, data length, and latency tolerance. The service communication period is dynamically adjusted according to network load status, extending the communication period during service idle periods to reduce system power consumption. This embodiment proposes a precise, synchronized, low-power data acquisition and reporting method, reducing communication power consumption and improving communication efficiency.
[0044] As can be seen from the above implementation methods, for the time calibration and synchronization of terminals within a distribution area to each node device, this application proposes a cross-level time synchronization method based on wired or wireless beacons, which solves the problem of the accuracy of time synchronization of nodes in the distribution area being affected by the cumulative error transmission at each level; it also proposes a low-power time synchronization and communication method based on the maximum tolerance period of the node, which reduces the frequency of sleep wake-up and communication frequency in the distribution area.
[0045] Based on the same inventive concept, this application also provides a time synchronization device for Internet of Things (IoT) devices. Figure 4 A schematic diagram illustrating the structure of a time synchronization device for an Internet of Things (IoT) device according to an embodiment of this application is shown. For example... Figure 4 As shown, the device includes: a sequence generation module, used for each slave node to obtain the sending node ID, sending node level, and local reception time of the time broadcast beacon frame after receiving it, and to obtain an information set sequence; a node determination module, used to determine a common-view node based on the intersection of the sending nodes in the information set sequence of the slave node and the information set sequence of the upper-layer node, and to determine a time synchronization reference node based on the common-view node and the sending node level; and a synchronization calculation module, used to perform time synchronization on the slave node based on the time difference between the local reception time of the common-view node and the time synchronization reference node.
[0046] In some optional implementations, obtaining the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence includes: after a node receives a time broadcast beacon frame, obtaining the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set; and assembling the information set sequence by combining all the information sets obtained within a timing period.
[0047] In some alternative implementations, the information set sequence of the upper-level node is received by the slave node after the upper-level node sends it to the lower-level node via broadcast.
[0048] In some optional implementations, the transmission of the time broadcast beacon frames and the transmission of the information set sequence are synchronized with the service data transmission process; the broadcast beacon frames are divided into local broadcast frames or global broadcast frames according to the time synchronization time slot intervals and the service data transmission, based on the time synchronization range.
[0049] In some optional implementations, determining the time synchronization reference node based on the common-view node and the sending node hierarchy includes: selecting an information set sequence that includes common-view nodes; obtaining the corresponding upper-level node based on the selected information set sequence; selecting the upper-level node with the smallest sending node hierarchy from the obtained upper-level nodes as the time synchronization reference node; the smallest sending node hierarchy means having the fewest hops with the master node.
[0050] In some optional implementations, time synchronization of the slave node is performed based on the time difference between the local reception times of the slave node and the time synchronization reference node based on their shared viewing nodes. This includes: obtaining the local reception time of the slave node receiving the time broadcast beacon frame from the shared viewing node; obtaining the local reception time of the time broadcast beacon frame received by the time synchronization reference node from the shared viewing node; obtaining the difference between the two local reception times; and calibrating the local time of the slave node based on the difference.
[0051] In some alternative implementations, the propagation of the time broadcast beacon frame within the system is triggered by the master node, and the time interval for triggering the start is determined based on the maximum allowable time error value, the maximum time synchronization period value, the time synchronization error margin, and the maximum time synchronization error within the system.
[0052] In some alternative implementations, the maximum allowable time error value and the maximum synchronization period value are determined based on the time synchronization requirements of the power service.
[0053] In some alternative implementations, the maximum time synchronization error within the system is determined based on the maximum value among the time synchronization errors of all slave nodes.
[0054] In some optional implementations, the master node uses time division multiple access to allocate a corresponding time slot for each slave node in the system for data reporting; the master node performs time synchronization with the slave nodes, and each slave node only wakes up the radio frequency module to report data within the allocated time slot, and remains in a sleep state at other times; the relay node allocates its own working time slot according to the reporting time slots of all subordinate nodes to ensure that it receives the reporting information from subordinate nodes.
[0055] In some optional implementations, the length of the time slot is determined based on service demand information and dynamically adjusted according to network load status; the service demand information includes at least one of the following: service type, period, data length, and latency tolerance.
[0056] The specific limitations of each functional module in the aforementioned IoT device time synchronization device can be found in the limitations of the IoT device time synchronization method described above, and will not be repeated here. Each module in the above system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module. This also solves the problems of multi-level time synchronization cumulative error and time synchronization reliability, improving the accuracy and reliability of time synchronization, and saving costs.
[0057] In some embodiments of this application, an electronic device is also provided, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor executes the aforementioned time synchronization method for an Internet of Things (IoT) device. Its internal structure diagram can be shown as follows. Figure 5 As shown. Figure 5This schematic diagram illustrates the internal structure of an electronic device according to an embodiment of this application. The electronic device includes a processor A01, a network interface A02, a memory (not shown), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A04. The network interface A02 is used for communication with external terminals via a network connection. When the computer program B02 is executed by the processor A01, it implements a time synchronization method for Internet of Things (IoT) devices. The electronic device also includes the following functional modules: a power control module C01 is used to execute logic such as node sleep or wake-up; and a local time counter C02 is used to provide local time, determine the local reception time, and / or align with standard time. Communication modem 1 (wired) C03 and communication modem 2 (wireless) C04 are used for communication with the outside world, including but not limited to receiving and sending time broadcast beacon frames and information set sequences.
[0058] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0059] In one embodiment provided in this application, a machine-readable storage medium is provided, on which instructions are stored, which, when executed by a processor, cause the processor to be configured to perform the aforementioned time synchronization method for an Internet of Things device.
[0060] In one embodiment provided in this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the aforementioned time synchronization method for Internet of Things (IoT) devices.
[0061] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0062] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0063] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0064] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0065] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0066] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0067] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0068] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0069] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A time synchronization method for Internet of Things (IoT) devices, characterized in that, Applied to a system including a master node and several slave nodes, the method includes: After receiving a time broadcast beacon frame, the slave node obtains the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence; The common-view node is determined based on the intersection of the information set sequence of the slave node and the information set sequence of the upper-level node of the slave node, and the time synchronization reference node is determined based on the common-view node and the sending node hierarchy. The slave node is time synchronized based on the time difference between the local reception time of the slave node and the time synchronization reference node based on their shared viewing node.
2. The method according to claim 1, characterized in that, Obtain the sending node ID, sending node level, and local reception time of the time broadcast beacon frame to obtain an information set sequence, including: After receiving a time broadcast beacon frame, the slave node obtains the sending node ID, sending node level and local reception time of the time broadcast beacon frame to obtain an information set; The information set sequence is composed of all the information obtained within a timing period.
3. The method according to claim 1, characterized in that, The information set sequence of the upper-level node is received by the slave node after the upper-level node sends it to the lower-level node via broadcast.
4. The method according to claim 3, characterized in that, The transmission of the time broadcast beacon frames and the transmission of the information set sequence are carried out synchronously with the service data transmission process; the broadcast beacon frames are divided into local broadcast frames or global broadcast frames according to the time synchronization time slot intervals and the service data transmission, based on the time synchronization range.
5. The method according to claim 1, characterized in that, The time synchronization reference node is determined based on the common-view node and the sending node hierarchy, including: Select the sequence of information sets that include nodes with shared views; The corresponding upper-level node is obtained based on the selected information set sequence; The upper-level node with the smallest sending node level is selected as the time synchronization reference node; the smallest sending node level means the fewest hops with the master node.
6. The method according to claim 1, characterized in that, Based on the time difference between the slave node and the time synchronization reference node according to their local reception times at their shared viewing nodes, the slave node is time-synchronized, including: Obtain the local reception time of the time broadcast beacon frame received by this slave node from the co-viewing node; Obtain the local reception time of the time broadcast beacon frame received by the time synchronization reference node from the common-view node; Obtain the difference between two local reception times, and calibrate the local time of this slave node based on the difference.
7. The method according to claim 1, characterized in that, The propagation of the time broadcast beacon frame within the system is triggered by the master node, and the time interval for triggering the start is determined based on the maximum allowable time error value, the maximum time synchronization period value, the time synchronization error margin, and the maximum time synchronization error within the system.
8. The method according to claim 7, characterized in that, The maximum allowable time error value and the maximum synchronization period value are determined based on the time synchronization requirements of power services.
9. The method according to claim 7, characterized in that, The maximum time synchronization error within the system is determined based on the maximum value among the time synchronization errors of all slave nodes.
10. The method according to claim 1, characterized in that, The master node uses time-division multiple access to allocate a corresponding time slot for data reporting to each slave node in the system. The master node synchronizes the time with the slave nodes. Each slave node only wakes up the radio frequency module to report data during the allocated time slot, and remains in sleep mode at other times. The relay node allocates its own working time slot according to the time slots reported by all subordinate nodes to ensure that it receives the reported information from subordinate nodes.
11. The method according to claim 10, characterized in that, The length of the time slot is determined based on service requirements and dynamically adjusted according to network load status. The business requirement information includes at least one of the following: business type, cycle, data length, and latency tolerance.
12. A time synchronization device for an Internet of Things (IoT) device, characterized in that, Applied to a system including a master node and several slave nodes, the device includes: The sequence generation module is used by each slave node to obtain the sending node ID, sending node level and local reception time of the time broadcast beacon frame after receiving the time broadcast beacon frame, and to obtain an information set sequence. The node determination module is used to determine the common-view node based on the intersection of the sending nodes in the information set sequence of this slave node and the information set sequence of the upper-layer node, and to determine the time synchronization reference node based on the common-view node and the sending node hierarchy; and The synchronization calculation module is used to synchronize the slave node's time based on the time difference between the slave node and the time reference node based on the local reception time of their shared viewing node.
13. An electronic device, characterized in that, include: At least one processor; A memory connected to the at least one processor; The memory stores instructions executable by the at least one processor, which implements the time synchronization method for the Internet of Things device according to any one of claims 1 to 11 by executing the instructions stored in the memory.
14. The electronic device according to claim 13, characterized in that, The electronic device is a chip.
15. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the time synchronization method for the Internet of Things device as described in any one of claims 1 to 11.
16. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the time synchronization method for the Internet of Things device as described in any one of claims 1 to 11.