Cloud platform clock timing method and system
By introducing a dedicated clock network and clock timing protocol into the cloud platform, the high cost and poor sharing issues of high-precision clock services on the cloud platform are resolved, and flexible and high-precision clock services are provided for virtualized services, meeting the migration needs of services such as high-speed railway control.
Patent Information
- Application Number
- CN202011545698.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2040-12-23
AI Technical Summary
When existing technologies provide high-precision clock services on cloud platforms, they are subject to significant limitations of virtualization technology, high costs, and poor sharing. These problems make it difficult to meet the high-precision clock requirements of high-speed railway control, earthquake early warning, and other services, making it impossible to migrate these services to cloud platforms.
By introducing a dedicated clock network between the master virtual machine and the business virtual machine in the cloud platform, using the clock source to calibrate the clock of the master virtual machine, and transmitting the timing protocol through the dedicated clock network, accurate clock calibration of the business virtual machine can be achieved, and different clock timing protocols are used to provide flexible timing services for different business virtual machines.
It provides flexible and high-precision clock services for virtualized businesses on the cloud platform, reduces costs, improves resource utilization and scalability of the cloud platform, and meets the business migration requirements of high-precision clock needs.
Smart Images

Figure CN112583513B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud technology, and in particular to a cloud platform clock timing method and system. Background Art
[0002] Virtualization technology typically provides clock services for services within virtual machines through virtualized clocks. Virtualized clocks often experience clock drift, which increases with service runtime. Cloud platforms based on virtualization technology typically use the Network Time Protocol (NTP) for clock synchronization, achieving millisecond-level timing accuracy. However, many services, such as high-speed rail control, earthquake warning, intelligent power generation control, and industrial measurement, require high-precision clock equipment to provide precise control and measurement results. The high-precision clock requirements of these services pose significant challenges in migrating them to the cloud, preventing them from leveraging the cloud platform's high resource utilization, region-independence, high service availability, and elastic scalability. Consequently, most of these services remain unvirtualized and run offline, resulting in resource monopoly, poor collaboration, and a lack of rapid scalability.
[0003] Existing solutions for introducing high-precision clocks into VMs rely on specific virtualization technologies (such as KVM) and attempt to integrate high-precision clocks into VMs through dedicated system calls, providing precise timing services for virtualized services. However, these solutions are either significantly limited by virtualization technology, making them applicable only to specific platforms, or require dedicated clock devices for each server, resulting in poor sharing. Furthermore, larger cloud platforms can be costly. Summary of the Invention
[0004] In view of this, the present invention provides a cloud platform clock timing method and system to improve the flexibility of providing clock timing for virtualized services and reduce the cost of cloud platform precise timing services.
[0005] In order to achieve the above object, the present invention adopts the following scheme:
[0006] According to one aspect of an embodiment of the present invention, a cloud platform clock timing method is provided, including:
[0007] The clock of the master virtual machine is calibrated according to the precise clock of the clock source to obtain the calibrated master virtual machine clock, and the precise clock service is provided through the formed virtual clock card;
[0008] According to the clock service port identifier of the first business virtual machine to be timed, find the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, and obtain the first clock timing protocol between the first business virtual machine and the master virtual machine;
[0009] According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide precise clock services.
[0010] In some embodiments, the clock of the master virtual machine is calibrated according to the precise clock of the clock source to obtain the calibrated master virtual machine clock, and a virtual clock card is formed to provide precise clock services, including: when the clock source is an external clock source, the clock of the master control node where the master virtual machine is located is used as a transparent clock, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, the clock of the master virtual machine is calibrated according to the precise clock of the clock source and the clock of the master control node where the master virtual machine is located to obtain the calibrated master virtual machine clock, and a virtual clock card is formed to provide precise clock services; or, when the clock source is a built-in clock board, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, the clock of the master virtual machine is calibrated according to the precise clock of the clock source to obtain the calibrated master virtual machine clock, and a virtual clock card is formed to provide precise clock services.
[0011] In some embodiments, when the clock source is an external clock source, the clock of the master node where the master virtual machine is located is used as a transparent clock, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, and the clock of the master virtual machine is calibrated according to the precise clock of the clock source and the clock of the master node where the master virtual machine is located to obtain the calibrated master virtual machine clock, and form a virtual clock card to provide precise clock service, including: using the transparent clock to calculate the residence and delay of the business node where the master virtual machine is located to calibrate the clock time of the master virtual machine, and form a virtual clock card to provide precise clock service.
[0012] In some embodiments, based on the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide precise clock services, including: using the clock of the master virtual machine and the clock of the first business virtual machine as boundary clocks, and using the clock of the business node where the first business virtual machine is located as a transparent clock, based on the first clock timing protocol between the first business virtual machine and the master virtual machine, through a dedicated clock network, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock and the clock of the business node where the first business virtual machine is located, and a virtual clock card is formed to provide precise clock services.
[0013] In some embodiments, the clock of the master virtual machine and the clock of the first business virtual machine are used as boundary clocks, and the clock of the business node where the first business virtual machine is located is used as a transparent clock. According to the first clock timing protocol between the first business virtual machine and the master virtual machine, through a dedicated clock network, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock and the clock of the business node where the first business virtual machine is located, and a virtual clock card is formed to provide precise clock services, including: using the transparent clock to calculate the residence and delay of the business node where the first business virtual machine is located to calibrate the clock time of the first business virtual machine, and forming a virtual clock card to provide precise clock services.
[0014] In some embodiments, based on the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide precise clock services, including: when the first business virtual machine is implemented based on a non-virtual machine, based on the third clock timing protocol between the business node where the first business virtual machine is located and the master virtual machine, through the dedicated clock network, the clock of the business node where the first business virtual machine is located is calibrated according to the calibrated master virtual machine clock, and the calibrated business node clock where the first business virtual machine is located is obtained as the proxy clock of the master virtual machine; wherein, the non-virtual machine includes a bare metal server; according to the fourth clock timing protocol between the business node where the first business virtual machine is located and the first business virtual machine, the clock of the first business virtual machine is calibrated according to the proxy clock of the master virtual machine, and a virtual clock card is formed to provide precise clock services; wherein, the first clock timing protocol includes a third clock timing protocol and a fourth clock timing protocol.
[0015] In some embodiments, the cloud platform clock timing method further includes: in the case where the master virtual machine is unavailable, calibrating the clock of the disaster recovery master virtual machine according to the precise clock of the disaster recovery clock source, obtaining the calibrated disaster recovery master virtual machine clock, and forming a virtual clock card to provide precise clock services; according to the clock service port identifier of the first business virtual machine to be timed, searching for the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, and obtaining the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine; based on the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine, calibrating the clock of the first business virtual machine according to the calibrated disaster recovery master virtual machine clock through a dedicated clock network, forming a virtual clock card to provide precise clock services.
[0016] In some embodiments, according to a first clock timing protocol between the first service virtual machine and the master virtual machine, the clock of the first service virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide a precise clock service, including: according to the first clock timing protocol between the first service virtual machine and the master virtual machine, according to the calibrated master virtual machine clock through a dedicated clock network, the clock frequency and clock time of the first service virtual machine are calibrated, and a virtual clock card is formed to provide a precise clock service;
[0017] According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock frequency of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, including: the master virtual machine sends a synchronization message according to the first clock timing protocol between the first business virtual machine and the master virtual machine through the dedicated clock network according to the calibrated master virtual machine clock period, wherein the synchronization message includes a first timestamp of the current clock of the master virtual machine; the first business virtual machine receives the synchronization message and records the second timestamp of the received synchronization message; calculates a first time interval between the first timestamps of two different synchronization messages and a second time interval between the second timestamps of the corresponding two different synchronization messages; adjusts the clock frequency of the first business virtual machine to make it consistent with the clock frequency of the master virtual machine by comparing the first time interval and the second time interval; or includes: according to the first clock timing protocol between the first business virtual machine and the master virtual machine, through the dedicated clock network, according to the calibrated master virtual machine clock, sending a synchronization message and a tracking message to the first business virtual machine to calibrate the clock frequency of the first business virtual machine;
[0018] According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock time of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, including: according to the first clock timing protocol between the first business virtual machine and the master virtual machine, through the dedicated clock network, the master virtual machine sends a message message at a first moment, the message message includes a timestamp of the first moment based on the current clock of the master virtual machine; the first business virtual machine receives the message message at a second moment, and records the timestamp of the second moment based on the current clock of the first business virtual machine, and extracts the timestamp of the first moment from the message message; the first business virtual machine sends a delay request message to the master virtual machine at a third moment, the delay request message includes a timestamp of the first moment based on the current clock of the first business virtual machine timestamp of the third moment of the clock; the master virtual machine receives the delay request message at the fourth moment, and sends the timestamp of the fourth moment based on the current clock of the master virtual machine to the first business virtual machine through the delay request message; calculate the average delay according to the timestamp of the first moment, the timestamp of the second moment, the timestamp of the third moment and the timestamp of the fourth moment; use the average delay to calibrate the clock time of the first business virtual machine to synchronize it with the time of the current clock of the business host; or, including: according to the first clock timing protocol between the first business virtual machine and the master virtual machine, through the dedicated clock network, send a message message, a delay request message and a tracking message to the first business virtual machine according to the calibrated master virtual machine clock to calibrate the clock time of the first business virtual machine.
[0019] According to another aspect of an embodiment of the present invention, a cloud platform clock timing system is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the above embodiments when executing the program.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0021] The cloud platform clock timing method, cloud platform clock timing system, and computer-readable storage medium of the embodiments of the present invention obtain a corresponding clock timing protocol based on the correspondence between the control virtual machine clock service port identifier, the business virtual machine clock service port identifier, and the clock timing protocol, and perform clock calibration on the corresponding business virtual machine according to the clock timing protocol. This allows different clock authorization protocols to be used between different master virtual machines and business virtual machines, making timing for virtualized services more flexible and less restricted. Because the clock source directly corrects the master virtual machine, and the number of master virtual machines is relatively small, while the number of business virtual machines is relatively large, the cost will not increase significantly when the cloud platform scale increases and the number of business virtual machines increases. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 1 is a flow chart of a cloud platform clock timing method according to an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of the topological structure of a cloud platform clock timing system according to a specific embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of interaction for performing frequency synchronization of a service virtual machine in a single-step manner according to an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of an interaction for synchronizing service virtual machine frequencies in a multi-step manner according to an embodiment of the present invention;
[0027] Figure 5 This is an interactive diagram of performing service virtual machine time synchronization in a single-step manner in one embodiment of the present invention.
[0028] Figure 6 This is a schematic diagram of the interaction of multi-step time synchronization of business virtual machines in one embodiment of the present invention. DETAILED DESCRIPTION
[0029] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0030] It should be noted in advance that the descriptions of the following embodiments or examples or the features mentioned therein can be combined with the features of other embodiments or examples in the same or similar manner, or replace the features of other embodiments or examples to form possible implementations. In addition, the term "include / comprise" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence of one or more other features, elements, steps, or components.
[0031] In response to the problems that existing solutions for providing accurate timing for virtualized services have large limitations, poor sharing, and a sharp increase in cost as the scale of the cloud platform increases, the present invention provides a cloud platform clock timing method to solve these problems.
[0032] Figure 1 FIG. 1 is a flow chart of a cloud platform clock timing method according to an embodiment of the present invention. Figure 1 As shown, the cloud platform clock timing method of this embodiment may include steps S110 to S130.
[0033] It's important to note that a clock source is a device that provides a precise clock. Nodes such as master nodes and service nodes can refer to servers and are also called hosts. When disconnected from the internet, master nodes, master VMs, service nodes, and service VMs can each have their own clock, called a local clock.
[0034] The specific implementation of steps S110 to S130 will be described in detail below.
[0035] Step S110: calibrate the clock of the master virtual machine according to the precise clock of the clock source to obtain the calibrated master virtual machine clock, and form a virtual clock card to provide clock services.
[0036] In step S110, the clock frequency and clock synchronization of the master virtual machine can be calibrated through frequency synchronization and time synchronization based on the precise clock of the clock source. The clock source can be an external clock source or a built-in clock board, for example, a shared GPS or BeiDou satellite.
[0037] In some embodiments, the above-mentioned step S110, that is, calibrating the clock of the master virtual machine according to the precise clock of the clock source to obtain the calibrated master virtual machine clock, and forming a virtual clock card to provide clock services, may specifically include the following steps: S111. When the clock source is an external clock source, the clock of the master node where the master virtual machine is located is used as a transparent clock, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, and the clock of the master virtual machine is calibrated according to the precise clock of the clock source and the clock of the master node where the master virtual machine is located to obtain the calibrated master virtual machine clock, and form a virtual clock card to provide clock services.
[0038] In step S111, clock calibration calculations can be performed using the boundary clock and the transparent clock. The transparent clock can participate in the calibration clock calculations, but it is not required to calibrate the local clock of the master node where the master VM resides. In other embodiments, the local clock of the master node where the master VM resides can also be calibrated.
[0039] Step S111 may include calculating the residency and latency of the service node where the master VM resides using a transparent clock to calibrate the master VM's clock time and form a virtual clock card to provide clock services. The transparent clock time may be equivalent to the clock of the master node where the master VM resides. In this embodiment, the residency and latency of the service node may be calculated using existing methods.
[0040] In other embodiments, step S110, i.e., calibrating the master VM's clock based on the precise clock source to obtain the calibrated master VM clock and forming a virtual clock card to provide clock services, may specifically include step S112: if the clock source is a built-in clock card, using the clock source's clock and the master VM's clock as boundary clocks, calibrating the master VM's clock based on the precise clock source to obtain the calibrated master VM clock, and forming a virtual clock card to provide clock services. In this embodiment, the built-in clock card can be directly plugged into the node's physical server to provide a precise clock for the virtual machine, thereby eliminating the need for a transparent clock.
[0041] Step S120: According to the clock service port identifier of the first business virtual machine to be timed, the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol is searched to obtain the first clock timing protocol between the first business virtual machine and the master virtual machine.
[0042] In step S120, the clock timing protocol between a master virtual machine and a business virtual machine can be various clock timing protocols that provide timing for virtualized services. For a cloud platform system, a correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol can be established in advance. At the master virtual machine end, the correspondence can be found based on the master virtual machine's clock service port identifier (such as port number) and the clock service port identifier (such as port number) of the business virtual machine to be timed, so that the master virtual machine can send synchronization messages, time messages, etc. to the business virtual machine based on the found clock timing protocol, and the business virtual machine can return messages, messages, etc. to the business host based on the clock timing protocol. In this way, the business virtual machine and different business virtual machines can use their own clock timing protocols to perform clock timing, calibration, etc., so that the master virtual machine can use different clock timing protocols to perform clock timing, calibration, etc. on different business virtual machines.
[0043] Step S130: Based on the first clock timing protocol between the first service virtual machine and the master virtual machine, the clock of the first service virtual machine is calibrated according to the calibrated master virtual machine clock through the dedicated clock network, and a virtual clock card is formed to provide clock services.
[0044] In step S130, the dedicated clock network can be a network independent of other cloud platform system networks (such as the management network and service network), specifically used for clock timing. By providing time synchronization to service VMs over the dedicated network, the network is not interfered with by other information transmissions. Therefore, the round-trip transmission paths can be symmetrical during clock timing. Therefore, the delay from the master VM to the service VM, or the delay from the service VM to the master VM, can be selected as the average path delay.
[0045] In a further embodiment, Figure 1 The cloud platform clock timing method shown may also include the following steps: according to the clock service port identifier of the second business virtual machine to be timed, searching for the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, obtaining the second clock timing protocol between the second business virtual machine and the master virtual machine, and forming a virtual clock card to provide clock services; according to the second clock timing protocol between the second business virtual machine and the master virtual machine, calibrating the clock of the second business virtual machine according to the calibrated master virtual machine clock through a dedicated clock network, and forming a virtual clock card to provide clock services; wherein, the first clock timing protocol and the second clock timing protocol are the same or different.
[0046] In a specific implementation, step S130 may include step S133: calibrating the clock frequency and clock time of the first service VM using the calibrated master VM clock via a dedicated clock network according to the first clock timing protocol between the first service VM and the master VM, thereby forming a virtual clock card to provide precise clock services. In this embodiment, calibrating the clock frequency and clock time can achieve more accurate clock calibration.
[0047] In some specific embodiments, clock frequency calibration or synchronization can be performed via a single-step message. For example, in step S133, the clock frequency of the first service virtual machine is calibrated based on the calibrated master virtual machine clock via a dedicated clock network according to the first clock timing protocol between the first service virtual machine and the master virtual machine. Specifically, the following steps may be included: S1331, the master virtual machine sends a synchronization message based on the calibrated master virtual machine clock period via a dedicated clock network according to the first clock timing protocol between the first service virtual machine and the master virtual machine, wherein the synchronization message includes a first timestamp of the master virtual machine's current clock; S1332, the first service virtual machine receives the synchronization message and records a second timestamp of the received synchronization message; S1333, calculating a first time interval between the first timestamps of two different synchronization messages and a second time interval between the second timestamps of the two different synchronization messages; S1334, adjusting the clock frequency of the first service virtual machine to be consistent with the clock frequency of the master virtual machine by comparing the first time interval and the second time interval. The synchronization message may be a SYNC message.
[0048] In other specific embodiments, clock frequency calibration or synchronization can be performed through multi-step messages. For example, in the above step S133, according to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock frequency of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network. Specifically, the step S1335 may include: according to the first clock timing protocol between the first business virtual machine and the master virtual machine, through the dedicated clock network, according to the calibrated master virtual machine clock, sending a synchronization message and a tracking message to the first business virtual machine to calibrate the clock frequency of the first business virtual machine. The synchronization message may be a SYNC message, and the tracking message may be a Follow-up message.
[0049] In some other specific embodiments, clock time calibration or synchronization can be performed through single-step messages. For example, in the above step S133, according to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock time of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network. Specifically, the following steps may be included: S1341, according to the first clock timing protocol between the first business virtual machine and the master virtual machine, through a dedicated clock network, the master virtual machine sends a message message at the first moment, the message message includes a timestamp of the first moment based on the current clock of the master virtual machine; S1351, the first business virtual machine receives the message message at the second moment, and records the timestamp of the second moment based on the current clock of the first business virtual machine, and extracts the timestamp of the first moment from the message message. Timestamp; S1361, the first business virtual machine sends a delay request message to the master virtual machine at the third moment, and the delay request message includes the timestamp of the third moment based on the current clock of the first business virtual machine; S1371, the master virtual machine receives the delay request message at the fourth moment, and sends the timestamp of the fourth moment based on the current clock of the master virtual machine to the first business virtual machine through the delay request message; S1381, calculate the average delay according to the timestamp of the first moment, the timestamp of the second moment, the timestamp of the third moment and the timestamp of the fourth moment; S1391, use the average delay to calibrate the clock time of the first business virtual machine to synchronize it with the time of the current clock of the business host.
[0050] In some further specific embodiments, clock time calibration or synchronization can be performed via multiple message steps. For example, in step S133, calibrating the clock time of the first service VM based on the calibrated master VM clock via a dedicated clock network according to the first clock timing protocol between the first service VM and the master VM may specifically include the following steps: S13101: sending a message message, a delay request message, and a tracking message to the first service VM via the dedicated clock network according to the calibrated master VM clock according to the first clock timing protocol between the first service VM and the master VM to calibrate the clock time of the first service VM.
[0051] In some embodiments, the above-mentioned step S130, that is, calibrating the clock of the first business virtual machine according to the calibrated master virtual machine clock through a dedicated clock network based on the first clock timing protocol between the first business virtual machine and the master virtual machine, may specifically include the steps of: S131, using the clock of the master virtual machine and the clock of the first business virtual machine as boundary clocks, and the clock of the business node where the first business virtual machine is located as a transparent clock, and calibrating the clock of the first business virtual machine according to the calibrated master virtual machine clock and the clock of the business node where the first business virtual machine is located through a dedicated clock network based on the first clock timing protocol between the first business virtual machine and the master virtual machine, and forming a virtual clock card to provide precise clock services.
[0052] In step S130, the transparent clock and boundary clock can participate in the clock calibration calculation, but the transparent clock is not used to calibrate the local clock. Therefore, the clock of the service node where the first service virtual machine is located does not need to be calibrated. In other embodiments, the clock of the service node where the first service virtual machine is located can also be calibrated.
[0053] In a specific implementation, step S131 may include the following step: S1311: Calculating the residency and latency of the service node where the first service VM resides using a transparent clock to calibrate the clock time of the first service VM and form a virtual clock card to provide precise clock services; wherein the transparent clock is the clock of the service node where the first service VM resides. In this embodiment, calculating the residency and latency on the service node where the service VM resides can make the clock calibration result more accurate.
[0054] In other embodiments, the above-mentioned step S130, that is, calibrating the clock of the first business virtual machine according to the calibrated master virtual machine clock through a dedicated clock network based on the first clock timing protocol between the first business virtual machine and the master virtual machine, may specifically include the steps of: S1321, when the first business virtual machine is implemented based on a non-virtual machine, calibrating the clock of the business node where the first business virtual machine is located according to the third clock timing protocol between the business node where the first business virtual machine is located and the master virtual machine through a dedicated clock network according to the calibrated master virtual machine clock, and obtaining the calibrated business node clock where the first business virtual machine is located as the proxy clock of the master virtual machine; wherein, the non-virtual machine includes a bare metal server; S1322, calibrating the clock of the first business virtual machine according to the proxy clock of the master virtual machine according to the fourth clock timing protocol between the business node where the first business virtual machine is located and the first business virtual machine, and forming a virtual clock card to provide precise clock services; wherein, the first clock timing protocol includes the third clock timing protocol and the fourth clock timing protocol.
[0055] In this embodiment, the non-virtual machine implementation can be a bare metal server. In this case, the master virtual machine is used to calibrate the business node where the business virtual machine is located, and then the clock of the business node is used to calibrate the business virtual machine on the business node. In this way, the business node where the business virtual machine is located acts as a clock agent and can be used to replace the master virtual machine to calibrate the business virtual machines therein.
[0056] In a further embodiment, the method described in the above embodiment may further include the step of: calibrating the clock of the third service VM located on the service node where the first service VM is located using the proxy clock of the master VM according to a fifth clock timing protocol between the service node where the first service VM is located and the third service VM; wherein the first clock timing protocol also includes a fifth clock timing protocol, and the fourth clock timing protocol and the fifth clock timing protocol are the same or different. The master VM's clock proxy, i.e., the clock proxy on the service node, can perform clock timing for each service VM on that service node.
[0057] In a further embodiment, Figure 1The cloud platform clock timing method shown may also include the following steps: S140, when the master virtual machine is unavailable, calibrating the clock of the disaster recovery master virtual machine according to the precise clock of the disaster recovery clock source, obtaining the calibrated disaster recovery master virtual machine clock, and forming a virtual clock card to provide precise clock services; S150, according to the clock service port identifier of the first business virtual machine to be timed, searching for the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, and obtaining the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine; S160, based on the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine, calibrating the clock of the first business virtual machine according to the calibrated disaster recovery master virtual machine clock through a dedicated clock network, and forming a virtual clock card to provide precise clock services.
[0058] In this embodiment, there can be multiple master virtual machines in the cloud platform system. Different master virtual machines can be on different master nodes. Different master virtual machines can be calibrated using different clock sources. When the master virtual machine (master) is unavailable, the master virtual machine (backup) (disaster recovery master virtual machine) can be used to synchronize time to the business virtual machine.
[0059] In addition, an embodiment of the present invention also provides a cloud platform clock timing system, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the steps of the method described in any of the above embodiments are implemented.
[0060] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described in any of the above embodiments when executed by a processor.
[0061] The above method is described below in conjunction with a specific embodiment. However, it should be noted that this specific embodiment is only for better illustrating the present application and does not constitute an improper limitation to the present application.
[0062] Figure 2 This is a schematic diagram of the topological structure of the cloud platform clock timing system according to a specific embodiment of the present invention. Figure 2The cloud platform includes control nodes 1, 2, and 3, as well as service nodes 1 and 2. Each control node may include a management virtual machine (VM) and a master VM. Each service node may include one or more service VMs, with the management VM connected to the service VMs via a management network. The cloud platform precision clock timing system of this embodiment may include a clock source (master), a clock source (backup), a clock network, and the like. The clock source may be an external clock source or a built-in clock board that provides a precise clock, such as a GPS satellite receiver or a BeiDou satellite receiver. The clock network is a proprietary network independent of the management network, service network, and the like, used to implement clock synchronization signal exchange. The clock network ensures the symmetry of the round-trip path of the clock synchronization signal. The master VM may serve as a boundary clock, receiving signals from the clock source and providing clock services to each service VM on the cloud platform. The host machine may refer to a node such as a control node or service node in the cloud platform system. It may participate in clock adjustment calculations as a transparent clock node, but may not correct the node's local clock. It may also participate in calculations as a boundary clock within a clock path and correct the local clock. The business virtual machine can serve as a normal clock, as the end point of timing, send and receive clock synchronization messages, continuously synchronize with the master clock or boundary clock and correct the local clock, thereby providing precise (such as microsecond level) clock services for virtualized services.
[0063] The system can accurately synchronize time by playing the role of each node in clock synchronization (such as transparent clock, boundary clock, etc.). By synchronizing the clocks of each node, the precise time consistent with the shared clock source can be obtained. Each node mainly includes two processes: frequency synchronization and time synchronization.
[0064] Both control nodes and service nodes can refer to physical servers (host machines). The master VM, service VM, and host machine all have their own clocks when not connected to the internet. These clocks are called local clocks. In a single-step approach, only sync messages can be sent. In a multi-step approach, multiple messages can be sent. For example, in a two-step approach, a sync message and a follow-up message can be sent. In this case, calibration occurs only after both the sync message and the follow-up message are received and matched. The arrival times of the sync message and the follow-up message may differ, so you can choose a single time to calculate latency and residency. Latency refers to the time it takes to send a message between the master VM and the service VM, and residency refers to the time it stays on the host machine (network card) (such as the gray block corresponding to "transparent transmission" in the figure). For example, calibration can be done in 1 second, or calibration can be performed only when the deviation exceeds a certain level.
[0065] The host agent can output the master VM as a yellow block, "Master," and the host (node) connected to it as an input "Slave." The "Slave" is then followed by the service VM connected to it as an input "Slave." This means that after calibrating the master VM according to the clock source, the host is calibrated according to the master VM, and finally the service VM is calibrated according to the host. This shifts the master clock function of the master VM down to the host, which is closer to the service VMs above it, resulting in more accurate calibration. A boundary clock can have a yellow block "Master" on the input, a "Slave" on the output, and no gray block "Transparent." This clock participates in computational clock synchronization and has both "Master" and "Slave." This type of clock is called a boundary clock. A transparent clock can be "Transparent" and does not participate in computational clock synchronization, making it a transparent clock. Time messages, such as sync messages, follow-up messages, and delay-resp messages, are all sent as time messages.
[0066] The main requirement is that the clocks of the master virtual machine and the business virtual machine are synchronized. If the host machines can also be synchronized, the clock timing will be more accurate.
[0067] The following uses IEEE 1588V2 as an example to illustrate how to achieve precise timing.
[0068] S1. Master virtual machine clock synchronization:
[0069] The master virtual machine can achieve a unified clock source for the cloud platform through different precise clock protocols or the clock provided by the synchronization clock card.
[0070] S2. Business virtual machine clock synchronization:
[0071] It may include frequency synchronization and time synchronization, which may be implemented in a single-step or multi-step manner.
[0072] S21. Frequency synchronization: The frequency synchronization of business virtual machines can be divided into single-step and multi-step methods.
[0073] like Figure 3 As shown, in single-step mode, the master VM's clock program periodically sends SYNC messages, which can carry the current clock timestamp Tx_M. After receiving the SYNC message, the service VM records the time of receipt, which can be recorded as Tx_S, where x is 1, 2, 3, ..., n, and n is a positive integer.
[0074] The business virtual machine can calculate the time interval between sending two sets of synchronization messages (expressed as Fm = Tn_M–T1_M) and receiving them (expressed as Fs = Tn_S–T1_S). Because this time interval, that is, the frequency of the clock and the clock beat are linearly related, as long as the time of the business virtual machine is adjusted to make Fs gradually approach Fm, the frequency of the clock of the master virtual machine can be maintained at the same frequency.
[0075] like Figure 4 As shown, the business virtual machine can also use the tracking message (Follow_up) to calculate the residence in a multi-step manner. The SYNC message (synchronization message) carries the sending time. Adding the time when the SYNC message carried by the Follow_up message leaves, the residence time of the message can be calculated, so that the calculation of the business clock will be more accurate.
[0076] S22. Time synchronization: The service VM continuously exchanges time messages with the master VM, records the timestamps generated when the time messages are exchanged, calculates the average path delay and time deviation between the master and slave devices, and achieves time synchronization between the master and slave devices.
[0077] See also Figure 5 , the master virtual machine sends a SYNC message at time T1_M. Time T1_M is transmitted to the service virtual machine along with the SYNC message. The service virtual machine device receives the SYNC message at time T1_S and obtains the time T1_M (timestamp) from the SYNC message. The service virtual machine sends a Delay_Req message (delay request message) to the master virtual machine at time T2_S. The master virtual machine receives the Delay_Req message at time T2_M, and the master device then sends the time T2_M to the service virtual machine through the Delay_Resp message. Through the above message transmission process, the service virtual machine can obtain the time of each moment T1_M, T1_S, T2_S, and T2_M4, and can use these four times to calculate the average path delay between the master virtual machine and the service virtual machine. Path latency: Average latency = [(T2_M – T1_M) + (T2_S – T1_S)] / 2. Because the clock network is symmetrical, the difference between the outbound and return latencies is minimal. Service VMs can use the SYNC message time and average latency to check and adjust their local clocks.
[0078] The system can support multi-step mode, see Figure 6 , the optional Follow_Up message can be used to carry the departure time to calculate the residence time for higher accuracy.
[0079] S3. Host clock processing
[0080] Under normal circumstances, the host can act as a transparent clock, participating in the calculation of business VM time synchronization, improving the clock accuracy of the business VM by calculating latency and resident time, but it does not update the local clock. In some special cases (such as when some services are not implemented on VMs, such as on bare metal servers), the host can act as a boundary clock, updating the local clock and acting as a proxy for the master clock, shortening the clock synchronization path and making the business clock more accurate.
[0081] In this embodiment, by designing a symmetrical dedicated network, executing different actions through different clock nodes, and sharing the clock source at the platform level, a universal, low-cost precision clock solution that is independent of virtualization technology is implemented, which facilitates the cloud migration of precision clock-sensitive services. By designing a proprietary clock network within the cloud platform, defining the role of each node in clock synchronization, and being compatible with the currently common standard precision clock protocol, precise timing is achieved for each business virtual machine by sharing a precise clock and a symmetrical clock synchronization path. Based on a proprietary clock network, by sharing the precise clock source provided by GPS or Beidou satellites, and using a dedicated network to complete clock synchronization technology, microsecond (sub-microsecond) clock services are provided for the cloud platform's services.
[0082] In summary, the cloud platform clock timing method, cloud platform clock timing system, and computer-readable storage medium of the embodiments of the present invention obtain a corresponding clock timing protocol based on the correspondence between the control virtual machine clock service port identifier, the business virtual machine clock service port identifier, and the clock timing protocol, and calibrate the clock of the corresponding business virtual machine according to the clock timing protocol. This allows different clock authorization protocols to be used between different master virtual machines and business virtual machines, making timing for virtualized services more flexible and less restricted. Since the clock source directly corrects the master virtual machine, and the number of master virtual machines is relatively small, while the number of business virtual machines is relatively large, the cost will not increase significantly when the scale of the cloud platform increases and the number of business virtual machines increases.
[0083] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present invention, and the order of steps therein is not limited and can be appropriately adjusted as needed.
[0084] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0088] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A cloud platform clock timing method, characterized in that: include: Calibrate the master VM's clock based on the precise clock source to obtain the calibrated master VM clock and create a virtual clock card to provide clock services. In the event that the master virtual machine is unavailable, the clock of the disaster recovery master virtual machine is calibrated according to the precise clock of the disaster recovery clock source to obtain the calibrated disaster recovery master virtual machine clock, forming a virtual clock card to provide precise clock services; the clock source provides precise clocks through an external clock source or a built-in clock board; In the case where the clock source is an external clock source, the clock of the master control node where the master virtual machine is located is used as a transparent clock, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, the clock of the master virtual machine is calibrated according to the precise clock of the clock source and the clock of the master control node where the master virtual machine is located, the calibrated master virtual machine clock is obtained, and a virtual clock card is formed to provide a precise clock service; or, in the case where the clock source is a built-in clock board, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, the clock of the master virtual machine is calibrated according to the precise clock of the clock source, the calibrated master virtual machine clock is obtained, and a virtual clock card is formed to provide a precise clock service; According to the clock service port identifier of the first business virtual machine to be timed, find the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, and obtain the first clock timing protocol between the first business virtual machine and the master virtual machine; According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide precise clock services.
2. The cloud platform clock timing method according to claim 1, wherein: In the case where the clock source is an external clock source, the clock of the master control node where the master virtual machine is located is used as a transparent clock, the clock of the clock source and the clock of the master virtual machine are used as boundary clocks, the clock of the master virtual machine is calibrated according to the precise clock of the clock source and the clock of the master control node where the master virtual machine is located, the calibrated master virtual machine clock is obtained, and a virtual clock card is formed to provide a precise clock service, including: The transparent clock is used to calculate the residency and latency of the business node where the master virtual machine is located to calibrate the clock time of the master virtual machine and form a virtual clock card to provide accurate clock services.
3. The cloud platform clock timing method according to claim 1, wherein: According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide accurate clock services, including: The clocks of the master virtual machine and the first business virtual machine are used as boundary clocks, and the clock of the business node where the first business virtual machine is located is used as a transparent clock. According to the first clock timing protocol between the first business virtual machine and the master virtual machine, through a dedicated clock network, the clock of the first business virtual machine is calibrated according to the calibrated clock of the master virtual machine and the clock of the business node where the first business virtual machine is located, and a virtual clock card is formed to provide precise clock services.
4. The cloud platform clock timing method according to claim 3, wherein: The clocks of the master virtual machine and the first service virtual machine are used as boundary clocks, and the clock of the service node where the first service virtual machine is located is used as a transparent clock. According to the first clock timing protocol between the first service virtual machine and the master virtual machine, the clock of the first service virtual machine is calibrated according to the calibrated clocks of the master virtual machine and the service node where the first service virtual machine is located through a dedicated clock network, and a virtual clock card is formed to provide precise clock services, including: The transparent clock is used to calculate the residency and delay of the service node where the first service virtual machine is located to calibrate the clock time of the first service virtual machine and form a virtual clock card to provide accurate clock services.
5. The cloud platform clock timing method according to claim 1, wherein: According to the first clock timing protocol between the first business virtual machine and the master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, and a virtual clock card is formed to provide accurate clock services, including: In the case where the first business virtual machine is implemented based on a non-virtual machine, according to a third clock timing protocol between the business node where the first business virtual machine is located and the master virtual machine, the clock of the business node where the first business virtual machine is located is calibrated according to the calibrated clock of the master virtual machine through a dedicated clock network, and the calibrated clock of the business node where the first business virtual machine is located is obtained as the proxy clock of the master virtual machine; wherein the non-virtual machine includes a bare metal server; According to the fourth clock timing protocol between the service node where the first service virtual machine is located and the first service virtual machine, the clock of the first service virtual machine is calibrated according to the proxy clock of the master virtual machine, and a virtual clock card is formed to provide accurate clock services; The first clock timing protocol includes a third clock timing protocol and a fourth clock timing protocol.
6. The cloud platform clock timing method according to claim 1, wherein: Also includes: In the case where the master virtual machine is unavailable, the clock of the disaster recovery master virtual machine is calibrated according to the precise clock of the disaster recovery clock source to obtain the calibrated disaster recovery master virtual machine clock, forming a virtual clock card to provide precise clock services; According to the clock service port identifier of the first business virtual machine to be synchronized, find the correspondence between the master virtual machine clock service port identifier, the business virtual machine clock service port identifier and the clock timing protocol, and obtain the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine; According to the clock timing protocol between the first business virtual machine and the disaster recovery master virtual machine, the clock of the first business virtual machine is calibrated according to the calibrated disaster recovery master virtual machine clock through a dedicated clock network to form a virtual clock card to provide accurate clock services.
7. The cloud platform clock timing method according to claim 1, wherein: According to a first clock timing protocol between the first service virtual machine and the master virtual machine, the clock of the first service virtual machine is calibrated according to the calibrated clock of the master virtual machine through a dedicated clock network, and a virtual clock card is formed to provide a precise clock service, including: according to the first clock timing protocol between the first service virtual machine and the master virtual machine, the clock frequency and clock time of the first service virtual machine are calibrated according to the calibrated clock of the master virtual machine through a dedicated clock network, and a virtual clock card is formed to provide a precise clock service; According to a first clock timing protocol between the first service virtual machine and the master virtual machine, the clock frequency of the first service virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, including: The master virtual machine sends a synchronization message according to the calibrated master virtual machine clock period through the dedicated clock network based on the first clock timing protocol between the first service virtual machine and the master virtual machine, wherein the synchronization message includes a first timestamp of the current clock of the master virtual machine; The first service virtual machine receives the synchronization message and records the second timestamp of receiving the synchronization message; Calculating a first time interval of first timestamps of two different synchronization messages and a second time interval of second timestamps of the two different synchronization messages; By comparing the first time interval and the second time interval, adjusting the clock frequency of the first service virtual machine to keep it consistent with the clock frequency of the master virtual machine; Alternatively, according to a first clock timing protocol between the first service virtual machine and the master virtual machine, a synchronization message and a tracking message are sent to the first service virtual machine through a dedicated clock network according to the calibrated master virtual machine clock to calibrate the clock frequency of the first service virtual machine; According to a first clock timing protocol between the first service virtual machine and the master virtual machine, the clock time of the first service virtual machine is calibrated according to the calibrated master virtual machine clock through a dedicated clock network, including: According to a first clock timing protocol between the first service virtual machine and the master virtual machine, the master virtual machine sends a message message at a first moment through a dedicated clock network, wherein the message message includes a timestamp of the first moment based on the current clock of the master virtual machine; The first service virtual machine receives the message message at the second moment, records the timestamp of the second moment based on the current clock of the first service virtual machine, and extracts the timestamp of the first moment from the message message; The first service virtual machine sends a delay request message to the master virtual machine at the third moment, where the delay request message includes a timestamp of the third moment based on the current clock of the first service virtual machine; The master virtual machine receives the delay request message at the fourth moment, and sends the timestamp of the fourth moment based on the current clock of the master virtual machine to the first service virtual machine through the delay request message; Calculate the average delay according to the timestamp of the first moment, the timestamp of the second moment, the timestamp of the third moment, and the timestamp of the fourth moment; Calibrate the clock time of the first service virtual machine using the average delay to synchronize it with the current clock time of the service host; Alternatively, based on the first clock timing protocol between the first business virtual machine and the master virtual machine, a message message, a delay request message and a tracking message are sent to the first business virtual machine through a dedicated clock network according to the calibrated master virtual machine clock to calibrate the clock time of the first business virtual machine.
8. A cloud platform clock timing system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Multistage clock synchronization method for edge cloud
CN111294135A
Clock synchronization in cloud computing
US20160006804A1