Time synchronization method, device, storage medium and system

By establishing a communication connection between the cleaning robot and the camera, and using synchronization parameters and transmission delay information for time synchronization, the problem of time synchronization between the cleaning robot and the camera is solved, and the accuracy and efficiency of time synchronization are achieved.

CN113676279BActive Publication Date: 2024-09-06DREAM INNOVATION TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110969366.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2024-09-06
Estimated Expiration
2041-08-23

AI Technical Summary

Technical Problem

Existing time synchronization methods cannot achieve time synchronization between the cleaning robot and the camera working together because the camera is not installed on the cleaning robot.

Method used

By establishing a communication connection between the cleaning robot and the camera, sending test data and performing time synchronization based on the synchronization parameters fed back by the target device, adaptive adjustments are made using transmission delay and network environment information to achieve time synchronization.

Benefits of technology

It solves the problem of inability to achieve time synchronization between the cleaning robot and the camera, improves the accuracy and efficiency of data transmission, saves computing resources, and adapts to transmission delays under different network conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113676279B
    Figure CN113676279B
Patent Text Reader

Abstract

The present application relates to a time synchronization method, device, storage medium and system, and belongs to the field of computer technology. The method comprises: establishing a communication connection between a device to be synchronized and a target device in response to a triggered time synchronization instruction; the device to be synchronized sends test data to the target device based on the communication connection; the target device generates synchronization parameters in response to receiving the test data sent by the device to be synchronized based on the communication connection, and feeds back the synchronization parameters to the device to be synchronized; the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the synchronization parameters fed back by the target device; the problem that time synchronization cannot be achieved between a cleaning robot and a camera can be solved; the present application creates a data transmission mechanism to synchronize the time of a cleaning robot and a camera to the time of a target device, and time synchronization between a cleaning robot and a camera can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to a time synchronization method, device, storage medium and system, and belongs to the field of computer technology. [Background technology]

[0002] Existing cleaning robots often have functions such as environment recognition, path planning, and map building. At this time, the cleaning robot usually collects environmental data of the working area and analyzes and processes the environmental data to achieve the corresponding functions.

[0003] However, the scope of environmental data collected by the cleaning robot is limited. Based on this, an additional camera can be set up in the work area, and the camera is used to monitor the self-moving device. At this time, the environmental data collected by the cleaning robot is fused with the environmental data collected during the camera monitoring process to analyze the fused environmental data, which can improve the accuracy of data analysis.

[0004] In order to ensure the accuracy of data fusion, the cleaning robot and the camera need to be time synchronized before use. The traditional time synchronization method only includes time synchronization of each sensor on the cleaning robot. The synchronization method includes: connecting each sensor and microprocessor through a hardware interface so that each sensor uses the same time system.

[0005] However, since the camera that works in conjunction with the cleaning robot is not installed on the cleaning robot, time synchronization between the cleaning robot and the camera cannot be achieved using traditional methods. [Summary of the invention]

[0006] The present application provides a time synchronization method, device, storage medium and system, which can solve the problem that the traditional time synchronization method only includes time synchronization of various sensors on the cleaning robot, and when the camera working with the cleaning robot is not installed on the cleaning robot, the time synchronization between the cleaning robot and the camera cannot be achieved. The present application provides the following technical solutions:

[0007] In a first aspect, a time synchronization method is provided, which is used in a device to be synchronized, wherein the device to be synchronized includes a cleaning robot or a camera working in cooperation with the cleaning robot, and the method includes:

[0008] In response to the triggered time synchronization instruction, establishing a communication connection between the device to be synchronized and the target device;

[0009] Sending test data to the target device based on the communication connection; the test data is used to trigger the target device to feed back synchronization parameters to the device to be synchronized;

[0010] The time of the device to be synchronized is synchronized to the time of the target device based on the synchronization parameter fed back by the target device.

[0011] Optionally, the test data includes a first time identifier of a first time, and the first time identifier is used to identify a first time when the device to be synchronized generates the test data;

[0012] The synchronization parameter includes a first difference between a reception time of the test data and the first time; or, the synchronization parameter includes a second difference between a second time and the first time, wherein the second time is a generation time of the test data inferred by the target device based on the reception time of the test data.

[0013] Optionally, synchronizing the time of the device to be synchronized to the time of the target device based on the synchronization parameter fed back by the target device includes:

[0014] When the synchronization parameter includes the first difference, and when the first difference is greater than a first threshold, synchronizing the time of the device to be synchronized to the time of the target device based on the first difference and the first threshold;

[0015] or,

[0016] When the synchronization parameter includes the second difference, and in the case where the second difference is greater than a second threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the second difference.

[0017] Optionally, the method further includes verifying the time synchronization result of the device to be synchronized according to the following manner:

[0018] Execute the step of sending the test data to the target device based on the communication connection;

[0019] When the synchronization parameter includes a first difference, if the first difference is less than or equal to a first threshold, the verification is passed;

[0020] or,

[0021] When the synchronization parameter includes a second difference value, if the second difference value is less than or equal to a second threshold value, the verification is passed.

[0022] Optionally, the method further comprises:

[0023] If the verification fails, the time of the device to be synchronized is synchronized to the time of the target device based on the synchronization parameter fed back by the target device.

[0024] Optionally, the synchronization parameter includes a reception time when the target device receives the test data;

[0025] The step of synchronizing the time of the device to be synchronized with the time of the target device based on the synchronization parameter fed back by the target device includes:

[0026] The time of the device to be synchronized is synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time, wherein the first time is the time when the device to be synchronized generates the test data.

[0027] Optionally, synchronizing the time of the device to be synchronized with the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time includes:

[0028] When the difference between the receiving time and the first time is greater than a third threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time.

[0029] Optionally, before synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time, the method further includes:

[0030] Get the current network transmission environment information;

[0031] The transmission delay is determined based on the network transmission environment information.

[0032] Optionally, the network transmission environment information includes at least one of a transmission distance, a current time period, and a network type; and determining the transmission delay based on the network transmission environment includes:

[0033] The network transmission environment information is input into a pre-trained delay prediction model to obtain the transmission delay; the delay prediction model is obtained by training a neural network using training data, and each set of training data includes a sample transmission distance, a sample time period, a sample network type and a corresponding actual transmission delay.

[0034] In a second aspect, a time synchronization method is provided, which is used in a target device, wherein the target device is used to perform time synchronization on a device to be synchronized, wherein the device to be synchronized includes a cleaning robot or a camera working in cooperation with the cleaning robot, and the method includes:

[0035] Establishing a communication connection with the device to be synchronized;

[0036] In response to receiving the test data sent by the device to be synchronized based on the communication connection, generating synchronization parameters;

[0037] Feedback synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the target device.

[0038] Optionally, the test data includes a first time identifier of a first time, and the first time identifier is used to identify the first time when the device to be synchronized generates the test data;

[0039] The generating synchronization parameters comprises:

[0040] Calculate a first difference between the receiving time of the test data and the first time to obtain the synchronization parameter;

[0041] or,

[0042] The generation time of the test data is inferred based on the reception time of the test data to obtain a second time; and a second difference between the second time and the first time is calculated to obtain the synchronization parameter.

[0043] Optionally, the generation time of the test data inferred based on the reception time of the test data includes:

[0044] Get the current network transmission environment information;

[0045] Based on the network transmission environment information, a transmission delay between the device to be synchronized and the target device is determined; and the second time is determined according to the transmission delay and the receiving time.

[0046] Optionally, generating synchronization parameters includes:

[0047] The synchronization parameter is generated based on a reception time of the test data.

[0048] According to a third aspect, an electronic device is provided, comprising a processor and a memory; the memory stores a program, the program is loaded and executed by the processor to implement the time synchronization method provided in the first aspect; or, to implement the time synchronization method provided in the second aspect.

[0049] In a fourth aspect, a computer-readable storage medium is provided, wherein a program is stored in the storage medium, and when the program is executed by a processor, it is used to implement the time synchronization method provided in the first aspect; or, to implement the time synchronization method provided in the second aspect.

[0050] In a fifth aspect, a time synchronization system is provided, the system comprising a device to be synchronized and a target device, the device to be synchronized comprising a cleaning robot and a camera working in cooperation with the cleaning robot;

[0051] The device to be synchronized is used to establish a communication connection between the device to be synchronized and a target device in response to a triggered time synchronization instruction; send test data to the target device based on the communication connection; the test data is used to trigger the target device to feed back synchronization parameters to the cleaning robot of the device to be synchronized;

[0052] The target device is used to generate synchronization parameters in response to receiving the test data sent by the device to be synchronized based on the communication connection; feedback the synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the time of the target device;

[0053] The device to be synchronized is further configured to synchronize the time of the device to be synchronized with the time of the target device based on the synchronization parameter fed back by the target device.

[0054] The beneficial effects of the present application include at least: establishing a communication connection between the device to be synchronized and the target device in response to a triggered time synchronization instruction; the device to be synchronized sends test data to the target device based on the communication connection; the test data is used to trigger the target device to feedback synchronization parameters to the device to be synchronized; the target device generates synchronization parameters in response to receiving the test data sent by the device to be synchronized based on the communication connection, and feeds back the synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the time of the target device; the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the synchronization parameters fed back by the target device; the problem that time synchronization cannot be achieved between the cleaning robot and the camera can be solved; the present application creates a data transmission mechanism to synchronize the time of the cleaning robot and the camera to the time of the target device, so as to achieve time synchronization between the cleaning robot and the camera.

[0055] In addition, the target device sends the synchronization parameter when the second difference is greater than the second threshold, that is, the judgment of whether to perform time synchronization is not performed in the device to be synchronized, which can save computing resources of the device to be synchronized.

[0056] In addition, since the network transmission type and distance between different devices to be synchronized and the target device may be different in different scenarios, the network congestion degree in different time periods may be different, which may lead to different transmission delays in different network situations. Based on this, this embodiment can improve the accuracy of predicting the second time by adaptively calculating the transmission delay using the delay prediction model, thereby improving the accuracy of time synchronization using the second time or transmission delay.

[0057] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings.

Brief Description of the Drawings

[0058] Figure 1 is a schematic diagram of the structure of a working system of a cleaning robot provided by an embodiment of the present application;

[0059] Figure 2 It is a structural diagram of a time synchronization system provided by an embodiment of the present application;

[0060] Figure 3 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0061] Figure 4 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0062] Figure 5 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0063] Figure 6 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0064] Figure 7 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0065] Figure 8 is a flowchart of a time synchronization method provided by an embodiment of the present application;

[0066] Fig. 9 is a block diagram of a time synchronization device provided by an embodiment of the present application;

[0067] Fig.10 is a block diagram of a time synchronization device provided by an embodiment of the present application;

[0068] Fig.11 It is a block diagram of an electronic device provided by an embodiment of the present application. [Specific implementation method]

[0069] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.

[0070] First, several terms involved in the embodiments of the present application are introduced.

[0071] Neural network: It is an algorithmic mathematical model that imitates the behavioral characteristics of animal neural networks and performs distributed parallel information processing. Neural networks rely on the complexity of the system and adjust the interconnected relationships between a large number of internal nodes to achieve the purpose of processing information.

[0072] Time synchronization: It is the process of providing a unified time scale for the distributed system through certain operations on the local clock. For example, a distributed system includes a device to be synchronized and a target device that communicates with the device to be synchronized. Time synchronization means synchronizing the time of all devices to be synchronized to the time of the target device.

[0073] Timestamp: It is data generated using digital signature technology. The object of the signature includes original file information, signature parameters, signature time, etc. Timestamp can be used to mark the generation time of data.

[0074] Conventional cleaning robots are usually equipped with sensors to collect environmental data of the current working area. Sensors include but are not limited to laser radar sensors, obstacle avoidance sensors, distance measurement sensors, visual sensors, etc., and this embodiment does not list the types of sensors one by one. Based on the environmental data collected by the sensors, the cleaning robot can realize functions such as map construction, obstacle avoidance, path planning, and target recognition in the working area.

[0075] However, the sensing range of the sensors installed on the cleaning robot is often small, and the posture of collecting data is fixed. Therefore, when using the environmental data collected by the sensors to implement corresponding functions, the analysis of the environmental data may be inaccurate, resulting in poor results in implementing the corresponding functions.

[0076] Based on this, reference Figure 1 , the present application proposes a working system of a cleaning robot 101, the working system includes a cleaning robot 101 and a camera 102, wherein the cleaning robot 101 and the camera 102 are both arranged in the same working area.

[0077] Optionally, the cleaning robot 101 may be a sweeper, a mop, or a scrubber, etc., which are devices with self-moving functions. The present application does not limit the type of the cleaning robot 101.

[0078] The camera 102 may be a smart camera, or a device (such as a mobile phone, tablet computer, etc.) equipped with a micro control unit (MCU) and having a camera function. The present application does not limit the type of the camera 102.

[0079] The installation height of the camera 102 is higher than the equipment height of the cleaning robot 101. In this way, when a sensor is installed on the cleaning robot 101, the camera 102 can collect environmental data of the working area in a posture different from the collection posture of the sensor. Afterwards, the environmental data collected by the camera 102 is integrated with the environmental data collected by itself, and the integrated environmental data is used for analysis, thereby improving the implementation effect of the corresponding function.

[0080] Before using the cleaning robot 101 and the camera 102, time synchronization is required. The conventional time synchronization method includes time synchronization of each sensor on the cleaning robot 101. The specific synchronization method includes: connecting each sensor to the microprocessor on the cleaning robot 101 through a hardware interface, so that each sensor uses the time system of the microprocessor.

[0081] However, since the camera 102 that cooperates with the cleaning robot 101 is not installed on the cleaning robot 101, time synchronization between the cleaning robot 101 and the camera 102 cannot be achieved using traditional methods.

[0082] Based on the above technical problems, this embodiment provides a time synchronization system and method, which are respectively introduced below.

[0083] Figure 2 FIG. 1 is a schematic diagram of the structure of a time synchronization system provided by an embodiment of the present application. Figure 2 As shown, the system at least includes a device to be synchronized 110 and a target device 120. The time synchronization system provided in this embodiment is used to synchronize Figure 1 The cleaning robot 101 and the camera 102 in the provided working system are time synchronized. Accordingly, the device to be synchronized 110 includes the cleaning robot 101 and the camera 102 working in cooperation with the cleaning robot 101.

[0084] The target device 120 is used to provide a unified time mechanism for the to-be-synchronized device 110. The target device 120 may be a mobile phone, a computer, or a wearable device with communication and computing functions. This embodiment does not limit the device type of the target device 120.

[0085] In this embodiment, the device to be synchronized 110 is used to establish a communication connection between the device to be synchronized 110 and the target device 120 in response to a triggered time synchronization instruction; and send test data to the target device 120 based on the communication connection.

[0086] Accordingly, the target device 120 is used to generate synchronization parameters in response to receiving the test data sent by the device to be synchronized 110 based on the communication connection, and to feed back the synchronization parameters to the device to be synchronized 110. The synchronization parameters are used for the device to be synchronized 110 to synchronize the time to the time of the target device 120. The test data is used to trigger the target device 120 to feed back the synchronization parameters to the device to be synchronized 110.

[0087] The device to be synchronized 110 is further configured to receive synchronization parameters sent by the target device 120 ; and synchronize the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameters.

[0088] The time synchronization refers to synchronizing the time between the multiple devices to be synchronized 110 to the time of the target device 120 .

[0089] Optionally, the time synchronization instruction can be generated by the device to be synchronized 110, that is, generated by the cleaning robot 101 or the camera 102; or, the time synchronization instruction can also be generated by the target device 120 and then sent. This embodiment does not limit the method for obtaining the time synchronization instruction.

[0090] For example, the target device 120 sends a time synchronization instruction to the device to be synchronized 110. A time synchronization interface is displayed in the target device 120, and the time synchronization interface includes a time synchronization control. When the target device 120 receives a trigger operation acting on the time synchronization control, it generates a time synchronization instruction and sends the time synchronization instruction to the device to be synchronized 110.

[0091] In this embodiment, both the target device 120 and the device to be synchronized 110 are installed with communication components, and a communication connection is established between the communication component in the target device 120 and the communication component in the device to be synchronized 110 .

[0092] Among them, the communication connection method between the communication component in the target device 120 and the communication component in the device to be synchronized 110 can be based on Bluetooth connection, or can also be based on wireless communication technology (WiFi) connection, etc. This embodiment does not limit the communication connection method between the communication component in the target device 120 and the communication component in the device to be synchronized 110.

[0093] Optionally, the synchronization parameters include but are not limited to one of the following three implementation methods. In the first method, the synchronization parameters include a first difference between the reception time of the test data and the first time; in the second method, the synchronization parameters include a second difference between the second time and the first time; in the third method, the synchronization parameters include the reception time of the test data. Different implementation methods of the synchronization parameters correspond to different time synchronization methods. The following introduces the corresponding time synchronization methods for different implementation methods of the synchronization parameters.

[0094] For ease of understanding, the first time, second time and receiving time in this application are first introduced. In this application, the first time refers to the time when the device to be synchronized 110 generates test data, that is, the actual generation time of the test data. The receiving time is the time when the target device 120 receives the test data, that is, the actual reception time of the test data. The second time is the generation time of the test data calculated by the target device 120 based on the reception time of the test data, that is, the second time is the estimated generation time of the test data, or the theoretical generation time.

[0095] The first mode: the synchronization parameter includes a first difference between the receiving time and the first time. In this case, the test data includes a first time identifier of the first time. The first time identifier is used to identify the first time when the device to be synchronized 110 generates the test data.

[0096] In one example, the first time identifier is a timestamp. Before sending the test data to the target device 120 based on the communication connection, the device to be synchronized 110 is further configured to: generate a first time identifier corresponding to the first time using a timestamp generation algorithm; and generate the test data using the first time identifier.

[0097] The timestamp generation algorithm may be an algorithm for generating timestamps based on Coordinated Universal Time (UTC), or an algorithm for generating timestamps based on Universal Time (UT). This embodiment does not limit the type of timestamp generation algorithm.

[0098] Optionally, in addition to the first time identifier, the test data may also include other data content, such as data type, check bit, etc. The data content of the test data is not limited in this embodiment.

[0099] In a first manner, the target device 120 generates a synchronization parameter, including: calculating a first difference between a reception time of the test data and a first time to obtain the synchronization parameter.

[0100] After the target device 120 generates synchronization parameters, the time synchronization method includes but is not limited to the following two situations. In the first situation, the device to be synchronized 110 determines whether time synchronization is required, and if so, executes the time synchronization process; in the second situation, the target device 120 determines whether time synchronization is required, and if so, triggers the device to be synchronized 110 to execute the time synchronization process. The two situations are introduced below.

[0101] The first case: the device to be synchronized 110 determines whether time synchronization is required. In this case, after the target device 120 generates synchronization parameters, it sends the synchronization parameters to the device to be synchronized 110 .

[0102] Correspondingly, the device to be synchronized 110 synchronizes the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameters fed back by the target device 120, including: when the first difference is greater than the first threshold, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the first difference and the first threshold.

[0103] When the first difference is less than or equal to the first threshold, the time synchronization between the device to be synchronized 110 and the target device 120 is completed, and the device to be synchronized 110 does not perform the process of synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the first difference and the first threshold.

[0104] The first threshold is set based on the maximum transmission delay between the device to be synchronized 110 and the target device 120 . The first threshold is pre-stored in the device to be synchronized 110 . This embodiment does not limit the value of the first threshold.

[0105] In one example, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the first difference and the first threshold includes: calculating the difference between the first difference and the first threshold; adding the difference to the current time of the device to be synchronized 110 to obtain the synchronized time.

[0106] For example, for the same moment, the time of the target device 120 at that moment is 10:00:00, and the time of the device to be synchronized 110 at that moment is 10:01:00. Assume that the first time when the device to be synchronized 110 generates test data is 10:01:00 (according to the time mechanism of the device to be synchronized 110), and the receiving time of the test data by the target device 120 is 10:00:10 (according to the time mechanism of the target device 120). At this time, the first difference is -50s. Assuming that the first threshold is 10s, the difference between the first difference and the first threshold is -60s. The device to be synchronized 110 adds -60s to the current time, that is, slows down by 60s, to obtain the synchronized time.

[0107] Optionally, the device to be synchronized 110 is further used to verify the time synchronization result of the device to be synchronized 110 .

[0108] Specifically, the device to be synchronized 110 executes the step of sending test data to the target device 120 based on the communication connection; if the first difference is less than or equal to the first threshold, the verification is successful; if the verification is not successful (that is, the first difference is greater than the first threshold), the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120.

[0109] The second situation: the target device 120 determines whether time synchronization is required. At this time, after generating the synchronization parameter, the target device 120 feeds back the synchronization parameter to the device to be synchronized 110, including: sending the synchronization parameter when the first difference is greater than the first threshold.

[0110] When the first difference is less than or equal to the first threshold, the synchronization parameter is not sent.

[0111] Accordingly, the device to be synchronized 110 synchronizes the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameters fed back by the target device 120, including: in response to receiving the first difference, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the first difference and the first threshold.

[0112] In response to not receiving the first difference, the time synchronization between the to-be-synchronized device 110 and the target device 120 is completed, and the to-be-synchronized device 110 does not perform a process of synchronizing the time of the to-be-synchronized device 110 to the time of the target device 120 based on the first difference.

[0113] In the second case, after the device to be synchronized 110 sends the test data, it detects whether the first difference is received within a predetermined time period. If the first difference is received, it means that time synchronization is required, and the device to be synchronized 110 performs the time synchronization process. If the first difference is not received, it means that time synchronization is not required, and the device to be synchronized 110 does not perform the time synchronization process.

[0114] The description of synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the first difference and the first threshold value refers to the first case, which will not be described in detail in this embodiment.

[0115] Optionally, the device to be synchronized 110 is further used to verify the time synchronization result of the device to be synchronized 110 .

[0116] Specifically, the device to be synchronized 110 executes the step of sending test data to the target device 120 based on the communication connection; if the first difference value is not received within the predetermined time period, the verification is successful; if the verification is not successful (that is, the first difference value is received within the predetermined time period), the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120.

[0117] The second method: the synchronization parameter includes a second difference between the second time and the first time. In this case, the test data includes a first time identifier of the first time. The target device 120 generates the synchronization parameter, including: obtaining the second time by inferring the generation time of the test data based on the reception time of the test data; and calculating the second difference between the second time and the first time to obtain the synchronization parameter.

[0118] Optionally, estimating the second time based on the receiving time of the test data includes: obtaining current network transmission environment information; determining the transmission delay between the device to be synchronized 110 and the target device 120 based on the network transmission environment information; and determining the second time according to the transmission delay and the receiving time.

[0119] The network transmission environment information includes at least one of the transmission distance, the current time period, and the network type. The transmission distance is positively correlated with the transmission delay. The network congestion levels are different for different time periods. For example, in the time period from 2:00 to 6:00 in the morning, the network usage rate is low, and accordingly, the network congestion level is low; while in the time period from 7:00 in the morning to 6:00 in the afternoon, the network usage rate is high, and accordingly, the network congestion level is high. The network type includes wireless network and data network.

[0120] In actual implementation, the network transmission environment information may also include other information that affects data transmission delay. This embodiment does not limit the type of information included in the network transmission environment information.

[0121] Specifically, based on the network transmission environment information, determining the transmission delay between the to-be-synchronized device 110 and the target device 120 includes: inputting the network transmission environment information into a pre-trained delay prediction model to obtain the transmission delay. The delay prediction model is obtained by training a neural network using training data, and each set of training data includes a sample transmission distance, a sample time period, a sample network type, and a corresponding actual transmission delay.

[0122] Schematically, the training process of the delay training model includes: creating an initial network model; inputting the sample transmission distance, sample time period, and sample network type into the initial network model to obtain model results; iteratively updating the parameters of the initial network model based on the model results and the corresponding actual transmission delay, and obtaining the delay prediction model when the number of iterations reaches a preset number or the updated model converges.

[0123] The neural network may be a BP neural network (Back Propagation Neural Network), an ART neural network, a RBF neural network or a LVM neural network. This embodiment does not limit the type of the neural network.

[0124] In one example, determining the second time according to the transmission delay and the receiving time includes: calculating the difference between the receiving time and the transmission delay to obtain the second time.

[0125] In the second mode, after the target device 120 generates the synchronization parameters, the time synchronization mode includes but is not limited to the following two cases: in the first case, the device to be synchronized 110 determines whether time synchronization is required, and if so, executes the time synchronization process; in the second case, the target device 120 determines whether time synchronization is required, and if so, triggers the device to be synchronized 110 to execute the time synchronization process. The two cases are introduced below.

[0126] The first case: the device to be synchronized 110 determines whether time synchronization is required. In this case, after the target device 120 generates synchronization parameters, it sends the synchronization parameters to the device to be synchronized 110 .

[0127] Accordingly, the device to be synchronized 110 synchronizes the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameters fed back by the target device 120, including: when the second difference is greater than the second threshold, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the second difference.

[0128] When the second difference is less than or equal to the second threshold, the time synchronization between the device to be synchronized 110 and the target device 120 is completed, and the device to be synchronized 110 does not perform the process of synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the second difference.

[0129] The value of the second threshold is close to 0, and the second threshold is determined based on the calculation error when estimating the second time. The value of the second threshold is pre-stored in the device to be synchronized 110, and this embodiment does not limit the value of the second threshold.

[0130] In one example, synchronizing the time of the to-be-synchronized device 110 to the time of the target device 120 based on the second difference includes: adding the second difference to the current time of the to-be-synchronized device 110 to obtain the synchronized time.

[0131] For example, for the same moment, the time of the target device 120 at that moment is 10:00:00, and the time of the device to be synchronized 110 at that moment is 10:01:00. Assume that the target device 120 receives the test data at 10:00:10 (according to the time mechanism of the target device 120), and the transmission delay is 10s. At this time, the second time is 10:00:00. Assume that the first time when the device to be synchronized 110 generates the test data is 10:01:00 (according to the time mechanism of the device to be synchronized 110), then the second difference is -60s, and the device to be synchronized 110 adds -60s to the current time, that is, slows down by 60s, to obtain the synchronized time.

[0132] Optionally, the device to be synchronized 110 is further used to verify the time synchronization result of the device to be synchronized 110 .

[0133] Specifically, the device to be synchronized 110 executes the step of sending test data to the target device 120 based on the communication connection; if the second difference is less than or equal to the second threshold, the verification is successful; if the verification is not successful (that is, the second difference is greater than the second threshold), the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120.

[0134] The second situation: the target device 120 determines whether time synchronization is required. At this time, after generating the synchronization parameter, the target device 120 feeds back the synchronization parameter to the device to be synchronized 110, including: sending the synchronization parameter when the second difference is greater than the second threshold.

[0135] Accordingly, the device to be synchronized 110 synchronizes the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameter fed back by the target device 120, including: in response to receiving the second difference, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the second difference.

[0136] In response to not receiving the second difference, the time synchronization between the to-be-synchronized device 110 and the target device 120 is completed, and the to-be-synchronized device 110 does not perform a process of synchronizing the time of the to-be-synchronized device 110 to the time of the target device 120 based on the second difference.

[0137] In the second case, after the device to be synchronized 110 sends the test data, it detects whether the second difference is received within a predetermined time period. If the second difference is received, it means that time synchronization is required, and the device to be synchronized 110 performs the time synchronization process. If the second difference is not received, it means that time synchronization is not required, and the device to be synchronized 110 does not perform the time synchronization process.

[0138] The description of synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the second difference is referred to the first case, and this embodiment will not be repeated here.

[0139] Optionally, the device to be synchronized 110 is further used to verify the time synchronization result of the device to be synchronized 110 .

[0140] Specifically, the device to be synchronized 110 executes the step of sending test data to the target device 120 based on the communication connection; if the second difference value is not received within the predetermined time period, the verification is successful; if the verification is not successful (that is, the second difference value is received within the predetermined time period), the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120.

[0141] The third mode: the synchronization parameter includes the receiving time when the target device 120 receives the test data. At this time, the target device 120 generates the synchronization parameter, including: generating the synchronization parameter based on the receiving time of the test data.

[0142] Accordingly, the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120, including: based on the transmission delay, the first time and the receiving time between the device to be synchronized 110 and the target device 120, the time of the device to be synchronized 110 is synchronized to the time of the target device 120, and the first time generates test data for the device to be synchronized 110.

[0143] Optionally, based on the transmission delay, the first time and the receiving time between the device to be synchronized 110 and the target device 120, the time of the device to be synchronized 110 is synchronized to the time of the target device 120, including: calculating the difference between the receiving time and the first time to obtain the actual transmission time; calculating the difference between the actual transmission time and the transmission delay; adding the current time of the device to be synchronized 110 to the difference to obtain the synchronized time.

[0144] For example, for the same moment, the time of the target device 120 at that moment is 10:00:00, and the time of the device to be synchronized 110 at that moment is 10:01:00. Assume that the first time when the device to be synchronized 110 generates test data is 10:01:00 (according to the time mechanism of the device to be synchronized 110), and the receiving time of the test data by the target device 120 is 10:00:10 (according to the time mechanism of the target device 120). At this time, the actual transmission time is -50s. Assuming that the transmission time is 10s, the calculation error is -60s. The device to be synchronized 110 adds -60s to the current time, that is, slows down by 60s, and obtains the synchronized time.

[0145] In one example, when the difference between the receiving time and the first time is greater than a third threshold, the device to be synchronized 110 synchronizes the time of the target device 120 based on the transmission delay between the device to be synchronized 110 and the target device 120, the first time and the receiving time.

[0146] When the difference between the receiving time and the first time is less than or equal to the third threshold, the time synchronization between the device to be synchronized 110 and the target device 120 is completed, and the device to be synchronized 110 does not perform the process of synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the transmission delay between the device to be synchronized 110 and the target device 120, the first time and the receiving time.

[0147] The third threshold is set based on the maximum transmission delay between the device to be synchronized 110 and the target device 120 . The third threshold is pre-stored in the device to be synchronized 110 . This embodiment does not limit the value of the third threshold.

[0148] Optionally, based on the transmission delay, the first time and the receiving time between the device to be synchronized 110 and the target device 120, before synchronizing the time of the device to be synchronized 110 to the time of the target device 120, it also includes: obtaining current network transmission environment information; determining the transmission delay based on the network transmission environment information.

[0149] The calculation process of the transmission delay refers to the second method, and this embodiment will not be repeated here.

[0150] Optionally, the device to be synchronized 110 is further used to verify the time synchronization result of the device to be synchronized 110 .

[0151] Specifically, the device to be synchronized 110 executes the step of sending test data to the target device 120 based on the communication connection; if the difference between the receiving time and the first time is less than or equal to the third threshold, the verification is successful; if the verification is not successful (that is, the difference between the receiving time and the first time is greater than the third threshold), the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameters fed back by the target device 120.

[0152] It should be noted that, in the present embodiment, the example is taken that the number of cameras 102 and the number of cleaning robots 101 are both one. In actual implementation, the number of cameras 102 and the number of cleaning robots 101 may also be multiple, that is, at least two cameras 102 and at least two cleaning robots 101 are communicatively connected to the target device 120.

[0153] In addition, in this embodiment, time synchronization of the cleaning robot 101 refers to synchronizing the time of the controller in the cleaning robot 101 to the time of the target device 120; and / or synchronizing the time of each sensor installed on the cleaning robot 101 to the time of the target device 120.

[0154] When the time of the controller in the cleaning robot 101 is synchronized with the time of the target device 120, the controller is connected to the target device 120 for communication. At this time, each sensor on the same cleaning robot 101 can be connected to the controller on the cleaning robot 101 through a hardware interface so that each sensor uses the time mechanism of the controller. In this way, after the time mechanism of the controller is synchronized with the time mechanism of the target device 120, the time mechanism of each sensor will also be synchronized with the time mechanism of the target device 120.

[0155] When synchronizing the time of each sensor installed on the cleaning robot 101 to the time of the target device 120, each sensor installed on the cleaning robot 101 can also be connected to the target device 120 through a communication component. At this time, the time mechanism of each sensor can be synchronized to the time mechanism of the target device 120.

[0156] To summarize, the time synchronization method provided in this embodiment establishes a communication connection between the device to be synchronized 110 and the target device 120 by responding to a triggered time synchronization instruction; the device to be synchronized 110 sends test data to the target device 120 based on the communication connection; the test data is used to trigger the target device 120 to feedback synchronization parameters to the device to be synchronized 110; the target device 120 generates synchronization parameters in response to receiving the test data sent by the device to be synchronized 110 based on the communication connection, and feeds back the synchronization parameters to the device to be synchronized 110; the synchronization parameters are used for the device to be synchronized 110 to synchronize the time to the time of the target device 120; the device to be synchronized 110 synchronizes the time of the device to be synchronized 110 to the time of the target device 120 based on the synchronization parameters fed back by the target device 120; the problem that time synchronization cannot be achieved between the cleaning robot 101 and the camera 102 can be solved; this embodiment creates a data transmission mechanism to synchronize the time of the cleaning robot 101 and the camera 102 to the time of the target device 120, so as to achieve time synchronization between the cleaning robot 101 and the camera 102.

[0157] In addition, the target device 120 sends the synchronization parameter when the second difference is greater than the second threshold, that is, the judgment of whether to perform time synchronization is not performed in the device to be synchronized 110, which can save computing resources of the device to be synchronized 110.

[0158] In addition, since the network transmission type and distance between different devices to be synchronized 110 and target devices 120 may be different in different scenarios, the network congestion degree in different time periods may be different, which may lead to different transmission delays in different network situations. Based on this, this embodiment can improve the accuracy of predicting the second time by adaptively calculating the transmission delay using the delay prediction model, thereby improving the accuracy of time synchronization using the second time or transmission delay.

[0159] The time synchronization method provided by this application is introduced in detail below.

[0160] Figure 3 This is a flowchart of a time synchronization method provided by an embodiment of the present application. This embodiment uses the method for Figure 2 The time synchronization system shown in the figure is used as an example for explanation. The method includes at least the following steps:

[0161] Step 301: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0162] Step 302: The device to be synchronized sends test data to the target device based on the communication connection.

[0163] Step 303: The target device generates synchronization parameters in response to receiving the test data sent by the device to be synchronized based on the communication connection.

[0164] Step 304: The target device feeds back synchronization parameters to the device to be synchronized.

[0165] Step 305: The device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the synchronization parameters fed back by the target device.

[0166] The time synchronization method provided in this embodiment establishes a communication connection between the device to be synchronized and the target device by triggering a time synchronization instruction; the device to be synchronized sends test data to the target device based on the communication connection; the target device generates synchronization parameters in response to receiving the test data sent by the device to be synchronized based on the communication connection, and feeds back the synchronization parameters to the device to be synchronized; the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the synchronization parameters fed back by the target device; the problem that time synchronization cannot be achieved between the cleaning robot and the camera can be solved; this embodiment creates a data transmission mechanism to synchronize the time of the cleaning robot and the camera to the time of the target device, which can achieve time synchronization between the cleaning robot and the camera.

[0167] Optionally, steps 301, 302 and 305 may be implemented separately as a method embodiment on the to-be-synchronized device side; steps 303 and 304 may be implemented separately as a method embodiment on the target device side.

[0168] Figure 4 is a flowchart of a time synchronization method provided by an embodiment of the present application; this embodiment uses the method for Figure 2 The first case of the first implementation method in the time synchronization system shown is used as an example for explanation. The method includes at least the following steps:

[0169] Step 401: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0170] Step 402: The device to be synchronized sends test data to the target device based on the communication connection, where the test data includes a first time identifier of a first time.

[0171] Step 403 : In response to receiving the test data sent by the device to be synchronized based on the communication connection, the target device calculates a first difference between the reception time of the test data and the first time to obtain a synchronization parameter.

[0172] Step 404: After the target device generates the synchronization parameters, it sends the synchronization parameters to the device to be synchronized.

[0173] Step 405: When the first difference is greater than the first threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the first difference and the first threshold, and step 402 is executed; when the first difference is less than or equal to the first threshold, the time synchronization between the device to be synchronized and the target device is completed.

[0174] In this embodiment, the synchronization parameter is the first difference between the reception time of the test data and the first time, so the current network transmission delay does not need to be calculated in the process of calculating the synchronization parameter, which can save the computing resources of the target device.

[0175] Optionally, steps 401, 402 and 405 may be implemented separately as method embodiments on the to-be-synchronized device side; steps 403 and 404 may be implemented separately as method embodiments on the target device side.

[0176] Figure 5 is a flowchart of a time synchronization method provided by an embodiment of the present application; this embodiment uses the method for Figure 2 The second situation of the first implementation mode in the time synchronization system shown is used as an example for explanation. The method includes at least the following steps:

[0177] Step 501: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0178] Step 502: The device to be synchronized sends test data to the target device based on the communication connection, where the test data includes a first time identifier of a first time.

[0179] Step 503, in response to receiving the test data sent by the device to be synchronized based on the communication connection, the target device calculates the first difference between the reception time of the test data and the first time to obtain the synchronization parameter. If the first difference is greater than the first threshold, step 504 is executed; if the first difference is less than or equal to the first threshold, the process ends.

[0180] Step 504: The target device feeds back synchronization parameters to the device to be synchronized.

[0181] Step 505, in response to receiving the first difference, the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the first difference and the first threshold, and executes step 502; in response to not receiving the first difference, the time synchronization between the device to be synchronized and the target device is completed.

[0182] In this embodiment, the target device sends the synchronization parameter when the first difference is greater than the first threshold, that is, the judgment of whether to perform time synchronization is not performed in the device to be synchronized, which can save computing resources of the device to be synchronized.

[0183] Optionally, steps 501, 502 and 505 may be implemented separately as method embodiments on the to-be-synchronized device side; steps 503 and 504 may be implemented separately as method embodiments on the target device side.

[0184] Figure 6 is a flowchart of a time synchronization method provided by an embodiment of the present application; this embodiment uses the method for Figure 2 The first case of the second implementation method in the time synchronization system shown is used as an example for explanation. The method includes at least the following steps:

[0185] Step 601: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0186] Step 602: The device to be synchronized sends test data to the target device based on the communication connection, where the test data includes a first time identifier of a first time.

[0187] Step 603, in response to receiving the test data sent by the device to be synchronized based on the communication connection, the target device obtains a second time by inferring the generation time of the test data based on the reception time of the test data; and calculates a second difference between the second time and the first time to obtain a synchronization parameter.

[0188] Step 604: After the target device generates the synchronization parameters, it sends the synchronization parameters to the device to be synchronized.

[0189] Step 605, when the second difference is greater than the second threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the second difference, and step 602 is executed; when the second difference is less than or equal to the second threshold, the time synchronization between the device to be synchronized and the target device is completed.

[0190] In this embodiment, the synchronization parameter is the second difference between the second time and the first time, and the second time is the generation time of the test data inferred based on the reception time of the test data. Since the inference process is based on the current network transmission delay, the accuracy of time synchronization can be improved.

[0191] Optionally, steps 601, 602 and 605 may be implemented separately as a method embodiment on the to-be-synchronized device side; steps 603 and 604 may be implemented separately as a method embodiment on the target device side.

[0192] Figure 7 is a flowchart of a time synchronization method provided by an embodiment of the present application; this embodiment uses the method for Figure 2 The second situation of the second implementation mode in the time synchronization system shown is used as an example for explanation. The method includes at least the following steps:

[0193] Step 701: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0194] Step 702: The device to be synchronized sends test data to the target device based on the communication connection, where the test data includes a first time identifier of a first time.

[0195] Step 703: In response to receiving the test data sent by the device to be synchronized based on the communication connection, the target device obtains the second time by inferring the generation time of the test data based on the reception time of the test data; and calculates the second difference between the second time and the first time to obtain the synchronization parameter. If the second difference is greater than the second threshold, step 704 is executed; if the second difference is less than or equal to the second threshold, the process ends.

[0196] Step 704: The target device feeds back synchronization parameters to the device to be synchronized.

[0197] Step 705: In response to receiving the second difference, the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the second difference, and executes step 702; in response to not receiving the second difference, the time synchronization between the device to be synchronized and the target device is completed.

[0198] In this embodiment, the target device sends the synchronization parameter when the second difference is greater than the second threshold, that is, the judgment of whether to perform time synchronization is not performed in the device to be synchronized, which can save computing resources of the device to be synchronized.

[0199] Optionally, steps 701, 702 and 705 may be implemented separately as a method embodiment on the to-be-synchronized device side; steps 703 and 704 may be implemented separately as a method embodiment on the target device side.

[0200] Figure 8 is a flowchart of a time synchronization method provided by an embodiment of the present application; this embodiment uses the method for Figure 2 The third implementation method in the time synchronization system shown is used as an example for explanation. The method includes at least the following steps:

[0201] Step 801: The device to be synchronized responds to a triggered time synchronization instruction and establishes a communication connection between the device to be synchronized and a target device.

[0202] Step 802: The device to be synchronized sends test data to the target device based on the communication connection.

[0203] Step 803 : In response to receiving the test data sent by the device to be synchronized based on the communication connection, the target device generates a synchronization parameter based on the reception time of the test data.

[0204] Step 804: After the target device generates the synchronization parameters, it sends the synchronization parameters to the device to be synchronized.

[0205] Step 805: When the difference between the receiving time and the first time of the device to be synchronized is greater than the third threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time, and step 802 is executed; when the difference between the receiving time and the first time is less than or equal to the third threshold, the time synchronization between the device to be synchronized and the target device is completed.

[0206] In this embodiment, the synchronization parameter is the receiving time of the test data, which can reduce the amount of calculation when the target device generates the synchronization parameter, thereby saving the computing resources of the target device.

[0207] Optionally, steps 801, 802 and 805 may be implemented separately as a method embodiment on the to-be-synchronized device side; steps 803 and 804 may be implemented separately as a method embodiment on the target device side.

[0208] Fig. 9 is a block diagram of a time synchronization device provided by an embodiment of the present application, the device is applied to Figure 2 The device to be synchronized 110 in the time synchronization system shown includes at least the following modules: an instruction receiving module 910 , a data sending module 920 and a data receiving module 930 .

[0209] The instruction receiving module 910 is used to establish a communication connection between the device to be synchronized and the target device in response to the triggered time synchronization instruction;

[0210] The data sending module 920 is used to send test data to the target device based on the communication connection; the test data is used to trigger the target device to feedback synchronization parameters to the device to be synchronized;

[0211] The data receiving module 930 is used to synchronize the time of the device to be synchronized with the time of the target device based on the synchronization parameters fed back by the target device.

[0212] Fig.10 is a block diagram of a time synchronization device provided by an embodiment of the present application, the device is applied to Figure 2 The target device 120 in the time synchronization system shown includes at least the following modules: a connection module 1010 , a generation module 1020 and a sending module 1030 .

[0213] A connection module 1010 is used to establish a communication connection with a device to be synchronized;

[0214] A generating module 1020, configured to generate synchronization parameters in response to receiving test data sent by the device to be synchronized based on the communication connection;

[0215] The sending module 1030 is used to feed back synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the target device.

[0216] For relevant details, refer to the above method embodiment.

[0217] It should be noted that: the time synchronization device provided in the above embodiment only uses the division of the above functional modules as an example when performing time synchronization. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the time synchronization device is divided into different functional modules to complete all or part of the functions described above. In addition, the time synchronization device provided in the above embodiment and the time synchronization method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0218] Fig.11 is a block diagram of an electronic device provided by an embodiment of the present application. The electronic device may be Figure 2 The device to be synchronized 110 in Figure 2 The target device 120 in the embodiment of the present invention. The electronic device at least includes a processor 1101 and a memory 1102.

[0219] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0220] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1102 is used to store at least one instruction, which is used to be executed by the processor 1101 to implement the time synchronization method provided in the method embodiment of the present application.

[0221] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 1101, the memory 1102 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.

[0222] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.

[0223] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the time synchronization method of the above method embodiment.

[0224] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the time synchronization method of the above method embodiment.

[0225] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0226] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A time synchronization method, characterized in that: Used in a device to be synchronized, the device to be synchronized includes a cleaning robot and a camera working in cooperation with the cleaning robot, the method includes: In response to the triggered time synchronization instruction, establishing a communication connection between the device to be synchronized and the target device; Sending test data to the target device based on the communication connection; the test data is used to trigger the target device to feed back synchronization parameters to the device to be synchronized; The time of the device to be synchronized is synchronized to the time of the target device based on the synchronization parameter fed back by the target device.

2. The method according to claim 1, characterized in that: The test data includes a first time identifier of a first time, and the first time identifier is used to identify a first time when the device to be synchronized generates the test data; The synchronization parameter includes a first difference between the reception time of the test data and the first time; Alternatively, the synchronization parameter includes a second difference between a second time and the first time, and the second time is a generation time of the test data inferred by the target device based on a reception time of the test data.

3. The method according to claim 2, characterized in that The step of synchronizing the time of the device to be synchronized with the time of the target device based on the synchronization parameter fed back by the target device includes: When the synchronization parameter includes the first difference, and when the first difference is greater than a first threshold, synchronizing the time of the device to be synchronized to the time of the target device based on the first difference and the first threshold; or, When the synchronization parameter includes the second difference, and in the case where the second difference is greater than a second threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the second difference.

4. The method according to claim 3, characterized in that The method further comprises verifying the time synchronization result of the device to be synchronized according to the following manner: Execute the step of sending the test data to the target device based on the communication connection; When the synchronization parameter includes a first difference, if the first difference is less than or equal to a first threshold, the verification is passed; or, When the synchronization parameter includes a second difference value, if the second difference value is less than or equal to a second threshold value, the verification is passed.

5. The method according to claim 4, characterized in that The method further comprises: If the verification fails, the time of the device to be synchronized is synchronized to the time of the target device based on the synchronization parameter fed back by the target device.

6. The method according to claim 1, characterized in that The synchronization parameters include a reception time when the target device receives the test data; The step of synchronizing the time of the device to be synchronized with the time of the target device based on the synchronization parameter fed back by the target device includes: The time of the device to be synchronized is synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time, wherein the first time is the time when the device to be synchronized generates the test data.

7. The method according to claim 6, characterized in that The step of synchronizing the time of the device to be synchronized with the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time, and the receiving time includes: When the difference between the receiving time and the first time is greater than a third threshold, the time of the device to be synchronized is synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time and the receiving time.

8. The method according to claim 6, characterized in that Before synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay between the device to be synchronized and the target device, the first time, and the receiving time, the method further includes: Get the current network transmission environment information; The transmission delay is determined based on the network transmission environment information.

9. The method according to claim 8, characterized in that The network transmission environment information includes at least one of a transmission distance, a current time period, and a network type; and determining the transmission delay based on the network transmission environment includes: The network transmission environment information is input into a pre-trained delay prediction model to obtain the transmission delay; the delay prediction model is obtained by training a neural network using training data, and each set of training data includes a sample transmission distance, a sample time period, a sample network type and a corresponding actual transmission delay.

10. A time synchronization method, characterized in that: Used in a target device, the target device is used to perform time synchronization on a device to be synchronized, the device to be synchronized includes a cleaning robot and a camera working in cooperation with the cleaning robot, the method includes: Establishing a communication connection with the device to be synchronized; In response to receiving the test data sent by the device to be synchronized based on the communication connection, generating synchronization parameters; Feedback synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the target device.

11. The method according to claim 10, characterized in that The test data includes a first time identifier of a first time, where the first time identifier is used to identify the first time when the device to be synchronized generates the test data; The generating synchronization parameters comprises: Calculate a first difference between the receiving time of the test data and the first time to obtain the synchronization parameter; or, The generation time of the test data is inferred based on the reception time of the test data to obtain a second time; and a second difference between the second time and the first time is calculated to obtain the synchronization parameter.

12. The method according to claim 11, characterized in that The generation time of the test data inferred based on the reception time of the test data includes: Get the current network transmission environment information; Based on the network transmission environment information, a transmission delay between the device to be synchronized and the target device is determined; and the second time is determined according to the transmission delay and the receiving time.

13. The method according to claim 10, characterized in that The generating synchronization parameters comprises: The synchronization parameter is generated based on a reception time of the test data.

14. An electronic device, characterized in that: The device includes a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to implement the time synchronization method as described in any one of claims 1 to 9; or, implement the time synchronization method as described in any one of claims 10 to 13.

15. A computer-readable storage medium, characterized in that: The storage medium stores a program, and when the program is executed by the processor, it is used to implement the time synchronization method as described in any one of claims 1 to 9; or, to implement the time synchronization method as described in any one of claims 10 to 13.

16. A time synchronization system, characterized in that: The system includes a device to be synchronized and a target device, wherein the device to be synchronized includes a cleaning robot and a camera working in cooperation with the cleaning robot; The device to be synchronized is used to establish a communication connection between the device to be synchronized and a target device in response to a triggered time synchronization instruction; send test data to the target device based on the communication connection; the test data is used to trigger the target device to feed back synchronization parameters to the cleaning robot of the device to be synchronized; The target device is configured to generate synchronization parameters in response to receiving test data sent by the device to be synchronized based on the communication connection; Feedback synchronization parameters to the device to be synchronized; the synchronization parameters are used for the device to be synchronized to synchronize the time to the target device; The device to be synchronized is further configured to synchronize the time of the device to be synchronized with the time of the target device based on the synchronization parameter fed back by the target device.