Bus time synchronization method, device, system, electronic equipment, medium and product

By using the reference master module and slave equipment for time calibration and synchronization in the EtherCAT bus system, the problem of time synchronization between multiple EtherCAT buses is solved, and a high-precision and low-cost time synchronization effect is achieved.

CN118944798BActive Publication Date: 2025-04-01BEIJING XIAOMI ROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411215930.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-04-01
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The prior art is difficult to realize time synchronization between multiple EtherCAT buses, resulting in low accuracy, high cost and cumbersome operation.

Method used

The reference master module sends a time read message to the reference slave device, receives and calibrates the master system time, and then each master module sends a time synchronization message to the corresponding slave device, so that the slave device can perform time synchronization adjustment.

Benefits of technology

Time synchronization between multiple EtherCAT buses is achieved, reducing costs, simplifying operations, and improving the accuracy of time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944798B_ABST
    Figure CN118944798B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of communication technology, and specifically provides a bus time synchronization method, device, system, electronic device, medium and product. Among them, the method includes: a reference master station module sends a time reading message to a reference slave station device; the reference master station module receives the reference slave station device time returned by the reference slave station device based on the time reading message; the reference master station module calibrates the master station system time according to the reference slave station device time; each master station module sends a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device each performs time synchronization adjustment based on the received time synchronization message. In this way, each device directly or indirectly performs time synchronization based on the reference slave station device time, thereby realizing the time synchronization of the bus time synchronization system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a bus time synchronization method, device, system, electronic equipment, medium and product. Background Art

[0002] Ethernet for Control Automation Technology (EtherCAT) is a high-performance communication protocol based on real-time Ethernet technology. EtherCAT uses a master-slave structure, where a master station is responsible for controlling and synchronizing the slave stations in the network. The master station sends control commands and data, and the slave stations receive and execute these commands. EtherCAT combines a distributed clock synchronization mechanism with Ethernet for data transmission, allowing data to be transmitted in the network at high speed and in real time.

[0003] With the development of industrial technology, a single EtherCAT bus control device can no longer meet the needs of users. Therefore, multiple EtherCAT buses are usually used to mount different devices to control communication. However, how to achieve time synchronization between multiple EtherCAT buses is a technical problem that needs to be solved. Summary of the invention

[0004] The purpose of the embodiments of the present disclosure is to provide a bus time synchronization method, device, system, electronic device, medium and product to solve the problem of how to achieve time synchronization between multiple EtherCAT buses.

[0005] On the one hand, an embodiment of the present disclosure provides a bus time synchronization method, the method comprising:

[0006] The reference master station module sends a time reading message to the reference slave station device; the reference master station module is a master station module among the master station modules included in the control device; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module;

[0007] The reference master station module receives the reference slave station device time returned by the reference slave station device based on the time reading message;

[0008] The reference master module calibrates the master system time according to the reference slave device time;

[0009] Each master station module sends a time synchronization message to the corresponding at least one slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the received time synchronization message.

[0010] In one implementation, the reference master station module calibrates the master station system time according to the reference slave station device time, including:

[0011] The master station system clock also provided in the control device is calibrated according to the reference slave station device time to calibrate the master station system time.

[0012] In one implementation, each master station module sends a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time, including:

[0013] Each master module performs the following steps:

[0014] According to the master station system clock, obtain the calibrated master station system time;

[0015] A time synchronization message including the calibrated master station system time is sent to the corresponding at least one slave station device, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the calibrated master station system time.

[0016] In one implementation, before the reference master module sends a time reading message to the reference slave device, the method further includes:

[0017] Each master station module performs the following steps:

[0018] Sending a clock test message to at least one corresponding slave station device;

[0019] receiving respective local time information returned by at least one slave device based on a clock test message;

[0020] Determine the time offset of each slave device according to the sending time of the clock test message and at least one local time information;

[0021] The corresponding time offset is sent to at least one slave station device, so that each slave station device performs time synchronization adjustment according to the corresponding time offset and the calibrated master station system time when receiving the time synchronization message.

[0022] In one implementation, each slave device group is divided according to the security level corresponding to each slave device.

[0023] In one aspect, an embodiment of the present disclosure provides a bus time synchronization device, the device comprising:

[0024] The reading unit is used to send a time reading message to the reference slave device through the reference master module; the reference master module is a master module in each master module included in the control device; the reference slave device is a slave device in the slave device group corresponding to the reference master module;

[0025] A receiving unit, used for receiving, through the reference master module, the reference slave device time returned by the reference slave device based on the time reading message;

[0026] A calibration unit, used to calibrate the master station system time according to the reference slave station device time through the reference master station module;

[0027] The synchronization unit is used for each master station module to send a time synchronization message to the corresponding at least one slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the received time synchronization message.

[0028] In one embodiment, the calibration unit is used to:

[0029] The master station system clock also provided in the control device is calibrated according to the reference slave station device time to calibrate the master station system time.

[0030] In one implementation, the synchronization unit is used to:

[0031] Perform the following steps with each master module:

[0032] According to the master station system clock, obtain the calibrated master station system time;

[0033] A time synchronization message including the calibrated master station system time is sent to the corresponding at least one slave station device, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the calibrated master station system time.

[0034] In one implementation, the synchronization unit is further configured to:

[0035] Perform the following steps for each master module:

[0036] Sending a clock test message to at least one corresponding slave station device;

[0037] receiving respective local time information returned by at least one slave device based on a clock test message;

[0038] Determine the time offset of each slave device according to the sending time of the clock test message and at least one local time information;

[0039] The corresponding time offset is sent to at least one slave station device, so that each slave station device performs time synchronization adjustment according to the corresponding time offset and the calibrated master station system time when receiving the time synchronization message.

[0040] In one implementation, each slave device group is divided according to the security level corresponding to each slave device.

[0041] On the one hand, a bus time synchronization system includes a control device and a plurality of slave device groups, wherein the control device includes a plurality of master station modules, and different slave device groups correspond to different master station modules; wherein,

[0042] The reference master station module is used to: send a time reading message to the reference slave station device, receive the reference slave station device time returned by the reference slave station device based on the time reading message, and calibrate the master station system time according to the reference slave station device time; the reference master station module is a master station module in each master station module included in the control device; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module;

[0043] Each master station module is used to: send a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time;

[0044] Each slave station device is used for: performing time synchronization adjustment based on the received time synchronization message.

[0045] In one aspect, an electronic device is provided in an embodiment of the present disclosure, including:

[0046] Processor; and

[0047] The memory stores computer instructions, wherein the computer instructions are used to enable the processor to execute the steps of the method provided in any of the various optional implementations of bus time synchronization as described above.

[0048] On the one hand, an embodiment of the present disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute steps of a method provided in any of the above-mentioned various optional implementations of bus time synchronization.

[0049] On the one hand, a computer program product is provided in an embodiment of the present disclosure, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the steps of the method provided in any of the various optional implementations of bus time synchronization described above.

[0050] The bus time synchronization method in the embodiment of the present disclosure includes calibrating the master station system time with the reference slave station device time of the reference slave station device by the reference master station module, and synchronizing the corresponding other slave station devices based on the calibrated master station system time, and other master station modules also synchronize the corresponding slave station devices based on the calibrated master station system time, that is, all devices directly or indirectly synchronize the time with the reference slave station device time as a reference, thereby realizing the time synchronization of the entire bus time synchronization system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0052] Figure 1 It is a schematic diagram of the architecture of a bus time synchronization system in an embodiment of the present disclosure.

[0053] Figure 2 It is a flowchart of a bus time synchronization method in an embodiment of the present disclosure.

[0054] Figure 3 It is a schematic diagram of the architecture of a robot in an embodiment of the present disclosure.

[0055] Figure 4 It is a schematic diagram of the bus structure of a robot in an embodiment of the present disclosure.

[0056] Figure 5 It is a structural block diagram of a bus time synchronization device in an embodiment of the present disclosure.

[0057] Figure 6 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] The technical solution of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described implementation is a part of the implementation of the present disclosure, rather than all the implementations. Based on the implementation in the present disclosure, all other implementations obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure. In addition, the technical features involved in the different implementations of the present disclosure described below can be combined with each other as long as they do not conflict with each other.

[0059] With the development of industrial technology, a single EtherCAT bus control device can no longer meet the needs of users. Therefore, multiple EtherCAT buses are usually used to mount different devices to control communication.

[0060] In the related art, a bridge device is usually connected to the first EtherCAT bus, so that the second EtherCAT bus can obtain the time difference with the first EtherCAT bus through the bridge device and perform time synchronization based on the time difference. However, this method requires the addition of additional hardware devices and corresponding software configurations, which is costly, cumbersome to operate, and the accuracy of time synchronization is not high.

[0061] Based on the defects of the above-mentioned related technologies, the embodiments of the present disclosure provide a bus time synchronization method, device, system, electronic device, medium and product, aiming to solve the problem of how to achieve time synchronization between multiple EtherCAT buses.

[0062] A bus time synchronization method is provided in an embodiment of the present disclosure. The method can be applied to a control device in a bus time synchronization system. The present disclosure does not limit the type of control device, which can be any type of device suitable for implementation, such as a robot, etc. The present disclosure will not elaborate on this.

[0063] The control device in the embodiment of the present disclosure includes multiple master station modules, and the bus time synchronization system also includes multiple slave station device groups; different slave station device groups correspond to different master station modules; each master station module communicates with the slave station devices in the corresponding slave station device group through the corresponding EtherCAT bus.

[0064] Each slave device is configured with a corresponding security level, and each slave device group is divided according to the corresponding security level of each slave device. This is because when the bus time synchronization system is more complex, the number of slave devices will be very large, and the security levels of different slave devices may be inconsistent. Therefore, it is reasonable and necessary to divide different slave devices into different EtherCAT buses, which can meet the security requirements of different slave devices.

[0065] Combine the following Figure 1 An example of a bus time synchronization system is given. Figure 1 A schematic diagram of the architecture of a bus time synchronization system. Figure 1In the embodiment, the bus time synchronization system includes a control device and a plurality of slave device groups, and the control device includes a plurality of master modules (Master), namely Master1, Master2...MasterN, where N is a positive integer. Each master module corresponds to a slave device group, and each master module communicates with the slave devices (Slave) in the corresponding slave device group through the corresponding EtherCAT bus. For example, the slave devices in the slave device group 1 corresponding to Master1 are Slave1-1, Slave1-2,..., Slave1-K1, respectively, the slave devices in the slave device group 2 corresponding to Master2 are Slave2-1, Slave2-2,..., Slave2-K2, respectively, and the slave devices in the slave device group 3 corresponding to Master3 are Slave3-1, Slave3-2,..., Slave3-K3, respectively.

[0066] K1, K2 and K3 are all positive integers. Each slave device group may include at least one slave device, and the number of slave devices included in different slave device groups may be the same or different.

[0067] In one implementation, a corresponding security level is configured for each slave device, and the slave devices are divided according to their security levels to obtain slave device groups, and different master station modules are allocated to different slave device groups.

[0068] As an example, the security level is divided into a plurality of level intervals, and the slave devices with security levels in the same level interval are divided into the same slave device group.

[0069] Furthermore, the slave device group with more devices can be split again, and multiple slave device groups with fewer devices can be merged. As an example, for each slave device group, if the number of slave devices in the slave device group is higher than a first quantity threshold (e.g., 10), the slave device group is split according to the quantity threshold to obtain at least two slave device groups. As another example, if there are multiple slave device groups with the number of devices lower than a second quantity threshold (e.g., 5), they are merged.

[0070] In this way, each slave device can be reasonably allocated to different master modules to meet security requirements.

[0071] Among them, an operating system runs in the control device, such as the control device runs the Linux operating system through the x86 / arm platform, and the master station module can be an application running on the operating system, which is used to communicate with the slave station devices mounted on the EtherCAT bus through the EtherCAT bus. The control device is provided with a master system clock to read the master system time. Each slave station device is respectively provided with a distributed clock (DC) supporting the EtherCAT bus.

[0072] A reference master station module is selected from each master station module, and a slave station device in the slave station device group corresponding to the reference master station module is determined as the reference slave station device.

[0073] Optionally, the reference master module may be randomly selected or pre-configured. As an example, the first master module among the master modules is set as the reference master module. Usually, the first slave device connected to the reference master module is determined as the reference slave device.

[0074] Each master station module is also provided with a network component, such as a network card, for supporting network transmission. Each network component is used to control the corresponding EtherCAT bus. For example, the control device is provided with N master station modules, each of which is provided with an Ethernet card, and each master station module controls the corresponding EtherCAT bus through the Ethernet card.

[0075] The reference master station module is used to send a time reading message to the reference slave station device, receive the reference slave station device time returned by the reference slave station device based on the time reading message, and calibrate the master station system time according to the reference slave station device time.

[0076] Each master station module is used to send a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time.

[0077] Each slave station device is used for: performing time synchronization adjustment based on the received time synchronization message.

[0078] In this way, time synchronization of each master station module and each slave station device can be achieved.

[0079] Combine the following Figure 1 and Figure 2 , the bus time synchronization method in the embodiment of the present disclosure is described, refer to Figure 2 FIG. 1 is a flowchart of a bus time synchronization method in an embodiment of the present disclosure. The specific implementation process of the method is as follows:

[0080] Step 201: The reference master module sends a time reading message to the reference slave device.

[0081] In one implementation, the reference master module sends a time reading message to the reference slave device via the EtherCAT bus.

[0082] The reference master station module is a master station module among the master station modules included in the control device; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module.

[0083] Step 202: The reference master module receives the reference slave device time returned by the reference slave device based on the time read message.

[0084] In one embodiment, when the reference slave device determines that a time reading message has been received, it obtains the reference slave device time through a local clock, i.e., a DC supporting the EtherCAT bus, and returns the reference slave device time to the reference master module through the EtherCAT bus.

[0085] Furthermore, the following method can be used to determine the reference slave device time:

[0086] In one implementation, the reference master module sends a time read message to each corresponding slave device via the EtherCAT bus. When each slave device determines that it has received the time read message, it obtains its own slave device time according to its own local clock. The reference master module receives the slave device time returned by each slave device via the EtherCAT bus, and obtains the slave device time of the reference slave device from each slave device time, i.e., the reference slave device time.

[0087] In this way, the reference slave device time of the reference slave device can be obtained.

[0088] Step 203: The reference master station module calibrates the master station system time according to the reference slave station device time.

[0089] In one implementation, the master station system clock also provided in the control device is calibrated according to the reference slave station device time to calibrate the master station system time.

[0090] It should be noted that the control device is provided with a master station system clock, and each master station module can obtain the current master station system time, that is, the calibrated master station system time, through the master station system clock. Therefore, after calibrating the master station system clock with reference to the master station module, the other master station modules can also directly obtain the calibrated master station system time, thereby realizing time synchronization between the master station modules.

[0091] Step 204: Each master station module sends a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time.

[0092] In one implementation, when executing step 204, each master station module executes the following steps:

[0093] S2041: Obtain the calibrated master station system time according to the master station system clock.

[0094] In one implementation, the current master station system time is read through the calibrated master station system clock, and the current master station system time is determined as the calibrated master station system time.

[0095] It should be noted that different master station modules may determine the calibrated master station system time simultaneously, or may determine their respective corresponding calibrated master station system time asynchronously, which is not limited here.

[0096] Since different master station modules may be operated synchronously or asynchronously, the current master station system time and the calibrated master station system time read by different master station modules may be the same or different.

[0097] For example, the reference master station module first obtains the current master station system time through the calibrated master station system clock, and determines the current master station system time as the calibrated master station system time. Then, each other master station module obtains the current master station system time through the calibrated master station system clock in turn, and determines the current master station system time obtained by each as the corresponding calibrated master station system time.

[0098] Furthermore, since there may be a time offset between different master station modules, the offset can also be eliminated in the following manner:

[0099] The reference master module obtains the current master system time through the calibrated master system clock, and determines the current master system time as the corresponding calibrated master system time. Each other master module obtains the current master system time through the calibrated master system clock, and adjusts the current master system time according to the corresponding master time error to obtain the corresponding calibrated master system time.

[0100] The master station time error is the time error between the master station module and the reference master station module, which may be determined according to the transmission delay time, or may be a fixed calibration time set according to actual application requirements, which is not limited here.

[0101] S2042: Send a time synchronization message including the calibrated master station system time to at least one corresponding slave station device.

[0102] When the master station module sends a time synchronization message to at least one corresponding slave station device, any of the following methods may be used:

[0103] Method 1: Each master station module simultaneously sends a time synchronization message containing the calibrated master station system time to its corresponding slave station device.

[0104] Method 2: The reference master station module sends a time synchronization message containing the calibrated master station system time to the corresponding slave station device, and other master station modules send time synchronization messages containing the calibrated master station system time to their corresponding slave station devices in turn.

[0105] Mode 3: The reference master station module sends a time synchronization message containing the calibrated master station system time to the corresponding slave station device, and other master station modules simultaneously send a time synchronization message containing the calibrated master station system time to their respective corresponding slave station devices.

[0106] It should be noted that, because the execution time of each master station module is very short and the execution speed is very fast, when each master station module is executed in sequence, it can also be equivalent to parallel processing.

[0107] In this way, each master station module can send a time synchronization message at the same time, or send its own time synchronization message in sequence.

[0108] Step 205: Each slave station device performs time synchronization adjustment based on the received time synchronization message.

[0109] In one implementation, each slave station device obtains its own corresponding time offset, and performs time synchronization adjustment based on the calibrated master station system time and the corresponding time offset.

[0110] When each slave station device obtains its own time offset, each master station module can perform the following steps respectively:

[0111] S2051: Send a clock test message to at least one corresponding slave station device.

[0112] S2052: Receive respective local time information returned by at least one slave device based on the clock test message.

[0113] The local time information may include the receiving time of the clock test message, and may also include the returning time when the local time information is returned.

[0114] S2053: Determine the time offset of each slave device according to the sending time of the clock test message and at least one local time information.

[0115] The time offset may include a transmission delay of data transmission between the master station device and the slave station device. For example, the transmission delay may be a difference between a receiving time and a sending time.

[0116] S2054: Sending the corresponding time offset to at least one slave device, so that each slave device performs time synchronization adjustment according to the corresponding time offset and the calibrated master system time when receiving the time synchronization message.

[0117] In this way, the differences in transmission delays of different slave devices are taken into consideration, and the time of the slave devices is further calibrated, further improving the accuracy of the synchronized time.

[0118] Combine the following Figure 3 The above embodiments are described by way of example. Figure 3 , which is a schematic diagram of the architecture of a robot. The robot (i.e., the bus time synchronization system) includes a robot master controller (i.e., a control device) and a plurality of slave devices. The slave devices are M11, M12, ..., M16, and M21, M22, ..., M26.

[0119] See also Figure 4 The figure shows a schematic diagram of the bus structure of a robot. Figure 4 In the robot main controller, two master modules are included, and each master module is provided with a network card. The two master modules are the robot upper limb Master1 and the robot lower limb Master2. The slave devices are divided into a first slave device group corresponding to the robot upper limb Master1 and a second slave device group corresponding to the robot lower limb Master2. The slave devices in the first slave device group are M11, M12, ..., M16. The slave devices in the second slave device group are M21, M22, ..., M26.

[0120] After the robot is powered on, the system is initialized first, and then each network card in the robot main controller is initialized in turn. The robot upper limb Master1 is the reference master module, and M11 is the reference slave device. The robot upper limb Master1 obtains the reference slave device time of M11 through the EtherCAT bus, and calibrates the master system time according to the reference slave device time, obtains the calibrated master system time, and sends the calibrated master system time to each slave device in the first slave device group through the EtherCAT bus. Each slave device in the first slave device group performs time synchronization according to the received calibrated master system time. The robot lower limb Master2 obtains the calibrated master system time, and sends the calibrated master system time to each slave device in the second slave device group through the EtherCAT bus. Each slave device in the second slave device group performs time synchronization according to the received calibrated master system time.

[0121] In the disclosed embodiment, the reference master station module calibrates the master station system time with the reference slave station device time of the reference slave station device, and synchronizes the time of other corresponding slave station devices based on the calibrated master station system time, and other master station modules also synchronize the time of their respective corresponding slave station devices based on the calibrated master station system time, that is, all devices directly or indirectly synchronize the time with the reference slave station device time as a reference, thereby realizing the time synchronization of the entire bus time synchronization system, without the need for additional hardware equipment and corresponding software configuration, with low cost, simple operation, adjustable adaptability, and high time synchronization accuracy.

[0122] Based on the same inventive concept, a bus time synchronization device is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the above device and equipment is similar to that of a bus time synchronization method, the implementation of the above device can refer to the implementation of the method, and the repeated parts will not be repeated. The device can be applied to electronic devices. The present disclosure does not limit the type of electronic devices. It can be any type of device suitable for implementation, such as terminal devices and servers, etc., and the present disclosure will not repeat this.

[0123] See also Figure 5 FIG. 1 is a block diagram of a bus time synchronization device according to an embodiment of the present disclosure. In some implementations, the bus time synchronization device according to an example of the present disclosure includes:

[0124] The reading unit 501 is used to send a time reading message to the reference slave device through the reference master module; the reference master module is a master module in each master module included in the control device; the reference slave device is a slave device in the slave device group corresponding to the reference master module;

[0125] A receiving unit 502 is used to receive, through a reference master module, a reference slave device time returned by the reference slave device based on a time reading message;

[0126] The calibration unit 503 is used to calibrate the master station system time according to the reference slave station device time through the reference master station module;

[0127] The synchronization unit 504 is used for each master station module to send a time synchronization message to the corresponding at least one slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the received time synchronization message.

[0128] In one implementation, the calibration unit 503 is used to:

[0129] The master station system clock also provided in the control device is calibrated according to the reference slave station device time to calibrate the master station system time.

[0130] In one implementation, the synchronization unit 504 is used to:

[0131] Perform the following steps with each master module:

[0132] According to the master station system clock, obtain the calibrated master station system time;

[0133] A time synchronization message including the calibrated master station system time is sent to the corresponding at least one slave station device, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the calibrated master station system time.

[0134] In one implementation, the synchronization unit 504 is further configured to:

[0135] Perform the following steps for each master module:

[0136] Sending a clock test message to at least one corresponding slave station device;

[0137] receiving respective local time information returned by at least one slave device based on a clock test message;

[0138] Determine the time offset of each slave device according to the sending time of the clock test message and at least one local time information;

[0139] The corresponding time offset is sent to at least one slave station device, so that each slave station device performs time synchronization adjustment according to the corresponding time offset and the calibrated master station system time when receiving the time synchronization message.

[0140] In one implementation, each slave device group is divided according to the security level corresponding to each slave device.

[0141] The bus time synchronization method in the embodiment of the present disclosure includes sending a time reading message from a reference master station module to a reference slave station device; the reference master station module is a master station module among the master station modules included in the control device; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module; the reference master station module receives the reference slave station device time returned by the reference slave station device based on the time reading message; the reference master station module calibrates the master station system time according to the reference slave station device time; each master station module sends a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device each performs time synchronization adjustment based on the received time synchronization message. In this way, the reference master station module calibrates the master station system time with the reference slave station device time of the reference slave station device, and synchronizes the time of other corresponding slave station devices based on the calibrated master station system time, and other master station modules also synchronize the time of their corresponding slave station devices based on the calibrated master station system time, that is, all devices directly or indirectly synchronize the time with the reference slave station device time as a benchmark, thus realizing the time synchronization of the entire bus time synchronization system, without the need for additional hardware equipment and corresponding software configuration, with low cost, simple operation, adjustable adaptability, and high time synchronization accuracy.

[0142] In an embodiment of the present disclosure, an electronic device is further provided, including:

[0143] Processor; and

[0144] The memory stores computer instructions, where the computer instructions are used to enable the processor to execute any of the above-mentioned implementation methods.

[0145] In an embodiment of the present disclosure, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned implementation methods.

[0146] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements any of the above-mentioned implementation methods.

[0147] Figure 6 FIG. 6 is a schematic diagram showing the structure of an electronic device 6000. Figure 6 As shown, the electronic device 6000 includes: a processor 6010 and a memory 6020, and optionally, may also include a power supply 6030, a display unit 6040, and an input unit 6050.

[0148] The processor 6010 is the control center of the electronic device 6000. It connects various components using various interfaces and lines, and performs various functions of the electronic device 6000 by running or executing software programs and / or data stored in the memory 6020, thereby monitoring the electronic device 6000 as a whole.

[0149] In the embodiment of the present disclosure, the processor 6010 executes the various steps in the above embodiment when calling the computer program stored in the memory 6020.

[0150] Optionally, the processor 6010 may include one or more processing units; preferably, the processor 6010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 6010. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips.

[0151] The memory 6020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 6000, etc. In addition, the memory 6020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.

[0152] The electronic device 6000 also includes a power source 6030 (such as a battery) for supplying power to various components. The power source can be logically connected to the processor 6010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0153] The display unit 6040 may be used to display information input by the user or information provided to the user and various menus of the electronic device 6000, and in the embodiment of the present disclosure, is mainly used to display the display interface of each application in the electronic device 6000 and objects such as text and pictures displayed in the display interface. The display unit 6040 may include a display panel 6041. The display panel 6041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0154] The input unit 6050 may be used to receive information such as numbers or characters input by the user. The input unit 6050 may include a touch panel 6051 and other input devices 6052. The touch panel 6051, also known as a touch screen, may collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 6051).

[0155] Specifically, the touch panel 6051 can detect the user's touch operation, detect the signal brought by the touch operation, convert these signals into touch point coordinates, send them to the processor 6010, and receive and execute the command sent by the processor 6010. In addition, the touch panel 6051 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 6052 can include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0156] Of course, the touch panel 6051 can cover the display panel 6041. When the touch panel 6051 detects a touch operation on or near it, it is transmitted to the processor 6010 to determine the type of touch event. Then the processor 6010 provides corresponding visual output on the display panel 6041 according to the type of touch event. Figure 6 In the embodiment, the touch panel 6051 and the display panel 6041 are used as two independent components to realize the input and output functions of the electronic device 6000, but in some embodiments, the touch panel 6051 and the display panel 6041 can be integrated to realize the input and output functions of the electronic device 6000.

[0157] The electronic device 6000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the electronic device 6000 may also include other components such as a camera. Since these components are not the key components used in the embodiments of the present disclosure, Figure 6 It is not shown and will not be described in detail.

[0158] Those skilled in the art will understand that Figure 6 The electronic device is merely an example and does not limit the electronic device, and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.

[0159] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present disclosure, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

Claims

1. A bus time synchronization method, characterized in that: The method comprises: The reference master station module sends a time reading message to the reference slave station device; the reference master station module is a master station module among the master station modules included in the control device; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module; The reference master station module receives the reference slave station device time returned by the reference slave station device based on the time read message; The reference master station module calibrates the master station system time according to the reference slave station device time; Each master station module sends a time synchronization message to the corresponding at least one slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the received time synchronization message.

2. The method according to claim 1, characterized in that: The reference master station module calibrates the master station system time according to the reference slave station device time, including: The master station system clock also provided in the control device is calibrated according to the reference slave station device time, so as to calibrate the master station system time.

3. The method according to claim 2, characterized in that: Each master station module sends a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time, including: Each master module performs the following steps: According to the master station system clock, obtaining the calibrated master station system time; A time synchronization message including the calibrated master station system time is sent to the corresponding at least one slave station device, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the calibrated master station system time.

4. The method according to any one of claims 1 to 3, characterized in that: Before the reference master module sends a time reading message to the reference slave device, the method further includes: Each master station module performs the following steps: Sending a clock test message to at least one corresponding slave station device; receiving respective local time information returned by the at least one slave device based on the clock test message; Determine the time offset of each slave device according to the sending time of the clock test message and at least one local time information; The corresponding time offset is sent to the at least one slave station device, so that each slave station device performs time synchronization adjustment according to the corresponding time offset and the calibrated master station system time when receiving the time synchronization message.

5. The method according to any one of claims 1 to 3, characterized in that: Each master station module included in the control device corresponds to a slave station device group, and each slave station device group is divided according to the security level corresponding to each slave station device.

6. A bus time synchronization device, characterized in that: The device comprises: A reading unit, used for sending a time reading message to a reference slave device through a reference master module; the reference master module is a master module in each master module included in the control device; the reference slave device is a slave device in the slave device group corresponding to the reference master module; A receiving unit, configured to receive, through the reference master module, a reference slave device time returned by the reference slave device based on the time read message; A calibration unit, configured to calibrate the master station system time according to the reference slave station device time through the reference master station module; The synchronization unit is used for each master station module to send a time synchronization message to the corresponding at least one slave station device according to the calibrated master station system time, so that the corresponding at least one slave station device respectively performs time synchronization adjustment based on the received time synchronization message.

7. A bus time synchronization system, characterized in that: The bus time synchronization system includes a control device and a plurality of slave device groups, wherein the control device includes a plurality of master station modules, and different slave device groups correspond to different master station modules; wherein, The reference master station module is used to: send a time reading message to the reference slave station device, receive the reference slave station device time returned by the reference slave station device based on the time reading message, and calibrate the master station system time according to the reference slave station device time; the reference master station module is a master station module in each master station module; the reference slave station device is a slave station device in the slave station device group corresponding to the reference master station module; Each master station module is used to: send a time synchronization message to at least one corresponding slave station device according to the calibrated master station system time; Each slave station device is used for: performing time synchronization adjustment based on the received time synchronization message.

8. An electronic device, characterized in that: include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that: Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 5.

10. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device executes the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-robot synchronous control method and system and multi-robot synchronous workstation

    CN117644519A

  • Ethercat master-slave station integrated bridge controller and control method thereof

    US20210318978A1