Time synchronization method for medical equipment, time synchronization equipment and medical equipment

By sending network delay measurement packets and timestamp packets in medical equipment, the time synchronization between the controlled device and the main control device is realized, and the problems of frequent message packet transmission and low time synchronization accuracy in the prior art are solved, and the real-time and accuracy of the system are improved.

CN119814215APending Publication Date: 2025-04-11SHANGHAI UNITED IMAGING HEALTHCARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411986320.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The message packets required for time synchronization in existing medical devices are frequently sent, occupying too much bandwidth, affecting the real-timeness of the data transmission control system, and the time synchronization accuracy is low.

Method used

After the time synchronization device is powered on, the controlled device control sends a network delay measurement packet to the main control device, calculates and transmits the delay time. The main control device sends a time stamp packet based on the set time interval, and the controlled device adjusts the local clock based on the delay time and the time stamp packet to achieve time synchronization.

Benefits of technology

It reduces the transmission of messages, reduces the bandwidth load on the network system, and improves the time synchronization accuracy. It is suitable for medical equipment with high requirements for real-time and accuracy, such as CT systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814215A_ABST
    Figure CN119814215A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of medical treatment, and provides a time synchronization method and device for medical equipment, time synchronization equipment and the medical equipment, and the method comprises the steps that after being powered on, a controlled device sends a network delay measurement packet to a master control device through at least one data exchange routing device; calculating delay time based on the network delay measurement packet, and sending the delay time to the controlled device; the master control device sends a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval; and the controlled device adjusts a local clock of the controlled device based on the delay time and the timestamp packet, so that the controlled device and the master control device are in time synchronization. According to the invention, the message transmission is reduced, the bandwidth load of a network system is reduced, and the time synchronization precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of medical technology, and in particular, relates to a time synchronization method, device, time synchronization device and medical device for medical equipment. Background Art

[0002] At present, in the field of medical systems, the controlled devices and the main control devices in medical equipment (such as CT systems) need to be synchronized. In the traditional 1588 Ethernet time synchronization, including ordinary clock (OC), boundary clock (BC), end-to-end transparent clock (E2ETC), peer-to-peer transparent clock (P2PTC) and management node, the messages included are usually: Sync, Delay_Req, Delay_Resp, Follow_Up, Pdelay_Req, Pdelay_Resp, etc. It can be seen that various message packets in the prior art are sent frequently, occupying too much bandwidth, which will affect the real-time control of the data transmission control system in the same network. At the same time, its time synchronization accuracy is also low. Summary of the invention

[0003] The embodiments of the present application provide a time synchronization method, apparatus, time synchronization device and medical device for medical equipment to solve the problems existing in the prior art that various message packets are frequently sent, occupying too much bandwidth, thereby affecting the real-time performance of the data transmission control system in the same network, and its time synchronization accuracy is also low.

[0004] In a first aspect, an embodiment of the present application provides a time synchronization method for a medical device, comprising:

[0005] After the time synchronization device is powered on, controlling the controlled device to send a network delay measurement packet to the main control device through at least one data exchange routing device;

[0006] Based on the received network delay measurement packet, calculate the delay time and send the delay time to the controlled device;

[0007] Controlling the main control device to send a time stamp packet to the controlled device through at least one data exchange routing device based on a set time interval;

[0008] The controlled device is controlled to adjust the local clock of the controlled device based on the delay time and each time stamp packet, so that the controlled device is synchronized with the master control device.

[0009] The embodiment of the present application provides a time synchronization method for medical equipment. After the time synchronization device is powered on, the controlled device sends a network delay measurement packet to the main control device through at least one data exchange routing device; the main control device calculates the delay time based on the network delay measurement packet and sends the delay time to the controlled device; the main control device sends a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval; the controlled device adjusts the local clock of the controlled device based on the delay time and the timestamp packet to synchronize the time of the controlled device with the main control device. Compared with the prior art that requires sending multiple different types of data packets, such as Sync, Delay_Req, Delay_Resp, Follow_Up, Pdelay_Req and Pdelay_Resp, the present application reduces the transmission of messages and only needs to send network delay measurement packets, delay time and timestamp packets, thereby reducing the bandwidth load on the network system, thereby avoiding affecting the real-time control of the data transmission control system in the same network. At the same time, field programmable gate array chips are provided in the main control device, the controlled device and at least one data exchange routing device. The present application can utilize the high real-time and low jitter characteristics of FPGA to optimize the switching network in which the entire time synchronization device is located, and perform high-precision adjustment on the local clock of the controlled device, thereby improving the time synchronization accuracy, and is suitable for scenarios such as CT systems that have relatively high requirements for real-time and accuracy.

[0010] In a possible implementation manner of the first aspect, controlling the controlled device to adjust a local clock of the controlled device based on the delay time and each timestamp packet includes:

[0011] For any transmission, the controlled device is controlled to adjust the local clock based on the delay time to obtain the initial time of the local clock under any transmission;

[0012] The controlled device is controlled to adjust the initial time of the local clock at any transmission based on the timestamp packet and the number of transmissions at any transmission, so as to obtain the target time of the local clock at any transmission; the number of transmissions refers to the number of times the master control device has sent the timestamp packet to the controlled device until the moment of any transmission.

[0013] In the above implementation, since there is a delay in the transmission process, this embodiment can first perform an initial adjustment on the local clock of the controlled device according to the delay time, and then adjust the local clock again in combination with the timestamp packet sent each time and the number of times it is sent, thereby improving the adjustment accuracy and precision of the local clock.

[0014] In an implementation manner of the first aspect, controlling the controlled device to adjust the initial time of the local clock at any transmission based on the timestamp packet and the number of transmissions at any transmission to obtain the target time of the local clock at any transmission includes:

[0015] When the number of transmissions is less than or equal to the first threshold, the controlled device is controlled to calculate a first deviation under any transmission based on a timestamp packet under any transmission and an initial time under any transmission, and adjust the initial time based on the first deviation under any transmission to obtain a target time;

[0016] When the number of transmissions is greater than the first threshold value and less than or equal to the second threshold value, the controlled device is controlled to determine the initial time of any transmission as the target time;

[0017] When the number of transmissions is greater than the second threshold and after the set time of the second threshold number of transmissions, the controlled device is controlled to calculate the second deviation under any transmission based on the timestamp packet under any transmission and the initial time under any transmission, and the number of clk processing corresponding to any transmission is calculated based on the second deviation under any transmission, the second threshold, the set time interval and the set clock cycle; the local clock is adjusted based on the second deviation and the number of clk processing under any transmission to obtain the target time.

[0018] In the above implementation, accurate adjustment of the local clock of the controlled device is achieved, thereby further improving the time synchronization accuracy.

[0019] In an implementation of the first aspect, the first threshold, the second threshold, and the set time are determined according to the following method:

[0020] Acquire the environment information of the time synchronization device, the first device information of the master control device, and the second device information of the controlled device;

[0021] The environmental information, the first device information and the second device information are input into a trained threshold prediction model for processing to obtain a first threshold, a second threshold and a set time; the threshold prediction model is trained by a pre-built neural network model.

[0022] In the above implementation, targeted settings of the first threshold, the second threshold and the set time are achieved, so that the first threshold, the second threshold and the set time are more matched with the environment and each device in which the time synchronization device is located, thereby further achieving accurate adjustment of the local clock to avoid excessive time deviation.

[0023] In an implementation of the first aspect, the first threshold, the second threshold, and the set time are determined according to the following method:

[0024] Pre-adjust the local clock based on the first initial value, the second initial value and the initial time, and obtain the deviation value of the local clock corresponding to the adjustment end time; the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial set time corresponds to the set time;

[0025] If the deviation value is greater than the set deviation, the first initial value is adjusted based on the first increase number, the second initial value is adjusted based on the second increase number, the initial time is adjusted based on the set duration, and the process returns to execute the steps of pre-adjusting the local clock based on the first initial value, the second initial value and the initial time, and obtaining the deviation value corresponding to the local clock at the adjustment end time and subsequent steps, until the deviation value obtained after adjustment is less than or equal to the set deviation;

[0026] The adjusted first initial value, the second initial value and the initial setting time corresponding to the deviation value obtained after adjustment are respectively determined as the first threshold, the second threshold and the setting time.

[0027] In the above implementation, the first threshold, the second threshold and the set time are set in a targeted manner, so that the local clock can be further accurately adjusted in combination with the first threshold, the second threshold and the set time to avoid excessive time deviation.

[0028] In one embodiment of the first aspect, the method further comprises:

[0029] For any adjustment, if the clock deviation corresponding to any adjustment is less than or equal to the first set deviation, the controlled device is controlled to adjust the local clock based on the clock deviation; the clock deviation includes the first deviation or the second deviation;

[0030] If the clock deviation corresponding to any adjustment is greater than the first set deviation and less than or equal to the second set deviation, the controlled device is controlled to update the clock deviation and adjust the local clock based on the updated clock deviation;

[0031] If the clock deviation corresponding to any adjustment is greater than the second set deviation, the first frequency of the master control device and the second frequency of the controlled device are adjusted, and / or the delay time is adjusted.

[0032] In the above implementation, when the clock deviation is small, the local clock can be adjusted directly based on the clock deviation to achieve accurate adjustment of the local clock; and when the clock deviation is large, the frequency of each device can be adjusted to ensure the subsequent time synchronization accuracy of the local clock.

[0033] In an implementation of the first aspect, after controlling the controlled device to adjust the local clock of the controlled device based on the delay time and each time stamp packet, the method further includes:

[0034] If the time synchronization device has a node restart operation, the first frequency of the master control device and the second frequency of the controlled device are adjusted, and / or the delay time is adjusted; the node restart operation refers to that any one of the master control device, the controlled device and at least one data exchange routing device performs a restart operation;

[0035] If the time deviations corresponding to each of the consecutive set sending times are greater than the third set deviation, the first frequency of the master control device, the second frequency of the controlled device are adjusted, and / or the delay time is adjusted; the time deviation corresponding to any one of the consecutive set sending times refers to the deviation between the master clock of the master control device and the local clock of the controlled device under any one of the consecutive set sending times.

[0036] In the above implementation, when there is a node restart operation in the time synchronization device, or when the time deviations corresponding to the continuous settings and sending are greater than the third set deviation, it means that there is a large error in the time synchronization at this time. Therefore, the time synchronization device can adjust the first frequency of the master control device, the second frequency of the controlled device, and / or adjust the delay time to improve the subsequent time synchronization accuracy.

[0037] In a second aspect, an embodiment of the present application provides a time synchronization device for medical equipment, comprising:

[0038] A first sending unit, configured to control the controlled device to send a network delay measurement packet to the main control device through at least one data exchange routing device after the time synchronization device is powered on;

[0039] A first calculation unit, configured to calculate a delay time based on a received network delay measurement packet, and send the delay time to the controlled device;

[0040] A second sending unit, used to control the main control device to send a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval;

[0041] The first adjustment unit is used to control the controlled device to adjust the local clock of the controlled device based on the delay time and each time stamp packet, so as to synchronize the time of the controlled device with the main control device.

[0042] In an implementation manner of the second aspect, the first adjustment unit specifically includes:

[0043] A second adjustment unit, for controlling the controlled device to adjust the local clock based on the delay time for any transmission, to obtain the initial time of the local clock under any transmission;

[0044] The third adjustment unit is used to control the controlled device to adjust the initial time of the local clock at any sending based on the timestamp packet and the number of sendings at any sending, so as to obtain the target time of the local clock at any sending; the number of sendings refers to the number of times the main control device has sent the timestamp packet to the controlled device until the moment of any sending.

[0045] In an implementation manner of the second aspect, the third adjustment unit specifically includes:

[0046] A second calculation unit is used for controlling the controlled device to calculate a first deviation under any transmission based on a timestamp packet under any transmission and an initial time under any transmission when the number of transmissions is less than or equal to a first threshold value, and to adjust the initial time based on the first deviation under any transmission to obtain a target time;

[0047] A first determining unit, configured to control the controlled device to determine the current time corresponding to each reception of the timestamp packet as the target time when the number of transmissions is greater than the first threshold and less than or equal to the second threshold;

[0048] The third calculation unit is used to control the controlled device to calculate the second deviation of each transmission based on the current time corresponding to the timestamp packet sent each time and the timestamp packet received each time when the number of transmissions is greater than the second threshold and the local clock reaches the set time, and calculate the number of clk processing corresponding to each transmission based on the second deviation of each transmission, the second threshold, the set time interval and the set clock cycle; adjust the local clock based on the second deviation of each transmission and the number of clk processing to obtain the target time.

[0049] In an implementation of the second aspect, the time synchronization device further includes:

[0050] A first acquisition unit, used to acquire environment information of the time synchronization device, first device information of the master control device, and second device information of the controlled device;

[0051] An input unit is used to input environmental information, the first device information and the second device information into a trained threshold prediction model for processing to obtain a first threshold, a second threshold and a set time; the threshold prediction model is trained by a pre-built neural network model.

[0052] In an implementation of the second aspect, the time synchronization device further includes:

[0053] A second acquisition unit is used to pre-adjust the local clock based on the first initial value, the second initial value and the initial time, and obtain the deviation value of the local clock corresponding to the adjustment end time; the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial set time corresponds to the set time;

[0054] an execution unit, configured to adjust the first initial value based on the first increase number, adjust the second initial value based on the second increase number, adjust the initial time based on the set duration, and return to execute the steps of pre-adjusting the local clock based on the first initial value, the second initial value, and the initial time, and obtaining the deviation value corresponding to the local clock at the end time of the adjustment, and subsequent steps, if the deviation value is greater than the set deviation, until the deviation value obtained after adjustment is less than or equal to the set deviation;

[0055] The second determining unit is used to determine the adjusted first initial value, the second initial value and the initial time corresponding to the deviation value obtained after adjustment as the first threshold, the second threshold and the set time respectively.

[0056] In an implementation of the second aspect, the time synchronization device further includes:

[0057] A first control unit, for controlling the controlled device to adjust the local clock based on the clock deviation for any adjustment if the clock deviation corresponding to any adjustment is less than or equal to the first set deviation; the clock deviation includes the first deviation or the second deviation;

[0058] A second control unit, configured to control the controlled device to update the clock deviation if the clock deviation corresponding to any adjustment is greater than the first set deviation and less than or equal to the second set deviation, and adjust the local clock based on the updated clock deviation;

[0059] The third control unit is used to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if the clock deviation corresponding to any adjustment is greater than the second set deviation.

[0060] In an implementation of the second aspect, the time synchronization device further includes:

[0061] a fourth adjustment unit, configured to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if a node restart operation exists in the time synchronization device; the node restart operation refers to that any one of the master control device, the controlled device, and at least one data exchange routing device performs a restart operation;

[0062] or,

[0063] The fifth adjustment unit is used to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if the time deviations corresponding to each of the consecutive set sending times are greater than the third set deviation; the time deviation corresponding to any one of the consecutive set sending times refers to the deviation between the master clock of the master control device and the local clock of the controlled device under any one of the consecutive set sending times.

[0064] In a third aspect, an embodiment of the present application provides a time synchronization device, a main control device, a controlled device, at least one data exchange routing device, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a time synchronization method for medical equipment as described in any one of the first aspects above.

[0065] In a fourth aspect, an embodiment of the present application provides a medical device, comprising the time synchronization device as described in the third aspect.

[0066] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the time synchronization method for a medical device as described in any one of the above-mentioned first aspects is implemented.

[0067] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a time synchronization device, the time synchronization device can execute the time synchronization method for medical equipment described in any one of the first aspects above. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0069] Figure 1 It is a structural diagram of a time synchronization device provided by an embodiment of the present application;

[0070] Figure 2 is a flow chart of an implementation method for time synchronization of medical devices provided in one embodiment of the present application;

[0071] Figure 3 is a flow chart of an implementation method for time synchronization of medical equipment provided by another embodiment of the present application;

[0072] Figure 4is a flowchart of a time synchronization method for medical equipment provided in yet another embodiment of the present application;

[0073] Figure 5 is a flow chart of an implementation method for time synchronization of medical equipment provided by another embodiment of the present application;

[0074] Figure 6 is a flow chart of an implementation method for time synchronization of medical equipment provided by another embodiment of the present application;

[0075] Figure 7 is a flow chart of an implementation method for time synchronization of medical equipment provided by another embodiment of the present application;

[0076] Figure 8 is a flow chart of an implementation method for time synchronization of medical equipment provided by another embodiment of the present application;

[0077] Fig. 9 is a structural schematic diagram of a time synchronization device for medical equipment provided by an embodiment of the present application;

[0078] Fig.10 It is a structural diagram of a time synchronization device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0079] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0080] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0081] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0082] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0083] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0084] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0085] At present, in data transmission control systems (such as CT systems), the controlled device and the master control device need to be synchronized. In the traditional 1588 Ethernet time synchronization, including ordinary clock (OC), boundary clock (BC), end-to-end transparent clock (E2ETC), peer-to-peer transparent clock (P2PTC) and management node, the messages included are usually: Sync, Delay_Req, Delay_Resp, Follow_Up, Pdelay_Req, Pdelay_Resp, etc. It can be seen that the message packets in the prior art are sent frequently, occupying too much bandwidth, which will affect the real-time control of the data transmission control system in the same network. At the same time, its time synchronization accuracy is also low.

[0086] Based on this, the present application proposes a time synchronization method for medical equipment to avoid the frequent sending of various data packets, reduce the bandwidth requirements of the network system, and improve the time synchronization accuracy.

[0087] See also Figure 1 , Figure 1 Schematic diagram of the structure of a time synchronization device provided by an embodiment of the present application. Figure 1As shown, the time synchronization device 1 includes: a master control device 10 , at least one data exchange routing device 20 (only two are shown in the figure) and a controlled device 30 .

[0088] In some possible embodiments, at least one data exchange routing device 20 may include a first type routing device and a second type routing device (not shown in the figure), the first type routing device is respectively connected to the main control device 10 and the second type routing device, and the second type routing device is connected to the controlled device 30. The above communication connection mode may be a wired communication connection or a wireless communication connection, which is not limited here.

[0089] The first type of routing device is located at the side of the main control device 10 , and is used to send various data packets sent by the main control device 10 to the second type of routing device, and to send data packets sent by the second type of routing device to the main control device 10 .

[0090] The second type of routing device is located at the side of the controlled device 30 , and is used to send various data packets sent by the controlled device 30 to the first type of routing device, and send data packets sent by the first type of routing device to the controlled device 30 .

[0091] In the embodiment of the present application, a field programmable gate array (FPGA) chip is disposed in the main control device 10 , the controlled device 30 , and at least one data exchange routing device 20 .

[0092] Based on this, the main control device 10, the controlled device 30 and at least one data exchange routing device 20 can all use their own FPGA chips to implement the time synchronization method for medical equipment proposed in this application.

[0093] In the embodiment of the present application, the time synchronization device 1 is arranged in a medical device.

[0094] It should be noted that, taking the medical device as a CT system as an example, the main control device 10 in the time synchronization device 1 may include a main control computer in the CT system, and the controlled device 30 may include a high voltage generator in the CT system.

[0095] See also Figure 2 , Figure 2 The embodiment of the present application provides a flow chart of a time synchronization method for medical devices. In the embodiment of the present application, the execution subject of the time synchronization method for medical devices is a time synchronization device.

[0096] like Figure 2 As shown, the time synchronization method for medical equipment provided in an embodiment of the present application may include S101 to S104, which are described in detail as follows:

[0097] In S101, after the time synchronization device is powered on, the controlled device is controlled to send a network delay measurement packet to the master control device through at least one data exchange routing device.

[0098] In an embodiment of the present application, after the time synchronization device is powered on, the time synchronization device can control the establishment of a communication connection between the master device, the controlled device and at least one data exchange routing device, that is, complete network negotiation, so that subsequent data interaction can be performed.

[0099] After the master device, the controlled device and at least one data exchange routing device complete network negotiation, the time synchronization device can control the controlled device to send a network delay measurement packet to the master device through multiple data exchange routing devices. The network delay measurement packet is used to instruct the master device to calculate the delay time between the master device and the controlled device.

[0100] In some possible embodiments, in order to reduce errors and improve the accuracy of the master device's calculation of the delay time, the controlled device may send n network delay measurement packets to the master device. Wherein, n may be determined according to actual needs and is not limited here. It should be noted that n is a positive integer.

[0101] In S102, based on the received network delay measurement packet, a delay time is calculated and sent to the controlled device.

[0102] In an embodiment of the present application, after the time synchronization device detects that the master control device has received a network delay measurement packet sent by the controlled device, the time synchronization device can control the master control device to calculate the delay time based on the sending time of the network delay measurement packet and the receiving time of the network delay measurement packet.

[0103] In some possible embodiments, when the controlled device sends n network delay measurement packets to the master control device, the master control device may receive n network delay measurement packets.

[0104] In this embodiment, for any network delay measurement packet sent, the time synchronization device can control the main control device to calculate the delay time corresponding to the network delay measurement packet according to the sending time and receiving time of the network delay measurement packet.

[0105] Based on this, the main control device can calculate the delay time corresponding to each of the n network delay measurement packets.

[0106] Afterwards, in order to reduce the calculation error of the delay time, the time synchronization device can control the main control device to calculate the average of the delay times corresponding to the above n network delay measurement packets, and determine the calculated average value as the final delay time.

[0107] In the embodiment of the present application, in order to improve the subsequent synchronization accuracy of the local clock of the controlled device, the time synchronization device can control the main control device to send the above calculated delay time to the controlled device through at least one data exchange routing device.

[0108] In S103, the main control device is controlled to send a time stamp packet to the controlled device through at least one data exchange routing device based on a set time interval.

[0109] In the embodiment of the present application, in order to adjust the local clock of the controlled device to improve the time synchronization accuracy, the time synchronization device can control the master device to send a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval. The set time interval can be set according to actual needs and is not limited here.

[0110] In some possible embodiments, since the prior art usually sends data packets with a sending period of 5 milliseconds, that is, the prior art sends a data packet every 5 milliseconds, therefore, in order to further reduce the frequent sending of data packets and reduce the bandwidth load on the network system, in this embodiment, the time interval can be set to 50 milliseconds.

[0111] In S104, the controlled device is controlled to adjust the local clock of the controlled device based on the delay time and each time stamp packet, so that the controlled device is synchronized with the master control device.

[0112] In the embodiment of the present application, the time synchronization device can control the controlled device to adjust its own local clock based on the received delay time and each received timestamp packet, thereby achieving time synchronization between the controlled device and the master control device.

[0113] It should be noted that the timestamp packet includes the time when the master control device sends the timestamp packet.

[0114] In the embodiment of the present application, for each time a timestamp packet is sent, the time synchronization device needs to control the controlled device to adjust its own local clock based on the delay time and the timestamp packet sent this time.

[0115] It should be noted that in order to further improve the time synchronization accuracy, in the embodiment of the present application, the time synchronization device can control the controlled device to adjust the local clock of the controlled device with nanosecond accuracy based on the delay time and the timestamp packet.

[0116] In one embodiment of the present application, in order to improve the adjustment accuracy and precision of the local clock of the controlled device, the time synchronization device can specifically Figure 3 Steps S201 to S202 shown are used to adjust the local clock of the controlled device, as described in detail below:

[0117] In S201, for any transmission, the controlled device is controlled to adjust the local clock based on the delay time to obtain the initial time of the local clock under any transmission.

[0118] It should be noted that the initial time of any transmission is the actual time when the controlled device receives the timestamp packet of any transmission.

[0119] In S202, the controlled device is controlled to adjust the initial time of the local clock at any sending based on the timestamp packet and the number of sendings at any sending, so as to obtain the target time of the local clock at any sending; the number of sendings refers to the number of times the master control device has sent the timestamp packet to the controlled device until the moment of any sending.

[0120] In this embodiment, since the time delay between the master control device and the controlled device always exists, for any transmission, when the time synchronization device controls the controlled device to adjust its own local clock under the any transmission, it is necessary to first control the controlled device to make an initial adjustment to its own local clock based on the previously received delay time to obtain the initial clock of the local clock; thereafter, the time synchronization device can control the controlled device to continue to adjust the initial time after the initial adjustment based on the received timestamp packet under the any transmission and the corresponding number of transmissions to obtain the final target time of the local clock of the controlled device.

[0121] The number of transmissions refers to the number of times the master device has sent the timestamp packet to the controlled device until any transmission time. It should be noted that the number of transmissions includes the number of times the master device has sent the timestamp packet to the controlled device at any transmission time.

[0122] In one embodiment of the present application, in order to achieve accurate adjustment of the local clock of the controlled device to further improve the time synchronization accuracy, for any transmission, the time synchronization device can control the controlled device to compare the number of transmissions corresponding to the timestamp packet under the any transmission with the first threshold and the second threshold, respectively, and accurately adjust the local clock of the controlled device according to the respective comparison results. Among them, the first threshold and the second threshold can be determined according to actual needs and are not limited here.

[0123] It should be noted that the first threshold is less than or equal to the second threshold.

[0124] In some possible embodiments, the first threshold and the second threshold may be determined according to the accuracy requirement of the medical device.

[0125] In this embodiment, the higher the accuracy requirement of the medical device, the larger the first threshold and the second threshold; the lower the accuracy requirement of the medical device, the smaller the first threshold and the second threshold.

[0126] In some other possible embodiments, the first threshold and the second threshold may be determined according to the power-on time of the medical device.

[0127] In this embodiment, the longer the power-on time of the medical device is, the larger the first threshold and the second threshold are; the shorter the power-on time of the medical device is, the smaller the first threshold and the second threshold are.

[0128] In some further possible embodiments, the first threshold and the second threshold may be determined according to the requirements of the medical device for delay error.

[0129] In this embodiment, the higher the delay error requirement of the medical device is, the larger the first threshold and the second threshold are; the lower the delay error requirement of the medical device is, the smaller the first threshold and the second threshold are.

[0130] In some further possible embodiments, the first threshold and the second threshold may be determined according to a device error of the controlled device.

[0131] In this embodiment, the greater the device error of the controlled device is, the greater the first threshold and the second threshold are; the smaller the device error of the controlled device is, the smaller the first threshold and the second threshold are.

[0132] In this embodiment, the time synchronization device can be specifically configured as follows: Figure 4 Steps S301 to S303 shown implement step S202, which are described in detail as follows:

[0133] In S301, when the number of transmissions is less than or equal to a first threshold, the controlled device is controlled to calculate a first deviation under any transmission based on a timestamp packet under any transmission and an initial time under any transmission, and the initial time is adjusted based on the first deviation under any transmission to obtain a target time.

[0134] In this embodiment, for any transmission, when the time synchronization device detects that the number of transmissions corresponding to the timestamp packet under the any transmission is less than or equal to the first threshold, it indicates that it is in the early adjustment stage, that is, the master device and the controlled device have just started time synchronization. Since the time deviation between the master device and the controlled device is relatively large when the master device and the controlled device just start time synchronization, the time synchronization device can control the controlled device to directly calculate the first deviation under the any transmission based on the timestamp packet under the any transmission and the initial time after the initial adjustment under the any transmission, and directly adjust the initial time under the any transmission based on the first deviation under the any transmission to obtain the target time under the any transmission.

[0135] Specifically, for any transmission, the time synchronization device can control the controlled device to calculate the first deviation based on the timestamp packet sent this time and the initial time of this transmission. Afterwards, the time synchronization device can control the controlled device to directly adjust the initial time of the local clock of the controlled device based on the first deviation to obtain the corresponding target time this time.

[0136] In one embodiment of the present application, for any transmission, the first deviation of the transmission = ±[master device time (determined by the timestamp packet of the transmission) - controlled device time (ie, the initial time corresponding to the transmission)].

[0137] Based on this, in this embodiment, for any transmission, when the first deviation under this transmission is a positive value, that is, the time of the master device is greater than the time of the controlled device, the time synchronization device can control the controlled device to directly add the first deviation to the above-mentioned initial time, and the target time of the local clock of the controlled device under this transmission can be obtained.

[0138] In this embodiment, for any transmission, when the first deviation in this transmission is a negative value, that is, the time of the master control device is less than the time of the controlled device, the time synchronization device can control the controlled device to directly subtract the first deviation from the above initial time, and determine the difference after the subtraction as the target time of the local clock of the controlled device in this transmission.

[0139] In S302, when the number of transmissions is greater than the first threshold and less than or equal to the second threshold, the controlled device is controlled to determine an initial time of any transmission as the target time.

[0140] In this embodiment, for any transmission, when the time synchronization device detects that the number of transmissions corresponding to the timestamp packet under the any transmission is greater than the first threshold value and less than or equal to the second threshold value, it indicates that the time is in a stable stage, that is, the master control device and the controlled device are already in a stable stage of time synchronization. Since the time deviation between the master control device and the controlled device is relatively small and can be ignored when the master control device and the controlled device are in a stable stage of time synchronization, the time synchronization device can control the controlled device to directly determine the initial time under the any transmission as the target time.

[0141] In S303, when the number of transmissions is greater than the second threshold and after the set time of the second threshold number of transmissions, the controlled device is controlled to calculate the second deviation under any transmission based on the timestamp packet under any transmission and the initial time under any transmission, and the number of clk processing corresponding to any transmission is calculated based on the second deviation under any transmission, the second threshold, the set time interval and the set clock cycle; the local clock is adjusted based on the second deviation and the number of clk processing under any transmission to obtain the target time.

[0142] In this embodiment, for any transmission, when the time synchronization device detects that the number of transmissions corresponding to the timestamp package under any transmission is greater than the second threshold, and the time corresponding to any transmission is after the set time of the second threshold number of transmissions, it indicates that it is in the late fine-tuning stage, that is, the master device and the controlled device perform late fine-tuning of time synchronization. At this time, in order to further improve the accuracy of time synchronization, the time synchronization device can control the controlled device to calculate the second deviation under any transmission based on the timestamp package under any transmission and the initial time under any transmission. Among them, the set time can be set according to actual needs, and there is no limitation this time. Exemplarily, the set time is greater than the time corresponding to the first threshold.

[0143] In some possible embodiments, the setting time may be determined according to the accuracy requirement of the medical device.

[0144] In this embodiment, the higher the accuracy requirement of the medical device, the longer the setting time; the lower the accuracy requirement of the medical device, the shorter the setting time.

[0145] In some other possible embodiments, the setting time may be determined according to the power-on time of the medical device.

[0146] In this embodiment, the longer the power-on time of the medical device is, the greater the set time is; and the shorter the power-on time of the medical device is, the smaller the set time is.

[0147] In some further possible embodiments, the set time may be determined according to the requirements of the medical device for delay error.

[0148] In this embodiment, the higher the delay error requirement of the medical device is, the longer the setting time is; the lower the delay error requirement of the medical device is, the shorter the setting time is.

[0149] In some other possible embodiments, the setting time may be determined according to the device error of the controlled device.

[0150] In this embodiment, the greater the device error of the controlled device is, the longer the setting time is; and the smaller the device error of the controlled device is, the shorter the setting time is.

[0151] In one embodiment of the present application, for any transmission, the second deviation of the transmission = ±[master device time (determined by the timestamp packet of the transmission) - controlled device time (ie, the initial time corresponding to the transmission)].

[0152] Afterwards, for any transmission, the time synchronization device can control the controlled device to calculate the number of clk processes corresponding to any transmission based on the second deviation, the second threshold, the set time interval and the set clock cycle under the any transmission. Among them, the set clock cycle can be determined according to actual needs and is not limited here.

[0153] In one embodiment of the present application, the number of clk processes corresponding to any one transmission can be calculated according to the following formula:

[0154] X=(N*timestamp) / (loss / T);

[0155] Among them, X represents the number of clk processes corresponding to any one transmission, N represents the second threshold, timestamp represents the set time interval, loss represents the second deviation, and T represents the set clock cycle.

[0156] It should be noted that the above X specifically refers to the number of clk intervals of the local clock of the controlled device at which one clk needs to be inserted / reduced.

[0157] Afterwards, for any transmission, the time synchronization device can control the controlled device to adjust the local clock based on the second deviation and the number of clk processes in any transmission to obtain the target time.

[0158] Specifically, for any transmission, when the first deviation under this transmission is a positive value, that is, the time of the master device is greater than the time of the controlled device, the time synchronization device can control the controlled device to directly add the first deviation to the above-mentioned initial time to obtain the target time of the local clock of the controlled device under this transmission.

[0159] At the same time, for any transmission, when the time synchronization device controls the controlled device to adjust the initial time of the local clock of the controlled device based on the second deviation, the time synchronization device can also control the controlled device to adjust the local clock of the controlled device according to the number of clk processing corresponding to the arbitrary transmission obtained by the above calculation, thereby completing the time adjustment of the local clock of the controlled device under the arbitrary transmission.

[0160] From the above, it can be seen that the embodiment of the present application provides a time synchronization method for medical equipment. After the time synchronization device is powered on, the controlled device sends a network delay measurement packet to the main control device through at least one data exchange routing device; the delay time is calculated based on the network delay measurement packet, and the delay time is sent to the controlled device; the main control device sends a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval; the controlled device adjusts the local clock of the controlled device based on the delay time and the timestamp packet to synchronize the time of the controlled device with the main control device. Compared with the prior art that requires sending multiple different types of data packets, such as Sync, Delay_Req, Delay_Resp, Follow_Up, Pdelay_Req and Pdelay_Resp, the present application reduces the transmission of messages and only needs to send network delay measurement packets, delay time and timestamp packets, thereby reducing the bandwidth load on the network system, thereby avoiding affecting the real-time control of the data transmission control system in the same network. At the same time, field programmable gate array chips are provided in the main control device, the controlled device and at least one data exchange routing device. The present application can utilize the high real-time and low jitter characteristics of FPGA to optimize the switching network in which the entire time synchronization device is located, and perform high-precision adjustment on the local clock of the controlled device, thereby improving the time synchronization accuracy, and is suitable for scenarios such as CT systems that have relatively high requirements for real-time and accuracy.

[0161] In one embodiment of the present application, since the environment in which the time synchronization device is located will affect the master device and the controlled device, and the device performance of the master device and the device performance of the controlled device will have a certain impact on their respective local clocks, thereby affecting the time synchronization accuracy, therefore, in order to achieve accurate adjustment of the local clock of the controlled device to avoid excessive time deviation, the time synchronization device can specifically be performed as follows: Figure 5 Steps S401 to S402 shown determine a first threshold, a second threshold, and a set time.

[0162] Based on this, see Figure 5 , Figure 5 FIG. 1 is a flowchart of a time synchronization method for medical equipment provided in another embodiment of the present application. Figure 1Corresponding to the embodiment, the time synchronization method for medical equipment provided in this embodiment may include S401 to S402, which are described in detail as follows:

[0163] In S401, the environment information of the time synchronization device, the first device information of the master device, and the second device information of the controlled device are obtained.

[0164] In this embodiment, the environmental information includes but is not limited to: temperature and humidity.

[0165] The first device information includes, but is not limited to: the crystal oscillator and manufacturing characteristics of the main control device.

[0166] The second device information includes, but is not limited to: crystal oscillator and manufacturing characteristics of the controlled device.

[0167] In S402, the environmental information, the first device information and the second device information are input into a trained threshold prediction model for processing to obtain a first threshold, a second threshold and a set time; the threshold prediction model is trained by a pre-built neural network model.

[0168] In this embodiment, the time synchronization device may input the above-obtained environmental information, first device information, and second device information into a trained threshold prediction model for processing to obtain a first threshold, a second threshold, and a set time.

[0169] It should be noted that the threshold prediction model can be obtained by training a pre-built deep learning model based on a preset sample set. Wherein, each sample data in the preset sample set includes sample information (including sample environment information, sample first device information and sample second device information) and a sample value corresponding to the sample information (including sample first threshold, sample second threshold and sample setting time). When training the pre-built deep learning model, the sample information (including sample environment information, sample first device information and sample second device information) in each sample data is used as the input of the deep learning model, and the sample value (including sample first threshold, sample second threshold and sample setting time) corresponding to the sample information (including sample environment information, sample first device information and sample second device information) in each sample data is used as the output of the deep learning model. Through training, the deep learning model can learn the correspondence between all possible sample information (including sample environment information, sample first device information and sample second device information) and sample values ​​(including sample first threshold, sample second threshold and sample setting time), and use the trained deep learning model as the threshold prediction model.

[0170] In one embodiment of the present application, in order to improve the prediction accuracy of the first threshold, the second threshold and the set time, the above-mentioned threshold prediction model may include multiple prediction sub-models: a first threshold prediction sub-model, a second threshold prediction sub-model and a set time prediction sub-model.

[0171] It can be seen from the above that the time synchronization method for medical equipment provided in this embodiment realizes the targeted setting of the first threshold, the second threshold and the set time, so that the first threshold, the second threshold and the set time are more matched with the environment and each device in which the time synchronization device is located, and thus can further realize the precise adjustment of the local clock to avoid excessive time deviation.

[0172] See also Figure 6 , Figure 6 FIG. 1 is a flowchart of a time synchronization method for medical equipment provided in another embodiment of the present application. Figure 1 Corresponding to the embodiment, the time synchronization method for medical equipment provided in this embodiment may include S501 to S503, which are described in detail as follows:

[0173] In S501, the local clock is pre-adjusted based on the first initial value, the second initial value and the initial time, and the deviation value of the local clock corresponding to the end time of the adjustment is obtained; the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial set time corresponds to the set time.

[0174] In this embodiment, before formally synchronizing the time of the master device and the controlled device, in order to determine the accurate first threshold, second threshold and set time to improve the time synchronization accuracy, the time synchronization device can control the controlled device to pre-adjust the local clock of the controlled device based on the first initial value, the second initial value and the initial time, and obtain the deviation value corresponding to the local clock at the end of the adjustment. Among them, the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial set time corresponds to the set time.

[0175] It can be understood that the specific process of the time synchronization device controlling the controlled device to pre-adjust the local clock of the controlled device based on the first initial value, the second initial value and the initial time can be seen in detail. Figure 4 The steps S301 to S303 shown are not described in detail here.

[0176] In this embodiment, the deviation value corresponding to the local clock at the adjustment end time specifically refers to the deviation value calculated when the time synchronization device controls the controlled device to perform the last pre-adjustment.

[0177] It should be noted that the first initial value, the second initial value and the initial setting time can be determined according to actual needs and are not limited here. For example, the first initial value can be set to 5 times, the second initial value can be set to 10 times, and the initial setting time can be 250 milliseconds.

[0178] Afterwards, the time synchronization device may compare the calculated deviation value with the set deviation, wherein the set deviation may be set according to actual needs and is not limited here.

[0179] In some possible embodiments, in order to achieve the accuracy of time adjustment at the nanometer level, the set deviation can be set to 1 microsecond.

[0180] In S502, if the deviation value is greater than the set deviation, the first initial value is adjusted based on the first number of increases, the second initial value is adjusted based on the second number of increases, the initial time is adjusted based on the set duration, and the process returns to execute the steps of pre-adjusting the local clock based on the first initial value, the second initial value and the initial time, and obtaining the deviation value corresponding to the local clock at the end of the adjustment, as well as subsequent steps, until the deviation value obtained after adjustment is less than or equal to the set deviation.

[0181] In this embodiment, when the time synchronization device detects that the above deviation value is greater than the set deviation, it indicates that the time synchronization error is large at this time, that is, the first initial value, the second initial value and the initial set time do not meet the requirements. Therefore, the time synchronization device can adjust the first initial value based on the first increase number, adjust the second initial value based on the second increase number, and adjust the initial time based on the set duration, and return to execute step S501 until the deviation value obtained after adjustment is less than or equal to the set deviation. Among them, the first increase number, the second increase number and the set duration can be determined according to actual needs and are not limited here.

[0182] In S503, the adjusted first initial value, the second initial value, and the initial setting time corresponding to the deviation value obtained after adjustment are determined as the first threshold, the second threshold, and the setting time, respectively.

[0183] In this embodiment, since the adjusted deviation value is less than or equal to the set deviation, it means that the adjusted deviation value is small, that is, the adjusted first initial value, second initial value and initial set time corresponding to the adjusted deviation value meet the requirements. Therefore, the time synchronization device can determine the adjusted first initial value as the first threshold, the adjusted second initial value as the second threshold, and the adjusted initial set time as the set time.

[0184] It can be seen from the above that the time synchronization method for medical equipment provided in this embodiment realizes the targeted setting of the first threshold, the second threshold and the set time, so that the combination of the first threshold, the second threshold and the set time at this time can further realize the precise adjustment of the local clock to avoid excessive time deviation.

[0185] See also Figure 7 , Figure 7 FIG. 1 is a flowchart of a time synchronization method for medical equipment provided by another embodiment of the present application. Figure 4 Corresponding to the embodiment, the time synchronization method for medical equipment provided in this embodiment may include S601 to S603, which are described in detail as follows:

[0186] In S601, for any adjustment, if the clock deviation corresponding to any adjustment is less than or equal to the first set deviation, the controlled device is controlled to adjust the local clock based on the clock deviation; the clock deviation includes the first deviation or the second deviation.

[0187] In this embodiment, any adjustment specifically refers to the adjustment made by the controlled device to the initial time of any transmission based on the received timestamp packet of any transmission.

[0188] The clock deviation corresponding to any adjustment specifically refers to the first deviation / second deviation between the timestamp packet sent at any time and the initial time of the any time sent by the controlled device.

[0189] In this embodiment, for any adjustment, when the time synchronization device detects that the clock deviation corresponding to any adjustment is less than or equal to the first set deviation, it indicates that the clock deviation at this time is small. Therefore, the time synchronization device can control the controlled device to adjust the local clock of the controlled device directly based on the clock deviation. The clock deviation includes the first deviation or the second deviation. The first set deviation can be determined according to actual needs and is not limited here.

[0190] In some possible embodiments, in order to achieve precision adjustment of time synchronization at the nanometer level, the first set deviation may be determined to be 1 microsecond.

[0191] In S602, if the clock deviation corresponding to any adjustment is greater than the first set deviation and less than or equal to the second set deviation, the controlled device is controlled to update the clock deviation and adjust the local clock based on the updated clock deviation.

[0192] In this embodiment, for any adjustment, when the time synchronization device detects that the clock deviation corresponding to any adjustment is greater than the first set deviation and less than or equal to the second set deviation, it indicates that the clock deviation at this time is medium. Therefore, in order to further achieve precise adjustment of the local clock, the time synchronization device can control the controlled device to update the clock deviation and adjust the local clock based on the updated clock deviation.

[0193] It can be understood that updating the clock deviation is to recalculate the clock deviation in combination with steps S301 to S303.

[0194] In some possible embodiments, in order to improve the time synchronization accuracy, the second set deviation may be determined to be 3 microseconds.

[0195] In S603, if the clock deviation corresponding to any adjustment is greater than the second set deviation, the first frequency of the master device and the second frequency of the controlled device are adjusted, and / or the delay time is adjusted.

[0196] In this embodiment, for any adjustment, when the time synchronization device detects that the clock deviation corresponding to any adjustment is greater than the second set deviation, it means that the clock deviation at this time is large, that is, the time error between the master control device and the controlled device is large. Therefore, in order to achieve accurate adjustment of the local clock, the time synchronization device can adjust the first frequency of the master control device, the second frequency of the controlled device, and / or adjust the delay time.

[0197] It should be noted that the time synchronization device can determine the first frequency of the master control device and the second frequency of the controlled device based on the existing frequency determination method. After that, the time synchronization device can correct the second frequency based on the ratio between the first frequency and the second frequency to achieve frequency synchronization between the master control device and the controlled device, thereby further improving the synchronization accuracy.

[0198] From the above, it can be seen that the time synchronization method for medical equipment provided in this embodiment can directly adjust the local clock based on the clock deviation when the clock deviation is small, thereby achieving accurate adjustment of the local clock; and when the clock deviation is large, the frequency of each device can be adjusted to ensure the subsequent time synchronization accuracy of the local clock.

[0199] See also Figure 8 , Figure 8 FIG. 1 is a flowchart of a time synchronization method for medical devices provided in another embodiment of the present application. Figure 1 Corresponding to the embodiment, the time synchronization method for medical equipment provided in this embodiment may include S701 to S702, which are described in detail as follows:

[0200] In S701, if there is a node restart operation in the time synchronization device, the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time are adjusted; the node restart operation refers to the master control device, the controlled device and any one of the at least one data exchange routing devices performing a restart operation.

[0201] In this embodiment, in the process of controlling the controlled device to execute step S104, in order to ensure the time synchronization accuracy, for any adjustment sent, the time synchronization device can detect in real time whether there is a node restart operation in itself. The node restart operation refers to the master device, the controlled device, and any one of the at least one data exchange routing devices in the time synchronization device performing a restart operation.

[0202] It should be noted that the adjustment under any transmission specifically refers to the adjustment of the local clock of the controlled device based on the received timestamp packet and delay time of any transmission.

[0203] In this embodiment, after the master device, the controlled device, and any one of the at least one data exchange routing devices in the time synchronization device perform a restart operation, the time error between the any one device and the other devices is large, and the time synchronization between the master device and the controlled device cannot be achieved through subsequent time adjustment. Therefore, in order to improve the synchronization accuracy, the time synchronization device can adjust the first frequency of the master device, the second frequency of the controlled device, and / or adjust the delay time.

[0204] It should be noted that the time synchronization device can determine the first frequency of the master control device and the second frequency of the controlled device based on the existing frequency determination method. After that, the time synchronization device can correct the second frequency based on the ratio between the first frequency and the second frequency to achieve frequency synchronization between the master control device and the controlled device, thereby further improving the synchronization accuracy.

[0205] In S702, if the time deviations corresponding to each of the consecutive set sending times are greater than the third set deviation, the first frequency of the master control device, the second frequency of the controlled device are adjusted, and / or the delay time is adjusted; the time deviation corresponding to any one of the consecutive set sending times refers to the deviation between the master clock of the master control device and the local clock of the controlled device under any one of the consecutive set sending times.

[0206] In this embodiment, when the time synchronization device is controlling the controlled device to execute step S104, when the time synchronization device detects that the time deviations corresponding to the respective consecutive set sending times are greater than the third set deviation, it means that even if the local clock of the controlled device is adjusted, the master control device and the controlled device cannot be synchronized in time. In other words, the time adjustment at this time is invalid. Therefore, in order to achieve accurate adjustment of the local clock, the time synchronization device can adjust the first frequency of the master control device, the second frequency of the controlled device, and / or adjust the delay time.

[0207] The time deviation corresponding to any one of the consecutive set sending times specifically refers to the deviation between the master clock of the master control device and the local clock of the controlled device in any one of the consecutive set sending times.

[0208] The number of consecutive settings can be determined according to actual needs and is not limited here. For example, the number of consecutive settings can be determined to be 3 times.

[0209] The third setting deviation can be determined according to actual needs and is not limited here.

[0210] It should be noted that the third set deviation may be greater than the first set deviation and less than the second set deviation.

[0211] From the above, it can be seen that in the time synchronization method for medical equipment provided in this embodiment, when there is a node restart operation in the time synchronization device, or when the corresponding time deviations at this time are continuously set to be greater than the third set deviation, it means that there is a large error in the time synchronization at this time. Therefore, the time synchronization device can adjust the first frequency of the main control device, the second frequency of the controlled device, and / or adjust the delay time to improve the subsequent time synchronization accuracy.

[0212] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0213] Corresponding to the time synchronization method for medical equipment described in the above embodiment, Fig. 9 The schematic diagram of the structure of a time synchronization device for medical equipment provided by an embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown. Fig. 9 The time synchronization device 800 for medical equipment includes: a first sending unit 81, a first calculating unit 82, a second sending unit 83 and a first adjusting unit 84. Wherein:

[0214] The first sending unit 81 is used to control the controlled device to send a network delay measurement packet to the main control device through at least one data exchange routing device after the time synchronization device is powered on.

[0215] The first calculation unit 82 is used to calculate the delay time based on the received network delay measurement packet, and send the delay time to the controlled device.

[0216] The second sending unit 83 is used to control the main control device to send a timestamp packet to the controlled device through at least one data exchange routing device based on a set time interval.

[0217] The first adjustment unit 84 is used to control the controlled device to adjust the local clock of the controlled device based on the delay time and each time stamp packet, so as to synchronize the time of the controlled device with the main control device.

[0218] In one embodiment of the present application, the first adjustment unit 84 specifically includes: a second adjustment unit and a third adjustment unit.

[0219] in:

[0220] The second adjustment unit is used for controlling the controlled device to adjust the local clock based on the delay time for any transmission, so as to obtain the initial time of the local clock under any transmission.

[0221] The third adjustment unit is used to control the controlled device to adjust the initial time of the local clock at any sending based on the timestamp packet and the number of sendings at any sending, so as to obtain the target time of the local clock at any sending; the number of sendings refers to the number of times the main control device has sent the timestamp packet to the controlled device until the moment of any sending.

[0222] In one embodiment of the present application, the third adjustment unit specifically includes: a second calculation unit, a first determination unit and a third calculation unit.

[0223] The second calculation unit is used to control the controlled device to calculate a first deviation under any sending based on a timestamp packet under any sending and an initial time under any sending when the number of sending times is less than or equal to a first threshold, and adjust the initial time based on the first deviation under any sending to obtain a target time.

[0224] The first determining unit is used to control the controlled device to determine the current time corresponding to each reception of the timestamp packet as the target time when the number of transmission times is greater than the first threshold and less than or equal to the second threshold.

[0225] The third calculation unit is used to control the controlled device to calculate the second deviation of each transmission based on the current time corresponding to the timestamp packet sent each time and the timestamp packet received each time when the number of transmissions is greater than the second threshold and the local clock reaches the set time, and to calculate the number of clk processing corresponding to each transmission based on the second deviation of each transmission, the second threshold, the set time interval and the set clock cycle; and to adjust the local clock based on the second deviation of each transmission and the number of clk processing to obtain the target time.

[0226] In one embodiment of the present application, the time synchronization device 800 for medical equipment further includes: a first acquisition unit and an input unit.

[0227] The first acquisition unit is used to acquire the environment information of the time synchronization device, the first device information of the master control device, and the second device information of the controlled device.

[0228] The input unit is used to input the environmental information, the first device information and the second device information into the trained threshold prediction model for processing to obtain the first threshold, the second threshold and the set time; the threshold prediction model is trained by a pre-built neural network model.

[0229] In one embodiment of the present application, the time synchronization device 800 for medical equipment further includes: a second acquisition unit, an execution unit and a second determination unit.

[0230] The second acquisition unit is used to pre-adjust the local clock based on the first initial value, the second initial value and the initial time, and obtain the deviation value corresponding to the local clock at the end time of the adjustment; the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial set time corresponds to the set time.

[0231] The execution unit is used to adjust the first initial value based on the first number of increases, adjust the second initial value based on the second number of increases, adjust the initial time based on the set duration, and return to execute the steps of pre-adjusting the local clock based on the first initial value, the second initial value and the initial time, and obtaining the deviation value corresponding to the local clock at the end time of the adjustment and subsequent steps if the deviation value is greater than the set deviation, until the deviation value obtained after adjustment is less than or equal to the set deviation.

[0232] The second determining unit is used to determine the adjusted first initial value, the second initial value and the initial time corresponding to the deviation value obtained after adjustment as the first threshold, the second threshold and the set time respectively.

[0233] In one embodiment of the present application, the time synchronization device 800 for medical equipment further includes: a first control unit, a second control unit and a third control unit.

[0234] The first control unit is used to control the controlled device to adjust the local clock based on the clock deviation for any adjustment if the clock deviation corresponding to any adjustment is less than or equal to the first set deviation; the clock deviation includes the first deviation or the second deviation.

[0235] The second control unit is used to control the controlled device to update the clock deviation if the clock deviation corresponding to any adjustment is greater than the first set deviation and less than or equal to the second set deviation, and adjust the local clock based on the updated clock deviation.

[0236] The third control unit is used to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if the clock deviation corresponding to any adjustment is greater than the second set deviation.

[0237] In one embodiment of the present application, the time synchronization device 800 for medical equipment further includes: a fourth adjustment unit, or a fifth adjustment unit.

[0238] The fourth adjustment unit is used to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if there is a node restart operation in the time synchronization device; the node restart operation refers to the master control device, the controlled device and any one of the at least one data exchange routing devices performing a restart operation.

[0239] The fifth adjustment unit is used to adjust the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time if the time deviations corresponding to each of the consecutive set sending times are greater than the third set deviation; the time deviation corresponding to any one of the consecutive set sending times refers to the deviation between the master clock of the master control device and the local clock of the controlled device under any one of the consecutive set sending times.

[0240] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0241] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0242] Fig.10 This is a schematic diagram of the structure of a time synchronization device provided in an embodiment of the present application. Fig.10 As shown, the time synchronization device 9 of this embodiment includes: at least one processor 90 ( Fig.10 Only one is shown), a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, wherein the processor 90 implements the steps of any of the above-mentioned embodiments of the time synchronization method for medical equipment when executing the computer program 92.

[0243] The time synchronization device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that FIG109 is merely an example of the time synchronization device 9 and does not constitute a limitation on the time synchronization device 9, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, may also include input and output devices, network access devices, etc.

[0244] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0245] In some embodiments, the memory 91 may be an internal storage unit of the time synchronization device 9, such as the memory of the time synchronization device 9. In other embodiments, the memory 91 may also be an external storage device of the time synchronization device 9, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the time synchronization device 9. Further, the memory 91 may also include both the internal storage unit of the time synchronization device 9 and the external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program, etc. The memory 91 may also be used to temporarily store data that has been output or is to be output.

[0246] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0247] An embodiment of the present application provides a computer program product. When the computer program product runs on a time synchronization device, the time synchronization device can implement the steps in the above-mentioned method embodiments when executing.

[0248] 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 computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the time synchronization device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0249] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0250] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A time synchronization method for medical equipment, characterized in that: The method comprises: After the time synchronization device is powered on, controlling the controlled device to send a network delay measurement packet to the main control device through at least one data exchange routing device; Calculate the delay time based on the received network delay measurement packet, and send the delay time to the controlled device; Control the master control device to send a timestamp packet to the controlled device through at least one of the data exchange routing devices based on a set time interval; The controlled device is controlled to adjust a local clock of the controlled device based on the delay time and each of the time stamp packets, so that the controlled device is synchronized with the master control device.

2. The time synchronization method for medical equipment according to claim 1, characterized in that: The controlling the controlled device to adjust the local clock of the controlled device based on the delay time and the timestamp packet includes: For any transmission, controlling the controlled device to adjust the local clock based on the delay time to obtain the initial time of the local clock under the any transmission; Control the controlled device to adjust the initial time of the local clock at any sending based on the timestamp packet and the number of sendings at any sending, so as to obtain the target time of the local clock at any sending; the number of sendings refers to the number of times the master control device has sent the timestamp packet to the controlled device until the moment of any sending.

3. The time synchronization method for medical equipment according to claim 2, characterized in that: The controlling the controlled device to adjust the initial time of the local clock at any one transmission based on the timestamp packet at any one transmission and the number of transmissions to obtain the target time of the local clock at any one transmission includes: When the number of transmissions is less than or equal to a first threshold, controlling the controlled device to calculate a first deviation under any transmission based on the timestamp packet under any transmission and the initial time under any transmission, and adjusting the initial time based on the first deviation under any transmission to obtain the target time; When the number of transmissions is greater than the first threshold and less than or equal to the second threshold, controlling the controlled device to determine the initial time of any transmission as the target time; When the number of transmissions is greater than the second threshold value, and after the set time of the second threshold number of transmissions, the controlled device is controlled to calculate the second deviation under any transmission based on the timestamp packet under any transmission and the initial time under any transmission, and the number of clk processing corresponding to any transmission is calculated based on the second deviation under any transmission, the second threshold value, the set time interval and the set clock cycle; the local clock is adjusted based on the second deviation under any transmission and the number of clk processing to obtain the target time.

4. The time synchronization method for medical equipment according to claim 3, characterized in that: The first threshold, the second threshold and the set time are determined according to the following method: Acquire the environment information of the time synchronization device, the first device information of the master control device, and the second device information of the controlled device; Inputting the environment information, the first device information, and the second device information into a trained threshold prediction model for processing to obtain the first threshold, the second threshold, and the set time; The threshold prediction model is obtained by training a pre-built neural network model.

5. The time synchronization method for medical equipment according to claim 3, characterized in that: The first threshold, the second threshold and the set time are determined according to the following method: Pre-adjusting the local clock based on a first initial value, a second initial value, and an initial time, and obtaining a deviation value of the local clock corresponding to the adjustment end time; the first initial value corresponds to the first threshold, the second initial value corresponds to the second threshold, and the initial time corresponds to the set time; If the deviation value is greater than the set deviation, the first initial value is adjusted based on the first increase number, the second initial value is adjusted based on the second increase number, the initial time is adjusted based on the set duration, and the process returns to execute the step of pre-adjusting the local clock based on the first initial value, the second initial value and the initial time, and obtaining the deviation value corresponding to the local clock at the adjustment end time and subsequent steps, until the deviation value obtained after adjustment is less than or equal to the set deviation; The first initial value, the second initial value, and the initial time corresponding to the deviation value obtained after adjustment are respectively determined as the first threshold, the second threshold, and the set time.

6. The time synchronization method for medical equipment according to claim 3, characterized in that: The method further comprises: For any adjustment, if the clock deviation corresponding to the any adjustment is less than or equal to a first set deviation, controlling the controlled device to adjust the local clock based on the clock deviation; the clock deviation includes the first deviation or the second deviation; If the clock deviation corresponding to any one of the adjustments is greater than the first set deviation and less than or equal to the second set deviation, controlling the controlled device to update the clock deviation, and adjusting the local clock based on the updated clock deviation; If the clock deviation corresponding to any one of the adjustments is greater than the second set deviation, the first frequency of the master control device and the second frequency of the controlled device are adjusted, and / or the delay time is adjusted.

7. The time synchronization method for medical equipment according to any one of claims 2 to 6, characterized in that: After controlling the controlled device to adjust the local clock of the controlled device based on the delay time and the timestamp packet, the method further includes: If the time synchronization device has a node restart operation, the first frequency of the master control device and the second frequency of the controlled device are adjusted, and / or the delay time is adjusted; the node restart operation refers to that any one of the master control device, the controlled device and the at least one data exchange routing device performs a restart operation; or, If the time deviations corresponding to each of the consecutive set sending times are greater than the third set deviation, the first frequency of the master control device, the second frequency of the controlled device, and / or the delay time are adjusted; the time deviation corresponding to each sending refers to the deviation between the master clock of the master control device and the local clock of the controlled device at the number of sending times.

8. A time synchronization device for medical equipment, characterized in that: include: A first sending unit (81), configured to enable the controlled device to send a network delay measurement packet to the main control device through at least one data exchange routing device after the time synchronization device is powered on; A first calculation unit (82) is used to calculate the delay time based on the received network delay measurement packet, and send the delay time to the controlled device; A second sending unit (83), used for controlling the main control device to send a time stamp packet to the controlled device through at least one of the data exchange routing devices based on a set time interval; A first adjustment unit (84) is used to control the controlled device to adjust the local clock of the controlled device based on the delay time and each of the time stamp packets, so as to synchronize the time between the controlled device and the master control device.

9. A time synchronization device, comprising a master control device (10), a controlled device (30), at least one data exchange routing device (20), a memory (91), a processor (90), and a computer program (92) stored in the memory (91) and executable on the processor (90), characterized in that: When the processor (90) executes the computer program (92), the time synchronization method for medical equipment according to any one of claims 1 to 7 is implemented.

10. A medical device, characterized in that: Comprising the time synchronization device as claimed in claim 9.