Method and apparatus for correcting a 2oo2-cycle timer based on a secure computer platform

By using a timer to calculate errors and offsets during communication between devices, the instability of time synchronization for redundant devices in a secure computer platform is resolved, enabling stable time synchronization and flexible configuration between devices.

CN117008684BActive Publication Date: 2026-11-10TRAFFIC CONTROL TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310953042.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2026-11-10
Estimated Expiration
2043-07-31

AI Technical Summary

Technical Problem

In existing secure computer platform systems, time synchronization of redundant devices suffers from problems such as complex hardware design, low modularity, and unstable hardwired pulse synchronization. Furthermore, the data interaction of the standard 1588 master-slave synchronization protocol is too frequent.

Method used

By communicating between devices, the periodic timer is corrected by calculating errors and offsets. Time synchronization is achieved through network communication, enabling stable time synchronization of devices and avoiding the instability of hard-wired pulse synchronization.

Benefits of technology

It achieves stable time synchronization of devices in a secure computer platform, solves the problems of complex hardware design and low modularity, and improves the reliability and flexibility of synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117008684B_ABST
    Figure CN117008684B_ABST
Patent Text Reader

Abstract

This disclosure provides a method and apparatus for correcting a 2002-period timer based on a secure computer platform. A first device and a second device are, respectively, an initiating device and a device under test. The method includes: determining the offset of the first device and the offset of the second device; correcting the period timers of the first and second devices based on their offsets; wherein determining the offset of the device under test includes the initiating device sending a clock synchronization request carrying a transmission time T1 to the device under test; the device under test receiving the clock synchronization request, recording the reception time T2, and sending a clock synchronization request response including T2 and a transmission time T3 to the initiating device; the initiating device recording the reception time T4, and calculating the offset of the device under test based on T1, T2, T3, and T4. In this manner, through inter-device communication, the timers of each device in the secure computer platform can be stably and accurately corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of device communication technology, and in particular to a 2oo2 cycle timer correction method and apparatus based on a secure computer platform. Background Technology

[0002] When running in the existing secure computer platform system environment, the redundant devices basically use hard-wired pulses for time synchronization. Since the redundant devices need to perform synchronous calculations and the delay needs to be within a controllable range, and the standard 1588 master-slave synchronization protocol data interaction is too frequent, a stable time synchronization mechanism needs to be designed to complete the time synchronization of the redundant devices.

[0003] The existing solutions have the following drawbacks:

[0004] Disadvantage 1: The hardware circuit design is complex. Redundant devices need to be designed on the same board. Each board occupies a large space, requires a high degree of integration, and has strong anti-interference capabilities, which is also a challenge for hardware design.

[0005] Disadvantage 2: The latency of redundant devices depends on the length of the circuit traces. In theory, redundant devices cannot be too far apart and need to be designed on the same board. The degree of modularity is low and the configuration is not flexible enough.

[0006] Disadvantage 3: The standard 1588 master-slave synchronization protocol involves too frequent data exchanges and can only synchronize the slave device's time with the master device's time.

[0007] Therefore, existing solutions cannot reliably achieve time synchronization of devices in a secure computer platform system. Summary of the Invention

[0008] This disclosure provides a method and apparatus for correcting a 2oo2 cycle timer based on a secure computer platform.

[0009] According to a first aspect of this disclosure, a 2002-cycle timer correction method based on a secure computer platform is provided. The method includes: the secure computer platform comprising a first device and a second device, characterized in that the first device and the second device are, respectively, an initiating device and a device under test; the method further includes:

[0010] Determine the offset of the first device and the offset of the second device;

[0011] Based on the offset of the first device and the offset of the second device, the periodic timers of the first device and the second device are corrected;

[0012] Determining the offset of the device under test includes:

[0013] The initiating device sends a clock synchronization request carrying the transmission time T1 to the device under test; the device under test receives the clock synchronization request, records the reception time T2, and sends a clock synchronization request response including T2 and the transmission time T3 to the initiating device, where T3 is the time when the device under test sends the clock synchronization request response to the initiating device; the initiating device receives the clock synchronization request response, records the reception time T4, and calculates the offset of the device under test based on T1, T2, T3, and T4.

[0014] In addition to the aspects and any possible implementations described above, a further implementation is provided that calculates the offset of the device under test based on T1, T2, T3, and T4, including:

[0015] The offset of the device under test is calculated using the formula offset = ((T2+T3)-(T4+T1)) / 2, where offset is the offset of the device under test.

[0016] In addition to the aspects and any possible implementations described above, a further implementation is provided, which modifies the periodic timers of the first device and the second device based on the offsets of the first device and the second device, including:

[0017] When the absolute values ​​of the offsets of the first device and the second device are both less than the first preset threshold, the offsets of the first device and the second device are marked.

[0018] When the number of offsets of the markers meets the second preset threshold, the average offset of the first device marked with the markers and the average offset of the second device marked with the markers are calculated.

[0019] Based on the mean offset of the first device marked and the mean offset of the second device marked, calculate the correction reference value of the first device and the correction reference value of the second device.

[0020] Based on the first device correction reference value and the second device correction reference value, the periodic timers of the first device and the second device are corrected.

[0021] As described above and in any possible implementation, a further implementation is provided, wherein the periodic timers of the first device and the second device are adjusted according to the first device adjustment reference value and the second device adjustment reference value, comprising:

[0022] When the absolute value of the first device correction reference value is greater than the third preset threshold, the periodic timer of the first device is corrected based on the preset unit correction amount and the first device correction reference value;

[0023] When the absolute value of the second device correction reference value is greater than the third preset threshold, the periodic timer of the second device is corrected based on the preset unit correction amount and the second device correction reference value.

[0024] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the first device correction reference value is calculated by the following formula: A = (CD) / 2;

[0025] The second equipment correction reference value is calculated using the following formula: B = (DC) / 2;

[0026] Where A is the first device correction reference value, B is the second device correction reference value, C is the average offset of the marked first device, and D is the average offset of the marked second device.

[0027] In addition to the aspects and any possible implementations described above, a further implementation is provided, which corrects the periodic timer of the first device based on a preset unit correction amount and a first device correction reference value, including: when the first device correction reference value is positive, subtracting the preset unit correction amount from the periodic timer of the first device; and when the first device correction reference value is negative, adding the preset unit correction amount to the periodic timer of the first device.

[0028] The second device's periodic timer is adjusted based on a preset unit correction amount and a second device correction reference value, including: when the second device correction reference value is positive, the second device's periodic timer is decremented by a preset unit correction amount; when the second device correction reference value is negative, the second device's periodic timer is incremented by a preset unit correction amount.

[0029] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the second preset threshold is calculated by the following formula: E = (1000 / (3*((T) / 100))*2);

[0030] Where E is the second preset threshold and T is the offset determination period.

[0031] According to a second aspect of this disclosure, a 2002-cycle timer correction device based on a secure computer platform is provided. The secure computer platform includes a first device and a second device, which are the initiating device and the device under test, respectively. The device includes:

[0032] The determination module is used to determine the offset of the first device and the offset of the second device;

[0033] The correction module is used to correct the periodic timers of the first device and the second device based on the offset of the first device and the offset of the second device;

[0034] Determining the offset of the device under test includes:

[0035] The initiating device sends a clock synchronization request carrying the transmission time T1 to the device under test; the device under test receives the clock synchronization request, records the reception time T2, and sends a clock synchronization request response including T2 and the transmission time T3 to the initiating device, where T3 is the time when the device under test sends the clock synchronization request response to the initiating device; the initiating device receives the clock synchronization request response, records the reception time T4, and calculates the offset of the device under test based on T1, T2, T3, and T4.

[0036] According to a third aspect of this disclosure, an electronic device is provided. The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the program to implement the method described above.

[0037] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described above.

[0038] The 2oo2 cycle timer correction method and device based on a secure computer platform of the present invention achieves time synchronization through communication between devices. The timer correction solution, which relies solely on network communication to calculate errors and offsets, enables devices to stably synchronize their time, thereby achieving synchronous calculation. It does not limit which device is under test or which device initiates the test, and thus enables timer correction of devices in a secure computer platform. This effectively solves the problems of unstable hard-wired pulse synchronization between devices and hardware design issues.

[0039] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0040] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of this disclosure. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0041] Figure 1 A flowchart illustrating a 2oo2-cycle timer correction method based on a secure computer platform provided in an embodiment of this disclosure is shown.

[0042] Figure 2 This illustration shows an interactive diagram of determining the offset of a device under test based on a secure computer platform, according to an embodiment of this disclosure.

[0043] Figure 3 This illustration shows a schematic diagram of an interaction offset between a first device and a second device provided in an embodiment of this disclosure;

[0044] Figure 4 This illustration shows a schematic diagram of a 2oo2-cycle timer correction device based on a secure computer platform, according to an embodiment of the present disclosure.

[0045] Figure 5 A structural diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0047] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0048] In this disclosure, time synchronization is achieved through communication between devices. The timer correction solution, which relies solely on network communication to calculate errors and offsets, enables devices to stably synchronize their time, thereby achieving synchronous calculations. It does not limit which device is under test or which device initiates the test, and can thus achieve correction between master and slave devices. This effectively solves the problems of instability and hardware design in hard-wired pulse synchronization between devices.

[0049] Figure 1 A flowchart illustrating a 2oo2-cycle timer correction method based on a secure computer platform according to an embodiment of this disclosure is shown.

[0050] Specifically, the secure computer platform includes a first device and a second device, where the first device and the second device are each other's initiating device and tested device, respectively. Figure 1 As shown, the 2oo2-cycle timer correction method 100 based on a secure computer platform may include:

[0051] S101, determine the offset of the first device and the offset of the second device.

[0052] S102, Based on the offset of the first device and the offset of the second device, the periodic timers of the first device and the second device are corrected.

[0053] In this context, the first device and the second device are the initiating device and the device under test, respectively. The process of determining the offset of the device under test in S101 can be as follows: Figure 2 As shown:

[0054] The initiating device sends a clock synchronization request, i.e., Sync_Req(t1), to the device under test, carrying the transmission time T1.

[0055] The device under test receives a clock synchronization request and records the receiving time T2. It then sends a clock synchronization request response, including T2 and the sending time T3, to the initiating device. Here, T3 is the time when the device under test sends the clock synchronization request response to the initiating device. The clock synchronization request response, including T2 and the sending time T3, is Sync_Resp(T2,T3).

[0056] Initiate a response to the device receive clock synchronization request and record the reception time T4. Calculate the offset of the device under test based on T1, T2, T3, and T4.

[0057] exist Figure 2 In this context, delay represents the communication delay between the initiating device and the device under test. The communication delay between the initiating device and the device under test is calculated using the formula delay=((T4-T1)-(T3-T2)) / 2, and then the offset of the device under test is calculated.

[0058] To accurately calculate the offset of the device under test, the above calculation based on T1, T2, T3, and T4 can include:

[0059] According to the formula offset=(T2-(T1+delay)-(T4-delay)+T3) / 2, we can calculate offset=((T2+T3)-(T4+T1)) / 2, and then calculate the offset of the device under test, where offset is the offset of the device under test. By using the communication method between devices, the offset of the device under test is accurately calculated based on T1, T2, T3 and T4 in the communication process, so that the periodic timer of the device in the security computer platform can be accurately corrected in the future.

[0060] Figure 3 The diagram illustrates an interaction offset between a first device and a second device according to an embodiment of the present disclosure. After the interaction, each device has the offset of all devices, which is used for subsequent calculation processing on each device. Cyctime is the offset determination period T for each device, and the offset determination period T for each device is the same.

[0061] To accurately correct the periodic timers of the first and second devices, the offsets of the first and second devices can be marked based on a first preset threshold to determine a device correction reference value for correcting the device's periodic timers. Therefore, in one embodiment, the above-mentioned correction of the periodic timers of the first and second devices based on the offsets of the first and second devices can specifically include:

[0062] When the absolute values ​​of the offsets of the first device and the second device are both less than the first preset threshold, the offsets of the first device and the second device are marked. The first preset threshold can be 10ms or can be adjusted according to the actual situation.

[0063] When the number of offsets of the markers meets the second preset threshold, the average offset of the first device marked and the average offset of the second device marked are calculated.

[0064] Based on the mean offset of the first device marked with tags and the mean offset of the second device marked with tags, calculate the correction reference value for the first device and the correction reference value for the second device.

[0065] Based on the first device correction reference value and the second device correction reference value, the periodic timers of the first device and the second device are corrected.

[0066] In the above embodiments, the average offset of the first device and the second device is calculated based on the relationship between the number of offsets of the markers and the second preset threshold, and then a correction reference value is calculated, thereby realizing accurate correction of the periodic timer of the first device and the periodic timer of the second device based on the correction reference value.

[0067] To further accurately correct the periodic timers of the first device and the second device, in some embodiments, the correction of the periodic timers of the first device and the second device based on the correction reference values ​​of the first and second devices may specifically include:

[0068] When the absolute value of the first device correction reference value is greater than the third preset threshold, the periodic timer of the first device is corrected based on the preset unit correction amount and the first device correction reference value.

[0069] When the absolute value of the second device correction reference value is greater than the third preset threshold, the periodic timer of the second device is corrected based on the preset unit correction amount and the second device correction reference value.

[0070] The third preset threshold can be 3ms, or it can be adjusted according to the actual situation.

[0071] In the above embodiments, by comparing the absolute value of the correction reference value with a third preset threshold, the periodic timer of the device can be accurately corrected based on the preset unit correction amount and the correction reference value.

[0072] In order to accurately calculate the first device correction reference value and the second device correction reference value, in some embodiments, the first device correction reference value can be calculated by the following formula: A = (CD) / 2.

[0073] The second equipment correction reference value can be calculated using the following formula: B = (DC) / 2.

[0074] Where A is the first device correction reference value, B is the second device correction reference value, C is the average offset of the marked first device, and D is the average offset of the marked second device.

[0075] In the above embodiments, the first device correction reference value and the second device correction reference value are accurately calculated based on the average offset C of the first device and the average offset D of the second device, so that the periodic timer of the device can be accurately corrected based on the accurate correction reference value.

[0076] To further accurately correct the device's periodic timer based on the correction reference value and a preset unit correction amount, in some embodiments, the periodic timer of the first device is corrected based on the preset unit correction amount and the first device correction reference value. Specifically, this may include: when the first device correction reference value is positive, subtracting the preset unit correction amount from the periodic timer of the first device; and when the first device correction reference value is negative, adding the preset unit correction amount to the periodic timer of the first device.

[0077] The second device's periodic timer is adjusted based on a preset unit correction amount and a second device correction reference value, including: when the second device correction reference value is positive, the second device's periodic timer is decremented by a preset unit correction amount; when the second device correction reference value is negative, the second device's periodic timer is incremented by a preset unit correction amount.

[0078] In other words, the security platform will determine whether the average offset has drifted by monitoring the average offset of the first device and the average offset of the marked second device, and calculating the correction reference values ​​for the first and second devices. When the average offset is detected to be greater than 3ms, the first and second devices will adjust their respective period timers by 1ms based on the sign of the corresponding correction reference value. That is, when the correction reference value for a device is positive, the corresponding period timer is decremented by 1ms; when the correction reference value for a device is negative, the corresponding period timer is incremented by 1ms.

[0079] In the above embodiments, considering the positive and negative relationship of the correction reference value, the periodic timer of the device can be accurately corrected based on the positive or negative of the correction reference value using a preset unit correction amount.

[0080] In order to accurately determine the second preset threshold by combining the device offset to determine the period, and thus make subsequent corrections accurate, in some embodiments, the second preset threshold is calculated by the following formula: E=(1000 / (3*((T) / 100))*2).

[0081] Where E is the second preset threshold and T is the offset determination period.

[0082] In the above embodiments, the second preset threshold is accurately determined by combining the device offset to determine the period, thereby making subsequent corrections accurate.

[0083] It should be noted that the preset unit correction amount can be 1ms, or it can be adjusted according to the actual situation.

[0084] In a specific embodiment, based on the parameters of the first preset threshold and the calculation formula of the second preset threshold, during the periodic operation phase, the security platform performs a 2oo2 clock synchronization interaction (req-ack) once per cycle, calculates the offset of the first device and the second device and transmits them to each other (two devices obtain a total of two offsets on one network per cycle). When the absolute value of the offset calculated by both devices is less than 10ms, these two offsets are recorded, i.e., marked. After accumulating 1000 / (3*((offset determination period) / 100)) valid periods (i.e., crystal oscillator error range) and (1000 / (3*((offset determination period) / 100))*2) valid offsets, the average value is taken. That is, when the number of marked offsets meets the second preset threshold, the average value of the marked offsets of the first device and the average value of the marked offsets of the second device are calculated.

[0085] In a specific example, the first device of the technical solution disclosed herein may be a first CPU in a secure computer platform, and the second device may be a second CPU in a secure computer platform.

[0086] Based on the above-mentioned preset unit correction amount and the calculation formula of the second preset threshold, it can be understood that in the process of correcting the periodic timer of the first device and the periodic timer of the second device according to the correction reference value of the first device and the correction reference value of the second device, in order to prevent the clock adjustment from masking the clock failure due to excessively frequent clock adjustments, the clock correction can be limited to at most once per (1000 / (3*(period time) / 100)) effective period, and each correction can be fixed at 1ms.

[0087] Furthermore, the first and second devices in this solution can be master and slave devices to each other, thus enabling the modification of master and slave devices in the security platform.

[0088] According to the embodiments of this disclosure, a 2oo2-cycle timer correction method based on a secure computer platform is provided. This method achieves time synchronization through communication between devices. The timer correction solution, which calculates errors and offsets solely through network communication, enables devices to stably synchronize their time. This allows for synchronous calculation without limiting which device is under test or which device initiates the test. Consequently, it can stably and accurately correct the timers of each device in the secure computer platform, effectively solving the problems of instability and hardware design issues related to hard-wired pulse synchronization between devices.

[0089] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this disclosure.

[0090] The above is an introduction to the method embodiments. The following describes the present disclosure solution further through device embodiments.

[0091] Figure 4 A block diagram of a 2002-cycle timer correction device 400 based on a secure computer platform according to an embodiment of the present disclosure is shown. The secure computer platform includes a first device and a second device, characterized in that the first device and the second device are, respectively, an initiating device and a device under test, as shown in the diagram. Figure 4 As shown, the 2oo2-cycle timer correction device 400 based on a secure computer platform includes:

[0092] The determination module 401 is used to determine the offset of the first device and the offset of the second device.

[0093] The correction module 402 is used to correct the periodic timers of the first device and the second device based on the offset of the first device and the offset of the second device.

[0094] Determining the offset of the device under test includes:

[0095] The initiating device sends a clock synchronization request carrying the transmission time T1 to the device under test; the device under test receives the clock synchronization request, records the reception time T2, and sends a clock synchronization request response including T2 and the transmission time T3 to the initiating device, where T3 is the time when the device under test sends the clock synchronization request response to the initiating device; the initiating device receives the clock synchronization request response, records the reception time T4, and calculates the offset of the device under test based on T1, T2, T3, and T4.

[0096] Furthermore, the first and second devices in this solution can be master and slave devices to each other, thus enabling the modification of master and slave devices in the security platform.

[0097] According to the embodiments of this disclosure, a 2oo2-cycle timer correction device based on a secure computer platform is provided. This device achieves time synchronization through communication between devices. The timer correction solution, which calculates errors and offsets solely through network communication, enables devices to stably synchronize their time. This allows for synchronous calculation without limiting which device is under test or which device initiates the test. Consequently, it can stably and accurately correct the timers of each device in the secure computer platform, effectively solving the problems of instability and hardware design issues related to hard-wired pulse synchronization between devices.

[0098] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0099] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0100] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0101] Figure 5 A schematic block diagram of an electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0102] Device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0103] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0104] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform method 100 by any other suitable means (e.g., by means of firmware).

[0105] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0106] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0107] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0109] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0110] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0111] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0112] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for correcting a 2002-cycle timer based on a secure computer platform, wherein the secure computer platform includes a first device and a second device, characterized in that, The first device and the second device are each other's initiating device and tested device, and the method includes: Determine the offset of the first device and the offset of the second device; Based on the offset of the first device and the offset of the second device, the periodic timers of the first device and the second device are corrected; Determining the offset of the device under test includes: The initiating device sends a clock synchronization request carrying a transmission time T1 to the device under test (DUT); the DUT receives the clock synchronization request, records the reception time T2, and sends a clock synchronization request response including T2 and the transmission time T3 to the initiating device, where T3 is the time when the DUT sends the clock synchronization request response to the initiating device; the initiating device receives the clock synchronization request response, records the reception time T4, and calculates the offset of the DUT based on T1, T2, T3, and T4; The step of correcting the periodic timers of the first device and the second device based on the offsets of the first device and the second device includes: marking the offsets of the first device and the second device when the absolute values ​​of the offsets of both devices are less than a first preset threshold; calculating the average of the marked offsets of the first device and the average of the marked offsets of the second device when the number of marked offsets meets a second preset threshold; calculating a first device correction reference value and a second device correction reference value based on the average of the marked offsets of the first device and the second device; and correcting the periodic timers of the first device and the second device according to the first device correction reference value and the second device correction reference value. The step of correcting the periodic timers of the first device and the second device based on the first device correction reference value and the second device correction reference value includes: when the absolute value of the first device correction reference value is greater than a third preset threshold, correcting the periodic timer of the first device based on a preset unit correction amount and the first device correction reference value; when the absolute value of the second device correction reference value is greater than a third preset threshold, correcting the periodic timer of the second device based on a preset unit correction amount and the second device correction reference value. The first device correction reference value is calculated using the following formula: A = (CD) / 2; the second device correction reference value is calculated using the following formula: B = (DC) / 2; where A is the first device correction reference value, B is the second device correction reference value, C is the average offset of the marked first device, and D is the average offset of the marked second device. The step of adjusting the periodic timer of the first device based on a preset unit correction amount and the first device correction reference value includes: when the first device correction reference value is positive, decrementing the periodic timer of the first device by a preset unit correction amount; and when the first device correction reference value is negative, incrementing the periodic timer of the first device by a preset unit correction amount. The step of correcting the periodic timer of the second device based on a preset unit correction amount and a second device correction reference value includes: when the second device correction reference value is positive, decrementing the periodic timer of the second device by a preset unit correction amount; and when the second device correction reference value is negative, incrementing the periodic timer of the second device by a preset unit correction amount.

2. The method according to claim 1, characterized in that, The calculation of the offset of the device under test based on T1, T2, T3, and T4 includes: The offset of the device under test is calculated using the formula offset=((T2+T3)-(T4+T1)) / 2, where offset is the offset of the device under test.

3. The method according to claim 1, characterized in that, The second preset threshold is calculated using the following formula: E=(1000 / (3 ((T) / 100)) 2); Where E is the second preset threshold and T is the offset determination period.

4. A 2002-period timer correction device based on a secure computer platform, wherein the secure computer platform includes a first device and a second device, characterized in that, For implementing the method as described in any one of claims 1-3, wherein the first device and the second device are each other an initiating device and a device under test, the apparatus comprises: The determination module is used to determine the offset of the first device and the offset of the second device; The correction module is used to correct the periodic timers of the first device and the second device based on the offset of the first device and the offset of the second device; Determining the offset of the device under test includes: The initiating device sends a clock synchronization request carrying a transmission time T1 to the device under test (DUT); the DUT receives the clock synchronization request, records the reception time T2, and sends a clock synchronization request response including T2 and the transmission time T3 to the initiating device, where T3 is the time when the DUT sends the clock synchronization request response to the initiating device; the initiating device receives the clock synchronization request response, records the reception time T4, and calculates the offset of the DUT based on T1, T2, T3, and T4.

5. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Process and system for geographic hot redundancy

    CN111666181A

  • Time synchronization method and device, storage medium and terminal

    CN113141225A