CN115580622B - Workflow execution method based on edge synchronization service, electronic equipment and medium - Google Patents

Workflow execution method based on edge synchronization service, electronic equipment and medium Download PDF

Info

Publication number
CN115580622B
CN115580622B CN202211096021.9A CN202211096021A CN115580622B CN 115580622 B CN115580622 B CN 115580622B CN 202211096021 A CN202211096021 A CN 202211096021A CN 115580622 B CN115580622 B CN 115580622B
Authority
CN
China
Prior art keywords
workflow
service unit
synchronization
edge
cloud
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.)
Active
Application number
CN202211096021.9A
Other languages
Chinese (zh)
Other versions
CN115580622A (en
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.)
Peng Cheng Laboratory
Original Assignee
Peng Cheng Laboratory
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 Peng Cheng Laboratory filed Critical Peng Cheng Laboratory
Priority to CN202211096021.9A priority Critical patent/CN115580622B/en
Publication of CN115580622A publication Critical patent/CN115580622A/en
Application granted granted Critical
Publication of CN115580622B publication Critical patent/CN115580622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a workflow execution method based on edge synchronization service, electronic equipment and a medium, which are applied to an edge end, wherein the edge end comprises a synchronization service unit and at least one worker service unit, and the workflow execution method based on the edge synchronization service comprises the following steps: the cloud-side communication connection is not interrupted in the execution process of the workflow, and the synchronous service unit plays roles of transferring and backing up hot spot data in one message; when cloud side communication connection is interrupted, the cloud side communication connection plays a role in service scheduling of a workflow engine in the cloud side, and workflow instance data are synchronized to the cloud side according to time sequence in a periodical increment synchronization mode after the cloud side communication connection is communicated with a cloud side network. The workflow execution method solves the technical problem that the workflow execution method in the intelligent manufacturing field cannot achieve both network stability and high performance.

Description

Workflow execution method based on edge synchronization service, electronic equipment and medium
Technical Field
The present application relates to the field of edge synchronization services, and in particular, to a workflow execution method, an electronic device, and a medium based on an edge synchronization service.
Background
Along with the development of industrial Internet, workflow gradually appears in industrial process manufacturing, and intelligent manufacturing can be rapidly realized by introducing workflow engines in the process of various process manufacturing, rapid customization or flow management is realized, and the production efficiency is improved. Currently, the mainstream workflow engine in the industry is generally used in the cloud computing field based on public cloud or private cloud, the cloud workflow engine generally applies some high-performance hardware equipment, the computing capability is very excellent, and an application program of the edge synchronization service is initiated at the edge side of a data source, so that the transfer process of data on a network is omitted, the speed is faster and safer, but a short board of the edge synchronization service is poor in hardware performance and cannot cope with complex and large-scale computation. The instability of the network makes the independent cloud workflow engine not exert the best effect, so the workflow execution method in the current intelligent manufacturing field has the technical problem that the stability and the high performance of the network cannot be combined.
Disclosure of Invention
The application mainly aims to provide a workflow execution method based on edge synchronization service, electronic equipment and medium, and aims to solve the technical problem that the network stability and high performance cannot be achieved in the workflow execution method in the current intelligent manufacturing field.
In order to achieve the above object, the present application provides a workflow execution method based on an edge synchronization service, which is applied to an edge, wherein the edge includes a synchronization service unit and at least one worker service unit, and the workflow execution method based on the edge synchronization service includes:
determining a current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed;
sending an execution instruction to the current worker service unit through the synchronous service unit, and controlling the current worker service unit to run to generate an execution result corresponding to the execution instruction;
if the communication connection between the edge end and the cloud end is not disconnected, forwarding the execution result to the cloud end through the synchronous service unit, and acquiring next worker service unit information fed back by the cloud end;
If the communication connection between the edge end and the cloud end is disconnected, inquiring information of a next worker service unit according to local module data through the synchronous service unit;
Updating the current worker service unit information to the next worker service unit information, and returning to the executing step: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
Optionally, before the step of determining, by the synchronization service unit, the current worker service unit corresponding to the workflow to be executed in each worker service unit according to the current worker service unit information corresponding to the workflow to be executed, the method further includes:
Acquiring a starting request corresponding to the workflow to be executed;
If the communication connection between the edge end and the cloud end is not disconnected, transmitting and forwarding the starting request to the cloud end through the synchronous service unit, and receiving starting worker service unit information corresponding to the workflow to be executed, which is fed back by the cloud end;
if the communication connection between the edge end and the cloud end is disconnected, inquiring starting worker service unit information corresponding to the workflow to be executed according to local template data through the synchronous service unit;
Updating the current worker service unit information to the starting worker service unit information.
Optionally, after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction, the method further includes:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
And detecting the communication connection between the cloud end and the edge end through heartbeat detection, and judging whether the communication connection between the cloud end and the edge end is disconnected or not.
Optionally, after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction, the method further includes:
Storing workflow instance data corresponding to the execution result to a local database;
If the communication connection between the edge end and the cloud end is not disconnected, the identification of the workflow instance data is set to be synchronized;
and if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized.
Optionally, after the identifying of the workflow instance data is set to be unsynchronized, the method further includes:
Screening the workflow instance data in the local database according to the identifiers corresponding to the workflow instance data by the timed task thread to obtain unsynchronized workflow instance data;
And when the connection between the cloud end and the edge end is not disconnected, synchronizing the unsynchronized workflow instance data to the cloud end according to a preset synchronization strategy, and setting the identification of the unsynchronized workflow instance data to be synchronized.
Optionally, the preset synchronization policy includes a preset synchronization number, a preset synchronization interval, and a preset single synchronization number, and synchronizing the unsynchronized workflow instance data to the cloud end according to the preset synchronization policy includes:
the unsynchronized workflow instance data are read according to time sequence, and whether the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronous number is judged;
If the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or not;
And if the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or the number corresponding to the unsynchronized workflow instance data is larger than the preset synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization number.
Optionally, the synchronizing the unsynchronized workflow instance data to the cloud end according to the preset number of single syncs includes:
judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not;
if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud;
and if the number of the unsynchronized workflow instance data is not smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end in batches according to the preset single synchronization number.
Optionally, before the step of querying, by the synchronization service unit, information of a next worker service unit according to local module data if the communication connection between the edge and the cloud is disconnected, the method further includes:
And receiving the flow template data sent by the cloud, storing the flow template data into a local database, and generating the local template data.
The application also provides a workflow execution device based on the edge synchronization service, which is applied to workflow execution equipment based on the edge synchronization service, wherein the workflow execution device based on the edge synchronization service is applied to an edge end, and the workflow execution device based on the edge synchronization service comprises:
The service determining module is used for determining the current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed;
The control operation module is used for sending an execution instruction to the current worker service unit through the synchronous service unit and controlling the current worker service unit to operate and generate an execution result corresponding to the execution instruction;
The cloud scheduling module is used for forwarding the execution result to the cloud through the synchronous service unit if the communication connection between the edge end and the cloud is not disconnected, and acquiring the next worker service unit information fed back by the cloud;
the offline scheduling module is used for inquiring information of a next worker service unit according to local module data through the synchronous service unit if communication connection between the edge end and the cloud end is disconnected;
The update circulation module is used for updating the current worker service unit information into the next worker service unit information, and returning to the execution step: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
Optionally, the service determining module is further configured to:
Acquiring a starting request corresponding to the workflow to be executed;
If the communication connection between the edge end and the cloud end is not disconnected, transmitting and forwarding the starting request to the cloud end through the synchronous service unit, and receiving starting worker service unit information corresponding to the workflow to be executed, which is fed back by the cloud end;
if the communication connection between the edge end and the cloud end is disconnected, inquiring starting worker service unit information corresponding to the workflow to be executed according to local template data through the synchronous service unit;
Updating the current worker service unit information to the starting worker service unit information.
Optionally, the control operation module is further configured to:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
sending a heartbeat message to the cloud workflow engine through the synchronous service unit and the connection channel every preset time period;
If the heartbeat message is successfully sent, the communication connection between the edge end and the cloud end is not disconnected;
If the heartbeat message is failed to be sent, the communication connection between the edge end and the cloud end is disconnected.
Optionally, the control operation module is further configured to:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
And detecting the communication connection between the cloud end and the edge end through heartbeat detection, and judging whether the communication connection between the cloud end and the edge end is disconnected or not.
Optionally, the control operation module is further configured to:
Storing workflow instance data corresponding to the execution result to a local database;
If the communication connection between the edge end and the cloud end is not disconnected, the identification of the workflow instance data is set to be synchronized;
and if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized.
Optionally, the control operation module is further configured to:
Screening the workflow instance data in the local database according to the identifiers corresponding to the workflow instance data by the timed task thread to obtain unsynchronized workflow instance data;
And when the connection between the cloud end and the edge end is not disconnected, synchronizing the unsynchronized workflow instance data to the cloud end according to a preset synchronization strategy, and setting the identification of the unsynchronized workflow instance data to be synchronized.
Optionally, the control operation module is further configured to:
the unsynchronized workflow instance data are read according to time sequence, and whether the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronous number is judged;
If the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or not;
And if the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or the number corresponding to the unsynchronized workflow instance data is larger than the preset synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization number.
Optionally, the control operation module is further configured to:
judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not;
if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud;
and if the number of the unsynchronized workflow instance data is not smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end in batches according to the preset single synchronization number.
Optionally, the offline scheduling module is further configured to:
And receiving the flow template data sent by the cloud, storing the flow template data into a local database, and generating the local template data.
The application also provides an electronic device, which is entity equipment, comprising: the system comprises a memory, a processor and a program of the workflow execution method based on the edge synchronization service, wherein the program of the workflow execution method based on the edge synchronization service is stored in the memory and can run on the processor, and the program of the workflow execution method based on the edge synchronization service can realize the steps of the workflow execution method based on the edge synchronization service when being executed by the processor.
The present application also provides a computer-readable storage medium having stored thereon a program for implementing an edge synchronization service-based workflow execution method, which when executed by a processor, implements the steps of the edge synchronization service-based workflow execution method as described above.
The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a workflow execution method based on an edge synchronization service as described above.
The application provides a workflow execution method based on edge synchronous service, electronic equipment and a computer readable storage medium, wherein the workflow execution method based on edge synchronous service is applied to an edge, the edge comprises a synchronous service unit and at least one worker service unit, the current worker service unit corresponding to the workflow to be executed is determined in each worker service unit through the synchronous service unit firstly according to the current worker service unit information corresponding to the workflow to be executed, then an execution instruction is sent to the current worker service unit through the synchronous service unit, the current worker service unit is controlled to run and generate an execution result corresponding to the execution instruction, if the communication connection between the edge and a cloud is not broken, the execution result is forwarded to the cloud through the synchronous service unit, next worker service unit information fed back by the cloud is obtained, if the communication connection between the edge and the cloud is broken, the next worker service unit information is queried according to local template data through the synchronous service unit, the current worker service unit information is updated into the next worker service unit information, and the execution step is returned to the next worker service unit information, and the execution is executed: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected. According to the application, by combining the edge synchronization service and cloud edge cooperative technology, an edge synchronization service unit is introduced on the basis of a cloud workflow engine, the offline autonomy of the edge is realized by the workflow service scheduling function of the redundant cloud and the mode of local module data, and the scheduling of the workflow can be completed by the edge synchronization service unit under the condition of unstable network, thereby achieving both network stability and high performance.
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.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a workflow execution method based on an edge synchronization service according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of a real-time architecture of each module in the workflow execution method based on the edge synchronization service according to the present application;
FIG. 3 is a flowchart of a workflow execution method based on an edge synchronization service according to a second embodiment of the present application;
FIG. 4 is a schematic diagram of a workflow execution device based on an edge synchronization service according to the present application;
Fig. 5 is a schematic device structure diagram of a hardware running environment related to a workflow execution method based on an edge synchronization service in an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present application more comprehensible, the following description of the embodiments accompanied with the accompanying drawings will be given in detail. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Example 1
Currently, the mainstream workflow engine in the industry is generally used in the cloud computing field based on public cloud or private cloud, the cloud workflow engine generally applies some high-performance hardware equipment, the computing capability is very excellent, and an application program of the edge synchronization service is initiated at the edge side of a data source, so that the transfer process of data on a network is omitted, the speed is faster and safer, but a short board of the edge synchronization service is poor in hardware performance and cannot cope with complex and large-scale computation. The instability of the network makes the independent cloud workflow engine not exert the best effect, so the workflow execution method in the current intelligent manufacturing field has the technical problem that the stability and the high performance of the network cannot be combined.
In a first embodiment of the workflow execution method based on the edge synchronization service according to the present application, referring to fig. 1, the workflow execution method based on the edge synchronization service includes:
Step S10, determining a current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed;
Step S20, an execution instruction is sent to the current worker service unit through the synchronous service unit, and the current worker service unit is controlled to run to generate an execution result corresponding to the execution instruction;
Step S30, if the communication connection between the edge end and the cloud end is not disconnected, forwarding the execution result to the cloud end through the synchronous service unit, and acquiring next worker service unit information fed back by the cloud end;
step S40, if the communication connection between the edge end and the cloud end is disconnected, inquiring information of a next worker service unit according to local module data through the synchronous service unit;
Step S50, the current worker service unit information is updated to the next worker service unit information, and the execution step is returned: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
In this embodiment, it should be noted that, the worker service unit includes a unique identifier corresponding to each task that is borne, where the task unique identifier is used to match with the task ID, and is used for the edge synchronization service unit to match the task ID with the service ID in a key-value pair manner and establish a cache, when an execution result needs to be forwarded, the next task ID is found out from the local template data at the first time, then the worker service unit corresponding to the task ID is found out from the cache, and then a callback API is initiated to the worker service unit to perform message notification, where the callback API adopts a uniform format for designing decoupling, and the format is as follows: http:// serviceName: port/{ processId }/{ taskId }, the parameters are sent in json format, wherein processId is the unique ID of the flow, and taskId is the task ID; the execution result can be execution success or execution failure; the edge synchronization service unit and the worker service unit can transmit messages by adopting a transmission mode of a restful (REpresentational STATE TRANSFER, presentation layer state transition) API (Application Programming Interface ), the transmission mode can realize the interaction between micro services developed in any language, and meanwhile, the message transmission is realized by providing a mode of configuring the message middleware which can be accessed to other third parties.
As an example, steps S10 to S50 include: acquiring a workflow to be executed, and determining a current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed; sending an execution instruction to the worker service unit to control the current worker service unit to execute corresponding tasks and generate a corresponding execution result; receiving an execution result fed back by the worker service unit through a restful API; if the communication connection between the edge end and the cloud end is not disconnected, forwarding the execution result to the cloud end through the synchronous service unit, and receiving information of a next worker service unit sent by the cloud end; if the communication connection between the edge end and the cloud end is disconnected, inquiring information of a next worker service unit according to the local module data through the synchronous service unit; updating the current worker service unit information to the next worker service unit information, and returning to execute step S10: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
Before the step of determining the current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed, the method further comprises the following steps:
Step A10, acquiring a starting request corresponding to the workflow to be executed;
Step A20, if the communication connection between the edge end and the cloud end is not disconnected, transmitting and forwarding the starting request to the cloud end through the synchronous service unit, and receiving starting worker service unit information corresponding to the workflow to be executed, which is fed back by the cloud end;
step A30, if the communication connection between the edge end and the cloud end is disconnected, inquiring information of a starting worker service unit corresponding to the workflow to be executed according to local template data through the synchronous service unit;
And step A40, updating the current worker service unit information into the starting worker service unit information.
In this embodiment, it should be noted that, the start request may be initiated by a user end or may be initiated by an equipment end, where the start request includes a flow ID and a task ID corresponding to a flow template to be invoked, and the method is used to query the corresponding flow template; the flow template may include one worker service unit or may include a plurality of worker service units.
As an example, steps a10 to a40 include: acquiring a starting request corresponding to the workflow to be executed, which is input by a user; judging whether the communication connection between the edge end and the cloud end is disconnected or not; if the communication connection between the edge end and the cloud end is not disconnected, sending and forwarding the starting request to a workflow engine of the cloud end through the synchronous service unit, and receiving starting point worker service unit information corresponding to the workflow to be executed, which is fed back by the workflow engine of the cloud end; if the communication connection between the edge end and the cloud end is disconnected, inquiring starting worker service unit information corresponding to the workflow to be executed according to local template data through the synchronous service unit; updating the current worker service unit information to the starting worker service unit information.
Wherein after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction, the method further comprises:
step B10, a connection message is sent to the cloud end through the synchronous service unit, and a connection channel between the edge end and the cloud end is constructed;
And step B20, detecting the communication connection between the cloud end and the edge end through heartbeat detection, and judging whether the communication connection between the cloud end and the edge end is disconnected or not.
In this embodiment, the connection message may be a TCP (Transmission Control Protocol ) connection message, which is used to establish a connection between the synchronization service unit and the workflow engine of the cloud; the heartbeat message is used for keeping connection between the cloud workflow engine and the edge synchronization service unit stable, and as a preferred mode, the preset time period may be 60 seconds.
As an example, steps B10 to B20 include: sending a TCP connection message to a workflow engine of the cloud end through the synchronous service unit to construct a connection channel between the edge end and the cloud end, wherein the connection channel is used for transmitting the execution result and information of each worker service unit; sending a heartbeat message to the cloud through the synchronous service unit; if the heartbeat message is successfully sent, the communication connection between the edge end and the cloud end is not disconnected; if the heartbeat message is failed to be sent, the communication connection between the edge end and the cloud end is disconnected; after the connection channel is successfully constructed, sending a heartbeat message to the cloud workflow engine through the synchronous service unit every preset time period, and judging that the connection channel is interrupted when the cloud workflow engine does not receive the heartbeat message after the preset time period; and resending the TCP message to the cloud workflow engine to construct a reconnection channel.
Wherein after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction, the method further comprises:
step C10, storing workflow instance data corresponding to the execution result into a local database;
Step C20, if the communication connection between the edge end and the cloud end is not disconnected, setting the identification of the workflow instance data to be synchronized;
And step C30, if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized.
In this embodiment, it should be noted that, referring to fig. 2, the local database may be a lightweight DB (datebase, database), which is used to store local template data and workflow instance data in a short period because of its small storage capacity; the workflow instance execution data is link state data when one service is executed each time; the workflow instance data are synchronized to the cloud end regularly to clear out the expiration data, so that the consistency of the storage function and cloud edge data is ensured; in fig. 2, the workflow cloud engine is a workflow engine of the cloud, has complete functional modules, exists in a cluster manner, is more perfect in performance and function than the synchronous service units, and is only used for standby service in the case of disconnection from the cloud in a short time. The data lake in fig. 2 is a data storage unit of the cloud, and can store a large amount of flow template data and workflow instance data; service a, service B, and service C in fig. 2 are all worker service units that undertake different work tasks; if the communication connection between the edge end and the cloud end is not disconnected, the reason that the identification of the workflow instance data is set to be synchronized is that when the communication connection between the edge end and the cloud end is not disconnected, the cloud end receives the execution result, then the workflow instance data corresponding to the execution result is stored by itself without synchronization, otherwise, when the communication connection between the edge end and the cloud end is not disconnected, the cloud end does not store the workflow instance data, and the identification is not synchronized.
As an example, step C10 to step C30 include: storing workflow instance data corresponding to the execution result to a local database, wherein the workflow instance data comprises a unique ID and a time stamp, and the unique ID and the time stamp are used for screening unsynchronized workflow instance data; judging whether the communication connection between the edge end and the cloud end is disconnected or not; if the communication connection between the edge end and the cloud end is not disconnected, the identification of the workflow instance data is set to be synchronized, and the execution result is forwarded to the cloud end; if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized, wherein the identification is used for screening unsynchronized workflow instance data from the workflow instance data.
Wherein after the identification of the workflow instance data is set to be unsynchronized, the method further comprises:
Step D10, screening workflow instance data in the local database according to the identifiers corresponding to the workflow instance data by the timed task thread to obtain unsynchronized workflow instance data;
And step D20, synchronizing the unsynchronized workflow instance data to the cloud end according to a preset synchronization strategy when the connection between the cloud end and the edge end is not disconnected, and setting the identification of the unsynchronized workflow instance data to be synchronized.
In this embodiment, it should be noted that the timed task thread is configured to filter the workflow instance data at regular time, so as to clear the expiration data of the local database, and ensure that the local database has sufficient storage space.
As an example, step D10 to step D20 include: screening the workflow instance data in the local database according to a timed task thread based on the identification of the workflow instance data, and inquiring to obtain unsynchronized workflow instance data; detecting the connection condition of the cloud end and the edge end; when the connection between the cloud end and the edge end is not disconnected, sending the unsynchronized workflow instance data to a workflow engine of the cloud end according to a preset synchronization strategy so that the workflow engine can store the unsynchronized workflow instance data to a data lake; and setting the identification of the unsynchronized workflow instance data as synchronized.
The preset synchronization policy includes a preset synchronization number, a preset synchronization interval, and a preset single synchronization number, and synchronizing the unsynchronized workflow instance data to the cloud end according to the preset synchronization policy includes:
Step D21, reading the unsynchronized workflow instance data according to a time sequence, and judging whether the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronous number or not;
Step D22, if the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval;
And D23, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization number if the difference between the last synchronization time and the current time is larger than the preset synchronization interval or the number corresponding to the unsynchronized workflow instance data is larger than the preset synchronization number.
In this embodiment, it should be noted that, the preset synchronization number is used as a data quota of the lightweight DB, so as to avoid affecting storage performance of the lightweight DB, and synchronize data to the cloud in time; the preset synchronization interval is used for realizing timing synchronization and keeping timeliness of data synchronization; the preset single synchronization number is used for ensuring the stability of the synchronization process and avoiding transmission failure caused by one-time transmission of excessive data; the method for sending the unsynchronized workflow instance data to the cloud can be performed in a manner of providing an HTTP interface for the cloud, an edge synchronization service unit regularly calls a cloud API to realize synchronization, a general json format is adopted in message design, the data are packed into a json array and sent to the cloud, and the cloud analyzes the json array and then checks and stores the json array in a batch; in addition, the sequence of synchronously transmitting the unsynchronized workflow instance data is the sequence of time stamps, and the cloud workflow engine guarantees the uniqueness of the data by the unique ID of the data, so that the data is prevented from being repeated.
As an example, steps D21 to D23 include: sequentially reading the unsynchronized workflow data according to the time stamp in the unsynchronized workflow instance data, and judging whether the number of the unsynchronized workflow instance data is smaller than the preset synchronous data; if the number of the unsynchronized workflow instance data is not smaller than the preset synchronous data, the unsynchronized workflow instance data is sent to the cloud end in batches according to the single synchronous number; if the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or not; if the difference value between the last synchronization time and the current time is not greater than the preset synchronization interval, stopping the synchronization flow; and if the difference value between the last synchronization time and the current time is larger than the preset synchronization interval, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization quantity.
Wherein synchronizing the unsynchronized workflow instance data to the cloud according to the preset number of single syncs includes:
Step D231, judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number;
step D232, if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud;
And step D233, if the number of the unsynchronized workflow instance data is not smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end in batches according to the preset single synchronization number.
As an example, steps D231 to D233 include: judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not; if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, all the unsynchronized workflow instance data are sent to the cloud end at one time; if the number corresponding to the unsynchronized workflow instance data is not smaller than the preset single synchronization number, sending the unsynchronized workflow instance data with the preset single synchronization number to the cloud; detecting the number of unsent unsynchronized workflow instance data, and returning to the execution step: and judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not until the unsynchronized workflow instance data is sent out.
Before the step of querying information of the next worker service unit according to the local module data by the synchronous service unit if the communication connection between the edge end and the cloud end is disconnected, the method further comprises:
and E10, receiving flow template data sent by the cloud workflow engine, storing the flow template data into a local database, and generating the local template data.
In this embodiment, it should be noted that, the flow template data includes a flow ID and a task ID, where the flow ID determines the uniqueness of the flow template, the task ID determines the uniqueness of a single task, each flow template is guaranteed to have uniqueness, and the local database is a lightweight DB.
As an example, step E10 includes: receiving the flow template data sent by the cloud through the synchronous service unit in a TCP long link mode; and storing the flow template data into a lightweight DB for calling at any time.
Wherein before the step of sending an execution instruction to the current worker service unit through the synchronization service unit, further comprises: starting each worker service unit, and receiving service registration sent by each worker service unit through the synchronous service unit, wherein the service registration comprises a work task born by each worker service unit, a task ID corresponding to the work task and a service ID corresponding to the worker service unit; and establishing a cache of the task ID and the service ID in a key value pair mode.
The embodiment provides a workflow execution method based on edge synchronous service, which is applied to an edge, wherein the edge comprises a synchronous service unit and at least one worker service unit, the current worker service unit corresponding to the workflow to be executed is determined in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed, then an execution instruction is sent to the current worker service unit through the synchronous service unit, the current worker service unit is controlled to run and generate an execution result corresponding to the execution instruction, if the communication connection between the edge and a cloud is not disconnected, the execution result is forwarded to the cloud through the synchronous service unit, next worker service unit information fed back by the cloud is obtained, if the communication connection between the edge and the cloud is disconnected, the next worker service unit information is queried through the synchronous service unit according to local template data, the current worker service unit information is updated to the next worker service unit information, and the execution step is returned: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected. According to the application, by combining the edge synchronization service and cloud edge cooperative technology, an edge synchronization service unit is introduced on the basis of a cloud workflow engine, the offline autonomy of the edge is realized by the workflow service scheduling function of the redundant cloud and the mode of local module data, and the scheduling of the workflow can be completed by the edge synchronization service unit under the condition of unstable network, thereby achieving both network stability and high performance.
Example two
Further, in another embodiment of the present application, the same or similar content as that of the first embodiment may be referred to the above description, and will not be repeated. On the basis, a workflow execution method based on the edge synchronization service is provided, and is applied to a cloud, wherein the cloud comprises a workflow engine and a data lake, and referring to fig. 3, the workflow execution method based on the edge synchronization service comprises the following steps:
Step F10, when an execution result sent by an edge end is received through the workflow engine, inquiring the information of a next worker service unit according to the workflow engine and the execution result;
Step F20, if the next worker service unit exists, transmitting information corresponding to the next worker service unit to the edge end through the workflow engine so that the synchronous service unit of the edge end can transmit an execution instruction to the next worker service unit;
and step F30, ending the workflow corresponding to the execution result if the next worker service unit does not exist.
In this embodiment, it should be noted that, when the network condition is stable, the trace stream engine in the cloud end may successfully receive an execution result forwarded by the synchronization service unit of the edge end, where the execution result may be execution success or execution failure; and inquiring information of a next worker service unit according to the execution result by the workflow engine, namely inquiring the next worker service unit corresponding to the execution result by the workflow engine according to a flow template corresponding to the execution result.
As an example, steps F10 to F30 include: when receiving an execution result corresponding to the worker service unit forwarded by the edge synchronization module through a TCP long-link mode through the workflow engine; querying a next worker service unit corresponding to a worker service unit corresponding to the execution result according to a flow template corresponding to the execution result by the workflow engine; if the next worker service unit is inquired, the workflow engine sends the relevant information corresponding to the worker service unit to the edge synchronization service unit so that the edge synchronization service unit sends an execution instruction to the next worker service unit; if the next worker service unit is not queried, determining that the workflow has been executed and ending the workflow.
Wherein before the step of querying the information of the next worker service unit according to the execution result when the execution result sent by the edge synchronization service unit is received, the method further comprises:
Step G10, acquiring a template creation instruction input by a user through a visualization tool through the workflow engine, and generating corresponding flow template data according to the template creation instruction through the workflow engine;
And step G20, storing the flow template data into a data lake through the workflow engine, and sending the flow template data to the edge through the workflow engine so that the edge synchronization service unit can call the corresponding flow template according to the flow template data and the received starting request.
In this embodiment, it should be noted that, the process of generating the corresponding flow template data includes receiving a template creation instruction input by a user through a visualization tool, then creating a standard BPMN (Business Process Modeling Notation, business process modeling and labeling) flow, and finally generating a file described by XML (eXtensible Markup Language ), that is, the flow template data; also included in the data lake is ELASTICSEARCH (search engine solution) for providing efficient query guarantees for querying massive template data as well as workflow instance data.
As an example, steps G10 to G20 include: acquiring a template creation instruction which is edited by a user through a visual template through the workflow engine, and creating a corresponding BPMN flow file through the workflow engine according to the template creation instruction; converting the standard BPMN process file into a corresponding XML file through the workflow engine, wherein the XML file is the process template data; storing the flow template data into a data lake through the workflow engine for calling at any time; and sending the flow template data to the synchronous service unit of the edge end through the workflow engine so that the synchronous service unit of the edge end can call the corresponding flow template according to the flow template data and the received starting request.
Wherein, after the step of querying the information of the next worker service unit according to the execution result when receiving the execution result sent by the edge synchronization service unit, the method further comprises:
step H10, storing workflow instance state data corresponding to the execution result into a data lake through the workflow engine;
And step H20, when the asynchronous workflow instance data sent by the edge synchronization service unit is received through the workflow engine, storing the asynchronous workflow instance data into the data lake through the workflow engine.
As an example, steps H10 to H20 include: writing the received workflow instance state data corresponding to the execution result into the data lake through the workflow engine; when the asynchronous workflow instance data sent by the edge synchronization service unit is received by the workflow engine, the asynchronous workflow instance data is written into the data lake by the workflow engine.
The embodiment of the application provides a workflow execution method based on edge synchronization service, which is applied to a cloud workflow engine, and firstly, when an execution result sent by an edge synchronization service unit is received through the workflow engine, the next worker service unit information is inquired through the workflow engine according to the execution result; if the next worker service unit exists, transmitting information corresponding to the next worker service unit to the edge synchronization service unit through the workflow engine so that the edge synchronization service unit can transmit an execution instruction to the next worker service unit; if the next worker service unit does not exist, the workflow is ended, and the workflow service is effectively scheduled based on the workflow engine of the cloud end, and the workflow instance data synchronized by the edge end are synchronized to a large-capacity data lake, so that the consistency of cloud edge data is ensured, and the workflow is effectively archived, so that the later inquiry of each workflow instance data is facilitated.
Example III
The embodiment of the application also provides a workflow execution device based on the edge synchronization service, which is applied to workflow execution equipment based on the edge synchronization service, and referring to fig. 4, the workflow execution device based on the edge synchronization service comprises:
The service determining module is used for determining the current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed;
The control operation module is used for sending an execution instruction to the current worker service unit through the synchronous service unit and controlling the current worker service unit to operate and generate an execution result corresponding to the execution instruction;
The cloud scheduling module is used for forwarding the execution result to the cloud through the synchronous service unit if the communication connection between the edge end and the cloud is not disconnected, and acquiring the next worker service unit information fed back by the cloud;
the offline scheduling module is used for inquiring information of a next worker service unit according to local module data through the synchronous service unit if communication connection between the edge end and the cloud end is disconnected;
The update circulation module is used for updating the current worker service unit information into the next worker service unit information, and returning to the execution step: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
Optionally, the service determining module is further configured to:
Acquiring a starting request corresponding to the workflow to be executed;
If the communication connection between the edge end and the cloud end is not disconnected, transmitting and forwarding the starting request to the cloud end through the synchronous service unit, and receiving starting worker service unit information corresponding to the workflow to be executed, which is fed back by the cloud end;
if the communication connection between the edge end and the cloud end is disconnected, inquiring starting worker service unit information corresponding to the workflow to be executed according to local template data through the synchronous service unit;
Updating the current worker service unit information to the starting worker service unit information.
Optionally, the control operation module is further configured to:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
sending a heartbeat message to the cloud workflow engine through the synchronous service unit and the connection channel every preset time period;
If the heartbeat message is successfully sent, the communication connection between the edge end and the cloud end is not disconnected;
If the heartbeat message is failed to be sent, the communication connection between the edge end and the cloud end is disconnected.
Optionally, the control operation module is further configured to:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
And detecting the communication connection between the cloud end and the edge end through heartbeat detection, and judging whether the communication connection between the cloud end and the edge end is disconnected or not.
Optionally, the control operation module is further configured to:
Storing workflow instance data corresponding to the execution result to a local database;
If the communication connection between the edge end and the cloud end is not disconnected, the identification of the workflow instance data is set to be synchronized;
and if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized.
Optionally, the control operation module is further configured to:
Screening the workflow instance data in the local database according to the identifiers corresponding to the workflow instance data by the timed task thread to obtain unsynchronized workflow instance data;
And when the connection between the cloud end and the edge end is not disconnected, synchronizing the unsynchronized workflow instance data to the cloud end according to a preset synchronization strategy, and setting the identification of the unsynchronized workflow instance data to be synchronized.
Optionally, the control operation module is further configured to:
the unsynchronized workflow instance data are read according to time sequence, and whether the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronous number is judged;
If the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or not;
And if the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or the number corresponding to the unsynchronized workflow instance data is larger than the preset synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization number.
Optionally, the control operation module is further configured to:
judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not;
if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud;
and if the number of the unsynchronized workflow instance data is not smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end in batches according to the preset single synchronization number.
Optionally, the offline scheduling module is further configured to:
And receiving the flow template data sent by the cloud, storing the flow template data into a local database, and generating the local template data.
The workflow execution device based on the edge synchronization service provided by the application adopts the workflow execution method based on the edge synchronization service in the embodiment, and solves the technical problem that the workflow execution method in the intelligent manufacturing field has network stability and high performance which cannot be both considered. Compared with the prior art, the workflow execution device based on the edge synchronization service provided by the embodiment of the application has the same beneficial effects as the workflow execution method based on the edge synchronization service provided by the embodiment, and other technical features in the workflow execution device based on the edge synchronization service are the same as the features disclosed in the method of the previous embodiment, and are not repeated herein.
Example IV
The embodiment of the application provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the workflow execution method based on the edge synchronization service in the first embodiment.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage means into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM and RAM are connected to each other via a bus. An input/output (I/O) interface is also connected to the bus.
In general, the following systems may be connected to the I/O interface: input devices including, for example, touch screens, touch pads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid Crystal Displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tape, hard disk, etc.; a communication device. The communication means may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
The electronic equipment provided by the application adopts the workflow execution method based on the edge synchronization service in the embodiment, and solves the technical problem that the workflow execution method in the intelligent manufacturing field cannot be compatible with network stability and high performance. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the application are the same as those of the workflow execution method based on the edge synchronization service provided by the first embodiment, and other technical features in the electronic device are the same as those disclosed by the method of the previous embodiment, so that details are not repeated.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Example five
The present embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon for performing the method of workflow execution based on edge synchronization services in the above embodiment one.
The computer readable storage medium according to the embodiments of the present application may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, the computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: determining a current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed; sending an execution instruction to the current worker service unit through the synchronous service unit, and controlling the current worker service unit to run to generate an execution result corresponding to the execution instruction; if the communication connection between the edge end and the cloud end is not disconnected, forwarding the execution result to the cloud end through the synchronous service unit, and acquiring next worker service unit information fed back by the cloud end; if the communication connection between the edge end and the cloud end is disconnected, inquiring information of a next worker service unit according to local module data through the synchronous service unit; updating the current worker service unit information to the next worker service unit information, and returning to the executing step: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium provided by the application stores the computer readable program instructions for executing the workflow execution method based on the edge synchronization service, and solves the technical problem that the workflow execution method in the intelligent manufacturing field has network stability and high performance which cannot be both considered. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the application are the same as the beneficial effects of the workflow execution method based on the edge synchronization service provided by the above embodiment, and are not described in detail herein.
Example six
The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a workflow execution method based on an edge synchronization service as described above.
The computer program product provided by the application solves the technical problem that the network stability and the high performance cannot be considered in the workflow execution method in the intelligent manufacturing field. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the application are the same as those of the workflow execution method based on the edge synchronization service provided by the above embodiment, and are not described in detail herein.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein, or any application, directly or indirectly, within the scope of the application.

Claims (10)

1. A workflow execution method based on an edge synchronization service, which is applied to an edge, wherein the edge comprises a synchronization service unit and at least one worker service unit, and the workflow execution method based on the edge synchronization service comprises the following steps:
determining a current worker service unit corresponding to the workflow to be executed in each worker service unit through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed;
sending an execution instruction to the current worker service unit through the synchronous service unit, and controlling the current worker service unit to run to generate an execution result corresponding to the execution instruction;
if the communication connection between the edge end and the cloud end is not disconnected, forwarding the execution result to the cloud end through the synchronous service unit, and acquiring next worker service unit information fed back by the cloud end;
If the communication connection between the edge end and the cloud end is disconnected, inquiring information of a next worker service unit according to local module data through the synchronous service unit;
Updating the current worker service unit information to the next worker service unit information, and returning to the executing step: and determining the current worker service unit corresponding to the workflow to be executed through the synchronous service unit according to the current worker service unit information corresponding to the workflow to be executed until the completion of the execution of the workflow to be executed is detected.
2. The workflow execution method based on the edge synchronization service according to claim 1, further comprising, before the step of determining, by the synchronization service unit, a current worker service unit corresponding to a workflow to be executed among the worker service units according to current worker service unit information corresponding to the workflow to be executed:
Acquiring a starting request corresponding to the workflow to be executed;
If the communication connection between the edge end and the cloud end is not disconnected, transmitting and forwarding the starting request to the cloud end through the synchronous service unit, and receiving starting worker service unit information corresponding to the workflow to be executed, which is fed back by the cloud end;
if the communication connection between the edge end and the cloud end is disconnected, inquiring starting worker service unit information corresponding to the workflow to be executed according to local template data through the synchronous service unit;
Updating the current worker service unit information to the starting worker service unit information.
3. The workflow execution method based on the edge synchronization service according to claim 1, further comprising, after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction:
sending a connection message to the cloud end through the synchronous service unit, and constructing a connection channel between the edge end and the cloud end;
And detecting the communication connection between the cloud end and the edge end through heartbeat detection, and judging whether the communication connection between the cloud end and the edge end is disconnected or not.
4. The workflow execution method based on the edge synchronization service according to claim 1, further comprising, after the step of sending an execution instruction to the current worker service unit through the synchronization service unit and controlling the current worker service unit to run and generate an execution result corresponding to the execution instruction:
Storing workflow instance data corresponding to the execution result to a local database;
If the communication connection between the edge end and the cloud end is not disconnected, the identification of the workflow instance data is set to be synchronized;
and if the communication connection between the edge end and the cloud end is disconnected, the identification of the workflow instance data is set to be unsynchronized.
5. The workflow execution method based on the edge synchronization service as claimed in claim 4, wherein after said identifying the workflow instance data as unsynchronized, further comprising:
Screening the workflow instance data in the local database according to the identifiers corresponding to the workflow instance data by the timed task thread to obtain unsynchronized workflow instance data;
And when the connection between the cloud end and the edge end is not disconnected, synchronizing the unsynchronized workflow instance data to the cloud end according to a preset synchronization strategy, and setting the identification of the unsynchronized workflow instance data to be synchronized.
6. The workflow execution method based on the edge synchronization service of claim 5, wherein the preset synchronization policy includes a preset synchronization number, a preset synchronization interval, and a preset single synchronization number, and synchronizing the unsynchronized workflow instance data to the cloud according to the preset synchronization policy includes:
the unsynchronized workflow instance data are read according to time sequence, and whether the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronous number is judged;
If the number corresponding to the unsynchronized workflow instance data is smaller than the preset synchronization number, judging whether the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or not;
And if the difference value between the last synchronization time and the current time is larger than the preset synchronization interval or the number corresponding to the unsynchronized workflow instance data is larger than the preset synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end according to the preset single synchronization number.
7. The workflow execution method based on the edge synchronization service as claimed in claim 6, wherein synchronizing the unsynchronized workflow instance data to the cloud according to the preset number of single syncs comprises:
judging whether the number of the unsynchronized workflow instance data is smaller than the preset single synchronization number or not;
if the number corresponding to the unsynchronized workflow instance data is smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud;
and if the number of the unsynchronized workflow instance data is not smaller than the preset single synchronization number, synchronizing the unsynchronized workflow instance data to the cloud end in batches according to the preset single synchronization number.
8. The workflow execution method based on the edge synchronization service as claimed in claim 1, further comprising, before the step of querying, by the synchronization service unit, information of a next worker service unit according to local template data if the communication connection between the edge and the cloud is broken:
And receiving the flow template data sent by the cloud, storing the flow template data into a local database, and generating the local template data.
9. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the edge synchronization service based workflow execution method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a program implementing a workflow execution method based on an edge synchronization service is stored, the program implementing the workflow execution method based on an edge synchronization service being executed by a processor to implement the steps of the workflow execution method based on an edge synchronization service according to any one of claims 1 to 7.
CN202211096021.9A 2022-09-08 2022-09-08 Workflow execution method based on edge synchronization service, electronic equipment and medium Active CN115580622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211096021.9A CN115580622B (en) 2022-09-08 2022-09-08 Workflow execution method based on edge synchronization service, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211096021.9A CN115580622B (en) 2022-09-08 2022-09-08 Workflow execution method based on edge synchronization service, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN115580622A CN115580622A (en) 2023-01-06
CN115580622B true CN115580622B (en) 2024-04-16

Family

ID=84581509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211096021.9A Active CN115580622B (en) 2022-09-08 2022-09-08 Workflow execution method based on edge synchronization service, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115580622B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177178A (en) * 2019-12-03 2020-05-19 腾讯科技(深圳)有限公司 Data processing method and related equipment
CN113992675A (en) * 2021-10-26 2022-01-28 云知声(上海)智能科技有限公司 IOT cloud platform and edge gateway cooperative work method, system and storage medium
CN114466029A (en) * 2022-03-10 2022-05-10 浪潮云信息技术股份公司 Cloud edge coordination system and method in edge cloud computing scene

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112967023B (en) * 2021-03-05 2023-01-24 北京百度网讯科技有限公司 Method, device, equipment, storage medium and program product for acquiring schedule information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177178A (en) * 2019-12-03 2020-05-19 腾讯科技(深圳)有限公司 Data processing method and related equipment
CN113992675A (en) * 2021-10-26 2022-01-28 云知声(上海)智能科技有限公司 IOT cloud platform and edge gateway cooperative work method, system and storage medium
CN114466029A (en) * 2022-03-10 2022-05-10 浪潮云信息技术股份公司 Cloud edge coordination system and method in edge cloud computing scene

Also Published As

Publication number Publication date
CN115580622A (en) 2023-01-06

Similar Documents

Publication Publication Date Title
CN108028856B (en) Method and apparatus for synchronizing file data between computer systems
WO2020134545A1 (en) Method for updating configuration, and related product
CN110413673B (en) Database data unified acquisition and distribution method and system
CN111309747A (en) Data synchronization method, system and device
CN112130475B (en) Equipment control method, device, terminal and storage medium
CN115114044B (en) Message pushing method, device, equipment and medium
CN111064626A (en) Configuration updating method, device, server and readable storage medium
CN115185705A (en) Message notification method, device, medium and equipment
CN114217921A (en) Distributed parallel computing method, computing device and storage medium
CN114513552B (en) Data processing method, device, equipment and storage medium
CN103975301A (en) Event service for local client applications through local server
CN115080101A (en) Application management method, application subscription method and related equipment
CN113037834A (en) Web page state updating method and device based on distributed instant push
CN115580622B (en) Workflow execution method based on edge synchronization service, electronic equipment and medium
CN111767176B (en) Method and device for remotely controlling terminal equipment
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN115454666A (en) Data synchronization method and device among message queue clusters
CN112839065A (en) Information processing method and device, first equipment and storage medium
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN114780263A (en) Service calling method, device, equipment and storage medium
CN113190624A (en) Asynchronous-to-synchronous calling method and device based on distributed cross-container
CN112799813A (en) Distributed job service scheduling method, distributed server and service terminal
CN111309367A (en) Method, device, medium and electronic equipment for managing service discovery
US20240152504A1 (en) Data interaction method, apparatus, and electronic device
CN114253520B (en) Interface code generation method and device

Legal Events

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