Time synchronization method applied to mobile internet and related equipment
By adopting a lightweight PTP time synchronization mechanism in the mobile Internet network, using timestamp information to calculate clock deviation and perform system time adjustment, the problem of insufficient time synchronization accuracy in the mobile Internet network is solved, and high-precision clock synchronization is achieved. Reduces hardware costs and adapts to network fluctuations.
Patent Information
- Application Number
- CN202310659284.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-12-06
AI Technical Summary
The existing NTP time synchronization protocol cannot meet the high-precision requirements in the mobile Internet network, and the application of the PTP time synchronization mechanism in the mobile Internet network is limited by the instability of hardware equipment costs and network coverage.
A lightweight PTP time synchronization mechanism is proposed. Through the master clock node and the slave clock node, the master clock node calls its own system function to record the timestamp information when the protocol message is interacted, the clock deviation is calculated and the system time is adjusted to realize clock synchronization, and filtering is used. Processing improves the accuracy of clock deviations.
It achieves higher time synchronization accuracy in mobile Internet networks, reduces hardware costs, and adapts to network fluctuations and coverage instability, improving the accuracy of clock synchronization.
Smart Images

Figure CN119094065A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a time synchronization method and related equipment applied to a mobile Internet network. Background Art
[0002] At present, the Internet widely uses the NTP (Network Time Protocol) time synchronization algorithm to improve the accuracy of the clock. The accuracy of NTP time synchronization is generally at the millisecond level, but this level of accuracy cannot meet the high-precision requirements of mobile Internet networks for time synchronization. Therefore, how to improve the time synchronization accuracy in mobile Internet networks is a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention
[0003] The embodiments of the present application respectively provide a time synchronization method applied to a mobile Internet network, a time synchronization device applied to a mobile Internet network, a mobile Internet network, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, an embodiment of the present application provides a time synchronization method applied to a mobile Internet network, wherein the mobile Internet network includes a master clock node and a slave clock node that synchronize time with each other, the method comprising: obtaining timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction; calculating the clock deviation between the master clock node and the slave clock node based on the timestamp information; and adjusting the system time of the slave clock node based on the clock deviation so that the slave clock node maintains clock synchronization with the master clock node.
[0005] In a second aspect, an embodiment of the present application provides a time synchronization device applied to a mobile Internet network, wherein the mobile Internet network includes a master clock node and a slave clock node that synchronize time with each other, and the device includes: an acquisition module, configured to obtain timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when interacting with each other via protocol messages; a calculation module, configured to calculate the clock deviation between the master clock node and the slave clock node based on the timestamp information; and a synchronization module, configured to adjust the system time of the slave clock node based on the clock deviation so that the slave clock node maintains clock synchronization with the master clock node.
[0006] In a third aspect, an embodiment of the present application provides a mobile Internet network, comprising: a master clock node and a slave clock node; a boundary clock node communicatively connected to the master clock node and the slave clock node respectively, for forwarding received protocol messages to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node; wherein the slave clock node maintains clock synchronization with the master clock node based on a clock deviation, and the clock deviation is calculated based on the timestamp information recorded by each of the master clock node and the slave clock node by calling their own system functions when interacting with each other through protocol messages.
[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the steps in the time synchronization method applied to a mobile Internet network as described above.
[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer executes the steps in the time synchronization method applied to a mobile Internet network as described above.
[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in the time synchronization method applied to a mobile Internet network as described above.
[0010] In the technical solution provided in the embodiments of the present application, the timestamp information of the master clock node and the slave clock node in the mobile Internet network is recorded by calling their own system functions when the clock nodes of both parties interact with each other via protocol messages. That is, the recording of the timestamp does not depend on the hardware level of the master and slave clock nodes, so that the recorded timestamp has higher accuracy, thereby being able to calculate a more accurate clock deviation, thereby making the clock synchronization accuracy between the master and slave clock nodes higher.
[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a schematic diagram of an exemplary process of protocol message interaction between master and slave clock nodes;
[0013] Figure 2 A flowchart of an exemplary time synchronization algorithm is shown;
[0014] Figure 3A flow chart illustrating a time synchronization method applied to a mobile Internet network;
[0015] Figure 4 A flow chart illustrating another method for time synchronization applied to a mobile Internet network;
[0016] Figure 5 A flowchart illustrating another method for time synchronization applied to a mobile Internet network is shown;
[0017] Figure 6 A flow chart illustrating another method for time synchronization applied to a mobile Internet network;
[0018] Figure 7 A flow chart illustrating another method for time synchronization applied to a mobile Internet network;
[0019] Figure 8 An example of a mobile Internet network deployment architecture diagram using a base station as a master clock node is provided;
[0020] Fig. 9 An example of a mobile Internet network deployment architecture diagram using a public cloud platform as the master clock node is provided;
[0021] Fig.10 An example of a mobile Internet network deployment architecture diagram using a private cloud platform as the master clock node is provided;
[0022] Fig.11 A block diagram of a time synchronization device applied to a mobile Internet network is shown;
[0023] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0025] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0026] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0027] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0028] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. The terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0029] First of all, it should be noted that emerging mobile applications involving distributed control and sensing require accurate time synchronization through wireless links. In a distributed system, due to physical dispersion, the system cannot provide a unified global clock for independent modules, and each process or module maintains its own local clock. Due to the inconsistency of the timing rate and operating environment of these local clocks, even if all local clocks are calibrated at a certain moment, these local clocks will be inconsistent after a period of time. In order for these local clocks to reach the same time value again, time synchronization operations must be performed.
[0030] At present, the widely used time synchronization algorithm in data packet switching networks is to use time information packet switching technology, that is, how to improve the accuracy of inaccurate clocks by exchanging time information. The Internet widely uses the NTP time synchronization algorithm to improve the accuracy of clocks, but the accuracy of NTP time synchronization is generally at the millisecond level, which cannot meet the high-precision requirements of 4G / 5G (4th / 5th Generation Mobile Communication Technology) or even higher versions of mobile Internet networks for time synchronization.
[0031] Industrial Ethernet widely uses the PTP (Precision Time Protocol) time synchronization algorithm to improve the accuracy of the clock. The accuracy of PTP time synchronization can be controlled within the microsecond range under certain conditions, so the accuracy of PTP time synchronization is much higher than that based on the NTP time synchronization protocol. However, on the one hand, an important reason for the high accuracy of PTP time synchronization is that the timestamp depends on the hardware network equipment in the industrial Ethernet, and has high requirements for the hardware network equipment. The timestamp generated at the position closest to the physical layer has the highest accuracy. The existing hardware equipment in the mobile Internet network generally cannot support the timestamp required for PTP time synchronization. If the hardware equipment in the mobile Internet network is replaced, it will be a huge cost, which makes it impossible to copy the PTP time synchronization mechanism used by the industrial Ethernet to the mobile Internet network for application. On the other hand, since the use of the PTP time synchronization mechanism in industrial Ethernet is within the local area network, that is, industrial Ethernet implements PTP time synchronization within the local area network, the local area network generally has the characteristic of consistent upstream and downstream data transmission delays, which makes the clock deviation error obtained based on the PTP time synchronization mechanism smaller, thereby obtaining higher time synchronization accuracy. However, due to the larger network coverage of the mobile Internet network, the transmission delay of upstream and downstream data is often unstable, which also makes it impossible to copy the PTP time synchronization mechanism adopted by industrial Ethernet to the mobile Internet network for application.
[0032] Based on at least the above two reasons, the inventor of the present application has uniquely conceived of proposing a lightweight PTP time synchronization mechanism, so that the lightweight PTP time synchronization mechanism can be applied to mobile Internet networks and enable mobile Internet networks to obtain higher time synchronization accuracy.
[0033] Before describing the lightweight PTP time synchronization mechanism proposed in this application, several related technical terms are introduced:
[0034] PTP domain: refers to a mobile Internet network that uses the lightweight PTP time synchronization mechanism. There is only one synchronization clock in the domain, and all devices in the domain are synchronized with the synchronization clock;
[0035] Clock node: refers to the node in the PTP domain;
[0036] Master clock node and slave clock node: A pair of mutually synchronized clock nodes exist in a master-slave relationship. The clock node that publishes the synchronized time is called the master clock node, and the clock node that receives the synchronized time is called the slave clock node. The slave clock node adjusts the local time according to the clock deviation to achieve time synchronization with the master clock node.
[0037] Boundary clock node: A node used to forward protocol messages between the master clock node and the slave clock node. In mobile Internet networks, boundary clock nodes are not necessary and need to be deployed according to actual needs.
[0038] The lightweight PTP time synchronization mechanism proposed in this application needs to obtain the timestamp information recorded by the master clock node and the slave clock node by calling their own system functions when interacting with protocol messages, and then calculate the clock deviation between the master clock node and the slave clock node based on the obtained timestamp information, and finally adjust the system time of the slave clock node based on the clock deviation, so that the slave clock node and the master clock node maintain clock synchronization.
[0039] Figure 1 is a schematic diagram of an exemplary process of protocol message interaction between master and slave clock nodes. Figure 1 As can be seen from the interaction process shown, the master clock node first initiates the Sync_master message. At this time, the master clock node will call its own system function to record the sending timestamp t1 of the protocol message, and carry the timestamp t1 in the Sync_master message. Next, the boundary clock node forwards the Sync_salve message to the slave clock node. After receiving the Sync_salve message, the slave clock node records the timestamp t2 of the received message, and also sends a Delay_Req_slave message to the boundary clock node, and accordingly records the timestamp t3 of the sent message. The boundary clock node forwards the Delay_Req_master message to the master clock node. After receiving the Delay_Req_master message, the master clock node records the timestamp t4 of the received message, and replies with a Delay_Resq_master message carrying the timestamp t4.
[0040] Or as an optional implementation, the master clock node may not carry the timestamp t1 in the Sync_master message, but instead send a Fllow_Up message carrying the timestamp t1 immediately after sending the Sync_master message, and the boundary clock node forwards this message to the slave clock node.
[0041] Based on the interaction process shown above, the slave clock node obtains the timestamp information recorded by the master clock node and the slave clock node by calling their own system functions when performing protocol message interaction, that is, timestamps t1-t4.
[0042] Based on the acquired timestamps t1-t4, the slave clock node can calculate the clock deviation between the master clock node and the slave clock node based on the formula "|[(t4-t3)-(t2-t1)] / 2|". Among them, "|(t4-t3)-(t2-t1)|" is understood as the round-trip delay difference of the data packet, that is, the absolute value of the difference between the upstream delay and the downstream delay. Based on this clock deviation, the slave clock node can adjust its own system time so that it can maintain clock synchronization with the master clock node.
[0043] In addition, considering that in actual application environments, mobile Internet networks are prone to network fluctuations, such as uncertain delay jitter caused by the operating system and protocol stack, and channel congestion caused by task running and communication traffic, the clock deviation calculated based on the above method may have a large possible error, resulting in low accuracy. Therefore, the above method of obtaining the clock deviation needs to be improved.
[0044] Figure 2 A flowchart of an exemplary time synchronization algorithm is shown. Figure 2 As shown, the time synchronization module is used to execute the clock deviation calculation recorded in the aforementioned method, and the filtering module is used to perform filtering processing on the input signal. The specific process of the time synchronization algorithm is as follows: after the time synchronization module obtains the clock deviation offset for the first time, it is necessary to determine whether the clock deviation has been filtered. If it is determined to be no, the timestamp information used to calculate the clock deviation needs to be input into the filtering module for filtering processing. The timestamp information after filtering processing is re-input into the time synchronization module to calculate the clock deviation. The clock deviation obtained at this time is used as the final clock deviation between the master clock node and the slave clock node, and the local time of the slave clock node is adjusted. The time synchronization module and the filtering module are both software modules, which respectively contain a program for executing and realizing the clock deviation calculation and a program for filtering processing.
[0045] It is understandable that, as mentioned above, since the mobile Internet is prone to network fluctuations, the accuracy of the clock deviation initially calculated by the time synchronization module is not high, so it is necessary to filter the timestamp information so that the filtered timestamp information can represent a relatively stable network state, thereby obtaining a more accurate clock deviation. The filtering method used by the filtering module can be Kalman filtering or other filtering methods, which are not limited here.
[0046] It can be understood that Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the system input and output observation data. Since the observation data includes the influence of noise and interference in the system, the optimal estimation can be regarded as a filtering process. When the filtering module uses the Kalman filter, the observation data is the timestamp information before filtering, and the timestamp information after filtering is the optimal estimated data.
[0047] It can be seen from the above that in the lightweight PTP time synchronization mechanism proposed in this application, compared with the PTP protocol used in industrial Ethernet, it does not need to rely on hardware devices to record timestamps, but records timestamps by calling its own system functions through the clock node, which will not increase the hardware cost of the mobile Internet network. It only needs to transplant the relevant software programs in the operating system of the clock node. The deployment and implementation are simple, so it is very suitable for mobile scenarios in mobile Internet networks. Moreover, compared with recording timestamps at the physical layer of hardware devices, the clock node uses software programs to record timestamps, which can reduce the error of timestamps to a certain extent, that is, the accuracy of the recorded timestamps is higher, so it is more conducive to obtaining a clock deviation with higher accuracy.
[0048] Based on the lightweight PTP time synchronization mechanism proposed in this application, Figure 3 The embodiment shown provides a time synchronization method applied to a mobile Internet network. The mobile Internet network includes a master clock node and a slave clock node that synchronize time with each other, and the method is executed by the slave clock node. Figure 3 As shown, in an exemplary embodiment, the time synchronization method applied to the mobile Internet network includes S310-S330, which are described in detail as follows:
[0049] S310, obtaining timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction.
[0050] In a mobile Internet network, since the master clock node and the slave clock node need to synchronize time with each other, a communication protocol is agreed upon in advance between the master clock node and the slave clock node, and protocol messages are exchanged according to this protocol, so that the slave clock node can obtain the timestamp information recorded when the two clock nodes exchange protocol messages.
[0051] It should be emphasized that the timestamp information obtained from the clock node is recorded by the master clock node and the slave clock node by calling their own system functions. That is, the recording of the timestamp does not depend on the hardware level of the master clock node and the slave clock node, but is recorded through the software program, which makes the recorded timestamp more accurate.
[0052] It should also be noted that, for the detailed process of protocol message interaction between the master clock node and the slave clock node, please refer to the aforementioned record of the lightweight PTP time synchronization mechanism proposed in this application, and this embodiment will not be repeated here.
[0053] S320, calculating the clock deviation between the master clock node and the slave clock node according to the timestamp information.
[0054] As described above, the timestamp information obtained from the slave clock node includes the first sending time t1 recorded when the master clock node sends a protocol message to the slave clock node, the first receiving time t2 recorded when the slave clock node receives the protocol message, the second sending time t3 recorded when the slave clock node returns a response message to the master clock node, and the second receiving time t4 recorded when the master clock node receives the response message.
[0055] The clock deviation between the master clock node and the slave clock node can be understood as half of the difference between the upstream delay and the downstream delay of the data packet. Therefore, the clock deviation can be calculated based on the timestamp information, that is, "|[(t4-t3)-(t2-t1)] / 2|".
[0056] S330: Adjust the system time of the slave clock node according to the clock deviation, so that the slave clock node maintains clock synchronization with the master clock node.
[0057] The slave clock node adjusts its own system time according to the calculated clock deviation, so that the slave clock node maintains clock synchronization with the master clock node. Exemplarily, the slave clock node first determines whether its own clock is ahead or behind the master clock, and then compensates the system time of the master clock node according to the value of the clock deviation.
[0058] Regarding the judgment of whether the slave clock is ahead or behind the master clock, for example, it can be determined by the positive or negative value of "(t4-t3)-(t2-t1)". If its value is a positive number, it means that the slave clock is ahead of the master clock, so the system time of the slave clock node needs to be adjusted back by the time corresponding to the clock deviation; otherwise, it means that the slave clock is behind the master clock, and the system time of the slave clock node needs to be adjusted forward by the time corresponding to the clock deviation.
[0059] It can be seen that in this embodiment, the timestamp information of the master clock node and the slave clock node in the mobile Internet network is recorded by calling their own system functions when the clock nodes of both parties interact with each other through protocol messages. That is, the recording of the timestamp does not depend on the hardware level of the master and slave clock nodes, so that the recorded timestamp has higher accuracy, so that a more accurate clock deviation can be calculated, and the clock synchronization accuracy between the master and slave clock nodes is higher.
[0060] In another exemplary embodiment, Figure 4 As shown, the time synchronization method applied to the mobile Internet network further includes S410-S430, which are described in detail as follows:
[0061] S410, determining whether the clock deviation has been filtered to obtain a determination result.
[0062] Based on the above records, in actual application environments, mobile Internet networks are prone to network fluctuations, such as uncertain delay jitter caused by the operating system and protocol stack, and channel congestion caused by task operation and communication traffic, which results in a large possible error in the clock deviation calculated by S320, resulting in a problem of low accuracy. Therefore, this embodiment also needs to determine whether the clock deviation has been filtered to obtain a corresponding determination result.
[0063] S420: If the judgment result indicates that the clock deviation has not been filtered, the timestamp information is sent to a filtering module for filtering to obtain filtered timestamp information.
[0064] If the judgment result indicates that the clock deviation has not been filtered, it means that the timestamp information previously used to calculate the clock deviation may contain a timestamp recorded under network fluctuations, resulting in an error in the calculated clock deviation. Therefore, the timestamp information needs to be sent to the filtering module for filtering. The filtered timestamp information obtained includes the estimated timestamp information, which corresponds to the timestamp information recorded when the network status is stable.
[0065] S430: Update the clock deviation between the master clock node and the slave clock node based on the filtered timestamp information.
[0066] Since the timestamp information after filtering represents the stable state of the network, the clock deviation is recalculated based on the timestamp information after filtering, and this clock deviation can be used as the final clock deviation to adjust the system time of the slave clock node, thereby realizing the update of the clock deviation between the master clock node and the slave clock node.
[0067] It should be noted that the clock deviation calculated based on the filtered timestamp information may carry a preset label, which is used to describe that the corresponding clock deviation has been filtered, thereby facilitating the determination in S410 whether the clock deviation has been filtered.
[0068] From this, it can be seen that the method proposed in this embodiment increases the judgment of whether the clock deviation has been filtered, filters the timestamp information when it is judged that it has not been filtered, and recalculates the clock deviation based on the filtered timestamp information. This can make the clock deviation based on which the slave clock node adjusts its own system time more accurate, thereby improving the clock synchronization accuracy between the master clock node and the slave clock node.
[0069] In another exemplary embodiment, the time synchronization method applied to the mobile Internet network also includes a step of determining whether the clock deviation between the master clock node and the slave clock node is greater than a preset compensation threshold. When the judgment is yes, it means that the deviation degree corresponding to the clock deviation is higher than the critical value, so the step content of S330 needs to be executed, that is, when the clock deviation between the master clock node and the slave clock node is greater than the preset compensation threshold, the system time of the master clock node is adjusted according to the clock deviation to achieve clock synchronization between the master and slave clock nodes. When the judgment is no, it means that the deviation degree corresponding to the clock deviation is lower than the critical value, so at this time, it can be chosen not to adjust the system time of the master clock node. Thus, a more flexible clock synchronization scheme is provided, so that it is possible to choose whether to adjust the system time of the master clock node according to the degree of clock deviation.
[0070] In another exemplary embodiment, Figure 5 As shown, the time synchronization method applied to the mobile Internet network also includes the following steps:
[0071] S510, detecting the network status of the mobile Internet network;
[0072] S520: Dynamically adjust the system time of the slave clock node according to the detected network status.
[0073] Considering that the network status of the mobile Internet network may affect the accuracy of the clock deviation, the embodiment of the present application further proposes a solution for dynamically adjusting the system time of the slave clock node according to the network status of the mobile Internet network.
[0074] In S510, the network status of the mobile Internet network includes, for example, at least one of SINR (Signal to Interference plus Noise Ratio), RSSI (Received Signal Strength Indicator), RSRP (Reference Signal Receiving Quality), RSRQ (Reference Signal Receiving Power), throughput, latency, and jitter value, and is not limited here.
[0075] In S520, the network quality level of the mobile Internet network can be determined according to the detected network status, and then the system time of the slave clock is adjusted according to the network quality level and using the time amount corresponding to the network quality level. For example, if the network quality level of the mobile Internet network is determined to be the first level, it means that the mobile Internet network status is stable, so no additional adjustment is made to the system time of the slave clock; if the network quality level of the mobile Internet network is determined to be the second level, it means that the mobile Internet network status is relatively stable, so the system time of the slave clock is adjusted by a first time amount; if the network quality level of the mobile Internet network is determined to be the third level, it means that the mobile Internet network status is unstable, so the system time of the slave clock is adjusted by a second time amount, wherein the second time amount is greater than the first time amount, and the first time amount and the second time amount are preset values.
[0076] As an exemplary implementation, after adjusting the system time of the slave clock node according to the clock deviation, the system time of the slave clock node is adjusted again according to the detected network status. This is equivalent to adjusting the system time of the slave clock node based on the clock deviation and then fine-tuning the system time of the slave clock node based on the detected network status.
[0077] As another exemplary implementation, in the process of adjusting the system time of the slave clock node according to the clock deviation, the system time of the slave clock node is adjusted based on the detected network status and the clock deviation. For example, after determining the amount of time required to adjust the system time of the slave clock according to the detected network status, first determine the size relationship between the amount of time and the amount of time corresponding to the clock deviation. If it is greater than, the system time of the slave clock node is adjusted according to the amount of time; if it is less than, the system time of the slave clock node is adjusted according to the clock deviation.
[0078] It can be seen that the method of the present application not only adjusts the system time of the slave clock node based on the clock deviation, but also dynamically adjusts the system time of the slave clock node according to the network status of the mobile Internet network, so as to avoid the impact of unstable network status on time synchronization and further improve the accuracy of time synchronization.
[0079] In another exemplary embodiment, Figure 6 As shown, the time synchronization method applied to the mobile Internet network also includes the following steps:
[0080] S610, determining an optimal synchronization period for the network state according to the detected network state;
[0081] And, S310 specifically includes the following contents:
[0082] The timestamp information recorded by the master clock node and the slave clock node during protocol message interaction is obtained within a synchronization cycle with an optimal network status.
[0083] First of all, it should be explained that, as an exemplary implementation, the network status of the mobile Internet network will be periodically detected, so the optimal network status within a certain length of time can be determined, and the period corresponding to this optimal network status is used as the synchronization period in S610. For example, in the process of periodically detecting the network status of the mobile Internet network, the network status detected in each period will be recorded accordingly, and the protocol message interaction between the master clock node and the slave clock node will be performed in each period. For the currently recorded optimal network status, if the network status in the most recent preset periods is lower than this, the corresponding period can be determined as the synchronization period with the optimal network status, and the clock deviation can be calculated based on the timestamp information in this period.
[0084] As another exemplary implementation, the network status of the mobile Internet network is still detected periodically, and then the cycle of the optimal network status is predicted based on the detected network status in the continuous cycle. When this cycle is reached, the timestamp information used to calculate the clock deviation can be obtained by performing protocol message interaction between the master clock node and the slave clock node in this cycle.
[0085] Therefore, S310 performs protocol message interaction between the master clock node and the slave clock node within the synchronization cycle with the optimal network status.
[0086] It can be seen that the method provided in this embodiment avoids the influence of poor network status on clock deviation, so that the timestamp information recorded by the master clock node and the slave clock node respectively has higher accuracy, thereby being able to further improve the time synchronization accuracy in the mobile Internet network.
[0087] In another exemplary embodiment, Figure 7 As shown, the time synchronization method applied to the mobile Internet network also includes the following steps:
[0088] S710, controlling the master clock node and the slave clock node to perform protocol message interaction again, so as to obtain the clock deviation between the master clock node and the slave clock node again;
[0089] S720: Verify the current time synchronization accuracy of the mobile Internet network according to the clock deviation obtained again.
[0090] This embodiment controls the master clock node and the slave clock node to interact with each other through protocol messages again after adjusting the system time of the slave clock node according to the clock deviation, so as to obtain the clock deviation between the master clock node and the slave clock node again, so as to verify whether the mobile Internet network currently maintains the master-slave clock synchronization based on the clock deviation obtained again. Specifically, if the clock deviation obtained again is less than the preset value, it means that the mobile Internet network currently maintains the master-slave clock synchronization, so no additional processing is required; if the clock deviation obtained again is greater than or equal to the preset value, it means that the mobile Internet network currently still does not maintain the master-slave clock synchronization, so the system time of the slave clock node can be re-adjusted according to the re-obtained clock deviation, or the clock deviation can be re-obtained in the manner described in the above embodiment, and the system time of the slave clock node can be re-adjusted according to the re-obtained clock deviation.
[0091] It can be seen that this embodiment can further ensure the time synchronization accuracy in the mobile Internet network by providing a verification method after adjusting the system time of the slave clock node and re-adjusting the master-slave clock synchronization when the verification fails.
[0092] Based on the lightweight PTP time synchronization mechanism proposed in the present application, an embodiment of the present application also provides a mobile Internet network, which includes a master clock node, a slave clock node and a boundary clock node. The boundary clock node is respectively connected to the master clock node and the slave clock node for communication, and is used to forward the received protocol message to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node. The slave clock node maintains clock synchronization with the master clock node based on the clock deviation, and the clock deviation is calculated by calling the timestamp information recorded by each of the master clock node and the slave clock node when the protocol message is interacted.
[0093] In actual deployment applications of mobile Internet networks, multiple sets of master-slave relationships are usually included, and each master-slave relationship is constructed by a master clock node, a boundary clock node and a slave clock node, or by a master clock node and a slave clock node.
[0094] Exemplarily, the master clock node can be deployed as a base station, a public cloud platform or a private cloud platform. If the master clock node is deployed as a public cloud platform, the boundary clock node can communicate with any master clock node in the mobile Internet network, and the master clock nodes can establish a communication connection. If the master clock node is deployed as a private cloud platform, the boundary clock node can establish a communication connection with the master clock node in the same local area network.
[0095] In order to facilitate understanding of the above-mentioned actual deployment and application of the mobile Internet network, the relevant deployment and application will be explained below with reference to the accompanying drawings.
[0096] See first Figure 8 , Figure 8 An example of a mobile Internet network deployment architecture diagram with a base station as the master clock node is provided, and the mobile Internet network provides a clock source through a GPS (Global Positioning System) server. Specifically, the base station is, for example, a 4G / 5G base station, and a master clock program is deployed in the base station. It can be understood that the master clock program contains programs related to the protocol message interaction between the master clock node and the slave clock node, such as calling its own system function to record the relevant timestamps in the process of protocol message interaction between the master clock node and the slave clock node.
[0097] A boundary clock program may be deployed in the road side unit (RSU), and the boundary clock program is used to forward the received protocol message to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node. Therefore, the road side unit also serves as a boundary clock node. Correspondingly, a slave clock program is deployed in the vehicle terminal, and the slave clock program includes programs related to the protocol message interaction between the master clock node and the slave clock node, such as calling its own system function to record the relevant timestamps during the protocol message interaction between the master clock node and the slave clock node, and a program to adjust its own system time according to the calculated clock deviation, so the vehicle terminal is used as a slave clock node. Exemplarily, the road side unit and the vehicle terminal can communicate through the PC5 mode, and the PC5 mode is understood as communicating with the road side equipment through the PC5 interface of the vehicle terminal.
[0098] The vehicle terminal, as a slave clock node, can also communicate directly with the master clock node, such as Figure 8 As shown, the vehicle-mounted terminal can communicate with the base station via the UU mode, and the UU mode is understood as communicating with the base station via the UU interface of the vehicle-mounted terminal.
[0099] Fig. 9The following is a schematic diagram of a mobile Internet network deployment architecture that uses a public cloud platform as the master clock node. The mobile Internet network provides a clock source through a GPS server or a Linux server. It is understandable that a public cloud platform usually refers to a cloud service platform that can be used by a third-party provider. The core attribute of a public cloud is shared resource services. Therefore, a mobile Internet network deployed based on a shared cloud platform is generally an open network architecture.
[0100] like Fig. 9 As shown, in this exemplary mobile Internet network, the roadside unit can still be deployed as a boundary clock node, and the vehicle-mounted terminal can still be deployed as a slave clock node. It can be seen that the boundary clock node can establish a communication connection with any public cloud platform, and communication connections can also be established between different public cloud platforms. The same vehicle-mounted terminal can establish communication connections with the roadside unit and the public cloud platform at the same time, thereby deploying an open network architecture.
[0101] Fig.10 The following is a diagram of a mobile Internet network deployment architecture that uses a private cloud platform as the master clock node. The mobile Internet network still provides the clock source through a GPS server or a Linux server. It can be understood that a private cloud platform is a cloud service platform built for a single customer to provide customers with the most effective control over data, security, and service quality. The core attribute of a private cloud is exclusive resource services, so the mobile Internet network deployed based on a private cloud platform is generally a non-open network architecture.
[0102] like Fig.10 As shown, the vehicle-mounted terminal, as a slave clock node, can still establish a communication connection with the master clock node through the boundary clock node in the same local area network, or directly establish a communication connection with the master clock node in the same local area network, thereby realizing the privatization service of resource data within the restrictions of the same local area network.
[0103] Therefore, by Figure 8-Figure 10 It can be seen that the mobile Internet network proposed in this embodiment deploys the lightweight PTP time synchronization mechanism proposed in this application, which proves that the lightweight PTP time synchronization mechanism proposed in this application can be applied to mobile scenarios such as 4G / 5G, and has the advantages of convenient deployment, obtaining clock deviation does not rely on hardware, and can achieve good time synchronization accuracy without the help of hardware.
[0104] Fig.11 FIG. 1 is a block diagram of a time synchronization device applied to a mobile Internet network, shown as an exemplary embodiment of the present application. Fig.11 As shown, the exemplary time synchronization device 1100 applied to a mobile Internet network includes:
[0105] The acquisition module 1110 is configured to acquire the timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction;
[0106] A calculation module 1120, configured to calculate a clock deviation between a master clock node and a slave clock node according to the timestamp information;
[0107] The synchronization module 1130 is configured to adjust the system time of the slave clock node according to the clock deviation so that the slave clock node maintains clock synchronization with the master clock node.
[0108] In another exemplary embodiment, the time synchronization device 1100 applied to the mobile Internet network further includes a filtering processing module, and the filtering processing module is configured to perform the following steps:
[0109] Determine whether the clock deviation has been filtered to obtain a determination result;
[0110] If the judgment result indicates that the clock deviation has not been filtered, the timestamp information is sent to the filtering module for filtering to obtain the filtered timestamp information;
[0111] The clock deviation between the master clock node and the slave clock node is updated based on the filtered timestamp information.
[0112] In another exemplary embodiment, the time synchronization device 1100 applied to the mobile Internet network also includes a judgment module, which is configured to judge whether the clock deviation between the master clock node and the slave clock node is greater than a preset compensation threshold, and jump to the synchronization module 1130 to execute corresponding steps when the judgment is yes.
[0113] In another exemplary embodiment, the time synchronization device 1100 applied to the mobile Internet network further includes a dynamic adjustment module, and the dynamic adjustment module is configured to perform the following steps:
[0114] Detect the network status of the mobile Internet;
[0115] The system time of the slave clock node is dynamically adjusted according to the detected network status.
[0116] In another exemplary embodiment, the dynamic adjustment module is further configured to perform the following steps:
[0117] After adjusting the system time of the slave clock node according to the clock deviation, the system time of the slave clock node is adjusted again according to the detected network status;
[0118] Alternatively, in the process of adjusting the system time of the slave clock node according to the clock deviation, the system time of the slave clock node is adjusted based on the detected network status and the clock deviation.
[0119] In another exemplary embodiment, the time synchronization device 1100 applied to the mobile Internet network further includes a control module, and the control module is configured to perform the following steps:
[0120] Determine the optimal synchronization period for the network status according to the detected network status;
[0121] The timestamp information recorded by the master clock node and the slave clock node during protocol message interaction is obtained within a synchronization cycle with an optimal network status.
[0122] In another exemplary embodiment, the time synchronization device 1100 applied to the mobile Internet network further includes a verification module, and the verification module is configured to perform the following steps:
[0123] Control the master clock node and the slave clock node to perform protocol message interaction again, so as to obtain the clock deviation between the master clock node and the slave clock node again;
[0124] The current time synchronization accuracy of the mobile Internet network is verified based on the re-obtained clock deviation.
[0125] In another exemplary embodiment, the mobile Internet network further includes a boundary clock node, and the boundary clock node is used to forward the received protocol message to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node.
[0126] In another exemplary embodiment, the timestamp information includes a first sending time recorded by the master clock node when sending a protocol message to the slave clock node, a first receiving time recorded by the slave clock node when receiving the protocol message, a second sending time recorded by the slave clock node when returning a response message to the master clock node, and a second receiving time recorded by the master clock node when receiving the response message.
[0127] In the time synchronization device applied to the mobile Internet network provided by the above-mentioned embodiments, the timestamp information of the master clock node and the slave clock node respectively is recorded by calling their own system functions when the clock nodes of both parties interact with each other via protocol messages. That is, the recording of the timestamp does not depend on the hardware level of the master and slave clock nodes, so that the recorded timestamp has higher accuracy, thereby being able to calculate a more accurate clock deviation, thereby making the clock synchronization accuracy between the master and slave clock nodes higher.
[0128] It should be noted that the time synchronization device applied to the mobile Internet network provided in the above embodiment and the time synchronization method applied to the mobile Internet network provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In actual application, the time synchronization device applied to the mobile Internet network provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0129] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the time synchronization method applied to a mobile Internet network provided in the above-mentioned embodiments.
[0130] Fig.12 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0131] like Fig.12 As shown, it includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method described in the above embodiment. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0132] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that a computer program read therefrom is installed into the storage section as needed.
[0133] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0134] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer program contained in the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0135] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0137] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the time synchronization method applied to a mobile Internet network as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0138] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the time synchronization method applied to a mobile Internet network provided in each of the above embodiments.
[0139] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
[0140] It should also be noted that in the specific implementation of this application, related data such as timestamp information and network status are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
Claims
1. A time synchronization method applied to a mobile Internet network, It is characterized in that The mobile internet network includes a master clock node and a slave clock node that synchronize time with each other, and the method includes: Acquire timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction; Calculate the clock deviation between the master clock node and the slave clock node according to the timestamp information; The system time of the slave clock node is adjusted according to the clock deviation so that the slave clock node maintains clock synchronization with the master clock node.
2. The method according to claim 1, It is characterized in that The method further comprises: Determine whether the clock deviation has been filtered to obtain a determination result; If the judgment result indicates that the clock deviation has not been filtered, the timestamp information is sent to a filtering module for filtering to obtain filtered timestamp information; The clock deviation between the master clock node and the slave clock node is updated based on the filtered timestamp information.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: Determine whether the clock deviation between the master clock node and the slave clock node is greater than a preset compensation threshold; If the judgment is yes, the step of adjusting the system time of the slave clock node according to the clock deviation so that the slave clock node maintains clock synchronization with the master clock is performed.
4. The method according to claim 1, It is characterized in that The method further comprises: Detecting the network status of the mobile Internet network; The system time of the slave clock node is dynamically adjusted according to the detected network status.
5. The method according to claim 4, It is characterized in that The dynamically adjusting the system time of the slave clock node according to the detected network status includes: After the system time of the slave clock node is adjusted according to the clock deviation, the system time of the slave clock node is adjusted again according to the detected network status.
6. The method according to claim 4, It is characterized in that The dynamically adjusting the system time of the slave clock node according to the detected network status includes: In the process of adjusting the system time of the slave clock node according to the clock deviation, the system time of the slave clock node is adjusted based on the detected network status and the clock deviation.
7. The method according to claim 4, It is characterized in that The method further comprises: Determine the optimal synchronization period for the network status according to the detected network status; The timestamp information recorded by the master clock node and the slave clock node respectively when performing protocol message interaction is obtained within the synchronization period in which the network status is optimal.
8. The method according to claim 1, It is characterized in that After adjusting the system time of the slave clock node according to the clock deviation so that the slave clock node maintains clock synchronization with the master clock, the method further includes: Controlling the master clock node and the slave clock node to perform protocol message interaction again, so as to obtain the clock deviation between the master clock node and the slave clock node again; The current time synchronization accuracy of the mobile Internet network is verified based on the re-obtained clock deviation.
9. The method according to claim 1, It is characterized in that The mobile Internet network also includes a boundary clock node, and the boundary clock node is used to forward the received protocol message to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node.
10. The method according to claim 1, It is characterized in that The timestamp information includes a first sending time recorded when the master clock node sends a protocol message to the slave clock node, a first receiving time recorded when the slave clock node receives the protocol message, a second sending time recorded when the slave clock node returns a response message to the master clock node, and a second receiving time recorded when the master clock node receives the response message.
11. A mobile Internet network, It is characterized in that include: Master clock node and slave clock node; A boundary clock node that is communicatively connected to the master clock node and the slave clock node respectively, and is used to forward received protocol messages to the master clock node or the slave clock node during the process of protocol message interaction between the master clock node and the slave clock node; The slave clock node maintains clock synchronization with the master clock node based on a clock deviation, wherein the clock deviation is calculated based on timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction.
12. The mobile Internet network according to claim 11, It is characterized in that The mobile internet network includes multiple groups of master-slave relationships, each group of master-slave relationships is constructed by a master clock node, a boundary clock node and a slave clock node, or by a master clock node and a slave clock node; The master clock node is deployed as a base station, a public cloud platform or a private cloud platform; If the master clock node is deployed as a public cloud platform, the boundary clock node can be connected to any master clock node in the mobile Internet network, and the master clock nodes can establish communication connections with each other; If the master clock node is deployed as a private cloud platform, the boundary clock node can establish a communication connection with the master clock node in the same local area network.
13. A time synchronization device for mobile Internet network, It is characterized in that The mobile internet network includes a master clock node and a slave clock node that synchronize time with each other, and the device includes: An acquisition module configured to acquire timestamp information recorded by the master clock node and the slave clock node respectively by calling their own system functions when performing protocol message interaction; A calculation module, configured to calculate a clock deviation between the master clock node and the slave clock node according to the timestamp information; The synchronization module is configured to adjust the system time of the slave clock node according to the clock deviation so that the slave clock node maintains clock synchronization with the master clock node.
14. An electronic device, It is characterized in that include: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the time synchronization method applied to a mobile Internet network as described in any one of claims 1 to 10.
15. A computer-readable storage medium, It is characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the time synchronization method applied to a mobile Internet network as described in any one of claims 1 to 10.
Citation Information
Cited By
Time synchronization method in SRB network and related device
CN119342574A
