WO2024098783A1 - Procédé et appareil de correction de temps - Google Patents

Procédé et appareil de correction de temps Download PDF

Info

Publication number
WO2024098783A1
WO2024098783A1 PCT/CN2023/103446 CN2023103446W WO2024098783A1 WO 2024098783 A1 WO2024098783 A1 WO 2024098783A1 CN 2023103446 W CN2023103446 W CN 2023103446W WO 2024098783 A1 WO2024098783 A1 WO 2024098783A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock module
time
slave clock
slave
master clock
Prior art date
Application number
PCT/CN2023/103446
Other languages
English (en)
Chinese (zh)
Inventor
赵思蓉
任慰
代雷
曾维林
李宗鸿
谢国琪
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024098783A1 publication Critical patent/WO2024098783A1/fr

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements

Definitions

  • the present application relates to the field of communications, and in particular to a time correction method and device.
  • each virtual machine performs its own functional tasks without interfering with each other, thus ensuring that the failure of a virtual machine will not affect the normal operation of other virtual machines.
  • frequent real-time data transmission is required between virtual machines to perform specific complex functional operations.
  • the brake system (virtual machine 1) needs to obtain data such as vehicle distance based on the radar system (virtual machine 2) to determine whether to brake at the moment.
  • the real-time communication function between virtual machines needs to ensure low latency and high reliability of the message transmission process.
  • ADAS advanced driver assistance system
  • the time error between virtual machines is not allowed to be less than microseconds. Therefore, it is necessary to perform time synchronization operations between the host and the virtual machine to reduce the time deviation between the two to the microsecond level to meet the needs of real-time communication between multiple virtual machines.
  • the existing time synchronization methods have low accuracy.
  • the present application provides a time correction method and device for solving the problem of low accuracy of existing time synchronization methods.
  • a time correction method is provided, which is applied to a slave clock module of a computing device, wherein the computing device further includes a master clock module, and the method includes:
  • the master clock module and the slave clock module When the master clock module and the slave clock module send time messages to each other at least twice, the master clock module and the slave clock module respectively send and receive multiple timestamps of the time messages; the master clock module and the slave clock module send and receive time messages through a first channel; the first channel is realized by mapping between the Unex domain socket file installed in the master clock module and the virtual serial port installed in the slave clock module, and the virtual serial port is obtained by the master clock module starting the VirtIO driver in the slave clock module; according to the multiple timestamps, the time error of the slave clock module relative to the master clock module is determined; and the system time of the slave clock module is corrected according to the time error.
  • the slave clock module and the master clock module send and receive time messages through the first channel composed of the mapping between the Unex domain socket file and the virtual serial port, so that the slave clock module obtains multiple timestamps. Then the slave clock module determines the time error of the slave clock module relative to the master clock module based on the multiple timestamps, and then corrects the system time of the slave clock module according to the time error.
  • the first channel is constructed using the VirtIO driver, and VirtIO is a shared physical memory communication method based on I/O virtualization, which does not rely on network communication and does not require protocol processing.
  • obtaining multiple timestamps includes:
  • the first time message carries a first timestamp representing the moment when the master clock module sends the first time message; record a second timestamp representing the moment when the master clock module receives the first time message; in response to the first time message, send a second time message to the master clock module, and record a third timestamp representing the moment when the slave clock module sends the second time message; receive a third time message sent by the master clock module to the slave clock module in response to the second time message, the third time message includes a fourth timestamp representing the time when the master clock module receives the second time message.
  • a response mechanism for the time message is designed so that the slave clock module can obtain multiple timestamps, and the multiple timestamps obtained have high accuracy.
  • the master clock module is a clock module of a master operating system
  • the slave clock module is a clock module in a slave operating system
  • the master operating system is an operating system of a computing device
  • the slave operating system is an operating system of a virtual machine running on the computing device.
  • the virtio serial field and the Unex field are set in the startup configuration extensible markup language file of the slave clock module; the virtual serial port is obtained by the master clock module by starting the VirtIO driver in the slave clock module according to the startup configuration extensible markup language file with the virtio serial field and the Unex field added; wherein, one virtual serial port corresponds to one Unex domain socket file.
  • the VirtIO driver is used to build the first channel.
  • VirtIO is a shared physical memory communication method based on I/O virtualization. It does not rely on network communication and does not require protocol processing. It implements data replication through file mapping, reduces the load consumption of sending and receiving time messages between the slave clock module and the master clock module, and the impact of network delays, thereby achieving lightweight time correction at the resource level, which can meet the time correction requirements of resource-constrained virtualization platforms.
  • correcting the system time of the slave clock module according to the time error includes:
  • the time error is input into a preset computer function to correct the system time of the slave clock module.
  • the system time of the slave clock module is corrected based on the time error by a preset computer function, and the correction efficiency is high.
  • the method further includes:
  • a plurality of time stamps are reacquired to recorrect the system time of the slave clock module.
  • a recalibration mechanism is designed in the event that the system time correction of the slave clock module fails.
  • the system time correction of the slave clock module fails, multiple timestamps can be reacquired to recalibrate the system time of the slave clock module, thereby improving the time correction accuracy.
  • a time correction method is provided, which is applied to a computing device, wherein the computing device includes a master clock module and a slave clock module, and the method is applied to the master clock module, and the method includes:
  • At least two timestamps are sent to the slave clock module through the first channel, and the timestamps are used to correct the system time of the slave clock module that obtains the at least two timestamps;
  • the at least two timestamps include a timestamp representing the moment when the master clock module sends a time message to the slave clock module, and a timestamp representing the moment when the master clock module receives a time message from the slave clock module;
  • the first channel includes a mapping between the Unex domain socket file installed in the master clock module and the virtual serial port installed in the slave clock module, and the virtual serial port is obtained by the master clock module starting the VirtIO driver in the slave clock module.
  • the slave clock module and the master clock module send and receive time messages through the first channel composed of the mapping between the Unex domain socket file and the virtual serial port, so that the slave clock module obtains multiple timestamps.
  • the first channel is constructed using the VirtIO driver, and VirtIO is a shared physical memory communication method based on I/O virtualization. It does not rely on network communication and does not require protocol processing. It achieves data replication through file mapping, reduces the load consumption of sending and receiving time messages between the slave clock module and the master clock module, and the impact of network delay, thereby achieving lightweight time correction at the resource level, which can meet the time correction requirements of resource-constrained virtualization platforms.
  • At least two timestamps are sent to the slave clock module through the first channel, including: sending a first time message to the slave clock module, the first time message carrying a timestamp representing the moment when the master clock module sends the first time message to the slave clock module; receiving a second time message from the slave clock module, the second time message is a time message sent by the slave clock module to the master clock module in response to the first time message; in response to the second time message, sending a third time message to the slave clock module, the third time message including a timestamp representing the moment when the master clock module receives the second time message.
  • a response mechanism for the time message is designed so that the slave clock module can obtain multiple timestamps, and the multiple timestamps obtained have high accuracy.
  • the master clock module is a clock module of a master operating system
  • the slave clock module is a clock module in a slave operating system
  • the master operating system is an operating system of a computing device
  • the slave operating system is an operating system of a virtual machine running on the computing device.
  • the startup configuration XML file of the slave clock module is provided with a virtio serial field and an unix field; the virtual serial port is configured by the master clock module according to the startup configuration file with the virtio serial field and the unix field added.
  • the VirtIO driver is used to build the first channel.
  • VirtIO is a shared physical memory communication method based on I/O virtualization. It does not rely on network communication and does not require protocol processing. It implements data replication through file mapping, reduces the load consumption of sending and receiving time messages between the slave clock module and the master clock module, and the impact of network delays, thereby achieving lightweight time correction at the resource level, which can meet the time correction requirements of resource-constrained virtualization platforms.
  • the present application provides a time correction device, which may be a slave clock module or a chip or system on chip in a slave clock module.
  • the time correction device may implement the functions performed by the slave clock module in the first aspect or a possible design of the first aspect, and the functions may be implemented by hardware or by hardware executing corresponding software.
  • the present application provides a time correction device, which may be a main clock module or a chip or system on chip in the main clock module.
  • the time correction device may implement the function performed by the main clock module in the second aspect or the possible design of the second aspect, and the function may be implemented by hardware or by hardware executing corresponding software.
  • the present application provides a time correction device, the time correction device includes a processor, the processor is used to support the time correction device to execute the method of the first aspect or the second aspect. Further, the time correction device may also include a memory, the memory stores computer instructions, and the processor can execute the computer instructions to execute the method of the first aspect or the second aspect.
  • the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed, the method of the first aspect or the second aspect is executed.
  • the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method of the first aspect or the second aspect described above.
  • the present application provides a chip comprising a processor and a transceiver, wherein the processor and the transceiver are used to support a time correction device to execute the method of the first aspect or the second aspect.
  • the present application provides a time correction system, which includes a master clock module and a slave clock module; wherein the master clock module is used to execute the method of the second aspect; and the slave clock module is used to execute the method of the first aspect.
  • the beneficial effects described in the third to ninth aspects of the present application can refer to the analysis of the beneficial effects of the first or second aspect, and will not be repeated here.
  • FIG1 is a schematic diagram of the structure of a time correction system provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a flow chart of a time correction method provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of the structure of another time correction system provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a flow chart of another time correction method provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a flow chart of another time correction method provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of the structure of another time correction system provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of the structure of a time device provided in an embodiment of the present application.
  • FIG8 is a structural diagram of a time correction device provided in an embodiment of the present application.
  • FIG9 is a structural diagram of another time correction device provided in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the structure of another time correction system provided in an embodiment of the present application.
  • the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.
  • a person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
  • Message passing A general term for a type of data time correction method between processes or software components in a computer system. It abstracts and encapsulates the data to be communicated into "messages". The two or more parties involved in the communication can transfer messages between processes or components by calling primitives such as message sending and receiving, thereby completing data communication.
  • Time synchronization The process of providing a unified time scale for distributed systems through certain operations on local clocks.
  • the operating system when the operating system starts, it is necessary to obtain the real-time clock (RTC) time for time initialization, and then calculate the current system time through the frequency count of the clock source (the kernel automatically selects the clock source with the highest precision value).
  • the count values are stored in registers.
  • the host and virtual machine are set to obtain the current system time through the count value of the cntvct_el0 register.
  • the same register cannot be read by multiple virtual machines at the same time, it is interrupted by interruptions during the reading and writing process of obtaining the count value, resulting in a time deviation of several milliseconds between the current time obtained by the virtual machine and the actual time. This is not conducive to ensuring low latency and high reliability of real-time communication for systems with high time accuracy. Therefore, it is necessary to perform time synchronization operations between the host and the virtual machine to reduce the time deviation between the two to the microsecond level to meet the needs of real-time communication between multiple virtual machines.
  • the general time synchronization method relies on the network between the host and the virtual machine for time synchronization, such as precise time protocol (PTP), Chrony time synchronization service, network time protocol (NTP) time synchronization service, etc.
  • PTP precise time protocol
  • NTP network time protocol
  • the above methods are aimed at the scenarios of cloud computing and virtualization platforms in high-performance computing, which are not limited by communication resources and are based on large communication resource consumption to achieve high-precision time synchronization.
  • an embodiment of the present application provides a time correction method.
  • the method provided by the embodiment of the present application is described below in conjunction with the drawings in the specification.
  • the time correction method provided in the embodiment of the present application can be applied to various time correction systems, such as: long term evolution (LTE) system, fifth generation (5G) mobile time correction system, wireless fidelity (WiFi) system, future time correction system, or a system integrating multiple time correction systems, etc., which is not limited in the embodiment of the present application.
  • LTE long term evolution
  • 5G fifth generation
  • WiFi wireless fidelity
  • future time correction system future time correction system
  • NR new radio
  • the time correction method provided in the embodiment of the present application is described below using the time correction system shown in FIG. 1 as an example.
  • FIG1 is a schematic diagram of a computing device provided by an embodiment of the present application.
  • the computing device may include: a master clock module and a slave clock module.
  • the master clock module may be a clock module of a master operating system
  • the slave clock module may be a clock module of a guest operating system.
  • the number of slave clock modules may be multiple, and two are used as an example in FIG1 . Messages can be transmitted bidirectionally between the master clock module and the slave clock module.
  • FIG2 shows a schematic flow chart of a time correction method provided by an embodiment of the present application. As shown in FIG2 , the method may include the following steps:
  • the multiple timestamps include the timestamps of the moments when the master clock module and the slave clock module respectively send and receive time messages when the master clock module and the slave clock module send time messages to each other at least twice.
  • the master clock module sends a time message to the slave clock module once, or the slave clock module sends a time message to the master clock module once, which is recorded as one mutual transmission.
  • the multiple timestamps obtained include at least the timestamp of the master clock module sending a time message (recorded as message A), the timestamp of the slave clock module receiving the message A, the timestamp of another time message (recorded as message B) sent by the slave clock module in response to the message A, and the timestamp of the master clock module receiving the message B. That is to say, at least four timestamps are included.
  • the master clock module can be the main operating system; the slave clock module can be the guest operating system.
  • the master clock module and the slave clock module send and receive time messages through the first channel; the first channel is established before the slave clock module obtains multiple timestamps, which is the preparatory work of the time correction method provided in the embodiment of the present application.
  • the first channel is mapped between the Unex domain socket file installed by the master clock module and the virtual serial port installed by the slave clock module. The establishment process of the first channel is described below:
  • XML startup configuration extensible markup language
  • the slave clock module determines a time error of the slave clock module relative to the master clock module according to the multiple timestamps.
  • the multiple timestamps can represent the time when the master clock module and the slave clock module send and receive time messages respectively when the master clock module and the slave clock module send time messages to each other at least twice. Furthermore, the time error of the slave clock module relative to the master clock module can be determined based on the multiple timestamps.
  • the interval from sending a certain time message to receiving the time message is recorded as the transmission time
  • the slave clock module can calculate the difference between any transmission time and the average of the transmission time as the time error of the slave clock module relative to the master clock module. It can be understood that the time error of the slave clock module relative to the master clock module is obtained according to the difference between the transmission time of a time message and the average of the transmission time of multiple time messages.
  • the time error when determining the time error, can be calculated according to a time error calculation formula. Taking the calculation of the time error based on the timestamps corresponding to the two times when the master clock module and the slave clock module send time messages to each other as an example, the time error calculation formula can be:
  • Time error (T 2 - T 1 ) - [(T 2 - T 1 ) + (T 4 - T 3 )] / 2
  • T1 represents the timestamp of the time when the time message is sent for the first time
  • T2 represents the timestamp of the time when the time message is received for the second time
  • T3 represents the timestamp of the time when the time message is sent for the second time
  • T4 represents the timestamp of the time when the time message is received for the first time.
  • the time error calculation is performed based on the time error calculation formula. Although a small amount of time is consumed in reading the data each time the timestamp is transmitted in S210, according to the time error calculation formula, the transmission time of a time message (the sum of the net transmission time and the above-mentioned small amount of time) and the average of the transmission time of multiple time messages both include the small amount of time. By subtracting them, they can offset each other, thereby increasing the accuracy of the time error and being able to accurately calculate the time error of the slave clock module relative to the master clock module.
  • the slave clock module corrects the system time of the slave clock module according to the time error.
  • the system time of the slave clock module can be corrected according to the time error.
  • the system time of the slave clock module can be corrected by inputting the time error into a preset computer function.
  • the preset computer function can be selected as adjtime.
  • the slave clock module and the master clock module receive and send time messages through the first channel composed of the mapping between the Unex domain socket file and the virtual serial port, so that the slave clock module obtains multiple timestamps. Then the slave clock module determines the time error of the slave clock module relative to the master clock module based on the multiple timestamps, and then corrects the system time of the slave clock module based on the time error.
  • the first channel is constructed using the VirtIO driver, and VirtIO is a shared physical memory communication method based on I/O virtualization, which does not rely on network communication and does not require protocol processing.
  • S210 obtaining multiple timestamps from a clock module may include:
  • the master clock module sends a first time message to the slave clock module, and correspondingly, the slave clock module receives the first time message from the master clock module.
  • the first time message carries a first timestamp, and the first timestamp represents the time when the main clock module sends the first time message.
  • the second timestamp represents the time when the main clock module receives the first time message.
  • the slave clock module sends a second time message to the master clock module in response to the first time message, and records a third timestamp. Accordingly, the master clock module receives the second time message.
  • the second time message may not carry content data.
  • the third timestamp represents the time when the second time message is sent from the clock module.
  • S440 The master clock module sends a third time message to the slave clock module in response to the second time message.
  • the slave clock module receives the third time message.
  • the third time message includes a fourth timestamp, and the fourth timestamp represents the time when the master clock module receives the second time message.
  • a response mechanism for designing a time message enables a slave clock module to obtain multiple timestamps, and the multiple timestamps obtained have high accuracy.
  • the slave clock module corrects the time of the slave clock module according to the time error, as shown in FIG5 , the method may further:
  • the preset computer function can output a result indicating whether the correction of the system time of the slave clock module is successful, taking the adjtime function as an example. If the correction is successful, TRUE is output; if the correction fails, FALSE is output. In the case where the output result indicates that the correction fails, multiple timestamps can be re-acquired according to the time error calculated in S220 to re-correct the system time of the slave clock module.
  • a re-correction mechanism is designed in the event that the system time correction of the slave clock module fails.
  • the system time correction of the slave clock module fails, multiple timestamps can be re-acquired to re-correct the system time of the slave clock module, thereby improving the time correction accuracy.
  • the time correction method provided in the embodiment of the present application can be applied to computing devices of various architectures, and can be applied to X86 architecture and ARM64 architecture, for example.
  • both the master clock module and the slave clock module are Ubuntu operating systems, and based on the creation steps of the first channel introduced in S210, two unix domain socket files vm1.ctl and vm2.ctl are created on the master clock module; two virtual serial ports vport2p1 and vport2p2 are generated on the slave clock module, and vm1.ctl and vm2.ctl are mapped one-to-one with vport2p1 and vport2p2, respectively.
  • the time error between the master clock module and the slave clock module is calculated to test the correction effect.
  • the time error between the master clock module and the slave clock module is calculated after time correction using the Chrony time synchronization service as a control group. The test results are shown in Table 1.
  • Table 1 shows that on the X86 architecture, the time correction method provided in the embodiment of the present application can reduce the time error between the virtual machine and the host to about 40 microseconds (us), and stabilize it at the microsecond level, while the existing time synchronization technology Chrony time synchronization service can only reduce the time error between the virtual machine and the host to about 2000us (i.e. 2 milliseconds (ms)).
  • the time correction method provided in the embodiment of the present application can reduce the time error between the virtual machine and the host to about 400us, while the Chrony time synchronization service can only reduce it to about 4100us (ie 4ms).
  • the time correction method provided in the embodiment of the present application has high time correction accuracy and can reduce the time error between the slave clock module and the master clock module from the millisecond level to the microsecond level.
  • each node such as the master clock module and the slave clock module, includes a hardware structure and/or software module corresponding to each function in order to realize the above functions.
  • the method of the embodiment of the present application can be implemented in the form of hardware, software, or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
  • the embodiment of the present application can divide the functional modules of the master clock module and the slave clock module according to the above method example.
  • each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.
  • the above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. It can be implemented in practice. There are other ways to divide it.
  • the computing device shown in the present application may adopt the composition structure shown in Figure 7 or include the components shown in Figure 7.
  • Figure 7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application.
  • the computing device may be a master clock module or a chip or system on chip in the master clock module.
  • the computing device may be a slave clock module or a chip or system on chip in the slave clock module.
  • the computing device may include a processor 701, a communication line 702, and a memory 704.
  • the processor 701 and the memory 704 may be connected via the communication line 702.
  • the processor 701 may include one or more CPUs, such as CPU0 and CPU1 in FIG7 .
  • the computing device includes multiple processors.
  • the processor 701 in FIG. 7 it may also include a processor 707 .
  • the processor 701 may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof.
  • the processor 701 may also be other devices with processing functions, such as circuits, devices, or software modules.
  • the communication line 702 is used to transmit information between the various components included in the computing device.
  • the computing device may also include a memory 704.
  • the memory 704 is used to store instructions, wherein the instructions may be computer programs.
  • the memory 704 can be a read-only memory (ROM) or other types of static storage devices that can store static information and/or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and/or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage, magnetic disk storage media or other magnetic storage devices, and the optical disc storage includes a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, or a Blu-ray disc, etc.
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • CD-ROM compact disc read-only memory
  • magnetic disk storage media or other magnetic storage devices and the optical disc storage includes a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, or a Blu-ray disc, etc.
  • the memory 704 can exist independently of the processor 701, or can be integrated with the processor 701.
  • the memory 704 can be used to store instructions or program codes or some data, etc.
  • the memory 704 can be located in the computing device or outside the computing device, without limitation.
  • the computing device may be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system, or a device having a similar structure as shown in FIG7.
  • the composition structure shown in FIG7 does not constitute a limitation on the time correction device.
  • the computing device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
  • FIG8 shows a structural diagram of a time correction device, which is applied to a slave clock module.
  • Each module in the device shown in FIG8 has the function of implementing the corresponding steps in FIG2 and can achieve its corresponding technical effects.
  • the corresponding beneficial effects of the steps executed by each module can be referred to the description of the corresponding steps in FIG2, and will not be repeated here.
  • the functions can be implemented by hardware or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the time correction device includes:
  • the transceiver module 810 is used to obtain multiple timestamps.
  • the multiple timestamps include timestamps of the moments when the master clock module and the slave clock module send and receive time messages respectively when the master clock module and the slave clock module send and receive time messages to each other at least twice.
  • the master clock module and the slave clock module send and receive time messages through a first channel.
  • the first channel is implemented by mapping between the Unex domain socket file installed by the master clock module and the virtual serial port installed by the slave clock module, and the virtual serial port is obtained by the master clock module starting the VirtIO driver in the slave clock module.
  • the processing module 820 is used to determine the time error of the slave clock module relative to the master clock module according to the multiple timestamps.
  • the processing module 820 is further configured to correct the system time of the slave clock module according to the time error.
  • the transceiver module 810 is specifically configured to:
  • a first time message is received, where the first time message carries a first timestamp, and the first timestamp represents a time when the master clock module sends the first time message.
  • a second timestamp is recorded, where the second timestamp represents the time when the master clock module receives the first time message.
  • a second time message is sent to the master clock module, and a third time stamp is recorded, wherein the third time stamp represents the time when the slave clock module sends the second time message.
  • a third time message is received, where the third time message is sent by the master clock module to the slave clock module in response to the second time message, and the third time message includes a fourth timestamp, where the fourth timestamp indicates the time when the master clock module receives the second time message.
  • the master clock module is a clock module of a master operating system
  • the slave clock module is a guest operating system
  • a virtio serial field and an unexchange field are set in a boot configuration extensible markup language file of a slave clock module.
  • the virtual serial port is obtained by the master clock module by starting the VirtIO driver in the slave clock module according to the startup configuration XML file with the virtio serial field and the Unex field added. Among them, one virtual serial port corresponds to one Unex domain socket file.
  • processing module 820 is specifically configured to:
  • the time error is input into a preset computer function to correct the system time of the slave clock module.
  • processing module 820 is further configured to:
  • the slave clock module After the slave clock module corrects the time of the slave clock module according to the time error, and the result output by the preset computer function indicates that the system time correction of the slave clock module fails, multiple time stamps are reacquired to recorrect the system time of the slave clock module.
  • FIG9 shows a structural diagram of a time correction device, which is applied to a main clock module.
  • Each module in the device shown in FIG9 has the function of implementing the corresponding steps in FIG2 and can achieve its corresponding technical effects.
  • the corresponding beneficial effects of the steps executed by each module can be referred to the description of the corresponding steps in FIG2, and will not be repeated here.
  • the functions can be implemented by hardware or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the time correction device includes:
  • the sending module 910 is used to send at least two time messages to the slave clock module through the first channel.
  • the time message includes a timestamp of the time when the master clock module sends the time message; the first channel is realized by mapping the Unex domain socket file installed by the master clock module with the virtual serial port installed by the slave clock module, and the virtual serial port is obtained by the master clock module starting the VirtIO driver in the slave clock module.
  • the apparatus further includes a receiving module 920;
  • a sending module 910 is used to send a first time message to the slave clock module, where the first time message carries a first timestamp, and the first timestamp indicates the time when the master clock module sends the first time message;
  • a receiving module 920 configured to receive a second time message from a slave clock module
  • the sending module 910 is used to send a third time message to the slave clock module in response to the second time message, where the third time message includes a fourth timestamp, and the fourth timestamp indicates the time when the master clock module receives the second time message.
  • the master clock module is a clock module of a master operating system; the slave clock module is a clock module of a guest operating system.
  • a virtio serial field and a Unex field are set in the startup configuration extensible markup language file of the slave clock module; the virtual serial port is obtained by the master clock module by starting the VirtIO driver in the slave clock module according to the startup configuration extensible markup language file with the virtio serial field and the Unex field added; wherein, one virtual serial port corresponds to one Unex domain socket file.
  • FIG10 is a structural diagram of a time correction system provided in an embodiment of the present application.
  • the time correction system is a time correction system corresponding to a time correction scenario.
  • the time correction system may include:
  • a master clock module 110 and a slave clock module 120 are connected to A master clock module 110 and a slave clock module 120 .
  • the master clock module 110 is used to send at least two time messages to the slave clock module 120 through the first channel.
  • the time message includes a timestamp of the time when the master clock module 110 sends the time message.
  • the first channel is realized by mapping between the Unex domain socket file installed by the master clock module 110 and the virtual serial port installed by the slave clock module 120.
  • the virtual serial port is obtained by the master clock module 110 starting the VirtIO driver in the slave clock module 120.
  • the slave clock module 120 is configured to receive at least two time messages and record the timestamp of the moment when the at least two time messages are received, and to send at least one time message to the master clock module 110 in response to the first time message of the at least two time messages, and record the timestamp of the moment when the at least one time message is sent.
  • the slave clock module 120 is further used to determine the time error of the slave clock module 120 relative to the master clock module 110 according to the received timestamp and the recorded timestamp.
  • the slave clock module 120 is further used to correct the system time of the slave clock module 120 according to the time error.
  • the embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by a computer program to instruct the relevant hardware, and the program can be stored in the above computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments.
  • the computer-readable storage medium can be a terminal device of any of the above embodiments, such as: an internal storage unit including a data sending end and/or a data receiving end, such as a hard disk or memory of the terminal device.
  • the above computer-readable storage medium can also be an external storage device of the above terminal device, such as a plug-in hard disk equipped on the above terminal device, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. Further, the above computer-readable storage medium can also include both the internal storage unit of the above terminal device and an external storage device.
  • the above computer-readable storage medium is used to store the above computer program and other programs and data required by the above terminal device.
  • the above computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
  • the present application also provides a computer instruction. All or part of the process in the above method embodiment can be completed by computer instructions to instruct related hardware (such as computers, processors, network devices, and terminals, etc.).
  • the program can be stored in the above computer-readable storage medium.
  • the embodiment of the present application also provides a chip system.
  • the chip system can be composed of a chip, or can include a chip and other discrete devices, without limitation.
  • the chip system includes a processor and a transceiver, and all or part of the processes in the above method embodiment can be completed by the chip system, such as the chip system can be used to implement the functions performed by the master clock module in the above method embodiment, or to implement the functions performed by the slave clock module in the above method embodiment.
  • the above-mentioned chip system also includes a memory, which is used to store program instructions and/or data.
  • the processor executes the program instructions stored in the memory so that the chip system performs the functions performed by the main clock module in the above-mentioned method embodiment or performs the functions performed by the slave clock module in the above-mentioned method embodiment.
  • the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
  • the general-purpose processor may be a microprocessor or any conventional processor, etc.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
  • the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as a random-access memory (RAM).
  • the memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
  • the memory in the embodiments of the present application may also be a circuit or any other device that can realize a storage function, for storing instructions and/or data.
  • At least one (item) refers to one or more
  • multiple refers to two or more
  • at least two (items) refers to two or three and more than three
  • and/or is used to describe the association relationship of the associated objects, indicating that there can be three relationships.
  • a and/or B can represent: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an "or” relationship.
  • At least one of the following (items) refers to any combination of these items, including any combination of single items (items) or plural items (items).
  • at least one of a, b or c can represent: a, b, c, "a and b", “a and c", “b and c", or "a and b and c", where a, b, c can be single or multiple.
  • "B corresponding to A" means that B is associated with A.
  • B can be determined based on A.
  • determining B based on A does not mean determining B based only on A, but B can also be determined based on A and/or other information.
  • connection mentioned in the examples refers to various connection modes such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitation on this.
  • the "transmission” (transmit/transmission) appearing in the embodiments of the present application refers to bidirectional transmission, including sending and/or receiving actions.
  • the "transmission” in the embodiments of the present application includes the sending of data, the receiving of data, or the sending of data and the receiving of data.
  • the data transmission here includes uplink and/or downlink data transmission.
  • Data may include channels and/or signals, uplink data transmission is uplink channel and/or uplink signal transmission, and downlink data transmission is downlink channel and/or downlink signal transmission.
  • the "network” and “system” appearing in the embodiments of the present application express the same concept, and the time correction system is a communication network.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
  • each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device, such as: a single-chip microcomputer, a chip, etc., or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, disks, or optical disks.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

La présente demande se rapporte au domaine des communications, et divulgue un procédé et un appareil de correction de temps. Le procédé de correction de temps est appliqué à un dispositif informatique, le dispositif informatique comprend un module d'horloge maître et un module d'horloge esclave, et le procédé est appliqué au module d'horloge esclave. Le procédé comprend les étapes suivantes : lorsque le module d'horloge maître et le module d'horloge esclave s'envoient des messages de temps au moins deux fois, acquisition d'une pluralité d'horodatages du module d'horloge maître et du module d'horloge esclave transmettant et recevant respectivement les messages de temps, le module d'horloge maître et le module d'horloge esclave transmettant et recevant les messages de temps au moyen d'un premier canal, le premier canal étant mis en œuvre au moyen d'un mappage entre un fichier d'interface de connexion de domaine Unix installé dans le module d'horloge maître et un port série virtuel installé dans le module d'horloge esclave, et le port série virtuel étant obtenu en démarrant un pilote VirtIO dans le module d'horloge esclave par le module d'horloge maître ; détermination d'une erreur de temps du module d'horloge esclave par rapport au module d'horloge maître selon la pluralité d'horodatages ; et correction du temps système du module d'horloge esclave selon l'erreur de temps. La précision de correction de temps du module d'horloge esclave est améliorée.
PCT/CN2023/103446 2022-11-11 2023-06-28 Procédé et appareil de correction de temps WO2024098783A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211414938.9A CN118041477A (zh) 2022-11-11 2022-11-11 时间校正方法及装置
CN202211414938.9 2022-11-11

Publications (1)

Publication Number Publication Date
WO2024098783A1 true WO2024098783A1 (fr) 2024-05-16

Family

ID=90990132

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/103446 WO2024098783A1 (fr) 2022-11-11 2023-06-28 Procédé et appareil de correction de temps

Country Status (2)

Country Link
CN (1) CN118041477A (fr)
WO (1) WO2024098783A1 (fr)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105703865A (zh) * 2014-11-25 2016-06-22 中兴通讯股份有限公司 一种自动获取1588链路非对称性延时的方法及装置
CN106775946A (zh) * 2016-12-16 2017-05-31 无锡华云数据技术服务有限公司 一种虚拟机快速创建方法
US20190097744A1 (en) * 2017-09-28 2019-03-28 Ciena Corporation Pseudowire clock recovery
CN110572230A (zh) * 2019-09-10 2019-12-13 北京邮电大学 一种用于实现时间同步的修正方法及装置
CN111726189A (zh) * 2020-06-15 2020-09-29 哈工大机器人(合肥)国际创新研究院 基于时间戳标记电路的双核系统时钟同步方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105703865A (zh) * 2014-11-25 2016-06-22 中兴通讯股份有限公司 一种自动获取1588链路非对称性延时的方法及装置
CN106775946A (zh) * 2016-12-16 2017-05-31 无锡华云数据技术服务有限公司 一种虚拟机快速创建方法
US20190097744A1 (en) * 2017-09-28 2019-03-28 Ciena Corporation Pseudowire clock recovery
CN110572230A (zh) * 2019-09-10 2019-12-13 北京邮电大学 一种用于实现时间同步的修正方法及装置
CN111726189A (zh) * 2020-06-15 2020-09-29 哈工大机器人(合肥)国际创新研究院 基于时间戳标记电路的双核系统时钟同步方法及装置

Also Published As

Publication number Publication date
CN118041477A (zh) 2024-05-14

Similar Documents

Publication Publication Date Title
US11550819B2 (en) Synchronization cache seeding
EP3982261A1 (fr) Procédé et appareil de traitement d'e/s
US9081709B2 (en) Virtualizable and forward-compatible hardware-software interface
US20140348182A1 (en) Time synchronization between nodes of a switched interconnect fabric
CN106775946B (zh) 一种虚拟机快速创建方法
Stuedi et al. jverbs: Ultra-low latency for data center applications
CN110046050B (zh) 一种核间数据传输的装置和方法
WO2019028682A1 (fr) Procédé et dispositif de gestion de mémoire partagée multi-système
TW202311977A (zh) 用於芯粒系統中的基於睡眠時鐘邊沿的全域計數器同步的系統和方法
WO2024098783A1 (fr) Procédé et appareil de correction de temps
US9619415B2 (en) System and method for intelligent platform management interface keyboard controller style interface multiplexing
WO2016188014A1 (fr) Procédé et dispositif de stockage de données
CN116848519A (zh) 硬件接口信号的生成方法、装置及电子设备
WO2024016595A1 (fr) Procédé et appareil de mappage rbd-nbd
CN115981892A (zh) 日志读取方法、装置、电子设备及存储介质
CN116601616A (zh) 一种数据处理装置、方法及相关设备
CN114510325A (zh) 任务调度方法、装置及系统
US20230153156A1 (en) Synchronization of system resources in a multi-socket data processing system
WO2022041936A1 (fr) Procédé et dispositif de synchronisation d'horloges dans un système distribué, et système
CN117971135B (zh) 存储设备的访问方法、装置、存储介质和电子设备
WO2024093885A1 (fr) Système de puce et procédé de communication collective
US11847088B2 (en) Data transmission method and device connecting a FPGA with an ARM processor
CN117873853B (zh) 数据记录方法、装置、电子设备及介质
WO2024055679A1 (fr) Procédé, appareil et système de stockage de données, puce et dispositif d'accélération
KR20240095423A (ko) 다중 소켓 데이터 처리 시스템에서의 시스템 자원 동기화

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23887479

Country of ref document: EP

Kind code of ref document: A1