A time synchronization method, system, fault injection device, and storage medium

By exchanging messages between the fault injection device and the main control device, filtering the ΔC time interval, and updating the device clock using the synchronization source clock Ts, the problem of insufficient time synchronization accuracy is solved, and high-precision time synchronization is achieved.

CN115913437BActive Publication Date: 2026-03-06BEIJING WATERTEK INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211542687.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2026-03-06
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

When achieving time synchronization between the fault injection device and the main control device, existing technologies cannot guarantee high-precision time synchronization.

Method used

By exchanging messages with the master control device N times, the time intervals ΔT and ΔC are obtained. ΔC that meets the accuracy requirements is selected, and the clock of this device is updated using the synchronization source clock Ts to achieve time synchronization.

Benefits of technology

It improves the time synchronization accuracy between the controlled equipment and the master control equipment, ensuring the accuracy and consistency of time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913437B_ABST
    Figure CN115913437B_ABST
Patent Text Reader

Abstract

A time synchronization method, system, fault injection device, and storage medium are disclosed. The method is applied to a device connected to a master control device via Ethernet and requiring time synchronization. The method includes: performing N message interactions with the master control device; each message interaction acquiring information including: the time interval ΔT from when the master control device sends a message to the device and when the device receives a feedback message from the device; and the time interval ΔC from when the device sends a message to the master control device and when the device receives a feedback message from the master control device; N is a preset value, N≥1; determining whether the corresponding ΔC meets the accuracy requirements based on the ΔT obtained from each message interaction; determining the time T for the message to be transmitted from the master control device to the device based on all ΔC values ​​that meet the accuracy requirements; and updating the device's clock based on the synchronization source clock Ts obtained from the master control device, according to Ts and T, to achieve time synchronization with the master control device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to time synchronization technology, and more particularly to a time synchronization method, system, fault injection device, and storage medium. Background Technology

[0002] With technological advancements and increasing demands, equipment functions are becoming increasingly complex, necessitating testability techniques to ensure accurate and effective performance. In testability techniques, a fault injection device, under the control of a master device, injects faults into the device under test. Since the injected faults must be delivered according to a strict timing sequence, the fault injection device and the master device must maintain time synchronization. Summary of the Invention

[0003] This application provides a time synchronization method, system, fault injection device, and storage medium that can achieve time synchronization between the controlled device and the master device.

[0004] The time synchronization method provided in this application is applied to devices that are connected to a master control device via Ethernet and need to achieve time synchronization. The method includes:

[0005] The device performs N message interactions with the master control device. The information obtained in each message interaction includes: the time interval ΔT from when the master control device sends a message to this device to when it receives a feedback message from this device, and the time interval ΔC from when this device sends a message to the master control device to when it receives a feedback message from the master control device; N is a preset value, N≥1;

[0006] Based on the ΔT obtained from each message interaction, determine whether the corresponding ΔC meets the accuracy requirements;

[0007] The time T for the transmission of messages from the master control device to this device is determined based on all ΔC values ​​that meet the accuracy requirements;

[0008] After obtaining the synchronization source clock Ts from the master control device, the clock of this device is updated according to Ts and T to achieve time synchronization with the master control device.

[0009] In one exemplary embodiment, the method for obtaining ΔT includes:

[0010] Receive a first message sent by the main control device, wherein the first message carries the sending time of the message;

[0011] The sending time of the first message is sent to the main control device via a second message;

[0012] The master control device receives a feedback message for the second message, which carries a ΔT determined by the master control device based on the difference between the time the second message is received and the time the first message is sent.

[0013] In one exemplary embodiment, the method for obtaining ΔC includes:

[0014] Send a third message to the main control device and record the sending time information Cs;

[0015] The system receives a feedback message from the main control device regarding the third message and records the reception time information Cr.

[0016] Cr-Cs is used as the ΔC;

[0017] The second message and the third message may be the same message or different messages.

[0018] In an exemplary embodiment, the transmission time information Cs and the reception time information Cr are count values ​​of the local device's clock counter, and the accuracy of the local device's clock counter is higher than the timing accuracy of the main control device.

[0019] In one exemplary embodiment, the device that is connected to the master control device via Ethernet and needs to achieve time synchronization is a fault injection device.

[0020] In an exemplary embodiment, determining whether the corresponding ΔC meets the precision requirement based on the ΔT obtained in each message interaction includes:

[0021] Determine whether the deviation between ΔT and ΔC is less than or equal to a preset threshold Tc. If so, then ΔC meets the accuracy requirements.

[0022] In an exemplary embodiment, determining the time T for messages transmitted from the master device to this device based on all ΔC values ​​that meet the accuracy requirements includes:

[0023] The average value of ΔC that meets the accuracy requirements is taken;

[0024] Half of the mean is taken as the time T when the message is transmitted from the master device to this device.

[0025] This application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the time synchronization method as described in any of the preceding embodiments.

[0026] This application also provides a fault injection device, which includes a memory and a processor. The memory stores a program that, when read and executed by the processor, implements the time synchronization method as described in any of the previous embodiments.

[0027] This application embodiment also provides a time synchronization system, the system comprising:

[0028] The fault injection device as described in the previous embodiment;

[0029] Furthermore, the master control device that interacts with the fault injection device is configured to perform N message interactions with the fault injection device. Each message interaction includes: providing feedback on a message from the fault injection device, and sending a time interval ΔT between sending a message to the fault injection device and receiving a feedback message from the fault injection device.

[0030] Compared with related technologies, the technical solution described in this application realizes time synchronization between the controlled device and the master control device; in addition, the parameter ΔC used to determine the synchronization time is screened, and ΔC that meets the accuracy requirements is selected, which can further improve the time synchronization accuracy.

[0031] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description

[0032] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0033] Figure 1 A flowchart of a time synchronization method provided in an embodiment of this application;

[0034] Figure 2 A flowchart illustrating the method for obtaining ΔT provided in this application embodiment;

[0035] Figure 3 A flowchart illustrating the ΔC acquisition method provided in this application embodiment;

[0036] Figure 4 This is a block diagram of the fault injection device provided in the embodiments of this application;

[0037] Figure 5 This is a block diagram of a time synchronization system provided in an embodiment of this application. Detailed Implementation

[0038] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.

[0039] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

[0040] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.

[0041] This application provides a time synchronization method applicable to devices connected to a master control device via Ethernet that require time synchronization, such as... Figure 1 As shown, the method includes:

[0042] Step S101 involves N message interactions with the master control device. The information obtained in each message interaction includes: the first time interval ΔT from when the master control device sends a message to this device to when it receives a feedback message from this device, and the second time interval ΔC from when this device sends a message to the master control device to when it receives a feedback message from the master control device; N is a preset value, N≥1;

[0043] Step S102 determines whether the corresponding ΔC meets the precision requirements based on the first time interval ΔT obtained from each message interaction;

[0044] ΔT values ​​that meet the accuracy requirements can be saved, while ΔT values ​​that do not meet the accuracy requirements can be deleted.

[0045] Step S103 determines the time T at which the message is transmitted from the master control device to this device based on all second time intervals ΔC that meet the accuracy requirements;

[0046] Step S104: After obtaining the synchronization source clock Ts from the master control device, update the clock of this device according to Ts and T to achieve time synchronization with the master control device.

[0047] The technical solution described in this application realizes time synchronization between the controlled device and the master control device; in addition, the parameter ΔC used to determine the synchronization time is screened, and ΔC that meets the accuracy requirements is selected, which can further improve the time synchronization accuracy.

[0048] In an exemplary embodiment, the method for obtaining ΔT is as follows: Figure 2 As shown, it includes:

[0049] Step S201 receives a first message sent by the master control device, the first message carrying the sending time of the message;

[0050] The sending time of the first message can be determined based on the clock of the master control device. For example, the clock of the master control device can be directly used as the sending time of the first message.

[0051] Step S202 sends the sending time of the first message to the master control device via a second message;

[0052] Step S203 Receive feedback message of the second message from the master control device. The feedback message of the second message carries a first time interval ΔT determined by the master control device based on the difference between the time of receiving the second message and the time of sending the first message.

[0053] The ΔT is equal to the time when the master control device receives the second message minus the time when the first message is sent.

[0054] In an exemplary embodiment, the method for obtaining ΔC is as follows: Figure 3 As shown, it includes:

[0055] Step S301: Send a third message to the main control device and record the sending time information Cs;

[0056] Step S302: Receive feedback message of the third message from the main control device and record the reception time information Cr;

[0057] Step S303 uses Cr-Cs as the ΔC.

[0058] In an exemplary embodiment, the transmission time information Cs and the reception time information Cr are count values ​​of a local device clock counter, and the accuracy of the local device clock counter is higher than that of the master control device. For example, the master control device's time information is a 32-bit number in milliseconds (ms) in a 24-hour format, while the local device clock counter can be a 64-bit clock counter with an accuracy of 1 microsecond (µs).

[0059] In one exemplary embodiment, the second message and the third message can be the same message, which can reduce the number of message interactions between the controlled device and the master device; the second message and the third message can also be different messages.

[0060] In an exemplary embodiment, determining whether the corresponding ΔC meets the precision requirement based on the ΔT obtained in each message interaction includes:

[0061] Determine whether the deviation ΔP between ΔT and ΔC is less than or equal to a preset threshold Tc. If so, then ΔC meets the accuracy requirements.

[0062] The deviation ΔP can be calculated as follows: ΔP = |ΔT - ΔC|;

[0063] In theory, ΔT and ΔC are equal after being converted to values ​​of the same time order. However, due to the uncertainty of the transmission network between the master control device and the controlled device, as well as the difference in the calculation accuracy between the master control device and the controlled device, ΔT and ΔC may not be equal after being converted to values ​​of the same time order, i.e., there is a deviation.

[0064] In an exemplary embodiment, determining the time T for messages transmitted from the master device to this device based on all ΔC values ​​that meet the accuracy requirements includes:

[0065] The average value of ΔC that meets the accuracy requirements is taken;

[0066] Half of the mean is taken as the time T when the message is transmitted from the master device to this device.

[0067] In an exemplary embodiment, after obtaining the synchronization source clock Ts from the master control device, updating the device clock according to Ts and T includes:

[0068] Update the device clock to Ts+T.

[0069] In one exemplary embodiment, the device that is connected to the master control device via Ethernet and needs to achieve time synchronization is a fault injection device.

[0070] The above embodiments are illustrated below with a specific application example.

[0071] The fault injection device is connected to the master control device via Ethernet. The master control device broadcasts its own clock to each fault injection device. The time precision of the master control device is in milliseconds and is represented by a 32-bit value. The time precision of each fault injection device is in microseconds and is counted by a 64-bit clock counter, which starts counting from 0 after power-on.

[0072] The master control device and the fault injection device perform a message exchange process. The master control device converts the clock 13:52:18:100 into a 32-bit value 49938100 and broadcasts it to the fault injection device.

[0073] After receiving the clock from the master control device, the fault injection device returns the clock 49938100 and the fault injection device's local clock 600000058 to the master control device.

[0074] The main control device calculates ΔT as 9ms based on the time of receiving the clock data and the clock 49938100, and then sends ΔT and the local clock 600000058 of the fault injection device to the fault injection device.

[0075] The fault injection device calculates ΔC as 9606us and ΔP = ΔC - ΔT = 606us based on the time of receiving the clock data and the local clock of the fault injection device 600000058. ΔC and ΔP are recorded as a set of numbers (ΔC, ΔP).

[0076] The main control device and the fault injection device perform nine more message interaction processes, resulting in a total of ten sets of (ΔC, ΔP), namely (9606, 606), (12712, 3809), (8948, 609), (9112, 598), (9456, 600), (9205, 600), (9181, 589), (9096, 596), (8999, 599), (10891, 1638);

[0077] The fault injection device is set to Tc = 1000, and the data that satisfies △P ≥ Tc will be discarded, that is, the two sets of data (12712, 3809) and (10891, 1638) will be discarded.

[0078] The fault injection device calculates the average value ΔCt based on the ΔC of the other 8 sets of data, which is 9200. ΔCt / 2 is then transmitted from the master control device to the fault injection device as the time T of the message.

[0079] If the synchronization source clock sent by the master control device is 13:52:200.100 on August 18, 2022, then the fault injection device will update its own time to 13:52:200.104.600 on August 18, 2022.

[0080] This application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the time synchronization method as described in any of the preceding embodiments.

[0081] This application also provides a fault injection device, such as... Figure 4 As shown, the device includes a memory 401 and a processor 402. The memory 401 stores a program, which, when read and executed by the processor 402, implements the touch method as described in any of the previous embodiments.

[0082] This application also provides a time synchronization system, such as... Figure 5 As shown, the system includes:

[0083] The fault injection device 501 as described in the previous embodiment;

[0084] Furthermore, the master control device 502, which interacts with the fault injection device 501, is configured to perform N message interactions with the fault injection device. Each message interaction includes: providing feedback on a message from the fault injection device, and sending a time interval ΔT from sending a message to the fault injection device to receiving a feedback message from the fault injection device.

[0085] The technical solution described in this application realizes time synchronization between the controlled device and the master control device; in addition, the parameter ΔC used to determine the synchronization time is screened, and ΔC that meets the accuracy requirements is selected, which can further improve the time synchronization accuracy.

[0086] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A time synchronization method applied to a device connected to a master device through Ethernet and requiring time synchronization, the method comprising: N times of message interactions with the master device, the information obtained each time of message interaction comprising: a time interval from sending a message from the master device to the device to receiving feedback message of the device T, and a time interval from sending a message of the device to the master device to receiving feedback message of the master device C; N is a preset value, N≥1; According to the message interaction obtained each time, the T determines whether the corresponding C meets the accuracy requirement, including: judging whether the deviation between the T and the C is less than or equal to a preset threshold Tc, if yes, the C meets the accuracy requirement; According to all the messages satisfying the accuracy requirement C determine the time T at which the message is transmitted from the master device to the device When the synchronization source clock Ts is acquired from the master device, the Ts and the The device clock is updated to achieve time synchronization with the master device. wherein a clock counter of the device has higher precision than a time precision of the master device. 2.The method of claim 1, wherein: The The acquisition method of T includes: a first message sent by the master device is received, the first message carrying a sending time of the message; the sending time of the first message is sent to the master device through a second message. receiving a feedback message of the second message from the master device, the feedback message of the second message carrying a value determined by the master device according to a difference between a time of receiving the second message and a time of sending the first message T. 3.The method of claim 2, wherein: The The acquisition method of C includes: a third message is sent to the master device, and sending time information Cs is recorded; a feedback message of the third message is received from the master device, and receiving time information Cr is recorded; Cr-Cs as said C; the second message and the third message are the same message or different messages. 4.The method of claim 3, wherein: the sending time information Cs and the receiving time information Cr are count values of the clock counter of the device. 5.The method of claim 1, wherein: the device connected to the master device through Ethernet and requiring time synchronization is a fault injection device. 6.The method of claim 1, wherein: According to all of the accuracy requirements C determining the time T at which the message is transmitted from the master device to the device, comprising: to the accuracy requirement C take the mean value; half of the mean value is taken as a time T for transmitting a message from the master device to the device. 7.A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the time synchronization method of any one of claims 1 to 6.

8. A fault injection device, characterized by The device comprises a memory and a processor, the memory storing a program, the program being read and executed by the processor to implement the time synchronization method of any one of claims 1 to 6.

9. A time synchronization system, characterized by The system comprises: the fault injection device of claim 8. and a master device interacting with the fault injection device, configured to perform N message interactions with the fault injection device, each message interaction comprising: feeding back a message from the fault injection device, and sending a message to the fault injection device from the master device to the time interval in which the master device receives the message from the fault injection device T.

Citation Information

Patent Citations

  • High-robustness satellite constellation time self-synchronization method

    CN110518960A

  • Time synchronization method of V2X equipment and related device

    CN114698091A