CN115237477A - Control method and device and electronic equipment - Google Patents

Control method and device and electronic equipment Download PDF

Info

Publication number
CN115237477A
CN115237477A CN202211046407.9A CN202211046407A CN115237477A CN 115237477 A CN115237477 A CN 115237477A CN 202211046407 A CN202211046407 A CN 202211046407A CN 115237477 A CN115237477 A CN 115237477A
Authority
CN
China
Prior art keywords
workflow
template
cloud
execution
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211046407.9A
Other languages
Chinese (zh)
Inventor
贺超群
高云伟
杨玉模
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202211046407.9A priority Critical patent/CN115237477A/en
Publication of CN115237477A publication Critical patent/CN115237477A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3867Concurrent instruction execution, e.g. pipeline or look ahead using instruction pipelines
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a control method, a control device and electronic equipment, wherein the method comprises the following steps: the method comprises the steps that a cloud device obtains templates of multiple workflows, wherein the templates at least comprise position parameters, and the position parameters represent execution positions of the workflows; and under the condition that the execution position is represented by the position parameter and is an edge device, the cloud device sends the template of the workflow to the corresponding edge device according to the position parameter, so that the edge device executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud device.

Description

Control method and device and electronic equipment
Technical Field
The present application relates to the field of workflow technologies, and in particular, to a control method and apparatus, and an electronic device.
Background
Workflow (Workflow) is a process abstraction for business, and the Workflow includes a plurality of execution steps (execution tasks), and is defined and implemented by a Workflow engine. The workflow can be executed at the frontier side and also at the cloud side.
However, because the number of the edge terminals is large, the workflow templates required to be configured for the edge terminals are also various, and if the user performs template configuration on each edge terminal, higher work complexity is caused.
Disclosure of Invention
In view of this, the present application provides a control method, apparatus and electronic device, as follows:
a method of controlling, the method comprising:
the method comprises the steps that a cloud device obtains templates of a plurality of workflows, wherein the templates at least comprise position parameters, and the position parameters represent execution positions of the workflows;
and under the condition that the execution position is represented by the position parameter and is an edge device, the cloud device sends the template of the workflow to the corresponding edge device according to the position parameter, so that the edge device executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud device.
Preferably, in the method, before the cloud device sends the template of the workflow to the corresponding edge device according to the location parameter, the method further includes:
detecting the template of the workflow to obtain a detection result of the template;
and under the condition that the detection result represents that the template meets legal conditions, executing the following steps: and the cloud equipment sends the template of the workflow to corresponding edge equipment according to the position parameters.
In the above method, preferably, the template at least includes event source monitoring component information, workflow triggering component information, and workflow engine component information; the event source monitoring component information comprises a first position parameter, the workflow triggering component information comprises a second position parameter, and the workflow engine component information comprises a third position parameter;
wherein the legal conditions include:
at least one identical target position exists in the execution positions characterized by the first position parameter, the second position parameter and the third position parameter respectively.
Preferably, the method for sending the template of the workflow to the corresponding edge device by the cloud device according to the location parameter includes:
the cloud end equipment determines target edge end equipment corresponding to the position parameters;
the cloud device deletes the position parameter in the template of the workflow;
and the cloud equipment sends the template of the workflow to the target edge equipment.
In the above method, preferably, when the location parameter indicates that the execution location is an edge device, the method further includes:
and the cloud equipment sends the mirror image data corresponding to the template of the workflow to corresponding edge equipment according to the position parameters.
In the above method, preferably, the template includes event source monitoring component information, workflow triggering component information, workflow engine component information, and at least one execution step;
when the location parameter indicates that the execution location is a cloud device, the method further includes:
the event source monitoring component information is used for enabling an event source monitoring component to monitor whether a corresponding event source has a cloud request event, and under the condition that the cloud request event occurs, the cloud request event is obtained and sent to a workflow triggering component;
the workflow triggering component information is used for enabling the workflow triggering component to trigger a workflow engine component according to the cloud end request event;
the workflow engine component information is used for enabling the workflow engine component to create corresponding step objects for the execution steps, and the step objects at least have object identifications;
under the condition that the execution position of the step object is an edge device, sending object information corresponding to the step object to the edge device so that the edge device can obtain step operation data according to the object information;
acquiring step operation data sent by the edge device, wherein the step operation data comprises the object identifier;
and updating the step object corresponding to the object identification according to the step operation data.
In the above method, preferably, when the execution step is of an operation container type, the edge device creates a corresponding step object according to the object information and starts a container corresponding to the step object, so as to obtain step operation data output by the container;
under the condition that the execution step is a script type, the side-end equipment executes a corresponding script file according to the object information to obtain step operation data corresponding to the script;
under the condition that the execution step is of a workflow type, the edge terminal equipment creates step sub-objects for execution sub-steps in a template of a sub-workflow corresponding to the execution step and starts containers corresponding to the step sub-objects to obtain step operation data corresponding to the sub-workflow; and the template of the sub workflow is sent to the edge-side equipment by the cloud-side equipment.
In the above method, preferably, the object identifies a step object used for characterizing the step operation data belongs to in the workflow;
wherein, according to the step operation data, updating the step object corresponding to the object identifier includes:
according to the object identification, determining a corresponding target object in a step object corresponding to the workflow;
and updating the target object according to the step operation data.
A control apparatus configured on a cloud device, the apparatus comprising:
the system comprises a template obtaining unit, a workflow processing unit and a workflow processing unit, wherein the template obtaining unit is used for obtaining templates of a plurality of workflows, the templates at least comprise position parameters, and the position parameters represent execution positions of the workflows;
and the template sending unit is used for sending the template of the workflow to the corresponding edge equipment according to the position parameter under the condition that the execution position is represented by the position parameter and the edge equipment, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud equipment.
An electronic device, comprising:
a memory for storing a computer program and data generated by the execution of the computer program;
a processor for executing the computer program to implement: obtaining a plurality of templates of the workflow, wherein the templates at least comprise position parameters, and the position parameters represent the execution positions of the workflow; and under the condition that the execution position is represented by the position parameter, sending the template of the workflow to the corresponding edge equipment according to the position parameter, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud equipment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a control method according to an embodiment of the present disclosure;
fig. 2 is another flowchart of a control method according to an embodiment of the present application;
fig. 3 is a partial flowchart of a control method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a control device according to a second embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
fig. 6 is an exemplary diagram of processing a complex workflow between cloud edges according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Referring to fig. 1, a flowchart of an implementation of a control method provided in an embodiment of the present application is shown, where the method may be applied to a cloud device in a cloud computing environment, such as a cloud computer or a server. According to the technical scheme in the embodiment, the workflow template is configured and issued at the cloud end, so that the work complexity is reduced.
Specifically, the method in this embodiment may include the following steps:
step 101: templates for a plurality of workflows are obtained.
The template of the workflow at least comprises a position parameter, and the position parameter represents the execution position of the workflow. For example, a runcode (operation mode) parameter is added to a template configured by a worker, the runcode specifies a scope of the template where the runcode is located, and the scope may be a cluster formed by a plurality of edge devices, a cluster group formed by a plurality of edge clusters, or certainly may be a cloud device. Specifically, the runcode records a cluster identifier or a cluster group identifier to represent the scope of the template in which the runcode is located as the edge device corresponding to the corresponding identifier.
Step 102: and judging that the position parameter representation execution position is the edge device or the cloud device, and executing the step 103 under the condition that the position parameter representation execution position is the edge device.
Step 103: and sending the template of the workflow to corresponding edge equipment according to the position parameter, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the running data of the workflow to the cloud equipment.
And based on the scope of the template in which the position parameter represents, sending the template of the workflow to the edge equipment represented by the position parameter under the condition that the position of the execution of the position parameter representation is the edge equipment. For example, a template of the workflow is sent to a plurality of edge devices in the edge cluster corresponding to the cluster identification recorded in the runcode; for another example, the workflow template is sent to a plurality of edge devices in a plurality of edge clusters corresponding to the cluster group identification recorded in the runcode. Based on the workflow processing method, the edge end receiving the workflow template can execute the corresponding workflow according to the workflow template, and after the operation data of the workflow are obtained, the operation data are sent to the cloud end equipment.
In addition, the cloud device can also send the mirror image data corresponding to the template of the workflow to the corresponding edge device according to the position parameters.
According to the scheme, in the control method provided by the embodiment of the application, the template of the workflow containing the position parameters is obtained on the cloud equipment, the template can be issued to the corresponding edge-side equipment according to the execution positions represented by the position parameters on the cloud equipment, the operation data of the workflow sent by the edge-side equipment are received, and then the configuration work of the template on the edge-side equipment by a worker is not needed, so that the template can be uniformly configured on the cloud equipment, and the work complexity is reduced.
In one implementation, before step 103 in fig. 1, the method in this embodiment may further include the following steps, as shown in fig. 2:
step 104: and detecting the template of the workflow to obtain a detection result of the template.
Specifically, in this embodiment, whether the template of the workflow meets the legal condition is detected, the legal condition is a detection rule, and the legal condition is a condition that the template representing the workflow can normally run, so that the obtained detection result represents whether the template meets the legal condition.
Step 105: and judging whether the detection result represents that the template meets legal conditions or not, and executing the step 103 under the condition that the detection result represents that the template meets the legal conditions. If the detection result indicates that the template does not meet the legal condition, the template can be discarded or prompt information is output to prompt the modification of the template.
Specifically, the template at least includes event source monitoring component information, workflow triggering component information and workflow engine component information, the event source monitoring component information is used for enabling the event source monitoring component to monitor a corresponding event source to obtain a corresponding request event, the workflow triggering component depends on the event source monitoring component, when the event source monitoring component monitors that the request event occurs, the event source monitoring component sends the request event to the workflow triggering component depending on the event source monitoring component, the workflow triggering component excites the corresponding workflow engine component according to the received request event, the workflow engine component executes an execution step corresponding to the request event to obtain step operation data corresponding to each execution step, and the step operation data of each execution step constitutes operation data of the workflow.
The event source monitoring component information comprises a first position parameter, the workflow triggering component information comprises a second position parameter, and the workflow engine component information comprises a third position parameter. Based on this, the legal conditions are: at least one identical target position exists in the execution positions characterized by the first position parameter, the second position parameter and the third position parameter respectively. Specifically, the legal conditions may be: the device identifier corresponding to the second location parameter is all present in the device identifier corresponding to the first location parameter, and the device identifier corresponding to the second location parameter is all present in the device identifier corresponding to the third location parameter.
For example, the event source listening component information is configured with runcode, the workflow triggering component information is configured with runcode, the workflow engine component information is configured with runcode, and detecting whether the template satisfies the legal condition may specifically include the following operations:
detecting whether the identifiers of all the edge devices contained in the runMode information in the workflow trigger component information exist in the runMode in the event source monitoring component information corresponding to the event source monitoring component depended by the edge devices;
and, whether the identification of all the edge devices contained in the irunnode in the workflow trigger component information exists in the irunnode of the workflow engine component information corresponding to the workflow engine component which is activated by the edge devices is detected.
And if the two detection results are yes, the template is shown to meet the legal condition.
In one implementation, step 102 shown in FIG. 1 may be implemented as shown in FIG. 3 by:
step 301: and determining the target edge-end equipment corresponding to the position parameters.
For example, a plurality of target edge devices corresponding to the cluster identifier are determined through the cluster identifier recorded in the runcode; for another example, a plurality of target edge devices corresponding to a plurality of cluster identifiers corresponding to the cluster group identifier are determined through the cluster group identifier recorded in the rugmode; for another example, the target edge device corresponding to the edge identifier is determined by the edge device identifier recorded in the runcode.
Step 302: the location parameter in the template of the workflow is deleted.
For example, the runcode within each component in the template is deleted.
Step 303: and sending the template of the workflow to the target side-end equipment.
Further, after step 303, the cloud device may further send other resources, such as mirror image data, that the workflow depends on to the target edge device corresponding to the location parameter, so as to ensure normal execution of the workflow on the target edge device.
In one implementation, the template in the job includes at least one execution step in addition to the event source monitoring component information, the workflow triggering component information, and the workflow engine component information.
Based on this, in the case that it is determined in step 102 that the location parameter representation execution location is the cloud device, the following processing may be performed on the cloud device:
firstly, enabling an event source monitoring component to monitor whether a corresponding event source has a cloud request event or not by event source monitoring component information on cloud equipment, and acquiring the cloud request event and sending the cloud request event to a workflow triggering component depending on the event source monitoring component under the condition that the cloud request event occurs;
then, the workflow triggering component information enables the workflow triggering component to trigger the corresponding workflow engine component according to the cloud request component, and based on the workflow engine component information, the workflow engine component enables the workflow engine component to create a corresponding step object for an execution step in the template, and the step object at least has an object identifier;
under the condition that the execution position of the step object is the cloud device, a workflow engine component on the cloud device can start a container corresponding to the step object to obtain step operation data output by the container;
and under the condition that the execution position of the step object is the edge device, sending object information corresponding to the step object to the corresponding edge device, so that the edge device receiving the object information obtains step operation data according to the object information and sends the step operation data to the cloud device.
Specifically, the object identifier is used to represent a step object to which the step operation data belongs in the workflow, and based on this, in this embodiment, when the step object corresponding to the object identifier is updated according to the step operation data, the corresponding target object may be determined first according to the object identifier in the step object corresponding to the workflow, and then the target object may be updated according to the step operation data. As can be seen, in this embodiment, the object identifier capable of representing the execution step to which the step object belongs is set in the step object, so that after step operation data sent by the edge device is received, the corresponding step object can be updated according to the object identifier.
For example, an object identifier podid is added to the step object and is represented by uuid, so as to represent the step object and the execution step corresponding to the step object. Based on this, the object information transmitted by the cloud device to the edge device includes the uuid, and correspondingly, the step operation data returned by the edge device to the cloud device also includes the corresponding uuid, so that the step object to be updated, i.e., the target object, can be found on the cloud device according to the uuid, and the input variable, the output variable and the execution state of the target object are updated according to the step operation data.
It should be noted that, the above execution steps refer to atomic steps in a workflow, and the type of the atomic step may be an operation container type, a script type, or a workflow type, and based on this, in an embodiment where the execution position of the step object is an edge device:
under the condition that the execution step is a type of an operation container, the edge equipment creates a corresponding step object according to the object information and starts the container corresponding to the step object to obtain step operation data output by the container;
under the condition that the execution step is a script type, the side-end equipment executes a corresponding script file according to the object information to obtain step operation data corresponding to the script;
and under the condition that the execution step is a workflow type, the edge equipment creates step sub-objects for the execution sub-steps in the template of the sub-workflow corresponding to the execution step and starts containers corresponding to the step sub-objects to obtain step operation data corresponding to the sub-workflow.
Specifically, the sending manner of the template of the sub workflow may refer to the sending manner of the template of the workflow shown in fig. 1.
In addition, the execution position of the step object may also be a cloud device, and in an embodiment in which the execution position of the step object is the cloud device:
under the condition that the execution step is a container operation type, a workflow engine component on the cloud equipment starts a container corresponding to the step object to obtain step operation data output by the container;
under the condition that the execution step is a script type, executing a script file corresponding to the step object by a workflow engine component on the cloud equipment to obtain step operation data corresponding to the script;
and under the condition that the execution step is a workflow type, a workflow engine component on the cloud equipment creates step sub-objects for the execution sub-steps in the templates of the sub-workflows corresponding to the execution step and starts containers corresponding to the step sub-objects to obtain step operation data corresponding to the sub-workflows.
Referring to fig. 4, a schematic structural diagram of a control apparatus provided in the second embodiment of the present disclosure is shown, where the apparatus may be configured on a cloud device, such as a cloud computer or a server. According to the technical scheme in the embodiment, the workflow template is configured and issued at the cloud end, so that the work complexity is reduced.
Specifically, the apparatus in this embodiment may include the following structure:
a template obtaining unit 401, configured to obtain templates of multiple workflows, where the templates at least include a location parameter, and the location parameter represents an execution location of the workflow;
a template sending unit 402, configured to send the template of the workflow to the corresponding edge device according to the position parameter when the position parameter indicates that the execution position is the edge device, so that the edge device executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud device.
According to the above technical scheme, in the control device provided by the second embodiment of the application, through the template that obtains the workflow that includes the position parameter on the high in the clouds equipment, just can send the template to corresponding edge-side equipment and receive the operational data of the workflow that edge-side equipment sent according to the execution position of these position parameter representations on the high in the clouds equipment, and then need not the staff and go respectively to carry out the configuration work of template on the edge-side equipment, can unify the completion at high in the clouds equipment, reduce the work complexity from this.
In one implementation manner, before sending the template of the workflow to the corresponding edge device according to the location parameter, the template sending unit 402 is further configured to: detecting the template of the workflow to obtain a detection result of the template; and under the condition that the detection result represents that the template meets legal conditions, executing the following steps: and sending the template of the workflow to corresponding edge equipment according to the position parameters.
In an alternative scheme, the template at least comprises event source monitoring component information, workflow triggering component information and workflow engine component information; the event source monitoring component information comprises a first position parameter, the workflow triggering component information comprises a second position parameter, and the workflow engine component information comprises a third position parameter;
wherein the legal conditions include:
at least one identical target position exists in the execution positions characterized by the first position parameter, the second position parameter and the third position parameter respectively.
In one implementation manner, the template sending unit 402 is specifically configured to: determining target edge-end equipment corresponding to the position parameters; deleting the location parameter in a template of the workflow; and sending the template of the workflow to the target edge-end equipment.
In an implementation manner, in a case that the location parameter indicates that the execution location is an edge device, the template sending unit 402 is further configured to: and sending the mirror image data corresponding to the template of the workflow to corresponding edge-end equipment according to the position parameters.
In one implementation, the template includes event source listening component information, workflow triggering component information, workflow engine component information, and at least one execution step;
when the position parameter indicates that the execution position is a cloud device, the event source monitoring component information is used for enabling an event source monitoring component to monitor whether a corresponding event source has a cloud request event, and when the cloud request event occurs, the cloud request event is obtained and sent to a workflow triggering component; the workflow triggering component information is used for enabling the workflow triggering component to trigger a workflow engine component according to the cloud end request event; the workflow engine component information is used for enabling the workflow engine component to create corresponding step objects for the execution steps, and the step objects at least have object identifications; under the condition that the execution position of the step object is an edge device, sending object information corresponding to the step object to the edge device so that the edge device can obtain step operation data according to the object information; acquiring step operation data sent by the edge device, wherein the step operation data comprises the object identifier; and updating the step object corresponding to the object identification according to the step operation data.
In an alternative, when the executing step is a type of an operating container, the edge device creates a corresponding step object according to the object information and starts a container corresponding to the step object to obtain step operating data output by the container; under the condition that the execution step is a script type, the side-end equipment executes a corresponding script file according to the object information to obtain step operation data corresponding to the script; under the condition that the execution step is of a workflow type, the edge terminal equipment creates step sub-objects for execution sub-steps in a template of a sub-workflow corresponding to the execution step and starts containers corresponding to the step sub-objects to obtain step operation data corresponding to the sub-workflow; and the template of the sub workflow is sent to the edge-side equipment by the cloud-side equipment.
In the alternative, the object identification is used for characterizing the step object to which the step operation data belongs in the workflow; when the workflow engine component updates the step object corresponding to the object identifier according to the step operation data, the workflow engine component is specifically configured to: according to the object identification, determining a corresponding target object in the step object corresponding to the workflow; and updating the target object according to the step operation data.
It should be noted that, for specific implementation of each unit in the present embodiment, reference may be made to corresponding contents in the foregoing, and details are not described here.
Referring to fig. 5, a schematic structural diagram of an electronic device according to a third embodiment of the present application is shown, where the electronic device may be a cloud computer or a server. According to the technical scheme in the embodiment, the workflow template is configured and issued at the cloud end, so that the work complexity is reduced.
Specifically, the electronic device in this embodiment may include the following structure:
a memory 501 for storing a computer program and data generated by the computer program;
a processor 502 for executing the computer program to implement: obtaining a plurality of templates of the workflow, wherein the templates at least comprise position parameters, and the position parameters represent the execution positions of the workflow; and under the condition that the execution position is represented by the position parameter, sending the template of the workflow to the corresponding edge equipment according to the position parameter, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud equipment.
According to the scheme, in the electronic device provided by the third embodiment of the application, the template of the workflow including the position parameters is obtained on the cloud device, the template can be issued to the corresponding edge-side device according to the execution positions represented by the position parameters on the cloud device, the operation data of the workflow sent by the edge-side device are received, and then the configuration work of the template on the edge-side device by a worker is not needed, the template can be uniformly completed on the cloud device, and the work complexity is reduced.
The technical solution in the present application is illustrated below with reference to the architecture diagram in fig. 6:
firstly, independent event sources and workflow engines are respectively deployed on the cloud device and the edge device, but due to the fact that the number of the edges is large, the types of the edges are different, and the capabilities of the edges are different, a user cannot respectively define an event source template, a workflow engine template and a trigger template at the edges. The user expects that the edge terminals can be grouped at the cloud terminal, the event source template, the workflow engine template and the trigger template are uniformly defined at the cloud terminal, and the workflow engine automatically synchronizes the related objects to the proper edge terminals for grouping. Some workflows are complex and can comprise side terminal tasks, side terminal workflow tasks and the like, and users expect that cloud-side cooperative atomic operation which is easy to use can be achieved, and designated subtasks or subtasks can be executed while designated. When the edge executes the workflow or sub-workflows, the user expects to see the execution state of these (sub) workflows in real time at the cloud.
In view of this, in the present application, by automatically distributing an event source (i.e., event source monitoring component information), a trigger template (i.e., workflow trigger component information), and a workflow engine template (i.e., workflow engine component information) to a designated edge group, a cloud side uniformly defines a workflow; in addition, in the embodiment, cloud-edge cooperative atomic operations are provided, and through the atomic operations, a designated edge group can execute an individual task, and can also execute a sub workflow, so that a user does not need to implement a complex cloud-edge interaction flow; moreover, when the workflow starts to be executed and each step is executed, the working states of the sub-workflows are collected in real time when all the execution is finished, and the states are synchronized to the cloud workflow engine in real time through the cloud side channel, so that a user can conveniently observe all the workflow execution processes in real time.
Therefore, the working process is managed and controlled in a centralized manner at the cloud end, and the management cost is low; the using method is consistent with that of the traditional workflow engine, and the learning cost of the user is low; in addition, the complex workflow can be realized without knowing the complex cloud edge interaction details. The method specifically comprises the following scheme:
1. the cloud-edge adaptive workflow object synchronization process comprises the following steps:
(1) A user defines Event Source (Event Source monitoring component) information, sensor (Workflow trigger component) information and Workflow resource template (Workflow engine component) information in a Cloud (Cloud) and submits the information to a Cloud Workflow engine instance. Wherein the runcode is filled in when defining the template for specifying the scope of the template. The scope herein can be divided into two types of groups (clusters) and nodes (clusters), wherein a plurality of edge nodes (clusters) can form a group (cluster group).
(2) When the user submits the templates to the cloud workflow engine instance, the cloud workflow engine instance performs a validity detection process on a Sensor and the like, and the specific detection rules are as follows:
1. it is checked whether all edgeIDs contained in the runcode definition in the Sensor definition are present in the runcode of the Event Source to which it depends.
2. It is checked whether all runmodes in the Sensor definition contain edgeids present in the runmodes with which Workflow is stimulated.
If the two detection results exist, the detection is passed (namely, legal conditions are met), otherwise, an error prompt of illegally referencing the Event Source or Workflow is added in the state of the Sensor, and the process is ended.
(3) The cloud Workflow engine instance extracts the Sensor, the Event Source dependent on the Sensor and the Workflow object triggered by the Sensor from the cloud k8s (the position of the storage template), removes the contents related to the rugmode and sends the contents to the edge Workflow engine instance specified by the Sensor rugmode. As shown in fig. 6, the cloud forwarding component cloud hub sends each template to the corresponding Edge device Edge1 and Edge2 through the channels topic-req-1 and topic-req-2 established in the Message system Nats (Message bus), respectively. On edge1, the template is sent to the edge Workflow engine instance Workflow engine by the edge proxy component edge agent to execute Workflow.
(4) Meanwhile, the cloud Workflow engine finds out other resources such as images depended by Workflow, and actively synchronizes the resources such as the images to the edge Workflow engine instance specified by the Sensor rugmode.
(5) The frontend subscribes to the distribution message of the cloud through a corresponding channel in the Nats, namely: after receiving the Sensor, event Source and Workflow objects sent by the cloud, the frontend submits the objects to the Workflow engine instance of the frontend, and when a specified Event occurs, the frontend engine can automatically trigger the specified Workflow.
Based on this, the complex workflow processing flow between cloud edges is as follows:
(1) The user defines a Workflow template in the cloud, the template comprises a plurality of steps, some steps need to be executed by the cloud, some steps need to be executed by a certain script in a specified edge group, and some steps need to be executed by a sub Workflow (another independent Workflow template) in the edge group. And executing the edge end steps by using the predefined atomic operation, namely configuring which edge end groups are needed and executing what operation.
(2) When the atomic operation is executed, the edge cluster list of the tasks to be executed is found according to the input parameters, and the tasks and the metadata (such as the object information of the workflow step objects) of the tasks are sent to the workflow engine instances of the edge. If the task type is the sub-workflow, the definition of the sub-workflow template needs to be taken from the cloud workflow engine, and the workflow object is sent to the edge after the rugmode is removed.
(3) And after receiving the work tasks, the edge-end workflow engine executes different processes according to the types of the work tasks. The work task types include Job (Job Container), script (Script), workflow (Workflow), and the like.
If the work task is a sub Workflow, a Workflow object is created in a local engine of the edge end, and then parameters are prepared and input, and the Workflow is actively triggered to be executed, namely, the nested complex Workflow is executed.
If the work task is Job, then the apicerver of the edge k8s cluster is called to create and launch a Job.
If the work task is Script, then the shell or python Script is executed directly.
(4) After the execution of the side end task is finished, the side terminal workflow engine collects the execution result of the task and returns success or failure to the cloud end workflow. If the task is a sub-workflow, the artifects generated in the workflow execution process need to be returned to the cloud artifects library. And if the task is a job or a script, returning the standard output of the task to the cloud.
(5) And after the cloud workflow engine receives the results returned by the side end and sets the output state of the step, continuing to execute other steps.
The workflow execution state real-time collection process is as follows:
(1) An init container is triggered before each step of the workflow is executed, and a wait container is automatically triggered after the step is executed.
(2) When executing init container of the first step, if the atomic step executed by the edge is a workflow object, the cloud workflow engine is enabled to create a workerFlow object through the cloud edge channel. Establishing a synchronized frontier workflow object list in the frontier workflow engine, and determining whether the step is the first step of the workflow by judging whether the workflow exists in the list in the init container.
(3) And at the execution end of the wait container of each step, collecting the execution result of the step, and uploading the execution result to a cloud workflow engine.
(4) And after the cloud receives the state information of the step, updating the status state information of the cloud Workflow for the user to use.
(5) After the execution of the edge workflow is finished, triggering the exit handler registered in advance to collect other metadata (such as artists, execution duration and the like) of the workflow and synchronize the metadata to the cloud workflow engine.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of controlling, the method comprising:
the method comprises the steps that a cloud device obtains templates of multiple workflows, wherein the templates at least comprise position parameters, and the position parameters represent execution positions of the workflows;
and under the condition that the execution position is represented by the position parameter and is an edge device, the cloud device sends the template of the workflow to the corresponding edge device according to the position parameter, so that the edge device executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud device.
2. The method of claim 1, before the cloud device sends the template of the workflow to the corresponding edge device according to the location parameter, the method further comprising:
detecting the template of the workflow to obtain a detection result of the template;
and under the condition that the detection result represents that the template meets legal conditions, executing the following steps: and the cloud equipment sends the template of the workflow to corresponding edge equipment according to the position parameters.
3. The method of claim 2, the template containing at least event source listening component information, workflow trigger component information, and workflow engine component information; the event source monitoring component information comprises a first position parameter, the workflow triggering component information comprises a second position parameter, and the workflow engine component information comprises a third position parameter;
wherein the legal conditions include:
at least one identical target position exists in the execution positions characterized by the first position parameter, the second position parameter and the third position parameter respectively.
4. The method according to claim 1 or 2, wherein the cloud device sends the template of the workflow to the corresponding edge device according to the location parameter, and the method comprises:
the cloud end equipment determines target edge end equipment corresponding to the position parameters;
the cloud device deletes the position parameter in the template of the workflow;
and the cloud equipment sends the template of the workflow to the target edge equipment.
5. The method of claim 1 or 2, in the case where the location parameter characterizes the execution location as an edge device, the method further comprising:
and the cloud equipment sends the mirror image data corresponding to the template of the workflow to corresponding edge equipment according to the position parameters.
6. The method of claim 1 or 2, the template containing event source listening component information, workflow trigger component information, workflow engine component information and at least one execution step;
when the location parameter indicates that the execution location is a cloud device, the method further includes:
the event source monitoring component information is used for enabling an event source monitoring component to monitor whether a corresponding event source has a cloud request event, and under the condition that the cloud request event occurs, the cloud request event is obtained and sent to a workflow triggering component;
the workflow triggering component information is used for enabling the workflow triggering component to trigger a workflow engine component according to the cloud end request event;
the workflow engine component information is used for enabling the workflow engine component to create corresponding step objects for the execution steps, and the step objects at least have object identifications;
under the condition that the execution position of the step object is an edge device, sending object information corresponding to the step object to the edge device so that the edge device can obtain step operation data according to the object information;
acquiring step operation data sent by the edge-side equipment, wherein the step operation data comprises the object identifier;
and updating the step object corresponding to the object identification according to the step operation data.
7. The method according to claim 6, wherein when the execution step is a type of an operation container, the edge device creates a corresponding step object according to the object information and starts a container corresponding to the step object to obtain step operation data output by the container;
under the condition that the execution step is a script type, the side-end equipment executes a corresponding script file according to the object information to obtain step operation data corresponding to the script;
under the condition that the execution step is a workflow type, the edge device creates step sub-objects for the execution sub-steps in the sub-workflow template corresponding to the execution step and starts containers corresponding to the step sub-objects to obtain step operation data corresponding to the sub-workflow; and the template of the sub workflow is sent to the edge-side equipment by the cloud-side equipment.
8. The method of claim 6, the object identifying a step object for characterizing the step operational data to which belongs in the workflow;
wherein, according to the step operation data, updating the step object corresponding to the object identifier includes:
according to the object identification, determining a corresponding target object in the step object corresponding to the workflow;
and updating the target object according to the step operation data.
9. A control apparatus configured on a cloud device, the apparatus comprising:
the system comprises a template obtaining unit, a workflow processing unit and a workflow processing unit, wherein the template obtaining unit is used for obtaining templates of a plurality of workflows, the templates at least comprise position parameters, and the position parameters represent execution positions of the workflows;
and the template sending unit is used for sending the template of the workflow to the corresponding edge equipment according to the position parameter under the condition that the execution position is represented by the position parameter and the edge equipment, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud equipment.
10. An electronic device, comprising:
a memory for storing a computer program and data generated by the execution of the computer program;
a processor for executing the computer program to implement: obtaining a plurality of templates of the workflow, wherein the templates at least comprise position parameters, and the position parameters represent the execution positions of the workflow; and under the condition that the execution position is represented by the position parameter, sending the template of the workflow to the corresponding edge equipment according to the position parameter, so that the edge equipment executes the corresponding workflow according to the received template of the workflow and sends the operation data of the workflow to the cloud equipment.
CN202211046407.9A 2022-08-30 2022-08-30 Control method and device and electronic equipment Pending CN115237477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211046407.9A CN115237477A (en) 2022-08-30 2022-08-30 Control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211046407.9A CN115237477A (en) 2022-08-30 2022-08-30 Control method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115237477A true CN115237477A (en) 2022-10-25

Family

ID=83681613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211046407.9A Pending CN115237477A (en) 2022-08-30 2022-08-30 Control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115237477A (en)

Similar Documents

Publication Publication Date Title
US20050071209A1 (en) Binding a workflow engine to a data model
CN108572845B (en) Upgrading method of distributed micro-service cluster and related system
CN110890987A (en) Method, device, equipment and system for automatically creating cluster
CN107203464B (en) Method and device for positioning service problem
CN112698952A (en) Unified management method and device for computing resources, computer equipment and storage medium
CN113961332A (en) Method and device for realizing workflow engine, electronic equipment and storage medium
US12035156B2 (en) Communication method and apparatus for plurality of administrative domains
US20200310828A1 (en) Method, function manager and arrangement for handling function calls
CN111538712B (en) Log recording method, processing node, electronic equipment and storage medium
CN117389655A (en) Task execution method, device, equipment and storage medium in cloud native environment
CN109063040A (en) Client-side program collecting method and system
WO2024139011A1 (en) Information processing method
CN115237477A (en) Control method and device and electronic equipment
KR101556541B1 (en) Apparatus and method for complex event processing based high load path
CN109324892B (en) Distributed management method, distributed management system and device
US11216352B2 (en) Method for automatically analyzing bottleneck in real time and an apparatus for performing the method
CN110750362A (en) Method and apparatus for analyzing biological information, and storage medium
CN113220480B (en) Distributed data task cross-cloud scheduling system and method
CN110764882B (en) Distributed management method, distributed management system and device
CN117873691B (en) Data processing method, device, equipment and readable storage medium
CN110795220B (en) Task merging method and device and computer readable storage medium
CN112148348B (en) Task processing method, device and storage medium
JP2006172278A (en) Workflow system, its workflow management server and method for managing workflow
CN115220792A (en) Control method and electronic device
CN108062327B (en) Matching method and device for client

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