Disclosure of Invention
In view of the above, the present invention provides an asynchronous timing control method, apparatus, storage medium, and electronic device that overcome or at least partially solve the above problems.
In a first aspect, an asynchronous timing control method includes:
Acquiring a configuration file of an asynchronous task;
Distributing the asynchronous tasks defined in the configuration file to at least one device based on a pre-trained distributed task scheduling algorithm so that the device can execute the distributed tasks and return corresponding execution results;
Analyzing the execution result aiming at the execution result of any one of the devices to obtain a corresponding decision;
and generating a corresponding control instruction according to the decision, and sending the control instruction to corresponding equipment so as to control the operation of the equipment.
Optionally, in some optional embodiments, before the obtaining the configuration file of the asynchronous task, the method further includes:
Obtaining configuration data of an asynchronous task input by a user, wherein the configuration data comprises an operation instruction, an execution condition, a time interval and the repetition number of equipment;
and generating the corresponding configuration file according to the configuration data.
Optionally, in some optional embodiments, before the obtaining the configuration file of the asynchronous task, the method further includes:
obtaining a registration request of the device;
performing identity verification on the equipment;
if the equipment passes the identity verification, registering equipment information of the equipment and establishing connection with the equipment;
and if the equipment fails the identity verification, returning a prompt of failed verification to the equipment.
Optionally, in some optional embodiments, the distributing the asynchronous task defined in the configuration file to at least one device based on a pre-trained distributed task scheduling algorithm includes:
Invoking the pre-trained distributed task scheduling algorithm to enable the distributed task scheduling algorithm to determine devices of each subtask in combination with reference factors of each device, wherein the reference factors comprise at least one of load balancing, weight, priority and network delay, and asynchronous tasks defined in the configuration file comprise at least one subtask;
And for any subtask, assigning the subtask to a corresponding device.
Optionally, in some optional embodiments, the analyzing the execution result for the execution result of any one of the devices to obtain a corresponding decision includes:
Aiming at the execution result of any one of the devices, using a pre-established cloud computing model to extract information from the execution result to obtain valuable information;
and analyzing the valuable information by using a pre-established big data analysis model to obtain a corresponding decision.
Optionally, in some optional embodiments, after the generating the corresponding control instruction according to the decision, and issuing the control instruction to the corresponding device to control the operation of the device, the method further includes:
obtaining the state of each device;
and if the equipment in the abnormal state exists, carrying out corresponding alarm.
Optionally, in some optional embodiments, the obtaining the status of each device includes:
Acquiring corresponding point location information from the point locations of the devices in real time, wherein the point location information comprises operation data fed back by the corresponding devices;
and determining the state of the corresponding equipment according to the operation data.
In a second aspect, an asynchronous timing control apparatus includes: the system comprises a file obtaining unit, a task allocation unit, a data analysis unit and an instruction issuing unit;
The file obtaining unit is used for obtaining a configuration file of the asynchronous task;
the task allocation unit is used for allocating the asynchronous tasks defined in the configuration file to at least one device based on a pre-trained distributed task scheduling algorithm so that the device can execute the tasks obtained by allocation and return corresponding execution results;
the data analysis unit is used for analyzing the execution result of any one of the devices to obtain a corresponding decision;
the instruction issuing unit is used for generating a corresponding control instruction according to the decision and issuing the control instruction to corresponding equipment so as to control the operation of the equipment.
In a third aspect, a computer readable storage medium has stored thereon a program which, when executed by a processor, implements the asynchronous timing control method of any of the above.
In a fourth aspect, an electronic device includes at least one processor, at least one memory coupled to the processor, and a bus; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke program instructions in the memory to perform the asynchronous timing control method of any of the above.
By means of the technical scheme, the asynchronous timing control method, the asynchronous timing control device, the storage medium and the electronic equipment can obtain the configuration file of an asynchronous task; distributing the asynchronous tasks defined in the configuration file to at least one device based on a pre-trained distributed task scheduling algorithm so that the device can execute the distributed tasks and return corresponding execution results; analyzing the execution result aiming at the execution result of any one of the devices to obtain a corresponding decision; and generating a corresponding control instruction according to the decision, and sending the control instruction to corresponding equipment so as to control the operation of the equipment. Therefore, the invention can reasonably distribute asynchronous tasks based on a distributed task scheduling algorithm, can intelligently analyze the execution result and efficiently control the operation of the equipment.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As shown in fig. 1, the present invention provides an asynchronous timing control method, including: s100, S200, and S300 and S400;
S100, obtaining a configuration file of an asynchronous task;
Alternatively, the asynchronous task belongs to the concept of the technology in the field, and the invention does not describe the task too much, and please refer to the related description in the field.
Alternatively, the execution subject of the present invention may be a cloud platform. That is, the present invention may implement asynchronous task definition and configuration on a cloud platform, which the present invention is not limited to.
Alternatively, the invention can be applied to the field of control of the industrial internet to realize an asynchronous timing control system of the industrial internet, and the invention is not limited to this.
For example, as depicted in fig. 2, in some alternative embodiments, prior to S100, the method further comprises: s90 and S91;
S90, obtaining configuration data of an asynchronous task input by a user, wherein the configuration data comprises an operation instruction, an execution condition, a time interval and the repetition number of equipment;
Optionally, the user may input configuration data through selecting, importing, inputting by a keyboard, writing, and the like, which is not limited in the present invention.
Alternatively, the present invention may create multiple tasks for a single device, depending on the needs. The tasks are not in absolute order, are defined according to specific requirements, and can be specifically set in a configuration file mode or a mode of customizing development page configuration items.
Optionally, the operation instruction in the present invention refers to: and (3) an action instruction issued to the equipment, such as: and the starting or stopping instruction of the equipment is bound with the starting and stopping point position of the equipment controller such as the PLC through the middleware, and an instruction (written value) is issued to the controller PLC to achieve the effect of controlling the equipment.
The execution conditions refer to: a precondition is reached for controlling the device or performing an action. Such as: before a device is started, no one within the range of the device is required to start. An absence of a person within the device is an execution condition, and if a person within the device is not allowed to boot up the device.
The time interval refers to: the action instruction is executed every long time.
The number of repetitions refers to: many factors (such as unstable network) in the system execution process cannot guarantee a hundred percent of success, and the system needs to be subjected to compatible processing, so that the fault tolerance of the system is improved. The number of repetitions is the number that will be performed again after the first failure.
S91, generating the corresponding configuration file according to the configuration data.
Optionally, the device in the invention can accept the dispatching and control of the cloud platform after the cloud platform is registered. Thus, for devices that have not yet been registered, a registration request may be initiated to the cloud platform, as the invention is not limited in this regard.
For example, as shown in fig. 3, in some alternative embodiments, prior to S100, the method further comprises: s80, S81, S82, and S83;
s80, obtaining a registration request of the equipment;
Optionally, the registration request may carry device information of the corresponding device, and after the subsequent authentication is passed, the corresponding device information may be directly extracted from the registration request for registration.
S81, carrying out identity verification on the equipment;
optionally, authentication is a process of ensuring that only authorized devices can access a system or network resource, a general process of authentication comprising:
After the system receives the authentication request of the device, the information provided by the device may be verified, including checking whether the unique identifier of the device is valid, verifying a digital signature, or decrypting encrypted information.
Once the device is successfully authenticated, the system may grant the corresponding access rights based on the identity of the device. Involves assigning devices to specific users or roles and restricting access to system resources based on their rights.
To increase security, the system may require the device to periodically update its credentials or re-authenticate, which helps prevent a device that has failed or has been lost from continuing to access the system.
S82, if the equipment passes the identity verification, registering equipment information of the equipment and establishing connection with the equipment;
and S83, if the equipment fails the identity authentication, a prompt that the authentication fails is returned to the equipment.
Optionally, the authentication of the device may ensure that only authorized devices can connect to the cloud platform, and ensure security of the system, which is not limited by the present invention.
S200, distributing asynchronous tasks defined in the configuration file to at least one device based on a pre-trained distributed task scheduling algorithm so that the device can execute the distributed tasks and return corresponding execution results;
optionally, asynchronous tasks are reasonably distributed and scheduled through a distributed task scheduling algorithm, so that load balance and resource utilization rate of the equipment are ensured. Therefore, the utilization efficiency of the equipment can be improved to the greatest extent, and the equipment is prevented from idling or overload.
Optionally, after performing a certain task, the device may generate a corresponding execution result. For example, a task of power outage is created for a device, the operation command is power transmission, the execution condition is that the area where the device is located is unmanned and the automatic mode, after the task is started, the device executes asynchronous action according to the set condition and the operation command, and the main task of the program is not affected.
Optionally, in some optional embodiments, the S200 includes: step 1.1 and step 1.2;
Step 1.1, invoking a pre-trained distributed task scheduling algorithm to enable the distributed task scheduling algorithm to determine devices of each subtask in combination with reference factors of the devices, wherein the reference factors comprise at least one of load balancing, weight, priority and network delay, and asynchronous tasks defined in the configuration file comprise at least one subtask;
And step 1.2, aiming at any subtask, distributing the subtask to corresponding equipment.
Optionally, the scheduling task needs to evaluate the resource situation of each node device. Such as CPU, memory, and network bandwidth. These resource conditions will be used as a basis for task scheduling to determine which node devices are suitable for performing which specific tasks.
Optionally, in the resource evaluation, in order to balance the load of the whole system, different weights may be set for different node devices, so as to better allocate tasks.
Optionally, the priorities of the tasks may be set according to factors such as service requirements, importance of the tasks, emergency degree, and the like, and these priorities are considered in task scheduling.
S300, analyzing an execution result of any one of the devices to obtain a corresponding decision;
for example, in some alternative embodiments, the S300 includes: step 2.1 and step 2.2;
Step 2.1, aiming at an execution result of any one of the devices, extracting information from the execution result by using a pre-established cloud computing model to obtain valuable information;
and 2.2, analyzing the valuable information by using a pre-established big data analysis model to obtain a corresponding decision.
Optionally, the cloud computing model and the big data analysis model belong to the technical concepts known in the present invention, and the present invention will not be described in detail herein, please refer to the related explanation in the art. It should be noted that: according to the invention, a model meeting the actual demand can be constructed according to the actual demand.
For example, the invention can collect information of the equipment during operation, such as temperature, speed, progress and the like, according to the measuring points in the equipment sensor, and then analyze according to the corresponding information so as to properly adjust the working parameters of the equipment, thereby achieving the purpose of optimizing production.
S400, generating a corresponding control instruction according to the decision, and issuing the control instruction to corresponding equipment so as to control the operation of the equipment.
Optionally, the purpose of the present invention is to implement asynchronous control of the device, so that the present invention can establish corresponding control instructions according to the analyzed decision, so as to remotely control the operation and function of the device. For example, the production rate of the equipment can be adjusted in real time in the production engineering according to the production rate on equipment collection and the work order plan completion time, and the invention is not limited in this respect.
Optionally, as shown in fig. 4, in some optional embodiments, after the step S400, the method further includes: s500 and S600;
s500, obtaining the state of each device;
Optionally, in some optional embodiments, the S500 includes:
Acquiring corresponding point location information from the point locations of the devices in real time, wherein the point location information comprises operation data fed back by the corresponding devices;
and determining the state of the corresponding equipment according to the operation data.
S600, if the equipment in the abnormal state exists, corresponding warning is carried out.
Optionally, during asynchronous timing control, the cloud platform may monitor the status and data anomalies of the device. Once the problem is found, an alarm notification is sent to related personnel in time so as to quickly solve the problem and ensure the reliability of the system.
For example, during asynchronous control, the system monitors the status of the device in real time through the measurement points on the device plc, such as: the equipment is stopped, operated, abnormal and other states and abnormal data in the production process, the equipment feeds back the states to the point positions of the PLC, the system asynchronously acquires the point position information in real time, and the point position information is fed back to the cloud platform or an alarm is sent.
Optionally, for a further clear description of the implementation of the present invention, please refer to the asynchronous timing control flow of the industrial internet device as shown in fig. 5. The terminal large screen, the database, the cloud platform and the production line equipment can jointly form an asynchronous timing control system of the industrial Internet equipment, and the production line equipment can be connected with the cloud platform through a Modbus protocol.
As another example, as shown in fig. 6, an execution flow of the asynchronous timing control of the device according to the present invention is shown, which is not limited by the present invention.
From this, it can be seen that the following technical effects can be achieved by the present invention:
1. Flexibility: by definition and configuration of asynchronous tasks, the operation and function of the device can be flexibly adjusted according to specific requirements and device states. Different devices can independently operate without synchronous coordination, so that the flexibility and the expandability of the system are improved.
2. The resource utilization rate is high: and by a distributed task scheduling algorithm, the asynchronous tasks are reasonably distributed and scheduled, and the load balance and the resource utilization rate of the equipment are ensured. Therefore, the utilization efficiency of the equipment can be improved to the greatest extent, and the equipment is prevented from idling or overload.
3. High efficiency: and the cloud computing and big data technology is adopted to process and analyze the data uploaded by the equipment, so that intelligent decision and optimization are realized. This enables the system to operate more efficiently, improving production and operating efficiency.
4. Remote control and monitoring: an asynchronous timing control scheme based on the industrial Internet can realize remote control and monitoring of equipment. The user can send control instructions through the cloud platform and monitor the state and execution results of the equipment. This provides convenience and real-time for remote management and maintenance.
As shown in fig. 7, the present invention provides an asynchronous timing control apparatus comprising: a file obtaining unit 100, a task assigning unit 200, a data analyzing unit 300, and an instruction issuing unit 400;
the file obtaining unit 100 is configured to obtain a configuration file of an asynchronous task;
The task allocation unit 200 is configured to allocate, based on a pre-trained distributed task scheduling algorithm, an asynchronous task defined in the configuration file to at least one device, so that the device executes the task obtained by allocation and returns a corresponding execution result;
The data analysis unit 300 is configured to analyze an execution result of any one of the devices to obtain a corresponding decision;
The instruction issuing unit 400 is configured to generate a corresponding control instruction according to the decision, and issue the control instruction to a corresponding device to control the operation of the device.
Optionally, in some optional embodiments, the apparatus further comprises: a data obtaining unit and a file generating unit;
The data obtaining unit is used for obtaining configuration data of the asynchronous task input by a user before the configuration file of the asynchronous task is obtained, wherein the configuration data comprises operation instructions, execution conditions, time intervals and repetition times of equipment;
The file generation unit is used for generating the corresponding configuration file according to the configuration data.
Optionally, in some optional embodiments, the apparatus further comprises: the system comprises a request acquisition unit, an identity verification unit, a first result unit and a second result unit;
the request obtaining unit is used for obtaining a registration request of the equipment before the configuration file of the asynchronous task is obtained;
the identity verification unit is used for carrying out identity verification on the equipment;
the first result unit is used for registering the equipment information of the equipment and establishing connection with the equipment if the equipment passes the identity verification;
And the second result unit is used for returning a prompt of failed verification to the equipment if the equipment fails the identity verification.
Optionally, in some optional embodiments, the task allocation unit 200 includes: a device determining subunit and a task allocation subunit;
The device determining subunit is configured to invoke the pre-trained distributed task scheduling algorithm, so that the distributed task scheduling algorithm determines devices of each subtask in combination with reference factors of each device, where the reference factors include at least one of load balancing, weight, priority, and network delay, and the asynchronous tasks defined in the configuration file include at least one subtask;
the task allocation subunit is configured to allocate, for any one of the subtasks, the subtask to a corresponding device.
Optionally, in some optional embodiments, the data analysis unit 300 includes: an information extraction sub-unit and an information analysis sub-unit;
The information extraction subunit is used for extracting information from the execution result of any one of the devices by using a pre-established cloud computing model to obtain valuable information;
The information analysis subunit is used for analyzing the valuable information by using a pre-established big data analysis model to obtain corresponding decisions.
Optionally, in some optional embodiments, the apparatus further comprises: a state obtaining unit and an alarm unit;
the state obtaining unit is used for obtaining the state of each device after the corresponding control instruction is generated according to the decision and issued to the corresponding device to control the operation of the device;
And the alarm unit is used for carrying out corresponding alarm if the equipment in the abnormal state exists.
Optionally, in some optional embodiments, the state obtaining unit includes: a point location information obtaining subunit and a state determining subunit;
The point location information obtaining subunit is configured to obtain corresponding point location information from the point locations of the devices in real time, where the point location information includes operation data fed back by the corresponding devices;
The state determining subunit is configured to determine a state of the corresponding device according to the operation data.
The present invention provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements the asynchronous timing control method of any of the above.
As shown in fig. 8, the present invention provides an electronic device 70, the electronic device 70 comprising at least one processor 701, and at least one memory 702, bus 703 connected to the processor 701; wherein, the processor 701 and the memory 702 complete communication with each other through the bus 703; the processor 701 is configured to invoke program instructions in the memory 702 to perform the asynchronous timing control method of any of the above.
In the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.