CN113676279A - Time synchronization method, device, storage medium and system - Google Patents

Time synchronization method, device, storage medium and system Download PDF

Info

Publication number
CN113676279A
CN113676279A CN202110969366.XA CN202110969366A CN113676279A CN 113676279 A CN113676279 A CN 113676279A CN 202110969366 A CN202110969366 A CN 202110969366A CN 113676279 A CN113676279 A CN 113676279A
Authority
CN
China
Prior art keywords
time
synchronized
synchronization
target device
test data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110969366.XA
Other languages
Chinese (zh)
Inventor
齐焱
张家豪
杨盛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dreame Innovation Technology Suzhou Co Ltd
Original Assignee
Dreame Innovation Technology Suzhou Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dreame Innovation Technology Suzhou Co Ltd filed Critical Dreame Innovation Technology Suzhou Co Ltd
Priority to CN202110969366.XA priority Critical patent/CN113676279A/en
Publication of CN113676279A publication Critical patent/CN113676279A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • H04L43/0864Round trip delays

Landscapes

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

Abstract

The application relates to a time synchronization method, a device, a storage medium and a system, belonging to the technical field of computers, wherein the method comprises the following steps: responding to the triggered time synchronization instruction, and establishing communication connection between the equipment to be synchronized and the target equipment; the device to be synchronized sends test data to the target device based on the communication connection; the target equipment generates a synchronization parameter in response to receiving test data sent by the equipment to be synchronized based on the communication connection, and feeds the synchronization parameter back to the equipment 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 parameter 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 application creates a data transmission mechanism to synchronize the time of the cleaning robot and the camera as the time of the target equipment, and can realize the time synchronization between the cleaning robot and the camera.

Description

Time synchronization method, device, storage medium and system
[ technical field ] A method for producing a semiconductor device
The application relates to a time synchronization method, time synchronization equipment, a storage medium and a time synchronization system, and belongs to the technical field of computers.
[ background of the invention ]
The existing cleaning robot often has the functions of environment recognition, path planning, map construction and the like. At this time, the cleaning robot generally acquires environmental data of the working area, and analyzes and processes the environmental data to implement corresponding functions.
However, the range of the cleaning robot to collect the environmental data is limited. Based on this, the working area can be additionally provided with a camera which is used for monitoring the self-moving equipment. At this time, the environmental data collected by the cleaning robot and the environmental data collected in the camera monitoring process are fused to analyze the fused environmental data, so that the accuracy of data analysis can be improved.
In order to ensure accuracy in data fusion, the cleaning robot and the camera need to be time synchronized before use. The conventional time synchronization method includes only time synchronization of respective sensors on the cleaning robot in a manner of including: and each sensor is connected with the microprocessor through a hardware interface, so that each sensor uses the same time system.
However, since a camera working in cooperation with the cleaning robot is not mounted on the cleaning robot, time synchronization between the cleaning robot and the camera cannot be achieved using the conventional manner.
[ summary of the invention ]
The application provides a time synchronization method, time synchronization equipment, a storage medium and a time synchronization system, which can solve the problem that the time synchronization between a cleaning robot and a camera cannot be realized when the camera working in cooperation with the cleaning robot is not installed on the cleaning robot because the conventional time synchronization method only comprises the step of carrying out time synchronization on each sensor on the cleaning robot. The application provides the following technical scheme:
in a first aspect, a time synchronization method is provided, for use in a device to be synchronized, the device to be synchronized including a cleaning robot or being a camera working in cooperation with the cleaning robot, the method including:
responding to a triggered time synchronization instruction, and establishing communication connection between the equipment to be synchronized and target equipment;
sending test data to the target device based on the communication connection; the test data is used for triggering the target equipment to feed back the synchronization parameters to the equipment to be synchronized;
and synchronizing the time of the equipment to be synchronized into the time of the target equipment based on the synchronization parameters fed back by the target equipment.
Optionally, 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 synchronization parameter comprises a first difference between a time of receipt of the test data and the first time; or, the synchronization parameter includes a second difference between a second time and the first time, where the second time is a generation time of the test data estimated by the target device based on the reception time of the test data.
Optionally, the 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:
when the synchronization parameter includes the first difference value, synchronizing the time of the device to be synchronized to the time of the target device based on the first difference value and a first threshold value if the first difference value is greater than the first threshold value;
alternatively, the first and second electrodes may be,
and when the synchronization parameter comprises the second difference value, synchronizing the time of the device to be synchronized to the time of the target device based on the second difference value under the condition that the second difference value is greater than a second threshold value.
Optionally, the method further includes verifying a time synchronization result of the device to be synchronized according to the following manner:
performing the step of sending test data to the target device based on the communication connection;
when the synchronization parameter comprises a first difference value, if the first difference value is smaller than or equal to a first threshold value, the verification is passed;
alternatively, the first and second electrodes may be,
and when the synchronization parameter comprises a second difference value, if the second difference value is smaller than or equal to a second threshold value, the verification is passed.
Optionally, the method further comprises:
and under the condition of passing the verification, synchronizing the time of the equipment to be synchronized into the time of the target equipment based on the synchronization parameters fed back by the target equipment.
Optionally, the synchronization parameter includes a receiving time when the target device receives the test data;
the 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:
and synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay, the first time and the receiving time between the device to be synchronized and the target device, wherein the first time is the time for generating the test data by the device to be synchronized.
Optionally, the synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay, the first time, and the receiving time between the device to be synchronized and the target device includes:
synchronizing the time of the device to be synchronized to the time of the target device based on a transmission delay between the device to be synchronized and the target device, the first time, and the reception time, if a difference between the reception time and the first time is greater than a third threshold.
Optionally, the synchronizing the time of the device to be synchronized to be before 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 further includes:
acquiring current network transmission environment information;
determining the transmission delay based on the network transmission environment information.
Optionally, the network transmission environment information includes at least one of a transmission distance, a current time period, and a network type; the determining the transmission delay based on the network transmission environment comprises:
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 by using training data, and each set of training data comprises a sample transmission distance, a sample time period, a sample network type and corresponding actual transmission delay.
In a second aspect, a time synchronization method is provided, where the target device is used for time synchronization of a device to be synchronized, where the device to be synchronized includes a cleaning robot or a camera working in cooperation with the cleaning robot, and the method includes:
establishing communication connection with the equipment to be synchronized;
generating synchronization parameters in response to receiving test data sent by the device to be synchronized based on the communication connection;
feeding back synchronization parameters to the equipment to be synchronized; the synchronization parameter is used for the device to be synchronized to synchronize time to the time of the target device.
Optionally, 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 of the synchronization parameter includes:
calculating a first difference value between the receiving time of the test data and the first time to obtain the synchronous parameter;
alternatively, the first and second electrodes may be,
generating time of the test data estimated based on the receiving time of the test data to obtain second time; and calculating a second difference value between the second time and the first time to obtain the synchronization parameter.
Optionally, the step of estimating the generation time of the test data based on the reception time of the test data includes:
acquiring current network transmission environment information;
determining a transmission delay between the device to be synchronized and the target device based on the network transmission environment information; determining the second time according to the transmission delay and the receiving time.
Optionally, the generating the synchronization parameter includes:
generating the synchronization parameter based on a time of receipt of the test data.
In a third aspect, an electronic device is provided, the device comprising a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement the time synchronization method provided by the first aspect; alternatively, the time synchronization method provided by the second aspect is implemented.
In a fourth aspect, a computer-readable storage medium is provided, in which a program is stored, which when executed by a processor, is configured to implement the time synchronization method provided in the first aspect; alternatively, the time synchronization method provided by the second aspect is implemented.
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;
the device to be synchronized is used for responding to a triggered time synchronization instruction and establishing communication connection between the device to be synchronized and target equipment; sending test data to the target device based on the communication connection; the test data is used for triggering the target equipment to feed back synchronization parameters to the cleaning robot of the equipment to be synchronized;
the target device is used for responding to the received test data sent by the device to be synchronized based on the communication connection and generating synchronization parameters; feeding back synchronization parameters to the equipment to be synchronized; the synchronization parameter is used for the device to be synchronized to synchronize time to the time of the target device;
the device to be synchronized is further configured to synchronize 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.
The beneficial effects of this application include at least: establishing communication connection between the equipment to be synchronized and the target equipment by responding to the 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 for triggering the target equipment to feed back the synchronization parameters to the equipment to be synchronized; the target equipment generates a synchronization parameter in response to receiving test data sent by the equipment to be synchronized based on the communication connection, and feeds the synchronization parameter back to the equipment to be synchronized; the synchronization parameter is used for the equipment to be synchronized to synchronize the time to the time of the target equipment; 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 parameter 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 application creates a data transmission mechanism to synchronize the time of the cleaning robot and the camera as the time of the target equipment, and the time synchronization between the cleaning robot and the camera can be realized.
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 execute the time synchronization is not executed in the device to be synchronized, so that the computing resource of the device to be synchronized can be saved.
In addition, since the network transmission types and distances between different devices to be synchronized and the target device may be different in different scenarios, the network congestion degrees in different time periods may be different, which may cause different transmission delays in different network situations. Based on this, the present embodiment can improve the accuracy of predicting the second time by adaptively calculating the propagation delay using the delay prediction model, thereby improving the accuracy when performing time synchronization using the second time or the propagation delay.
The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical solutions of the present application more clear and clear, and to implement the technical solutions according to the content of the description, the following detailed description is made with reference to the preferred embodiments of the present application and the accompanying drawings.
[ description of the drawings ]
Fig. 1 is a schematic structural diagram of a working system of a cleaning robot according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a time synchronization system according to an embodiment of the present application;
FIG. 3 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 4 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 5 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 6 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 7 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 8 is a flow chart of a method of time synchronization provided by an embodiment of the present application;
FIG. 9 is a block diagram of a time synchronizer provided by an embodiment of the present application;
FIG. 10 is a block diagram of a time synchronizer provided by an embodiment of the present application;
fig. 11 is a block diagram of an electronic device provided by an embodiment of the application.
[ detailed description ] embodiments
The following detailed description of embodiments of the present application will be made with reference to the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
First, a number of terms related to embodiments of the present application will be described.
A neural network: the method is an arithmetic mathematical model simulating animal neural network behavior characteristics and performing distributed parallel information processing. The neural network depends on the complexity of the system, and the aim of processing information is fulfilled by adjusting the interconnection relationship among a large number of internal nodes.
Time synchronization: is a process for providing a uniform time scale for a distributed system through certain operations of a local clock. Such as: the distributed system comprises equipment to be synchronized and target equipment in communication connection with the equipment to be synchronized, and the time synchronization refers to the synchronization of the time of all the equipment to be synchronized into the time of the target equipment.
Time stamping: the data is generated by using a digital signature technology, and the signed object comprises original file information, signature parameters, signature time and other information. The time stamp may be used to mark the generation time of the data.
Conventional cleaning robots are generally provided with sensors to collect environmental data of a current working area. The sensors include, but are not limited to, a laser radar sensor, an obstacle avoidance sensor, a distance measurement sensor, a vision sensor, etc., and the present embodiment does not list the types of the sensors. The cleaning robot can realize the functions of map construction, obstacle avoidance, path planning, target identification and the like of a working area based on the environmental data acquired by the sensor.
However, the sensing range of the sensor installed on the cleaning robot is often small, and the gesture of the collected data is fixed, so when the corresponding function is realized by using the environmental data collected by the sensor, the problem of poor effect of realizing the corresponding function may be caused by inaccurate analysis of the environmental data.
Based on this, referring to fig. 1, the present application proposes a working system of a cleaning robot 101, which comprises the cleaning robot 101 and a camera 102, wherein both the cleaning robot 101 and the camera 102 are arranged within the same working area.
Alternatively, the cleaning robot 101 may be a sweeper, a mopping machine, a floor washing machine, or other equipment with a self-moving function, and the type of the cleaning robot 101 is not limited in this application.
The camera 102 may be a smart camera or a device (e.g., a mobile phone, a tablet computer, etc.) equipped with a Micro Control Unit (MCU) and having a camera function, and the application does not limit the type of the camera 102.
The installation height of the camera 102 is higher than the equipment height of the cleaning robot 101, so that when a sensor is installed on the cleaning robot 101, the camera 102 can collect environmental data of the work area in a posture different from the collection posture of the sensor. Then, the environmental data collected by the camera 102 is fused with the environmental data collected by the camera, and the fused environmental data is used for analysis, so that the realization effect of the corresponding function is improved.
The cleaning robot 101 and the camera 102 need to be time synchronized before use. The conventional time synchronization method includes time-synchronizing respective sensors on the cleaning robot 101. The specific synchronization mode comprises: each sensor is connected to the microprocessor on the cleaning robot 101 through a hardware interface, so that each sensor uses the time system of the microprocessor.
However, since the camera 102 working in cooperation with the cleaning robot 101 is not mounted on the cleaning robot 101, time synchronization between the cleaning robot 101 and the camera 102 cannot be achieved using the conventional manner.
In view of the above technical problems, the present embodiment provides a time synchronization system and method, which are described below.
Fig. 2 is a schematic structural diagram of a time synchronization system according to an embodiment of the present application. As shown in fig. 2, the system includes at least a device to be synchronized 110 and a target device 120. The time synchronization system provided by the present embodiment is used to time-synchronize the cleaning robot 101 and the camera 102 in the work system provided in fig. 1. Accordingly, the device to be synchronized 110 includes the cleaning robot 101 and the camera 102 working in cooperation with the cleaning robot 101.
The target device 120 is used to provide a uniform time mechanism for the devices to be synchronized 110. The target device 120 may be a device having a communication function and a computing function, such as a mobile phone, a computer, or a wearable device, and the present embodiment does not limit the device type of the target device 120.
In this embodiment, the device to be synchronized 110 is configured to establish a communication connection between the device to be synchronized 110 and the target device 120 in response to the triggered time synchronization instruction; the test data is sent to the target device 120 based on the communication connection.
Accordingly, the target device 120 is configured to generate the synchronization parameter in response to receiving the test data sent by the device to be synchronized 110 based on the communication connection; the synchronization parameters are fed back to the device to be synchronized 110. The synchronization parameter is 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 synchronization parameters to the device to be synchronized 110.
The device to be synchronized 110 is further configured to receive the synchronization parameter sent by the target device 120; the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the synchronization parameter.
Here, the time synchronization refers to synchronizing the time between the multiple devices to be synchronized 110 to the time of the target device 120.
Alternatively, the time synchronization instruction may be generated by the device to be synchronized 110, i.e. by the cleaning robot 101 or the camera 102; alternatively, the time synchronization command may be generated and transmitted by the target device 120, and the embodiment does not limit the manner of acquiring the time synchronization command.
Such as: taking an example that the target device 120 sends a time synchronization instruction to the device to be synchronized 110 as an illustration, a time synchronization interface is displayed in the target device 120, and the time synchronization interface includes a time synchronization control. When receiving the trigger operation acting on the time synchronization control, the target device 120 generates a time synchronization instruction, and sends the time synchronization instruction to the device to be synchronized 110.
In this embodiment, the target device 120 and the device to be synchronized 110 are both installed with communication components, and the communication component in the target device 120 and the communication component in the device to be synchronized 110 establish communication connection.
The communication connection between the communication component in the target device 120 and the communication component in the device to be synchronized 110 may be based on bluetooth connection, or may also be based on wireless communication technology (WiFi) connection, and the like, and the communication connection between the communication component in the target device 120 and the communication component in the device to be synchronized 110 is not limited in this embodiment.
Optionally, the synchronization parameter includes, but is not limited to, one of the following three implementations. In a first mode, the synchronization parameter comprises a first difference between a time of receipt of the test data and a first time; in a second manner, the synchronization parameter comprises a second difference between the second time and the first time; in a third mode, the synchronization parameter includes a time of receipt of the test data. The implementation modes of the synchronization parameters are different, and the corresponding time synchronization modes are also different. In the following, different implementation manners of the synchronization parameter are introduced for the corresponding time synchronization manners, respectively.
For ease of understanding, the first time, the second time, and the reception time in this application will be described first. In this application, the first time refers to the time when the device to be synchronized 110 generates the test data, i.e., the actual generation time of the test data. The reception time is the time at which the target device 120 receives the test data, i.e., the actual reception time of the test data. The second time is a generation time of the test data estimated by the target device 120 based on the reception time of the test data, that is, the second time is an estimated generation time of the test data, or a theoretical generation time.
The first mode is as follows: the synchronization parameter includes a first difference between the time of receipt and the first time. At this point, the test data includes a first time identification of the first time. The first time identification is used to identify a first time when the device to be synchronized 110 generates test data.
In one example, the first time is identified as a timestamp. Before the device to be synchronized 110 sends the test data to the target device 120 based on the communication connection, the device to be synchronized is further configured to: generating a first time identifier corresponding to the first time by utilizing a timestamp generation algorithm; test data is generated using the first time stamp.
The timestamp generation algorithm may be an algorithm for generating a timestamp based on Universal Time Coordinated (UTC), or may also be an algorithm for generating a timestamp based on Universal Time (UT), and the present embodiment does not limit the type of the timestamp generation algorithm.
Optionally, the test data may include other data content besides the first time identifier, such as: data type, check bits, etc., and the data content of the test data is not limited in this embodiment.
In a first approach, the target device 120 generates synchronization parameters, including: and calculating a first difference value between the receiving time of the test data and the first time to obtain a synchronization parameter.
After the target device 120 generates the synchronization parameters, the time synchronization method includes, but is not limited to, determining whether time synchronization is required by the device to be synchronized 110, and if so, performing a 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 perform the time synchronization process. These two cases will be described separately below.
In the first case: it is determined by the device to be synchronized 110 whether time synchronization is required. At this time, after the target device 120 generates the synchronization parameter, the synchronization parameter is transmitted to the device to be synchronized 110.
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 case 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 first difference and the first threshold.
In the case where 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 a 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.
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, and a value of the first threshold is not limited in this embodiment.
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 a difference between the first difference and a first threshold; the current time of the device to be synchronized 110 is added to the difference to obtain the synchronized time.
Such as: for the same time, the time of the target device 120 at the time is 10:00:00, and the time of the device to be synchronized 110 at the time is 10:01: 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), and the receiving time when the target device 120 receives the test data is 10:00:10 (according to the time mechanism of the target device 120). At this time, the first difference is-50 s. Assuming that the first threshold is 10s, the difference between the first difference and the first threshold is-60 s, and the device to be synchronized 110 adds-60 s to the current time, i.e., slows down for 60s, to obtain the synchronized time.
Optionally, the device to be synchronized 110 is further configured to verify a time synchronization result of the device to be synchronized 110.
Specifically, the device to be synchronized 110 performs a step of transmitting test data to the target device 120 based on the communication connection; if the first difference is smaller than or equal to the first threshold, the verification is passed; in case of non-verification pass (i.e. the first difference is larger 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.
In the second case: the target device 120 determines whether time synchronization is required. At this time, after the target device 120 generates the synchronization parameter, the target device feeds back the synchronization parameter to the device to be synchronized 110, which includes: the synchronization parameter is sent when the first difference is greater than a first threshold.
The synchronization parameter is not transmitted when the first difference is less than or equal to the first threshold.
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 first difference, the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the first difference and the first threshold.
In response to not receiving the first difference value, 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 a 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 value.
In the second case, after the device to be synchronized 110 sends the test data, it is detected whether the first difference is received within a predetermined time period. If the first difference is received, it indicates that time synchronization is required, and the device to be synchronized 110 performs a time synchronization process. If the first difference is not received, it indicates that time synchronization is not required, and the device to be synchronized 110 does not perform the time synchronization process.
For a 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, refer to the first case, and this embodiment is not described herein again.
Optionally, the device to be synchronized 110 is further configured to verify a time synchronization result of the device to be synchronized 110.
Specifically, the device to be synchronized 110 performs a step of transmitting test data to the target device 120 based on the communication connection; if the first difference is not received within the preset time, the verification is passed; in case of non-verification pass (i.e. detection of reception of the first difference value within a 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 parameter fed back by the target device 120.
The second mode is as follows: the synchronization parameter includes a second difference between the second time and the first time. At this point, the test data includes a first time identification of the first time. The target device 120 generates synchronization parameters including: generating time of the test data is estimated based on the receiving time of the test data to obtain second time; and calculating a second difference value between the second time and the first time to obtain the synchronization parameter.
Optionally, inferring the second time based on the time of receipt of the test data comprises: acquiring current network transmission environment information; determining a transmission delay between the device to be synchronized 110 and the target device 120 based on the network transmission environment information; the second time is determined according to the transmission delay and the reception time.
The network transmission environment information includes at least one of a transmission distance, a current time period, and a network type. Wherein the transmission distance is positively correlated with the transmission delay. The degree of network congestion is different for different time periods. Such as: in the morning 2:00 to 6: in the time period of 00, the network utilization rate is low, and correspondingly, the network congestion degree is low; and in the morning from 7:00 a.m. to 6:00 a.m., the network usage rate is higher and, correspondingly, the degree of network congestion is higher. Network types include wireless networks and data networks.
In practical implementation, the network transmission environment information may further include other information that affects data transmission delay, and the present embodiment does not limit the type of information included in the network transmission environment information.
Specifically, determining the transmission delay between the device to be synchronized 110 and the target device 120 based on the network transmission environment information includes: and 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 by using training data, and each set of training data comprises a sample transmission distance, a sample time period, a sample network type and corresponding actual transmission delay.
Illustratively, the process of training the delayed training model includes: creating an initial network model; inputting the sample transmission distance, the sample time period and the sample network type into the initial network model to obtain a model result; and iteratively updating parameters of the initial network model based on the model result and the corresponding actual transmission delay, and obtaining a delay prediction model when the iteration times reach preset times or the updated model is converged.
The Neural Network may be a Back Propagation Neural Network (BP), an ART, an RBF, or an LVM Neural Network, and the present embodiment does not limit the type of the Neural Network.
In one example, determining the second time in terms of a transmission delay and a reception time includes: and calculating the difference value between the receiving time and the transmission delay to obtain a second time.
In the second way, after the target device 120 generates the synchronization parameters, the time synchronization method includes, but is not limited to, determining whether time synchronization is required by the device to be synchronized 110, and if so, performing a 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 perform the time synchronization process. These two cases will be described separately below.
In the first case: it is determined by the device to be synchronized 110 whether time synchronization is required. At this time, after the target device 120 generates the synchronization parameter, the synchronization parameter is transmitted to the device to be synchronized 110.
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 case 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 second difference.
In the case where 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 a 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.
Wherein a value of the second threshold is close to 0, and the second threshold is determined based on a calculation error at the time of estimating the second time. The value of the second threshold is pre-stored in the device to be synchronized 110, and the value of the second threshold is not limited in this embodiment.
In one example, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the second difference comprises: the synchronized time is obtained by adding the second difference to the current time of the device to be synchronized 110.
Such as: for the same time, the time of the target device 120 at the time is 10:00:00, and the time of the device to be synchronized 110 at the time is 10:01: 00. Assume that the reception time of the target device 120 to receive the test data is 10:00:10 (according to the time scheme of the target device 120), and the transmission delay is 10 s. At this time, the second time is 10:00: 00. Assuming 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), the second difference is-60 s, and the device to be synchronized 110 adds-60 s to the current time, i.e., slows down by 60s, to obtain the synchronized time.
Optionally, the device to be synchronized 110 is further configured to verify a time synchronization result of the device to be synchronized 110.
Specifically, the device to be synchronized 110 performs a step of transmitting test data to the target device 120 based on the communication connection; if the second difference is smaller than or equal to the second threshold, the verification is passed; in case of non-verification pass (i.e. the second difference is larger 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 parameter fed back by the target device 120.
In the second case: the target device 120 determines whether time synchronization is required. At this time, after the target device 120 generates the synchronization parameter, the target device feeds back the synchronization parameter to the device to be synchronized 110, which includes: and transmitting the synchronization parameter when the second difference is greater than a second threshold.
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, the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the second difference.
In response to not receiving the second difference, 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 a 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.
In the second case, after the device to be synchronized 110 sends the test data, it is detected whether the second difference is received within a predetermined time period. If the second difference is received, it indicates that time synchronization is required, and the device to be synchronized 110 performs a time synchronization process. If the second difference is not received, it indicates that time synchronization is not required, and the device to be synchronized 110 does not perform the time synchronization process.
For a 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, reference is made to the first case, and this embodiment is not described herein again.
Optionally, the device to be synchronized 110 is further configured to verify a time synchronization result of the device to be synchronized 110.
Specifically, the device to be synchronized 110 performs a step of transmitting test data to the target device 120 based on the communication connection; if the second difference is not received within the preset time, the verification is passed; in case of non-verification pass (i.e. detection of reception of the second difference value 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 parameter fed back by the target device 120.
The third mode is as follows: the synchronization parameter includes a reception time when the target device 120 receives the test data. At this time, the target device 120 generates synchronization parameters including: synchronization parameters are generated based on the time of receipt of the test data.
Accordingly, synchronizing 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 includes: the time of the device to be synchronized 110 is synchronized to the time of the target device 120 based on the transmission delay, the first time, and the reception time between the device to be synchronized 110 and the target device 120, the first time being the time at which the device to be synchronized 110 generates the test data.
Optionally, synchronizing the time of the device to be synchronized 110 to the time of the target device 120 based on the transmission delay, the first time and the reception time between the device to be synchronized 110 and the target device 120 includes: calculating the difference value 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; the current time of the device to be synchronized 110 is added to the difference to obtain the synchronized time.
Such as: for the same time, the time of the target device 120 at the time is 10:00:00, and the time of the device to be synchronized 110 at the time is 10:01: 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), and the receiving time when the target device 120 receives the test data is 10:00:10 (according to the time mechanism of the target device 120). At this point, the actual transmission time is-50 s. Assuming that the transmission is 10s, the calculation error is-60 s, and the device to be synchronized 110 adds-60 s to the current time, i.e. slows down for 60s, to obtain the synchronized time.
In one example, 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 transmission delay between the device to be synchronized 110 and the target device 120, the first time, and the reception time, if the difference between the reception time and the first time is greater than the third threshold.
In a case where the difference between the reception 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 a 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, the first time, and the reception time between the device to be synchronized 110 and the target device 120.
The third threshold is set based on the maximum transmission delay between the device to be synchronized 110 and the target device 120, and the third threshold is pre-stored in the device to be synchronized 110, and the value of the third threshold is not limited in this embodiment.
Optionally, synchronizing the time of the device to be synchronized 110 to be before the time of the target device 120 based on the transmission delay, the first time and the receiving time between the device to be synchronized 110 and the target device 120, further includes: acquiring current network transmission environment information; the transmission delay is determined based on the network transmission environment information.
The second method is referred to for the calculation process of the transmission delay, and this embodiment is not described herein again.
Optionally, the device to be synchronized 110 is further configured to verify a time synchronization result of the device to be synchronized 110.
Specifically, the device to be synchronized 110 performs a step of transmitting test data to the target device 120 based on the communication connection; if the difference value between the receiving time and the first time is less than or equal to the third threshold value, the verification is passed; in case of non-verification pass (i.e. the difference between the reception 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 parameter fed back by the target device 120.
It should be added that, in the present embodiment, the number of the cameras 102 and the number of the cleaning robots 101 are both described as one example, and in actual implementation, the number of the cameras 102 and the number of the cleaning robots 101 may also be multiple, that is, at least two cameras 102 and at least two cleaning robots 101 are connected to the target device 120 in a communication manner.
In addition, in the present embodiment, the time synchronization of the cleaning robot 101 means that the time of the controller in the cleaning robot 101 is synchronized 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.
When synchronizing the time of the controller in the cleaning robot 101 to the time of the target device 120, the controller is communicatively connected to the target device 120. At this time, each sensor on the same cleaning robot 101 may be connected to a controller on the cleaning robot 101 through a hardware interface so that each sensor uses a time scheme of the controller. Thus, after synchronizing the time mechanism of the controller to the time mechanism of the target device 120, the time mechanisms of the respective sensors are also synchronized to the time mechanism of the target device 120.
Each sensor installed on the cleaning robot 101 may also be communicatively connected to the target device 120 through a communication component when synchronizing the time of each sensor installed on the cleaning robot 101 to the time of the target device 120. At this time, the time mechanisms of the respective sensors may be synchronized as the time mechanism of the target device 120.
In summary, 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 the 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 for triggering the target device 120 to feed back the synchronization parameters to the device to be synchronized 110; the target device 120 generates a synchronization parameter in response to receiving test data sent by the device to be synchronized 110 based on the communication connection, and feeds back the synchronization parameter to the device to be synchronized 110; the synchronization parameter is 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 parameter 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; the present embodiment creates a data transmission mechanism to time-synchronize the cleaning robot 101 and the camera 102 to the time of the target device 120, and can achieve time synchronization between the cleaning robot 101 and the camera 102.
In addition, the target device 120 sends the synchronization parameter when the second difference is greater than the second threshold, that is, the determination of whether to perform time synchronization is not performed in the device to be synchronized 110, which may save the computing resources of the device to be synchronized 110.
In addition, since the network transmission type and distance between different devices to be synchronized 110 and the target device 120 may be different in different scenarios, the degree of network congestion may be different in different time periods, which may cause transmission delay to be different in different network situations. Based on this, the present embodiment can improve the accuracy of predicting the second time by adaptively calculating the propagation delay using the delay prediction model, thereby improving the accuracy when performing time synchronization using the second time or the propagation delay.
The time synchronization method provided in the present application is described in detail below.
Fig. 3 is a flowchart of a time synchronization method according to an embodiment of the present application. This embodiment will be described by taking the method as an example for use in the time synchronization system shown in fig. 2. The method at least comprises the following steps:
step 301, the device to be synchronized responds to the triggered time synchronization instruction, and establishes a communication connection between the device to be synchronized and the target device.
Step 302, the device to be synchronized sends test data to the target device based on the communication connection.
Step 303, the target device generates a synchronization parameter in response to receiving the test data sent by the device to be synchronized based on the communication connection.
Step 304, the target device feeds back the synchronization parameters to the device to be synchronized.
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 parameter fed back by the target device.
According to the time synchronization method provided by the embodiment, the communication connection between the device to be synchronized and the target device is established through the triggered time synchronization instruction; the device to be synchronized sends test data to the target device based on the communication connection; the target equipment generates a synchronization parameter in response to receiving test data sent by the equipment to be synchronized based on the communication connection, and feeds the synchronization parameter back to the equipment 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 parameter 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 embodiment creates a data transmission mechanism to synchronize the time of the cleaning robot and the camera as the time of the target equipment, and can realize the time synchronization between the cleaning robot and the camera.
Alternatively, steps 301, 302 and 305 may be implemented separately as method embodiments on the device side to be synchronized; steps 303 and 304 may be implemented separately as method embodiments on the target device side.
FIG. 4 is a flow chart of a method of time synchronization provided by an embodiment of the present application; the present embodiment is described by taking as an example the first case of the first implementation mode in which the method is used in the time synchronization system shown in fig. 2. The method at least comprises the following steps:
step 401, the device to be synchronized responds to the triggered time synchronization instruction, and establishes a communication connection between the device to be synchronized and the target device.
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.
In step 403, the target device calculates a first difference between the receiving time of the test data and the first time in response to receiving the test data sent by the device to be synchronized based on the communication connection, so as to obtain a synchronization parameter.
Step 404, after the target device generates the synchronization parameter, the target device sends the synchronization parameter to the device to be synchronized.
Step 405, when the first difference value is greater than the first threshold value, 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 value and the first threshold value, and step 402 is executed; and when the first difference is smaller than or equal to the first threshold, completing the time synchronization between the device to be synchronized and the target device.
In this embodiment, the synchronization parameter is a first difference between the receiving time of the test data and the first time, so that the current network transmission delay does not need to be calculated in the process of calculating the synchronization parameter, and the calculation resource of the target device can be saved.
Alternatively, steps 401, 402 and 405 may be implemented separately as method embodiments on the device side to be synchronized; steps 403 and 404 may be implemented separately as method embodiments on the target device side.
FIG. 5 is a flow chart of a method of time synchronization provided by an embodiment of the present application; the present embodiment is described by taking as an example the second case of the first implementation mode in which the method is used in the time synchronization system shown in fig. 2. The method at least comprises the following steps:
step 501, the device to be synchronized responds to the triggered time synchronization instruction, and establishes communication connection between the device to be synchronized and the target device.
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.
Step 503, the target device, in response to receiving the test data sent by the device to be synchronized based on the communication connection, calculates a first difference between the receiving time of the test data and the first time, and obtains a synchronization parameter. In case the first difference is larger than the first threshold, perform step 504; in the case where the first difference is less than or equal to the first threshold, the flow ends.
Step 504, the target device feeds back the synchronization parameters to the device to be synchronized.
Step 505, in response to receiving the first difference value, the device to be synchronized synchronizes the time of the device to be synchronized with the time of the target device based on the first difference value and the first threshold, and executes step 502; and in response to not receiving the first difference value, completing time synchronization between the device to be synchronized and the target device.
In this embodiment, the target device sends the synchronization parameter when the first difference is greater than the first threshold, that is, whether the determination of performing the time synchronization is not performed in the device to be synchronized, so that the computing resource of the device to be synchronized can be saved.
Alternatively, steps 501, 502 and 505 may be implemented separately as method embodiments on the device side to be synchronized; steps 503 and 504 may be implemented separately as method embodiments on the target device side.
FIG. 6 is a flow chart of a method of time synchronization provided by an embodiment of the present application; the present embodiment is described by taking as an example the first case of the second implementation mode in which the method is used in the time synchronization system shown in fig. 2. The method at least comprises the following steps:
step 601, the device to be synchronized responds to the triggered time synchronization instruction, and establishes communication connection between the device to be synchronized and the target device.
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.
Step 603, the target device, in response to receiving the test data sent by the device to be synchronized based on the communication connection, estimates the generation time of the test data based on the receiving time of the test data to obtain a second time; and calculating a second difference value between the second time and the first time to obtain the synchronization parameter.
Step 604, after the target device generates the synchronization parameter, the target device sends the synchronization parameter to the device to be synchronized.
Step 605, when the second difference value is greater than the second threshold value, 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 value, and step 602 is executed; and when the second difference is smaller than or equal to the second threshold, completing the time synchronization between the device to be synchronized and the target device.
In this embodiment, the synchronization parameter is a second difference between the second time and the first time, and the second time is a generation time of the test data estimated based on the reception time of the test data.
Alternatively, steps 601, 602 and 605 may be implemented separately as method embodiments on the device side to be synchronized; steps 603 and 604 may be implemented separately as method embodiments on the target device side.
FIG. 7 is a flow chart of a method of time synchronization provided by an embodiment of the present application; the present embodiment is described by taking a second case of the second implementation manner in which the method is used in the time synchronization system shown in fig. 2 as an example. The method at least comprises the following steps:
step 701, the device to be synchronized responds to the triggered time synchronization instruction, and establishes communication connection between the device to be synchronized and the target device.
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.
Step 703, the target device, in response to receiving the test data sent by the device to be synchronized based on the communication connection, estimates the generation time of the test data based on the receiving time of the test data, and obtains a second time; and calculating a second difference value between the second time and the first time to obtain the synchronization parameter. In case the second difference is larger than the second threshold, perform step 704; in the case where the second difference is less than or equal to the second threshold, the flow ends.
Step 704, the target device feeds back the synchronization parameters to the device to be synchronized.
Step 705, the device to be synchronized responds to the received second difference value, synchronizes the time of the device to be synchronized to the time of the target device based on the second difference value, and executes step 702; and in response to not receiving the second difference, completing the time synchronization between the device to be synchronized and the target device.
In this embodiment, the target device sends the synchronization parameter when the second difference is greater than the second threshold, that is, whether the determination of performing the time synchronization is not performed in the device to be synchronized may be performed, so as to save the computing resource of the device to be synchronized.
Alternatively, steps 701, 702, and 705 may be implemented separately as method embodiments on the device side to be synchronized; steps 703 and 704 may be implemented separately as method embodiments on the target device side.
FIG. 8 is a flow chart of a method of time synchronization provided by an embodiment of the present application; the present embodiment takes a third implementation manner of the method used in the time synchronization system shown in fig. 2 as an example. The method at least comprises the following steps:
step 801, the device to be synchronized responds to the triggered time synchronization instruction, and establishes communication connection between the device to be synchronized and the target device.
Step 802, the device to be synchronized sends test data to the target device based on the communication connection.
In step 803, the target device generates a synchronization parameter based on the reception time of the test data in response to receiving the test data sent by the device to be synchronized based on the communication connection.
Step 804, after the target device generates the synchronization parameter, the target device sends the synchronization parameter to the device to be synchronized.
Step 805, when the difference between the receiving time and the first time is greater than the third threshold, the device to be synchronized synchronizes the time of the device to be synchronized to the time of the target device based on the transmission delay, the first time and the receiving time between the device to be synchronized and the target device, and step 802 is executed; and when the difference value between the receiving time and the first time is less than or equal to a third threshold value, completing the time synchronization between the device to be synchronized and the target device.
In this embodiment, the synchronization parameter is the receiving time of the test data, which can reduce the calculation amount when the target device generates the synchronization parameter, thereby saving the calculation resource of the target device.
Alternatively, steps 801, 802 and 805 may be implemented separately as method embodiments on the device side to be synchronized; steps 803 and 804 may be implemented separately as method embodiments on the target device side.
Fig. 9 is a block diagram of a time synchronization apparatus provided in an embodiment of the present application, where the apparatus is applied to a device 110 to be synchronized in the time synchronization system shown in fig. 2, and the apparatus includes at least the following modules: an instruction receiving module 910, a data transmitting module 920 and a data receiving module 930.
An instruction receiving module 910, configured to establish a communication connection between a device to be synchronized and a target device in response to a triggered time synchronization instruction;
a data sending module 920, configured to send test data to a target device based on a communication connection; the test data is used for triggering the target equipment to feed back the synchronization parameters to the equipment to be synchronized;
a data receiving module 930, configured to synchronize 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.
Fig. 10 is a block diagram of a time synchronization apparatus provided in an embodiment of the present application, which is applied to the target device 120 in the time synchronization system shown in fig. 2, and the apparatus includes at least the following modules: a connection module 1010, a generation module 1020, and a transmission module 1030.
A connection module 1010, configured to establish a communication connection with a device to be synchronized;
a generating module 1020, configured to generate a synchronization parameter in response to receiving test data sent by a device to be synchronized based on a communication connection;
a sending module 1030, configured to feed back synchronization parameters to a device to be synchronized; the synchronization parameter is used for the device to be synchronized to synchronize the time to the time of the target device.
For relevant details reference is made to the above-described method embodiments.
It should be noted that: in the time synchronization device provided in the above embodiment, only the division of the above functional modules is used for illustration when performing time synchronization, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the time synchronization device is divided into different functional modules to complete all or part of the above described functions. In addition, the time synchronization device and the time synchronization method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 11 is a block diagram of an electronic device provided by an embodiment of the application. The electronic device may be the device to be synchronized 110 in fig. 2 or the target device 120 in fig. 2. The electronic device comprises at least a processor 1101 and a memory 1102.
Processor 1101 may include one or more processing cores such as: 4 core processors, 8 core processors, etc. The processor 1101 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor 1101 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 1102 may include one or more computer-readable storage media, which may be non-transitory. Memory 1102 can also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1102 is used to store at least one instruction for execution by processor 1101 to implement the time synchronization method provided by the method embodiments of the present application.
In some embodiments, the electronic device may further include: a peripheral interface and at least one peripheral. The processor 1101, memory 1102 and peripheral interface may be connected by bus or signal lines. Each peripheral may be connected to the peripheral interface via a bus, signal line, or circuit board. Illustratively, peripheral devices include, but are not limited to: radio frequency circuit, touch display screen, audio circuit, power supply, etc.
Of course, the electronic device may include fewer or more components, which is not limited by the embodiment.
Optionally, the present application further 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-mentioned method embodiment.
Optionally, the present application further 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-mentioned method embodiment.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (16)

1. A time synchronization method for use in a device to be synchronized, the device to be synchronized including a cleaning robot or being a camera working in cooperation with the cleaning robot, the method comprising:
responding to a triggered time synchronization instruction, and establishing communication connection between the equipment to be synchronized and target equipment;
sending test data to the target device based on the communication connection; the test data is used for triggering the target equipment to feed back the synchronization parameters to the equipment to be synchronized;
and synchronizing the time of the equipment to be synchronized into the time of the target equipment based on the synchronization parameters fed back by the target equipment.
2. The method of claim 1, wherein the test data comprises a first time identifier of a first time, the first time identifier identifying the first time when the test data is generated by the device to be synchronized;
the synchronization parameter comprises a first difference between a time of receipt of the test data and the first time; or, the synchronization parameter includes a second difference between a second time and the first time, where the second time is a generation time of the test data estimated by the target device based on the reception time of the test data.
3. The method of claim 2, wherein the 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 comprises:
when the synchronization parameter includes the first difference value, synchronizing the time of the device to be synchronized to the time of the target device based on the first difference value and a first threshold value if the first difference value is greater than the first threshold value;
alternatively, the first and second electrodes may be,
and when the synchronization parameter comprises the second difference value, synchronizing the time of the device to be synchronized to the time of the target device based on the second difference value under the condition that the second difference value is greater than a second threshold value.
4. The method of claim 3, further comprising verifying a time synchronization result of the device to be synchronized according to:
performing the step of sending test data to the target device based on the communication connection;
when the synchronization parameter comprises a first difference value, if the first difference value is smaller than or equal to a first threshold value, the verification is passed;
alternatively, the first and second electrodes may be,
and when the synchronization parameter comprises a second difference value, if the second difference value is smaller than or equal to a second threshold value, the verification is passed.
5. The method of claim 4, further comprising:
and under the condition of passing the verification, synchronizing the time of the equipment to be synchronized into the time of the target equipment based on the synchronization parameters fed back by the target equipment.
6. The method of claim 1, wherein the synchronization parameter comprises a time of receipt of the test data by the target device;
the 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:
and synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay, the first time and the receiving time between the device to be synchronized and the target device, wherein the first time is the time for generating the test data by the device to be synchronized.
7. The method of claim 6, wherein the synchronizing the time of the device to be synchronized to the time of the target device based on the transmission delay, the first time, and the receive time between the device to be synchronized and the target device comprises:
synchronizing the time of the device to be synchronized to the time of the target device based on a transmission delay between the device to be synchronized and the target device, the first time, and the reception time, if a difference between the reception time and the first time is greater than a third threshold.
8. The method of claim 6, wherein the synchronizing the time of the device to be synchronized to be before 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 receive time, further comprises:
acquiring current network transmission environment information;
determining the transmission delay based on the network transmission environment information.
9. The method of claim 8, wherein the network transmission environment information comprises at least one of a transmission distance, a current time period, and a network type; the determining the transmission delay based on the network transmission environment comprises:
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 by using training data, and each set of training data comprises a sample transmission distance, a sample time period, a sample network type and corresponding actual transmission delay.
10. A time synchronization method used in a target apparatus for time-synchronizing an apparatus to be synchronized including a cleaning robot or a camera working in cooperation with the cleaning robot, the method comprising:
establishing communication connection with the equipment to be synchronized;
generating synchronization parameters in response to receiving test data sent by the device to be synchronized based on the communication connection;
feeding back synchronization parameters to the equipment to be synchronized; the synchronization parameter is used for the device to be synchronized to synchronize time to the time of the target device.
11. The method of claim 10, wherein the test data comprises a first time identifier of a first time, the first time identifier identifying the first time when the device to be synchronized generates the test data;
the generating of the synchronization parameter includes:
calculating a first difference value between the receiving time of the test data and the first time to obtain the synchronous parameter;
alternatively, the first and second electrodes may be,
generating time of the test data estimated based on the receiving time of the test data to obtain second time; and calculating a second difference value between the second time and the first time to obtain the synchronization parameter.
12. The method of claim 11, wherein said inferring a time of generation of said test data based on a time of receipt of said test data comprises:
acquiring current network transmission environment information;
determining a transmission delay between the device to be synchronized and the target device based on the network transmission environment information; determining the second time according to the transmission delay and the receiving time.
13. The method of claim 10, wherein generating the synchronization parameter comprises:
generating the synchronization parameter based on a time of receipt of the test data.
14. An electronic device, characterized in that the device comprises a processor and a memory; the memory has stored therein a program that is loaded and executed by the processor to implement the time synchronization method of any one of claims 1 to 9; alternatively, a time synchronization method according to any one of claims 10 to 13 is implemented.
15. A computer-readable storage medium, characterized in that the storage medium has stored therein a program for implementing the time synchronization method according to any one of claims 1 to 9 when executed by a processor; alternatively, a time synchronization method according to any one of claims 10 to 13 is implemented.
16. A time synchronization system, characterized in that the system comprises a device to be synchronized and a target device, wherein the device to be synchronized comprises a cleaning robot and a camera working in cooperation with the cleaning robot;
the device to be synchronized is used for responding to a triggered time synchronization instruction and establishing communication connection between the device to be synchronized and target equipment; sending test data to the target device based on the communication connection; the test data is used for triggering the target equipment to feed back synchronization parameters to the cleaning robot of the equipment to be synchronized;
the target device is used for responding to the received test data sent by the device to be synchronized based on the communication connection and generating synchronization parameters; feeding back synchronization parameters to the equipment to be synchronized; the synchronization parameter is used for the device to be synchronized to synchronize time to the time of the target device;
the device to be synchronized is further configured to synchronize 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.
CN202110969366.XA 2021-08-23 2021-08-23 Time synchronization method, device, storage medium and system Pending CN113676279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110969366.XA CN113676279A (en) 2021-08-23 2021-08-23 Time synchronization method, device, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110969366.XA CN113676279A (en) 2021-08-23 2021-08-23 Time synchronization method, device, storage medium and system

Publications (1)

Publication Number Publication Date
CN113676279A true CN113676279A (en) 2021-11-19

Family

ID=78545335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110969366.XA Pending CN113676279A (en) 2021-08-23 2021-08-23 Time synchronization method, device, storage medium and system

Country Status (1)

Country Link
CN (1) CN113676279A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115191871A (en) * 2022-06-07 2022-10-18 深圳市倍思科技有限公司 Data time synchronization method and device, cleaning robot and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170136626A1 (en) * 2015-11-16 2017-05-18 Abb Technology Ag Facilitating robot positioning
US10399227B1 (en) * 2019-03-29 2019-09-03 Mujin, Inc. Method and control system for verifying and updating camera calibration for robot control
CN112606000A (en) * 2020-12-22 2021-04-06 上海有个机器人有限公司 Method for automatically calibrating robot sensor parameters, calibration room, equipment and computer medium
CN112672415A (en) * 2020-12-25 2021-04-16 之江实验室 Multi-sensor time synchronization method, device, system, electronic device and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170136626A1 (en) * 2015-11-16 2017-05-18 Abb Technology Ag Facilitating robot positioning
US10399227B1 (en) * 2019-03-29 2019-09-03 Mujin, Inc. Method and control system for verifying and updating camera calibration for robot control
CN112606000A (en) * 2020-12-22 2021-04-06 上海有个机器人有限公司 Method for automatically calibrating robot sensor parameters, calibration room, equipment and computer medium
CN112672415A (en) * 2020-12-25 2021-04-16 之江实验室 Multi-sensor time synchronization method, device, system, electronic device and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115191871A (en) * 2022-06-07 2022-10-18 深圳市倍思科技有限公司 Data time synchronization method and device, cleaning robot and storage medium
CN115191871B (en) * 2022-06-07 2024-05-28 深圳市倍思科技有限公司 Method and device for data time synchronization, cleaning robot and storage medium

Similar Documents

Publication Publication Date Title
US10943091B2 (en) Facial feature point tracking method, apparatus, storage medium, and device
CN110209639B (en) Information processing method, device and system
CN113382439A (en) Information reporting method, access mode determining method, terminal and network equipment
CN104360816A (en) Screen capture method and system
CN109672978A (en) A kind of hotspot scan frequency control method and device
EP3913961B1 (en) Radio operation management system and radio operation assistant method
US20180067218A1 (en) Observation system and observation method
CN111813699B (en) Data routing test method and device based on intelligent electric meter and computer equipment
CN113676279A (en) Time synchronization method, device, storage medium and system
CN115902882A (en) Collected data processing method and device, storage medium and electronic equipment
CN111340286B (en) Robot scheduling method, robot scheduling device, electronic device and storage medium
CN115830709A (en) Action recognition method based on federal edge learning, server and electronic equipment
Jia et al. Online V2X scheduling for raw-level cooperative perception
CN108271018B (en) Space camera electronics emulation test system
Ruíz-Guirola et al. Performance analysis of ML-based MTC traffic pattern predictors
CN116800638A (en) Network detection method, device, electronic equipment and storage medium
CN116594028B (en) Verification method and device for alignment parameters, storage medium and electronic equipment
CN102195805B (en) Communication apparatus and communication method
CN105528315A (en) Hard disk IO timeout control method and apparatus
SanMiguel et al. Networked computer vision: the importance of a holistic simulator
CN113473118A (en) Data timestamp alignment method, device, equipment and storage medium
JP2023551939A (en) Simulation test methods, equipment and systems
EP2961031B1 (en) Frequency control method and frequency control system
US20150195214A1 (en) Verification method, verification device, and recording medium
WO2023061458A1 (en) Positioning method, terminal, and network side device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination