CN117997918A - Method, device, equipment and storage medium for correcting instruction execution time - Google Patents

Method, device, equipment and storage medium for correcting instruction execution time Download PDF

Info

Publication number
CN117997918A
CN117997918A CN202211376886.0A CN202211376886A CN117997918A CN 117997918 A CN117997918 A CN 117997918A CN 202211376886 A CN202211376886 A CN 202211376886A CN 117997918 A CN117997918 A CN 117997918A
Authority
CN
China
Prior art keywords
time
internet
control center
instruction
execution
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
CN202211376886.0A
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.)
China Mobile Communications Group Co Ltd
China Mobile Chengdu ICT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Chengdu ICT 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 China Mobile Communications Group Co Ltd, China Mobile Chengdu ICT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202211376886.0A priority Critical patent/CN117997918A/en
Publication of CN117997918A publication Critical patent/CN117997918A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application discloses a method, a device, equipment and a storage medium for correcting instruction execution time, wherein the method is applied to a control center and comprises the following steps: receiving a first timing execution instruction from a service system, wherein the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment; acquiring a time difference between the system time of the Internet of things equipment and the system time of the control center; correcting the execution time according to the time difference; and sending a second timing execution instruction to the Internet of things equipment, wherein the second timing execution instruction is used for indicating the Internet of things equipment to execute the first task at the corrected execution moment. According to the method, under the condition that the system time of the Internet of things equipment is not modified, the fact that the moment when the Internet of things equipment executes the instruction is consistent with the expected moment of the control center is ensured, and therefore interference to other programs running on the Internet of things equipment is avoided.

Description

Method, device, equipment and storage medium for correcting instruction execution time
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for correcting an instruction execution time.
Background
When the cloud control center issues a timing execution instruction to the internet of things equipment, the system time of the internet of things equipment and the system time of the cloud platform are required to be ensured to be consistent, so that the moment of the execution instruction of the internet of things equipment is ensured to be consistent with the expected moment of the cloud platform. If the system time of the internet of things device is different from the cloud platform time, the system time of the internet of things device needs to be corrected, namely, the time synchronization is performed on the internet of things device. However, this time-synchronized behavior may cause the system time of the internet of things device to jump, thereby causing interference to other programs running on the internet of things device.
Therefore, when the system time of the internet of things device is inconsistent with the system time of the cloud platform, how to ensure that the moment when the internet of things device executes the instruction is consistent with the moment expected by the cloud platform without modifying the system time of the internet of things device is a problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present application at least provide a method, apparatus, device and storage medium for correcting instruction execution time.
The technical scheme of the application is realized as follows:
In a first aspect, an embodiment of the present application provides a method for correcting an instruction execution time, where the method is applied to a control center, and the method includes: receiving a first timing execution instruction from a service system, wherein the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment; acquiring a time difference between the system time of the Internet of things equipment and the system time of the control center; correcting the execution time according to the time difference; and sending a second timing execution instruction to the Internet of things equipment, wherein the second timing execution instruction is used for indicating the Internet of things equipment to execute the first task at the corrected execution moment.
In a second aspect, an embodiment of the present application provides an apparatus for correcting an instruction execution time, where the apparatus includes: the receiving module is used for receiving a first timing execution instruction from the service system, wherein the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment; the acquisition module is used for acquiring the time difference between the system time of the Internet of things equipment and the system time of the device; the processing module is used for correcting the execution time according to the time difference; the sending module is used for sending a second timing execution instruction to the internet of things equipment, and the second timing execution instruction is used for indicating the internet of things equipment to execute the first task at the corrected execution moment.
In a third aspect, embodiments of the present application provide a computer device comprising a memory and a processor; wherein the memory is used for storing computer executable instructions; a processor, coupled to the memory, for implementing the method according to the first aspect by executing the computer-executable instructions.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by at least one processor, implements a method as described in the first aspect.
The embodiment of the application provides a method, a device, equipment and a computer readable storage medium for correcting instruction execution time, wherein the control center side receives a first timing execution instruction from a service system, and the first timing execution instruction is used for indicating an Internet of things equipment to execute a first task at the execution time; acquiring a time difference between the system time of the Internet of things equipment and the system time of the control center; correcting the execution time according to the time difference; and sending a second timing execution instruction to the Internet of things equipment, wherein the second timing execution instruction is used for indicating the Internet of things equipment to execute the first task at the corrected execution moment. According to the method, under the condition that the system time of the Internet of things equipment is not modified, the fact that the moment when the Internet of things equipment executes the instruction is consistent with the expected moment of the control center is ensured, so that the jump of the system time of the Internet of things equipment is avoided, and interference to other programs operated by the Internet of things equipment is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the aspects of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart of a method for correcting an instruction execution time according to an embodiment of the disclosure;
FIG. 2 is a schematic diagram of a system architecture suitable for use with embodiments of the present disclosure;
FIG. 3 is a schematic diagram of an implementation flow of a method for correcting instruction execution time according to an embodiment of the disclosure;
fig. 4 is a schematic diagram of a composition structure of an apparatus for correcting an instruction execution time according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a hardware entity of a computer device in an embodiment of the disclosure.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the embodiments of the application is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict. It should also be noted that the term "first\second\third" in relation to embodiments of the present application is used merely to distinguish similar objects and does not represent a particular ordering for the objects, it being understood that the "first\second\third" may be interchanged in a particular order or sequence, where allowed, to enable embodiments of the present application described herein to be practiced in an order other than that illustrated or described herein.
When the cloud (such as a control center) issues a timing execution instruction to the internet of things device (such as an unmanned aerial vehicle), the system time of the internet of things device and the system time of the cloud platform are required to be ensured to be consistent, so that the moment of executing the instruction by the internet of things device is ensured to be consistent with the expected moment of the cloud platform. If the system time of the internet of things device is different from the cloud platform time, the system time of the internet of things device needs to be corrected, namely, the time synchronization is performed on the internet of things device. However, this time-synchronized behavior may cause the system time of the internet of things device to jump, thereby causing interference to other programs running on the internet of things device. In addition, the system time check and time synchronization are carried out on the Internet of things equipment before the instruction is issued, so that excessive preparation work before the instruction is issued can be caused, and the instruction issuing speed is influenced.
To this end, the disclosed embodiments provide a method, apparatus, and computer-readable storage medium for correcting instruction execution time, the method being executable by a processor of a computer device. The computer device may be a server, a notebook computer, a tablet computer, a desktop computer, or a device with data processing capability. The embodiments of the present disclosure are exemplarily described as being executed by a control center in the method. In the method, the control center can acquire the time difference between the system time of the Internet of things equipment and the system time of the control center, and correct the execution time of the first task executed by the Internet of things equipment according to the time difference, so that the time of the first task executed by the Internet of things equipment is ensured to be consistent with the expected time of the control center under the condition that the system time of the Internet of things equipment is not modified. Because the method does not need to modify the system time of the Internet of things equipment, the jump of the system time of the Internet of things equipment is avoided, and further, the interference to other programs running on the Internet of things equipment is avoided.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a method for correcting an instruction execution time according to an embodiment of the present disclosure, which may be applied to a control center, and the method may include:
S101, receiving a first timing execution instruction from a service system, wherein the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment.
Illustratively, the first timing execution instruction may include two types of instructions: immediately issuing a timing execution instruction and timing issuing a timing execution instruction. In a possible case, the first timing execution instruction is an immediate issue timing execution instruction, and at this time, the control center can immediately send the first timing execution instruction to the internet of things device after receiving the first timing execution instruction; in another possible case, the first timing execution instruction is a timing issue timing execution instruction, and at this time, after receiving the first timing execution instruction, the control center may send the first timing execution instruction to the internet of things device at a sending time specified by the instruction. The execution time may be carried in a first timing execution instruction. The execution time may also be understood as a time when the desired internet of things device executes the first task with reference to a system time of the control center.
It should be understood that in the embodiments of the present disclosure, the control center may be disposed on the same server as the service system, or may be disposed on a different server. In some embodiments, the business system may also include two or more business systems, e.g., business system a and business system B may be included. When the service system includes two or more service systems, the control center may be disposed on the same server as one of the service systems, or may be disposed on an independent server alone, which is not limited.
S102, acquiring a time difference between the system time of the Internet of things equipment and the system time of the control center.
For example, the internet of things device may read a time difference between a system time of the internet of things device and a system time of the control center from a storage module, wherein the storage module may comprise a database and/or a memory of the control center.
For example, the time difference may be cached in the control center (e.g., cached in a memory of the control center) in advance, so that when the control center needs to acquire the time difference, the control center may quickly read the cached time difference, thereby improving the efficiency of the control center to acquire the time difference. As another example, the time difference may also be pre-stored in a database, for example, so that the control center can read the time difference from the database.
As an implementation, before acquiring the time difference between the system time of the internet of things device and the system time of the control center, the method may further include the steps of:
step 1021: and sending a time reading instruction to the Internet of things equipment at the first moment.
The time reading instruction can be used for reading the system time of the Internet of things equipment. As an implementation manner, the time reading instruction may carry the system time when the control center sends the time reading instruction, that is, the first moment.
Step 1022: and receiving time data from the Internet of things equipment, wherein the time data comprises data of a first moment and data of a second moment, and the second moment is the moment when the Internet of things equipment receives a time reading instruction.
After receiving the time reading instruction from the control center, the internet of things device can record the current system time of the internet of things device, namely the second time, and immediately generate a piece of time data, wherein the time data can carry the data of the first time and the data of the second time. And then, the internet of things equipment can send the time data to a control center. For example, the internet of things device may send the time data to the control center through the internet of things device-oriented communication message server (e.g., mqtt a), that is, the internet of things device may send the time data to mqtt a first, and then forward the time data to the control center by mqtt a.
Step 1023: and determining the time difference between the system time of the Internet of things equipment and the system time of the control center according to the first time, the second time and the third time, wherein the third time is the time when the control center receives the time data.
After receiving the time data from the internet of things device, the control center can read the first time and the second time from the time data, and meanwhile, the control center can record the time when the time data is received, namely the third time. Further, the control center may determine a time difference between the system time of the internet of things device and the system time of the control center according to the first time, the second time, and the third time.
In the embodiment of the present disclosure, a time difference between a system time of the internet of things device and a system time of the control center may be defined as: at the same time, the system time of the Internet of things equipment is subtracted by the difference value obtained by the system time of the control center; or the difference value obtained by subtracting the system time of the internet of things equipment from the system time of the control center at the same moment can be defined; or the absolute value of the difference value obtained by subtracting the system time of the control center from the system time of the internet of things equipment at the same moment can be defined. For ease of understanding, one possible implementation of determining the time difference in the embodiments of the present disclosure is described below by taking the time difference defined as a difference obtained by subtracting the system time of the control center from the system time of the internet of things device at the same time.
For example, assuming that the downstream (control center to internet of things device) data transmission delay and the upstream (internet of things device to control center) data transmission delay are equal, the internet of things device may determine the time difference by the following formula:
Δt=t2-(t1+(t3-t1)/2)。
Wherein Δt represents a time difference between a system time of the internet of things device and a system time of the control center, t1 represents a first time, t2 represents a second time, and t3 represents a third time. It will be appreciated that t3-t1 may represent the round trip delay of data transmission between the control center and the internet of things device, i.e., the delay experienced in total during the time from the time the control center sends data to the time the control center receives a response from the internet of things device (the internet of things device sends a response immediately after receiving the data). This round trip delay t3-t1 can theoretically be considered as the maximum error of Δt, or alternatively, the accuracy of Δt is t3-t1.
In one possible manner, the control center may continuously execute the above method for determining time differences multiple times, so as to obtain multiple time differences, for example, the time differences are respectively denoted as time difference #1, time differences #2, … …, and time differences #n, N are positive integers, and then, in the process of determining the time differences, the control center may adopt one time difference corresponding to the smallest t3-t1 as the finally determined time difference. For example, the control center obtains 3 time differences, namely, time difference #1, time difference #2 and time difference #3, by continuously performing the above method for determining the time difference a plurality of times, wherein the value of t3-t1 is 35ms during the time difference #1 determination, the value of t3-t1 is 30ms during the time difference #2 determination, and the value of t3-t1 is 40ms during the time difference #3 determination, and then the control center may adopt the time difference #2 as the finally determined time difference. Since the smaller the value of t3-t1, the higher the accuracy of Δt, the time difference with higher accuracy can be obtained by the above-described method of determining the time difference a plurality of times in succession.
In some embodiments, the method further comprises step 1024: and saving the time difference delta t to a storage module. The storage module may include, for example, a database and/or a memory of the control center. In one possible scenario, the storage module includes a database so that Δt can be centrally and persistently stored to facilitate retrospective lookup of problems via historical traces. In another possible case, the storage module includes a memory of the control center, so that when the control center needs to acquire Δt, the Δt can be quickly read from the memory of the control center, thereby being beneficial to improving the efficiency of the control center in acquiring Δt. In yet another possible scenario, the storage module may also include both a database and a memory of the control center.
In some embodiments, when Δt exceeds a certain threshold, the control center may incorporate the internet of things device into the clock error warning list and provide page display, for example, the number of the internet of things device, the value of Δt, and information such as a timestamp when determining Δt may be displayed in the form of a report, so that a device maintainer may detect and maintain the internet of things device according to the content of page display. In a specific example, when Δt exceeds 1s, the control center may incorporate the internet of things device into the clock error warning list.
S103, correcting the execution time according to the time difference between the system time of the Internet of things equipment and the system time of the control center.
For example, if the time difference Δt is defined as a difference obtained by subtracting the system time of the control center from the system time of the internet of things device at the same time, the method for correcting the execution time according to Δt may be: and taking the result of adding the execution time carried in the first timing execution instruction and deltat as the corrected execution time.
For example, assuming that the execution time carried in the first timing execution instruction is TimeX and the corrected execution time is TimeY, timeY may be represented as TimeY = TimeX +Δt. Therefore, when the control center performs instruction communication with the Internet of things equipment, time synchronization of the Internet of things equipment is not needed, namely, the system time of the Internet of things equipment is not needed to be modified, the fact that the moment when the Internet of things equipment executes the first task is consistent with the expected moment of the control center is ensured, and therefore the jump of the system time of the Internet of things equipment is avoided, and further interference to other programs running on the Internet of things equipment is avoided.
In one implementation, after a first time interval that determines a time difference between a system time of the internet of things device and a system time of the control center, the method further comprises: determining the time difference between the system time of the Internet of things equipment and the system time of the control center again; and correcting the execution time according to the redetermined time difference under the condition that the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is larger than or equal to a first threshold value and the Internet of things equipment does not execute the first task. It should be understood that the latest stored time difference in the memory module may also be understood as the latest stored time difference in the memory module. In a possible case, if the storage module includes both the database and the memory of the control center, the latest stored time difference in the storage module may be understood as the latest stored time difference among all the time differences stored in the database and the memory. In a specific example, the first time interval may be 2 minutes, for example.
The manner of determining the time difference may refer to the related description in S102, which is not described herein.
It should be understood that in the embodiment of the present disclosure, the first threshold may be a numerical value, or may be a numerical range, which is not limited.
It should also be appreciated that the first threshold may be a pre-configured constant value or a dynamically configured value. The first threshold value may be stored in the control center in advance, or may be transmitted to the control center by another device, for example, and the present application is not limited thereto. In a specific example, the first threshold value is 50ms.
In this implementation manner, if the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is greater than or equal to the first threshold, and the internet of things device has not performed the first task (the execution time has not expired), the control center may correct the execution time carried in the first timing execution instruction according to the redetermined time difference.
According to the method of the embodiment, when the change of the time difference between the system time of the internet of things device and the system time of the control center is too large, the time change time is considered to be triggered, or time jump occurs, at this time, the execution time of the first task executed by the internet of things device can be corrected again according to the newly obtained time difference, so as to further ensure the accuracy of the execution time.
In some embodiments, in the event that the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is greater than or equal to the second threshold, the method further comprises: and saving the redetermined time difference and the identification of the Internet of things equipment to a storage module (for example, a memory comprising a database and/or a control center). Further, the control center may also save to the storage module an absolute value of a difference between the redetermined time difference and a newly stored time difference in the storage module. The second threshold may be a preset constant value or a dynamically configured value. The second threshold value may be stored in the control center in advance, or may be transmitted to the control center by another device, for example, and the present application is not limited thereto. For example, the second threshold may be a difference between the third time and the first time; for yet another example, the second threshold value may also be equal to the first threshold value, for example.
According to the method of the embodiment, when the change of the time difference between the system time of the internet of things device and the system time of the control center exceeds a certain range, the control center can backup the redetermined time difference and the identifier of the internet of things device to the storage module, and further, the control center can store the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module (namely, the change of the time difference) to the storage module, for example, can store the absolute value into a database, so that equipment maintenance personnel can trace back and find problems through historical marks.
S104, sending a second timing execution instruction to the Internet of things equipment, wherein the second timing execution instruction is used for indicating the Internet of things equipment to execute the first task at the corrected execution moment.
The second timing execution instruction may carry the corrected execution time, so that the internet of things device may execute the first task at the corrected execution time after receiving the second timing execution instruction.
For example, the control center may send the second timing execution instruction to the internet of things device through the internet of things device-oriented communication message server (mqtt) 1, that is, the control center may send the second timing execution instruction to mqtt first, and then forward the second timing execution instruction to the internet of things device by mqtt.
In some embodiments, the method further comprises: and saving the second timing execution instruction to a database. Therefore, the command issued to the Internet of things equipment by the control center can be stored in a centralized and persistent mode, so that the problem can be traced and found through the history trace.
In some embodiments, the method further comprises S105.
S105, correcting the sending moment of the first report data sent by the Internet of things equipment according to the time difference between the system time of the Internet of things equipment and the system time of the control center.
In one possible way, S105 may be implemented by:
step 1051: and receiving first reporting data from the Internet of things equipment, wherein the first reporting data comprises a fourth moment, and the fourth moment is the moment when the Internet of things equipment sends the first reporting data.
The fourth time may be further understood as the current system time of the internet of things device when the internet of things device sends the first report data. As an implementation manner, the internet of things device may send the first report data to the control center through mqtt a 1. Accordingly, the control center may receive the first report data through mqtt a 1.
Step 1052: the fourth time is corrected based on the time difference Δt.
For example, if the time difference Δt is defined as a difference obtained by subtracting the system time of the control center from the system time of the internet of things device at the same time, the method for correcting the fourth time according to Δt may be: the fourth time is corrected to a fifth time, wherein the fifth time is the difference between the fourth time and Δt. For example, assuming that the fourth time is denoted as TimeS and the corrected fourth time (i.e., fifth time) is denoted as TimeM, timeM may be denoted as TimeM =TimeS- Δt.
Step 1053: and sending second reporting data to the service system, wherein the second reporting data comprises a fourth time after correction.
As an implementation manner, the control center may send the second report data to the service system through an internal system-oriented communication message server (for example, mqtt a 2), that is, the control center may send the second report data to mqtt a2, and then forward the second report data to the service system by mqtt a for use by the service system.
In some embodiments, the method further comprises: calculating a difference value between a fifth moment and a sixth moment, wherein the sixth moment is the moment when the control center receives the first report data; in the case where the absolute value of the difference between the fifth time and the sixth time is greater than or equal to the third threshold value, the time difference Δt is redetermined.
The sixth time may also be understood as the current system time of the control center when the control center receives the first report data. The third threshold may be a preset constant value or a dynamically configured value. The third threshold value may be stored in the control center in advance, or may be transmitted to the control center by another device, for example, and the present application is not limited thereto. For example, the third threshold may be, for example, a sum of a round trip delay (t 3-t 1) of the data transmission and a preset duration, and the third threshold may be, for example, t3-t1+50ms.
According to the method of the present embodiment, if the absolute value of the difference between the fifth time and the sixth time is greater than or equal to the third threshold, the time change time is considered to be triggered, or the time jump occurs, and at this time, the control center may redetermine the time difference Δt to ensure that the time difference can be updated in time.
In practical applications, for the timing execution instruction, there is a data transmission delay, so that the receiving end of the instruction may not receive the instruction at the expected time, and in this regard, when the first timing execution instruction is the timing execution instruction (i.e., when the second timing execution instruction is the timing execution instruction), the method may further include S106.
S106, the transmission time (instruction transmission time) at which the second timing execution instruction is transmitted is corrected.
The second timing execution instruction may include an indication sending time, where the indication sending time may be used to instruct the control center to send the second timing execution instruction to the internet of things device at the indication sending time. The form of the instruction indicating the transmission time in the second timing execution instruction may be, for example, in the form of time stamp data.
In order to enable the internet of things device to more accurately receive the second timing execution instruction, the control center needs to send the second timing execution instruction in advance of the indication sending time, or the control center needs to correct the indication sending time. For example, the control center may correct the instruction transmission time to the seventh time, so that the control center may transmit the second timing execution instruction at the seventh time. The seventh time is the difference between the indication sending time and the data transmission time delay, and the data transmission time delay is equal to one half of the difference between the third time and the first time, that is, the data transmission time delay is equal to (t 3-t 1)/2. For example, assuming that the indicated transmission time is denoted as t4 and the seventh time is denoted as t5, t5=t4- (t 3-t 1)/2.
According to the method of the embodiment, when the control center sends the second timing execution instruction, the sending time of the second timing execution instruction can be corrected according to the data transmission delay. According to the method, the influence of the data transmission delay on the instruction transmission is considered, so that the accuracy of the control center for sending the second timing execution instruction is improved. In addition, in this embodiment, the control center has the capability of issuing the instruction at regular time, so that the service system can close the system after completing the instruction issuing, thereby being beneficial to saving energy consumption. For example, the business system expects the internet of things device to be at 18:00 receives an instruction, then the business system may at 18: the 00 forward control center sends a sending time of 18: and (3) issuing an instruction at a timing of 00, and then enabling the service system to be powered off for saving energy.
In some embodiments, the control center may also receive immediate execution instructions from the business system. The immediate execution instruction may include two types: immediately issuing an immediate execution instruction and timing the immediate execution instruction. In a possible case, the immediate execution instruction is an immediate execution instruction issued immediately, and after receiving the immediate execution instruction, the control center can immediately send the immediate execution instruction to the internet of things equipment, and the internet of things equipment needs to immediately execute a task indicated by the instruction after receiving the immediate execution instruction; in another possible case, when the immediate execution instruction is a timing execution instruction, after receiving the immediate execution instruction, the control center may send the immediate execution instruction to the internet of things device at a sending time specified by the instruction, and the internet of things device needs to immediately execute a task indicated by the instruction after receiving the immediate execution instruction.
In some implementations, for a particular type of instruction, the control center may support instruction type conversion. For example, in the case where the control center supports instruction type conversion, the control center may convert the timing issue immediate execution instruction into an immediate issue timing execution instruction. For example, the control center may send a time of 7:00, converting into a timing execution instruction which needs to be issued immediately and the execution time is 7:00, so as to ensure that the internet of things equipment can execute corresponding tasks at expected time.
According to the method of the embodiment, the control center can automatically correct the execution time of the timing execution instruction and rapidly issue the instruction under the condition that the system time of the Internet of things equipment is not invasively modified, so that the timing execution instruction can be ensured to be correctly executed according to the expected execution time. Meanwhile, the control center also supports the capability of issuing instructions at regular time and tracking the issued instructions, so that the practicability of the method is further enhanced.
A method for correcting an instruction execution time according to an embodiment of the present disclosure is described above with reference to fig. 1. To facilitate understanding of the embodiments of the present application, a specific scenario is taken as an example, and one possible implementation flow of the method for correcting the execution time of an instruction provided in the embodiments of the present disclosure is described below with reference to fig. 2 and 3.
Fig. 2 illustrates a system architecture suitable for use with embodiments of the present disclosure. The system architecture may include a control center (such as control center 200 in fig. 2), where control center 200 may time-correct the execution time of an issued instruction (such as a timed execution instruction), and control center 200 may be, for example, a set of software systems developed by java. The system architecture may further include at least one service system (such as service system 201 and service system 202 in fig. 2), and when the service system needs to issue a command to the internet of things device, a control center interface may be invoked, and communication may be performed between the service systems through, for example, a hypertext transfer protocol (Hyper Text Transfer Protocol, http) interface call. The system architecture may also include at least one internet of things device (e.g., drone 203 and drone 204 in fig. 2) and a database (e.g., database 205 in fig. 2). The control center 200 may be disposed on the same server as the system 201 or the system 202, or may be disposed on a separate server alone, which is not limited by the present application. The database 205 may be disposed on the same server as the control center 200, or may be disposed on the same server as other devices, or may be disposed on a separate server alone, which is not limited by the present application. In some embodiments, the system architecture further includes an internet of things device oriented communication message server (e.g., mqtt a 206 in fig. 2) and an internal system oriented communication message server (e.g., mqtt a 207 in fig. 2), wherein mqtt a1 can be used for data forwarding between the control center and the internet of things device and mqtt a2 can be used for data forwarding between the control center and the business system.
In the disclosed embodiment, the main responsibilities of control center 200 include: performing heartbeat communication with an internet of things device (such as an unmanned plane 203; such as an unmanned plane 204); sending an execution instruction to the Internet of things equipment; sending a time reading instruction to the Internet of things equipment to acquire the system time of the Internet of things equipment; and calculating and recording the time difference between the system time of each Internet of things device and the system time of the control center. The execution instructions sent to the internet of things equipment by the control center can be divided into four types: class a instructions, immediate issue immediate execution instructions; class B instructions, immediately issuing timing execution instructions; class C instructions, issuing immediate execution instructions at regular time; class D instructions, timing issue timing execution instructions. The control center is responsible for correcting the execution time of the timing execution instruction (B-class and D-class instructions) sent to the Internet of things equipment. Meanwhile, the control center can provide the capability of issuing instructions at fixed time for the service system, and issues instructions to the Internet of things equipment when the designated time is reached, so that the instruction management of the service system is simplified. The control center can also provide a clock error report of the internet of things equipment, and the clock error report can record the time difference between the system time of the control center and the system time of the internet of things equipment, and can record the time difference with overlarge variation and the specific numerical value of the variation of the time difference, so that equipment maintenance personnel can trace and search the problem through history marks.
The control center can also store the time difference between the system time of each Internet of things device and the system time of the control center in a lasting mode through the database, can record in an hour under the condition that time jump is not generated, and can record immediately when the time difference is detected to jump. The control center can also maintain record backup of the instruction to be executed, and tracking of the instruction to be executed of the Internet of things equipment is achieved. When time jump occurs to a certain internet of things device, the control center can correct execution time of the timing execution instruction which is not executed yet, and the timing execution instruction can be issued again after correction, so that automatic restoration of the timing execution instruction is realized.
For ease of understanding, symbols or terms related to the present embodiment are described below.
T1: the control center sends the time (time stamp) of the time reading instruction to the internet of things device.
T2: the moment (timestamp) at which the internet of things device receives the time reading instruction.
T3: the control center monitors (receives) the time (time stamp) of the time data.
T4: and the sending time (time stamp) carried by the timing execution instruction is used for indicating the control center to send the timing execution instruction to the Internet of things equipment at the sending time.
T5: and t4 after correction.
Δt: time difference between the system time of the internet of things device and the system time of the control center.
TimeX: the execution time (time stamp) carried in the timing execution instruction is the control center system time.
TimeY: and the corrected TimeX is the execution time actually carried in the timing execution instruction received by the internet of things equipment.
TimeS: the time (timestamp) of the reported data sent by the internet of things device, that is, the current system time of the internet of things device when the reported data is sent by the internet of things device.
TimeM: and (5) the control center corrects the time.
TimeNow: the control center monitors (receives) the time (time stamp) at which the data was reported.
Mqtt1: and the communication message server is oriented to the Internet of things equipment.
Mqtt2: an internal system oriented communication message server.
A downlink instruction: and the control center sends an execution instruction to the Internet of things equipment.
Uplink data packet: and the Internet of things equipment sends the reported data to the control center.
Class a instructions: immediately issuing an immediate execution instruction.
Class B instruction: immediately issuing a timing execution instruction.
Class C instructions: the immediate execution instruction is issued at a timing.
Class D instruction: and timing execution instructions are issued at fixed time.
As shown in fig. 3, an implementation flow of the method for correcting an instruction execution time according to an embodiment of the disclosure may include:
S301, the control center 200 receives an execution instruction from a service system (such as the service system 201; such as the service system 202). This step may correspond to S101 in the foregoing embodiment.
Wherein the execution instructions may include one or more of class a instructions, class B instructions, class C instructions, class D instructions.
S302, the control center 200 obtains a time difference Deltat between the system time of the Internet of things device (e.g. the unmanned aerial vehicle 203; e.g. the unmanned aerial vehicle 204) and the system time of the control center. This step may correspond to S102 in the foregoing embodiment.
Wherein Δt can be defined, for example, as: at the same time, the system time of the Internet of things equipment is the system time of the control center. The Δt determination method is as follows: the control center 200 sends a time reading instruction to the internet of things device, where the time reading instruction may carry the current timestamp t1 of the control center 200. After receiving the time reading instruction, the internet of things equipment records the current time stamp t2 of the internet of things equipment, and immediately generates a piece of time data, wherein the time data can carry the time stamps t1 and t2. This time data may be reported to the message service center mqtt1 so that the control center may record the time stamp t3 after hearing the time data from mqtt 1. At this time, the transmission time difference (round trip delay of data transmission between the control center and the internet of things device), that is, the time period that the command is sent to the receiving response, may be recorded as t3-t1. Assuming that the transmission delay of the downlink (from the control center 200 to the internet of things device) is equal to the transmission delay of the uplink (from the internet of things device to the control center 200), the downlink transmission time is (t 3-t 1)/2.
The reasoning can be as follows: and taking the time of the control center as a reference, wherein the time when the time reading instruction reaches the Internet of things equipment is t1+ (t 3-t 1)/2.
The time data can be used for knowing that the timestamp of the time reading instruction received by the internet of things equipment is t2, and then according to the definition of Δt=the system time of the internet of things equipment and the system time of the control center, Δt=t2- (t1+ (t 3-t 1)/2). Further, it is possible to obtain: the time difference between the system time of each internet of things device and the system time of the control center 200 is t2- (t1+ (t 3-t 1)/2). Wherein the maximum error of Deltat is t3-t1, namely the precision is t3-t1.
In some embodiments, the control center 200 may continuously perform the time difference calculation multiple times on the currently online internet of things device according to the above-described method of calculating the time difference. For each of the devices of the internet of things, a plurality of Time differences, for example, time1, time2, …, timeN, are obtained, and the Time difference with the smallest searching precision t3-t1 is adopted as the finally determined Time difference deltat. Then, the control center 200 may establish a relationship between the time difference Δt and the serial number of the internet of things device corresponding to the time difference Δt, cache the time difference Δt into the memory, and store the time difference Δt into the database at the same time, so as to perform centralized persistent storage on the Δt, so as to trace back and find the problem through the history trace. Furthermore, when the control center 200 needs to acquire the time difference Δt, the required time difference can be quickly acquired by reading the buffered Δt.
In some embodiments, when Δt exceeds a certain threshold, the control center 200 may incorporate the internet of things device into the clock error warning list and provide page display, for example, the number of the internet of things device, the value of Δt, the timestamp when determining Δt, and other information may be displayed in the form of a report, so that a device maintainer may detect and maintain the internet of things device according to the content of page display. In a specific example, when Δt exceeds 1s, the control center may incorporate the internet of things device into the clock error warning list.
In some embodiments, when the execution instruction is a timed execution instruction (class B instruction or class D instruction), the implementation flow further includes S303 and S304.
S303, the control center 200 corrects the execution time carried in the execution instruction. This step may correspond to S103 in the foregoing embodiment.
In the embodiment of the disclosure, the service system may issue an execution instruction to the internet of things device through the control center interface, and after the control center obtains the execution instruction, the control center may quickly obtain the time difference Δt of the target internet of things device from the cache, and change the execution time of the execution instruction to be corrected to an execution time based on the system time of the internet of things device. The correction algorithm is as follows: if the execution time (based on the control center system time) originally carried in the execution instruction is TimeX and the corrected execution time (based on the internet of things device system time) is TimeY, timeY = TimeX +Δt. The following was demonstrated:
Because: time difference Δt=system time of the internet of things device-system time of the control center between the system time of the internet of things device and the system time of the control center, so: Δt= TimeY-TimeX, so that it is possible to obtain: timeY = TimeX + Δt.
Therefore, when the control center and the Internet of things equipment carry out instruction communication, if a timing task needs to be executed, time synchronization is not needed, and the execution time carried in the execution instruction is only needed to be corrected according to the time difference and then issued.
In some embodiments, the implementation flow further includes: the time difference Δt is updated (redetermined) periodically at regular intervals, and the redetermined Δt is updated to the cache. In a specific example, the time interval may be, for example, 2 minutes. If the absolute value of the difference between the updated Δt and the Δt in the previous buffer is greater than or equal to the current maximum error t3-t1, immediately saving an updated Δt to the database. The save key may be, for example: (Internet of things device number + ": Δt"). According to the method of the present embodiment, the control center 200 can ensure timely update of the time difference Δt by periodically re-determining the time difference.
In some embodiments, the control center 200 may analyze the detected change in Δt to see if time jump behavior has occurred during operation of the device. As one example, when the control center 200 detects that the absolute value of the difference between the post-update time difference and the pre-update time difference is greater than or equal to the first threshold, then a time-skip behavior may occur for the task. In a specific example, the value of the first threshold may be, for example, 50ms.
In some embodiments, the control center 200 may sort the detected time differences Δt, and may further alert the internet of things devices that have errors exceeding t3-t 1. Further, the control center 200 may further provide a clock error report of the internet of things device, where the clock error report may record, for example, a time difference Δt, a serial number of the internet of things device corresponding to the Δt, further, may record Δt with an excessive variation, and a specific value of the variation of Δt, so as to facilitate a device maintainer to trace back and find a problem through a history trace.
In some embodiments, when the control center 200 detects that time jump behavior has occurred, execution time correction of the instruction to be executed may be triggered, which process does not require involvement of the business system. For example, when the time jump occurs, if the internet of things device has not yet performed the task indicated by the execution instruction (the execution time has not yet expired), the control center may correct the execution time carried in the execution instruction according to the updated time difference.
In a possible case, the control center 200 does not issue the execution instruction to the internet of things device yet, in this case, the control center 200 may correct the execution time according to the updated time difference and issue the corrected execution time to the internet of things device; in another possible case, the control center 200 has issued the execution instruction to the internet of things device, in this case, the control center 200 may issue an execution instruction again, where the execution instruction may carry a corresponding task ID and an updated execution time, or in this case, the control center 200 may send a timed task modification instruction to the internet of things device, where the timed task modification instruction may include a corresponding task ID (identifier) and an updated execution time, so after receiving the timed task modification instruction, the internet of things device may determine an execution instruction corresponding to the task ID according to the task ID, and correct an original execution time in the execution instruction according to the updated execution time.
In some embodiments, when the control center 200 detects that time hopping activity has occurred, the time hopping activity may be recorded and permanently stored so that device time adjustments may be monitored. For example, when the control center 200 detects that a time hopping activity has occurred, the control center 200 may record the number of the internet of things device that has occurred the time hopping activity, the timestamp of when the time hopping activity occurred for the internet of things device, and a specific hopping value (i.e., the amount of change in Δt).
S304, the control center 200 sends the corrected execution instruction to the Internet of things equipment. This step may correspond to S104 in the foregoing embodiment.
After correcting the execution time carried in the execution instruction, the control center 200 may send the corrected execution instruction to the internet of things device. As an implementation manner, the control center 200 may send the corrected execution instruction to the internet of things device through mqtt a. That is, the control center 200 may send the corrected execution instruction to mqtt1 first, and then forward the corrected execution instruction from mqtt to the internet of things device, so that the internet of things device may obtain the corrected execution instruction from mqtt 1.
It should be appreciated that when the execution instruction is an immediate execution instruction (a class a instruction or a class C instruction), the control center 200 may not need to make corrections to the execution timing of the execution instruction. For the class a instruction, the control center 200 may immediately issue the execution instruction to the internet of things device after receiving the execution instruction; for the class C instruction, after receiving the execution instruction, the control center 200 may send the execution instruction to the internet of things device at a sending time specified by the execution instruction.
In some embodiments, the control center 200 may perform centralized persistent storage (e.g., may save to a database) of instructions issued by the control center 200 to the internet of things device in order to trace back the lookup problem through the history trace.
According to the method of the embodiment, the service system can issue the execution instruction through the interface of the control center, after the control center obtains the instruction, the time difference of the target internet of things device can be obtained from the cache quickly, the execution time of the issued timing issue instruction and the execution time of the unexecuted timing execution instruction are changed according to the time difference, and then the execution instruction with the changed execution time is issued to the internet of things device, so that the time of the execution instruction of the internet of things device is ensured to be consistent with the expected time of the control center.
In some embodiments, the implementation flow further includes:
S305, the control center 200 receives the report data from the Internet of things equipment. This step may correspond to step 1051 in S105 in the previous embodiment.
As an implementation manner, the reported data sent by the internet of things device may be pushed to mqtt first, and then forwarded to the control center 200 by mqtt 1. Further, the control center 200 may perform snoop filtering on the reported data.
S306, the control center 200 corrects the sending time of the reported data sent by the Internet of things equipment. This step may correspond to step 1052 in S105 in the previous embodiment.
For the reported data from the internet of things equipment, the control center can correct the sending time of the reported data sent by the internet of things equipment based on the following formula: timeM = time- Δt.
S307, the control center 200 sends the corrected report data to the service system. This step may correspond to step 1053 in S105 in the previous embodiment.
After correcting the sending time of the reporting data sent by the internet of things device, the control center 200 can send the corrected reporting data to the service system. As an implementation manner, the control center 200 may send the corrected report data to the service system through mqtt b, that is, the control center 200 may send the report data to mqtt b, and then the report data is forwarded to the service system by mqtt b for use by the service system, and further, the service system may monitor the report data from the control center 200.
In some embodiments, the implementation flow further includes: the control center 200 intelligently discovers time hops. For example, the control center 200 may monitor the reported data from the internet of things device in real time, so that the control center 200 may obtain the time TimeS of the internet of things device sending the reported data from the reported data. From the time difference Δt, timeM =time—Δt can be corrected. At this time, the result of TimeM-TimeNow may be taken as an absolute value, and if the absolute value is greater than or equal to the third threshold, it may be considered that a time jump has occurred, or that a time change event has been triggered, in which case the control center 200 may automatically recalculate the time difference Δt. For example, the third threshold may be, for example, a sum of a round trip delay (t 3-t 1) of the data transmission and a preset duration, and the third threshold may be, for example, t3-t1+50ms.
This is because, theoretically, timeM is the same as TimeNow in the case where the transmission line rate is stable and the time jump does not occur in the internet of things device, and there is a difference in actual situation, but if the deviation exceeds a certain range, it can be concluded that the system time of the internet of things device jumps.
In some embodiments, when the execution instruction is a timing issue instruction (class C instruction or class D instruction), the implementation flow further includes:
S308, the control center 200 corrects the transmission timing of the transmission execution command. This step may correspond to S106 in the foregoing embodiment.
For example, assuming that the transmission time before correction (i.e., the transmission time originally carried by the execution instruction) is denoted by t4 and the transmission time after correction is denoted by t5, t5=t4- (t 3-t 1)/2, where (t 3-t 1)/2 represents the data transmission delay.
According to the method of this embodiment, when the control center 200 issues the instruction at the transmission timing, the transmission time of the instruction at the transmission timing can be corrected according to the data transmission delay. The method considers the influence of the data transmission delay on the instruction transmission, so that the accuracy of sending the timing issuing instruction by the control center 200 is improved. In addition, in this embodiment, the control center 200 has the capability of issuing the instruction at regular time, so that the service system can be turned off after the instruction is issued, which is beneficial to saving energy consumption. For example, the business system expects the internet of things device to be at 18:00 receives an instruction, then the business system may at 18: the 00 forward control center sends a sending time of 18: and (3) issuing an instruction at a timing of 00, and then enabling the service system to be powered off for saving energy.
In some embodiments, the control center 200 may also maintain an online device queue for the internet of things. For example, the control center 200 may monitor the heartbeat of the internet of things device, record the internet of things device having a heartbeat in a preset period (e.g., 10 minutes), and reject the internet of things device having no heartbeat beyond the preset period from the buffer queue. Thus, the control center 200 may use the internet of things device queue having the heartbeat in the preset period as the online device queue.
In some embodiments, control center 200 may also maintain timing execution instructions. For example, the control center 200 may cache the timing execution instruction (the instruction whose execution time has not expired) that has not yet been executed, and perform real-time maintenance, so that the task to be executed in a period of time in the future of each internet of things device may be known at any time.
In some embodiments, control center 200 also supports instruction type conversion: for example, in the case where the internet of things device supports a timed task, the control center 200 may convert the timed issue immediate execution instruction into an immediate issue timed execution instruction, i.e., a class C instruction to a class B instruction.
It should be appreciated that in the disclosed embodiments, the internet of things device supports control center base instructions. Such as a time-read instruction, and a timing task modification instruction. After receiving the time reading instruction, the Internet of things equipment can immediately respond according to the specification; after receiving the timing task modification instruction, the execution time carried in the corresponding instruction can be modified, and the response is fed back.
According to the implementation flow, the method for correcting the execution time of the instruction provided by the embodiment of the disclosure can realize the following functions:
1) The execution time of the execution instruction is intensively corrected: the control center has instruction modification authority and can modify the execution time carried in the execution instruction from the service system. The correction logic is based on a time difference Δt automatically maintained by the control center.
2) And (3) correcting the reported data: the control center can correct the sending time of the reported data sent by the Internet of things equipment.
3) The control center maintains the device time difference Δt: the control center maintains the time difference between the system time of the Internet of things equipment and the system time of the control center, and maintains the time difference in a mode of timing inquiry equipment; and a data packet monitoring mode is adopted to find out the time difference.
4) The control center provides instruction caching and timing issuing capability. Aiming at a timing issuing instruction (a class C instruction or a class D instruction), the issuing time is t4- (t 3-t 1)/2.
5) And (3) recording time jump of the Internet of things equipment: the time hopping behavior is recorded and stored permanently so that the device time adjustment can be monitored.
6) A clock error report is provided. The control center may provide a clock error report to the internet of things device that is currently online.
7) Historical instructions trace back. The history issuing instruction record of a certain internet of things device can be retrieved.
As described above, existing instruction issuing systems may suffer from the following drawbacks:
1) Is invasive: the system time of the instruction execution device (slave device) is required to be ensured to be consistent with the system time of the master device (cloud control center), and the instruction execution device is required to be synchronized by taking the time of the cloud control center as a standard.
2) Interference is strong: the time synchronization is carried out on the instruction execution device, so that the system time of the instruction execution device jumps, and interference is caused to other programs operated by the instruction execution device.
3) The instruction issuing rate is low: the system time of the instruction execution device needs to be checked before the instruction is issued, and time synchronization needs to be performed when deviation occurs, so that preparation work is excessive before the instruction is issued, and the instruction issuing speed is influenced.
4) Timing instructions are not supported: the business system needs to implement the timing issue instruction logic itself. If the control is required to issue an instruction to the equipment of the Internet of things at 8 points and 0 minutes and 0 seconds, the service system is required to maintain the scheduling capability. Different system scheduling accuracy may not be consistent, resulting in inconsistent expectations with actual delivery times.
5) The following cannot be performed: after inconsistent time, the problem cannot be found through the history trace.
Compared with the existing instruction issuing system, the embodiment of the disclosure has the following advantages:
1) No invasion: the system time of the instruction execution device (such as the internet of things device) is not changed. Only the system time of the instruction execution device is read regularly, and the time difference Δt with the system time of the control center is calculated.
2) No interference: the time synchronization of the Internet of things equipment is not needed, so that the jumping behavior caused by the influence of the system time of the Internet of things equipment by the control center is avoided, and the interference to other programs running on the Internet of things equipment is avoided.
3) The instruction issuing speed is high: the control center periodically reads the system time of the Internet of things equipment and calculates the time difference delta t. When the instruction is issued, correcting the execution time of the timing execution instruction, and then issuing the timing execution instruction to the Internet of things equipment. Therefore, the time synchronization time can be saved, and the instruction issuing speed can be improved.
4) Support instruction timing scheduling: the centralized control center supports instruction caching, provides an instruction scheduling mechanism and issues execution instructions at regular time. The issuing instruction considers the data transmission delay, and the timing instruction issuing with higher precision is realized.
5) The following can be tracked: and (5) carrying out centralized management on the time difference delta t corresponding to the Internet of things equipment, and storing the time difference delta t into a database. And backing up the correction instruction record. Retrospective analysis may be performed on the historical execution record. After the time jump behavior of the Internet of things equipment is found, the control center can automatically repair the instruction executed by the user.
6) Instructions may backtrack: the historical issuing instruction of each Internet of things device can be retrieved.
Taking the internet of things equipment as an unmanned aerial vehicle as an example, the method provided by the embodiment of the disclosure has good prospects in the aspects of unmanned aerial vehicle group control and safe flight, such as multi-machine aeronautical performance application, and multi-machine cooperation execution tasks. After the centralized instruction correction and control system is provided, open interface service can be provided for the outside, the cluster control difficulty of the unmanned aerial vehicle is simplified, and the technical cost of a cooperator is reduced. Meanwhile, the scheme records each instruction, can perform safety analysis based on instruction data, and has a certain prevention effect on safe flight.
Based on the foregoing embodiments, an embodiment of the present application provides an apparatus for correcting an instruction execution time, where the apparatus includes each module included, and may be implemented by a processor in a computer device; of course, the method can also be realized by a specific logic circuit; in an implementation, the Processor may be a central processing unit (Central Processing Unit, CPU), a microprocessor (Microprocessor Unit, MPU), a digital signal Processor (DIGITAL SIGNAL Processor, DSP), or a field programmable gate array (Field Programmable GATE ARRAY, FPGA), or the like.
Fig. 4 shows a composition of an apparatus 400 for correcting instruction execution time according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus 400 may include: a receiving module 401, an acquiring module 402, a processing module 403 and a transmitting module 404; wherein,
The receiving module 401 is configured to receive a first timing execution instruction from the service system, where the first timing execution instruction is configured to instruct the internet of things device to execute a first task at an execution time; an obtaining module 402, configured to obtain a time difference between a system time of the internet of things device and a system time of the apparatus 400; a processing module 403, configured to correct the execution time according to the time difference; the sending module 404 is configured to send a second timing execution instruction to the internet of things device, where the second timing execution instruction is configured to instruct the internet of things device to execute the first task at the corrected execution time.
In some embodiments, the sending module 404 is further configured to send a time reading instruction to the internet of things device at the first moment; the receiving module 401 is further configured to receive time data from an internet of things device, where the time data includes data at a first time and data at a second time, and the second time is a time when the internet of things device receives a time reading instruction; the processing module 403 is further configured to determine a time difference according to the first time, the second time, and a third time, where the third time is a time when the apparatus 400 receives the time data; the processing module 403 is further configured to store, before acquiring the time difference between the system time of the internet of things device and the system time of the apparatus 400, the time difference and/or the second timing execution instruction to the storage module, where the storage module includes a database and/or a memory of the apparatus 400; the obtaining module 402 is specifically configured to: the time difference is read from the memory module.
In some embodiments, the processing module 403 is further configured to: after a first time interval in which the time difference is determined, the time difference is redetermined; and correcting the execution time according to the redetermined time difference under the condition that the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is larger than or equal to a first threshold value and the Internet of things equipment does not execute the first task.
In some embodiments, the processing module 403 is further configured to store the redefined time difference and the identifier of the internet of things device to the storage module if the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is greater than or equal to a second threshold, where the second threshold is a difference between the third time and the first time.
In some embodiments, the receiving module 401 is further configured to receive first report data from an internet of things device, where the first report data includes a fourth time, and the fourth time is a time when the internet of things device sends the first report data; the processing module 403 is further configured to correct the fourth time according to the time difference; the sending module 404 is further configured to send second report data to the service system, where the second report data includes the corrected fourth time.
In some embodiments, the second timing execution instruction further includes an indication transmission time, where the indication transmission time is used to instruct the apparatus 400 to transmit the second timing execution instruction to the internet of things device at the indication transmission time, and the transmission module 404 is further configured to transmit the second timing execution instruction at a seventh time, where the seventh time is a difference between the indication transmission time and a data transmission delay, and the data transmission delay is equal to one half of a difference between the third time and the first time.
In some embodiments, the sending module 404 is specifically configured to send, through the internet of things device-oriented communication message server, a second timing execution instruction to the internet of things device; the sending module 404 is specifically further configured to send the second reporting data to the service system through the internal system oriented communication message server.
The description of the apparatus embodiments above is similar to that of the method embodiments above, with similar advantageous effects as the method embodiments. In some embodiments, the functions or modules included in the apparatus provided by the embodiments of the present disclosure may be used to perform the methods described in the embodiments of the methods, and for technical details that are not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the description of the embodiments of the methods of the present disclosure for understanding.
It should be noted that, in the embodiment of the present application, if the above-mentioned data processing method is implemented in the form of a software functional module, and sold or used as a separate product, the data processing method may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or some of contributing to the related art may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
The embodiment of the application provides a computer device, which comprises a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor realizes part or all of the steps in the method when executing the program.
Embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs some or all of the steps of the above-described method. The computer readable storage medium may be transitory or non-transitory.
Embodiments of the present application provide a computer program comprising computer readable code which, when run in a computer device, causes a processor in the computer device to perform some or all of the steps for carrying out the above method.
Embodiments of the present application provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program which, when read and executed by a computer, performs some or all of the steps of the above-described method. The computer program product may be realized in particular by means of hardware, software or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium, and in other embodiments, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
It should be noted here that: the above description of various embodiments is intended to emphasize the differences between the various embodiments, the same or similar features being referred to each other. The above description of apparatus, storage medium, computer program and computer program product embodiments is similar to that of method embodiments described above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus, the storage medium, the computer program and the computer program product of the present application, reference should be made to the description of the embodiments of the method of the present application.
It should be noted that, fig. 5 is a schematic diagram of a hardware entity of a computer device in an embodiment of the disclosure, as shown in fig. 5, the hardware entity of the computer device 500 includes: a processor 501, a communication interface 502 and a memory 503, wherein:
the processor 501 generally controls the overall operation of the computer device 500.
The communication interface 502 may enable the computer device to communicate with other terminals or servers over a network.
The memory 503 is configured to store instructions and applications executable by the processor 501, and may also cache data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or processed by the various modules in the processor 501 and the computer device 500, and may be implemented by a FLASH memory (FLASH) or a random access memory (Random Access Memory, RAM). Data transfer may be performed between the processor 501, the communication interface 502 and the memory 503 via the bus 504.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence number of each step/process described above does not mean that the execution sequence of each step/process should be determined by its functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Or the above-described integrated units of the application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The foregoing is merely an embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application.

Claims (10)

1. A method for correcting instruction execution time, applied to a control center, the method comprising:
Receiving a first timing execution instruction from a service system, wherein the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment;
Acquiring a time difference between the system time of the Internet of things equipment and the system time of the control center;
Correcting the execution time according to the time difference;
and sending a second timing execution instruction to the internet of things equipment, wherein the second timing execution instruction is used for indicating the internet of things equipment to execute the first task at the corrected execution moment.
2. The method of claim 1, wherein prior to the obtaining a time difference between a system time of the internet of things device and a system time of the control center, the method further comprises:
A time reading instruction is sent to the Internet of things equipment at a first moment;
receiving time data from the internet of things device, wherein the time data comprises data of the first moment and data of the second moment, and the second moment is the moment when the time reading instruction is received by the internet of things device;
Determining the time difference according to the first time, the second time and a third time, wherein the third time is the time when the control center receives the time data;
Storing the time difference and/or the second timing execution instruction to a storage module, wherein the storage module comprises a database and/or a memory of the control center;
the obtaining the time difference between the system time of the internet of things device and the system time of the control center includes: the time difference is read from the memory module.
3. The method according to claim 2, wherein the method further comprises:
After determining the first time interval of the time difference, re-determining the time difference;
and correcting the execution time according to the redetermined time difference under the condition that the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is larger than or equal to a first threshold value and the Internet of things equipment does not execute the first task.
4. A method according to claim 3, characterized in that the method further comprises:
And storing the redetermined time difference and the identification of the internet of things device to the storage module under the condition that the absolute value of the difference between the redetermined time difference and the latest stored time difference in the storage module is larger than or equal to a second threshold, wherein the second threshold is the difference between the third moment and the first moment.
5. The method according to any one of claims 1 to 4, further comprising:
Receiving first reporting data from the internet of things device, wherein the first reporting data comprises a fourth moment, and the fourth moment is the moment when the internet of things device sends the first reporting data;
Correcting the fourth time according to the time difference;
And sending second reporting data to the service system, wherein the second reporting data comprises a corrected fourth moment.
6. The method of any of claims 2 to 4, wherein the second timing execution instruction further comprises an indication transmission time for instructing the control center to transmit the second timing execution instruction to the internet of things device at the indication transmission time, the method further comprising:
and transmitting the second timing execution instruction at a seventh moment, wherein the seventh moment is a difference value between the indication transmission time and the data transmission time delay, and the data transmission time delay is equal to one half of a difference value between the third moment and the first moment.
7. The method of claim 5, wherein the step of determining the position of the probe is performed,
The sending a second timing execution instruction to the internet of things device includes: sending a second timing execution instruction to the Internet of things equipment through a communication message server facing the Internet of things equipment;
the sending the second report data to the service system includes: and sending second reporting data to the service system through an internal system communication message server.
8. An apparatus for correcting an instruction execution time, the apparatus comprising:
The system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a first timing execution instruction from a service system, and the first timing execution instruction is used for indicating the Internet of things equipment to execute a first task at the execution moment;
The acquisition module is used for acquiring the time difference between the system time of the Internet of things equipment and the system time of the device;
The processing module is used for correcting the execution time according to the time difference;
the sending module is used for sending a second timing execution instruction to the internet of things equipment, and the second timing execution instruction is used for indicating the internet of things equipment to execute the first task at the corrected execution moment.
9. A computer device, the computer device comprising:
a memory for storing computer executable instructions;
A processor, coupled to the memory, for implementing the method of any one of claims 1 to 7 by executing the computer-executable instructions.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by at least one processor, implements the method according to any one of claims 1 to 7.
CN202211376886.0A 2022-11-04 2022-11-04 Method, device, equipment and storage medium for correcting instruction execution time Pending CN117997918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211376886.0A CN117997918A (en) 2022-11-04 2022-11-04 Method, device, equipment and storage medium for correcting instruction execution time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211376886.0A CN117997918A (en) 2022-11-04 2022-11-04 Method, device, equipment and storage medium for correcting instruction execution time

Publications (1)

Publication Number Publication Date
CN117997918A true CN117997918A (en) 2024-05-07

Family

ID=90892400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211376886.0A Pending CN117997918A (en) 2022-11-04 2022-11-04 Method, device, equipment and storage medium for correcting instruction execution time

Country Status (1)

Country Link
CN (1) CN117997918A (en)

Similar Documents

Publication Publication Date Title
US10368312B2 (en) Method, device, and system for detecting device power
CN101217402B (en) A method to enhance the reliability of the cluster and a high reliability communication node
RU2011152117A (en) MOBILE COMPUTER AND METHOD WITH IMPROVED POLL MANAGEMENT
CN105591821A (en) Monitoring system and business system
JP2014529366A (en) Send category information
EP3417598B1 (en) Method, apparatus and computer program for communicating state change information
CN112165413B (en) Equipment state reporting method and device and electronic device
CN110445697B (en) Video big data cloud platform equipment access service method
KR101596800B1 (en) Centralized Control System and Controlling Method for Sun Tracking
US20130094622A1 (en) System and method for synchronization of networked fire alarm panels
CN117997918A (en) Method, device, equipment and storage medium for correcting instruction execution time
CN115378841B (en) Method and device for detecting state of equipment accessing cloud platform, storage medium and terminal
WO2012039096A1 (en) Illumination apparatus
CN110445647A (en) A kind of diagnosis of internet of things data and error correction method
JP4662842B2 (en) Time correction system
CN112653717B (en) Multi-cloud cooperation distributed system and application distribution method
KR20130109410A (en) Method and apparatus for controlling push notification message transmit cycle in push notification services by communication system
CN112395155A (en) Service monitoring method and device, storage medium and electronic device
US10673726B2 (en) Heartbeat packet timer identification method, and device
CN115361317B (en) Clock monitoring method, adjusting method, clock system and storage medium
CN110351142B (en) Network equipment management method, equipment and system
JPH05189385A (en) Timer synchronization system in distributed processing environment system
CN116527729B (en) Distributed data management system based on Web3
JP7210863B2 (en) remote control system
CN117221159A (en) Converter station time synchronization monitoring method, device, computer equipment and storage medium

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