Control methods, devices and electronic equipment

By establishing workflow triggering relationships between edge and cloud devices, the problem of the inability of edge and cloud devices to trigger workflows to each other is solved, realizing cross-device workflow triggering and the autonomous capability of edge devices.

CN115309458BActive Publication Date: 2026-05-26LENOVO (BEIJING) LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2022-08-30
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The inability of edge and cloud devices to trigger workflows together creates challenges in executing collaborative workflows.

Method used

By establishing workflow triggering relationships between edge and cloud devices, triggering events are generated using event source listener objects and workflow triggering objects, and the triggering events are transmitted in the asynchronous data transmission system through data transmission identifiers to achieve cross-device workflow triggering.

Benefits of technology

It enables workflows to be triggered between edge and cloud devices, ensuring that edge devices can independently complete workflows and have autonomous capabilities, whether the network is normal or offline.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309458B_ABST
    Figure CN115309458B_ABST
Patent Text Reader

Abstract

This application discloses a control method, apparatus, and electronic device. The method is applied to a target device among a plurality of devices, wherein the target device is an edge device or a cloud device. The method includes: determining a workflow triggering relationship among the plurality of devices; acquiring a triggering event generated in the target device; and sending the triggering event to at least one triggered device among the plurality of devices according to the workflow triggering relationship, so that the triggered device triggers a workflow in the triggered device according to the triggering event.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of workflow technology, and more particularly to a control method, apparatus, and electronic device. Background Technology

[0002] A workflow is a process-oriented abstraction of a business logic. It contains multiple execution steps (tasks) and is defined and implemented by a workflow engine. Workflows can be executed on the edge or in the cloud.

[0003] However, workflows cannot be triggered between the edge and the cloud. Summary of the Invention

[0004] In view of the above, this application provides a control method, apparatus, and electronic device, as follows:

[0005] A control method applied to a target device among multiple devices, wherein the target device is an edge device or a cloud device, the method comprising:

[0006] Determine the workflow triggering relationships among the multiple devices;

[0007] Acquire the triggering events generated in the target device;

[0008] According to the workflow triggering relationship, the triggering event is sent to at least one of the multiple devices to be triggered, so that the triggered device triggers the workflow in the triggered device according to the triggering event.

[0009] Preferably, in the above method, the workflow triggering relationship is obtained in the following way:

[0010] The cloud device obtains the listening position parameters in the newly created event source listening object and the trigger position parameters in the newly created workflow trigger object; the event source listening component created by the event source listening object is used to listen to whether the corresponding event source generates the corresponding trigger event; the workflow trigger component created by the workflow trigger object is used to trigger the corresponding workflow engine component according to the trigger event, and the workflow engine component is used to execute the triggered workflow;

[0011] Based on the monitoring location parameters and the trigger location parameters, a workflow triggering relationship is generated.

[0012] In the above method, preferably, the workflow triggering relationship represents the correspondence between the event source monitoring object and the workflow triggering object, and the correspondence between the workflow triggering object and the triggered device among the multiple devices;

[0013] The event source listening component created by the event source listening object is used to listen for whether the corresponding event source generates a corresponding trigger event; the workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the trigger event, and the workflow engine component is used to execute the triggered workflow.

[0014] In the above method, preferably, the target device has an event source monitoring object, and the event source monitoring object corresponds to at least one event source; the event source monitoring object is sent to the target device by the cloud device;

[0015] The step of acquiring the triggering event generated in the target device includes:

[0016] The event source listening component created by the event source listening object listens to the event source corresponding to the event source listening object in order to obtain the triggering event generated on the target device, the triggering event including the listened request event.

[0017] Preferably, in the above method, sending the triggering event to at least one triggered device among the plurality of devices according to the workflow triggering relationship includes:

[0018] Based on the correspondence between the event source listening object and the workflow triggering object in the workflow triggering relationship, determine the target triggering object corresponding to the triggering event;

[0019] Based on the correspondence between the workflow triggering object and the triggered device among the multiple devices in the workflow triggering relationship, the triggered device where the target triggering object is located is determined;

[0020] The trigger event is sent to the triggered device where the target trigger object is located, so that the triggered device triggers the corresponding workflow according to the trigger event through the workflow triggering component created by the target trigger object.

[0021] The above method, preferably, involves sending the triggering event to at least one triggered device among the plurality of devices according to the workflow triggering relationship, including:

[0022] Using the data transmission identifier corresponding to the triggered device, the triggering event is sent to the triggered device corresponding to the triggering event. The data transmission identifier is sent by the cloud device to the triggered device and the target device.

[0023] In the above method, preferably, the step of sending the triggering event to the triggering device corresponding to the triggering event using the data transmission identifier corresponding to the triggered device includes:

[0024] Set the trigger event to the data transmission identifier corresponding to the triggered device;

[0025] The trigger event is sent to the messaging system so that the triggered device can obtain the trigger event from the messaging system based on its data transmission identifier.

[0026] Preferably, when the target device is an edge device, the method further includes the following steps before sending the triggering event to the messaging system:

[0027] Determine whether the data connection between the target device and the triggered device is in a normal state. In the normal state, the data connection is used to send the triggering event to the messaging system.

[0028] If the data connection is in the normal state, perform the following: send the triggering event to the messaging system;

[0029] If the data connection is not in the normal state, the trigger event is saved in the target device until the data connection is restored to the normal state, and then the trigger event saved in the target device is sent to the messaging system.

[0030] A control device is applied to a target device among multiple devices, the target device being an edge device or a cloud device, the device comprising:

[0031] A relationship determination unit is used to determine the workflow triggering relationship among the multiple devices;

[0032] Event acquisition unit, used to acquire triggering events generated in the target device;

[0033] An event sending unit is configured to send the triggering event to at least one of the multiple devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event.

[0034] An electronic device, which is a target device among a plurality of devices, wherein the target device is an edge device or a cloud device, and the target device includes:

[0035] A memory used to store computer programs and the data generated by the execution of said computer programs;

[0036] A processor is configured to execute the computer program to: determine a workflow triggering relationship among the plurality of devices; acquire a triggering event generated in the target device; and send the triggering event to at least one triggered device among the plurality of devices according to the workflow triggering relationship, so that the triggered device triggers a workflow in the triggered device according to the triggering event. Attached Figure Description

[0037] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 A flowchart of a control method provided in Embodiment 1 of this application;

[0039] Figure 2 This is a flowchart illustrating the process of obtaining workflow triggering relationships in this application embodiment;

[0040] Figure 3 This is a schematic diagram illustrating the transmission of triggering events in an embodiment of this application;

[0041] Figure 4 This is a schematic diagram of the structure of a control device provided in Embodiment 2 of this application;

[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this application;

[0043] Figure 6 This is a schematic diagram illustrating workflow triggering applicable to edge computing scenarios in this application. Detailed Implementation

[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] refer to Figure 1 The diagram shown is a flowchart illustrating the implementation of a control method according to Embodiment 1 of this application. This method can be applied to electronic devices capable of data processing. The electronic device can be a target device among multiple devices, and the target device can be an edge device or a cloud device. The technical solution in this embodiment is mainly used to implement workflow triggering between the edge and the cloud.

[0046] Specifically, the method in this embodiment may include the following steps:

[0047] Step 101: Determine the workflow triggering relationship between multiple devices.

[0048] The workflow triggering relationship exists in the form of a table, such as a relationship reference table. The relationship application table contains one or more records, and each record is a workflow triggering relationship. Each workflow triggering relationship corresponds to the event source listening component, the workflow triggering component, the workflow engine component, and the triggered device, thereby representing the triggering relationship between cloud devices or edge devices.

[0049] Specifically, the workflow triggering relationship represents the correspondence between the event source listener object and the workflow triggering object, as well as the correspondence between the workflow triggering object and the triggered devices among multiple devices. The event source listener object in the workflow triggering relationship corresponds to a cloud device or one or more edge devices, the workflow triggering object corresponds to a cloud device or one or more edge devices, and the triggered device is configured with the workflow engine component corresponding to the workflow engine object.

[0050] Among them, the event source listener component created by the event source listener object is used to listen for whether the corresponding event source generates the corresponding trigger event; the workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the trigger event, and the workflow engine component is used to execute the triggered workflow.

[0051] Step 102: Obtain the trigger events generated in the target device.

[0052] In one implementation, the target device has an event source listener object, which corresponds to at least one event source, such as a logging system or a monitoring system. The event source listener object is sent to the target device by a cloud device after its creation. Based on this, the target device can listen to the event source corresponding to the event source listener object through the event source listener component created by the event source listener object, thereby obtaining the triggered events generated on the target device. These triggered events include listened-upon request events, which are used to request corresponding processing to obtain the appropriate processing results.

[0053] Specifically, in this embodiment, the event source listening component on the target device can be used to monitor whether the corresponding event source generates a corresponding trigger event. For example, the Event Source component on the cloud device or edge device can be used to listen for abnormal log events of the logging system or abnormal monitoring events of the monitoring system.

[0054] Step 103: Based on the workflow triggering relationship, send the triggering event to at least one of the multiple devices being triggered, so that the triggered device can trigger the workflow in the triggered device according to the triggering event.

[0055] The workflow triggering relationship represents the triggering relationship between cloud devices or edge devices. Based on this, the triggering event is sent to the corresponding triggered device according to the workflow triggering relationship.

[0056] Specifically, the workflow triggering relationship represents the correspondence between the event source listening object and the workflow triggering object. Based on this, the triggering event is sent to the cloud device or edge device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, i.e. the triggered device. Thus, the workflow triggering component on the triggered device triggers the workflow engine component created by the corresponding workflow engine object, and the workflow engine component executes the workflow in the triggered device.

[0057] For example, a workflow triggering relationship can be represented by a record in a relationship reference table: EventSource -> Workflow Triggering Object Sensor -> Device ID (edgeids) of the cloud or edge device. Based on this, the EventSource component on the cloud or edge device listens for the corresponding event source to generate a triggering event. According to the record in the relationship reference table, this EventSource component corresponds to the Sensor component on the cloud or edge device, and the Sensor component on the cloud or edge device corresponds to the Workflow engine component (Workflow component) on the cloud or edge device. Therefore, in this embodiment, based on the record corresponding to the triggering event in the relationship reference table, the triggering event is sent to the Sensor component on the cloud or edge device corresponding to the EventSource component. The Sensor component triggers the Workflow engine component (Workflow component) on the cloud or edge device (edgeids) based on the triggering event. The Workflow component on the cloud or edge device then executes the triggered workflow corresponding to the triggering event.

[0058] As can be seen from the above technical solutions, in the control method provided in Embodiment 1 of this application, by determining the workflow triggering relationship between multiple devices, and then after obtaining the triggering event generated in the target device, the triggering event can be sent to at least one of the triggered devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event. It is evident that this embodiment achieves workflow triggering between the target device and the triggered device by establishing a workflow triggering relationship, and the target device and the triggered device are not limited to cloud devices or terminal devices, thereby enabling cloud devices and edge devices to trigger workflows to each other.

[0059] In one implementation, the workflow triggering relationship in this embodiment can be obtained in the following way, such as... Figure 2 As shown:

[0060] Step 201: The cloud device obtains the listening position parameters from the newly created event source listener object and the trigger position parameters from the newly created workflow trigger object.

[0061] The event source listener object and workflow trigger object are objects created by the user on cloud devices. Both the event source listener object and the workflow trigger object have a `runMode` parameter. `runMode` specifies the scope of the object, which can be a cluster of multiple edge devices, a group of multiple edge device clusters, or a cloud device. Specifically, `runMode` records the device identifier of the cloud device, the cluster identifier of the edge device, or the cluster group identifier of the edge device, indicating that the scope of the object is the cloud device or the edge device corresponding to the corresponding identifier.

[0062] Step 202: Generate workflow triggering relationships based on the listening position parameters and trigger position parameters.

[0063] In this embodiment, the listening location parameter represents the cloud device or edge device where the event source listening component created by the event source listening object resides, and the trigger location parameter represents the cloud device or edge device where the workflow trigger object created by the workflow trigger object resides. Based on this, this embodiment generates a correspondence between the event source listening object and the workflow trigger object, as well as a correspondence between the workflow trigger object and the triggered device (cloud device or edge device) among multiple devices, thereby generating a workflow trigger relationship.

[0064] For example, the Event Source object configured by the user contains a listening location parameter representing the cloud device, indicating that the Event Source component created by the Event Source object runs on the cloud device. The Sensor object contains a trigger location parameter representing the edge device, indicating that the Sensor component created by the Sensor object runs on the edge device. The Workflow component triggered by the Sensor component runs on the edge device. Based on this, a workflow triggering relationship is generated in this embodiment: Event Source object of the cloud device -> Sensor object of the edge device -> device identifier edgeids of the edge device.

[0065] Furthermore, after obtaining the newly created event source listener object on the cloud device, the listener position parameter in the event source listener object is deleted before the event source listener object is sent to the cloud device or edge device corresponding to the listener position parameter, so that the event source listener component created by the event source listener object can listen to whether the corresponding event source has generated the corresponding trigger event.

[0066] After the cloud device receives the newly created workflow trigger object, it deletes the trigger position parameter in the workflow trigger object and then sends the workflow trigger object to the cloud device or edge device corresponding to the trigger position parameter, so that the workflow trigger component created by the workflow trigger object triggers the workflow engine component according to the received trigger event.

[0067] In addition, after obtaining the newly created workflow engine object on the cloud device, the engine position parameter in the workflow engine object is deleted before the workflow engine object is sent to the cloud device or edge device corresponding to the engine position parameter, so that the workflow engine component created by the workflow engine object can execute the corresponding workflow.

[0068] In addition, the cloud device also checks whether the image and other data corresponding to the workflow have been synchronized to the edge device. If not, the cloud device performs an image synchronization task to send the image and other data corresponding to the workflow to the edge device.

[0069] It should be noted that after the workflow trigger relationship is generated on the cloud device, the workflow trigger relationship can be sent to each edge device. Thus, each edge device can obtain the workflow trigger relationship. Therefore, when the edge device is the target device, the trigger event can be sent to the triggered device among multiple devices, such as other edge devices or cloud devices, according to the workflow trigger relationship.

[0070] In a specific implementation, when the target device sends a trigger event to at least one of the triggered devices among multiple devices according to the workflow triggering relationship, it can be done in the following way:

[0071] First, based on the correspondence between the event source listening object and the workflow triggering object in the workflow triggering relationship, determine the target triggering object corresponding to the triggering event, that is, the workflow triggering object corresponding to the workflow triggering component of the event source listening component on the target device;

[0072] Next, based on the correspondence between the workflow triggering object and the triggered device among multiple devices in the workflow triggering relationship, determine the triggered device where the target triggering object is located; for example, based on the correspondence between the Sensor object and the device identifier of the cloud device or the device identifier edgeids of the edge device in the relationship reference table, determine the triggered device corresponding to the Sensor object;

[0073] Finally, the trigger event is sent to the triggered device where the target trigger object is located, so that the triggered device can trigger the corresponding workflow according to the trigger event through the workflow triggering component created by the target trigger object.

[0074] For example, the Sensor component created by the Senor object on the triggered device triggers its corresponding workflow engine component according to the triggering event. The workflow engine component can be a component running on the currently triggered device, or a component running on a cloud device or edge device. Based on this, the workflow engine component executes the corresponding workflow according to the triggering event.

[0075] In one implementation, when the target device sends a trigger event to at least one triggered device among multiple devices according to the workflow triggering relationship, it can be achieved in the following way:

[0076] Using the data transmission identifier corresponding to the triggered device, the triggering event is sent to the triggered device corresponding to the triggering event. Here, the data transmission identifier is sent from the cloud device to the triggered device and the target device.

[0077] The data transmission identifier corresponding to the triggered device indicates that the transmitted data belongs to the triggered device. The triggered device obtains the transmitted data. Thus, the target device can send the trigger event to the triggered device corresponding to the data transmission identifier through the data transmission identifier corresponding to the triggered device.

[0078] In other words, this embodiment achieves data transmission between multiple devices, including cloud devices and edge devices, through asynchronous data transmission. Specifically, the cloud device configures data transmission identifiers for both cloud devices and edge devices, allowing them to retrieve data sent by other devices based on their own data transmission identifiers.

[0079] Based on this, in this embodiment, the trigger event can first be set with a data transmission identifier corresponding to the triggered device to indicate that the trigger event belongs to the triggered device corresponding to the data transmission identifier; then, the trigger event is sent to the message system so that the triggered device can obtain the trigger event from the message system according to its data identifier.

[0080] like Figure 3 As shown, the NATS messaging system is configured for cloud devices and edge devices, thereby enabling asynchronous data transmission between cloud devices and edge devices, as well as between edge devices themselves, through the messaging system.

[0081] Based on this, taking edge device A as the target device and another edge device B as the triggered device, after the target device listens to the trigger event through the event source listening component, it sets the trigger event to the data transmission identifier topic-edge-B of the triggered device. For example, topic-cloud is the data transmission identifier for the cloud device, and topic-edge is the data transmission identifier for the edge device. Then, it sends the trigger event to the messaging system. Thus, the triggered devices (edge ​​devices) with the same topic-edge-B can read the trigger event from the messaging system according to their topic. The triggered device, through its workflow triggering component, stimulates the corresponding workflow engine component (located on the local edge device, other edge devices, or cloud devices) according to the received trigger event, and the workflow engine component executes the corresponding workflow. Similarly:

[0082] In one implementation, after the edge device, acting as the target device, detects a trigger event through the event source listening component, it sets the trigger event as the data transmission identifier topic-cloud of the cloud device being triggered. Then, it sends the trigger event to the messaging system. Thus, cloud devices with the same topic-cloud can read the trigger event from the messaging system according to their topic. The cloud device then uses its workflow triggering component to activate the corresponding workflow engine component (located on the local edge device, other edge devices, or cloud devices) according to the received trigger event, and the workflow engine component executes the corresponding workflow.

[0083] In another implementation, after the cloud device, acting as the target device, detects a trigger event through the event source listening component, it sets the trigger event as the data transmission identifier topic-edge of the edge device being triggered. Then, it sends the trigger event to the messaging system. Thus, edge devices with the same topic-edge can read the trigger event from the messaging system according to their topic. The edge device then uses its workflow triggering component to activate the corresponding workflow engine component (located on the local edge device, other edge devices, or the cloud device) according to the received trigger event, and the workflow engine component executes the corresponding workflow.

[0084] In another implementation, after the cloud device acting as the target device listens to the triggering event through the event source listening component, it sets the triggering event as the data transmission identifier topic-cloud of the cloud device being triggered. Then, it sends the triggering event to the messaging system. Thus, cloud devices with the same topic-cloud can read the triggering event from the messaging system according to their topic. The cloud device triggers the corresponding workflow engine component (located on the local edge device, other edge devices, or cloud devices) according to the received triggering event through its workflow triggering component, and the workflow engine component executes the corresponding workflow.

[0085] Based on the above implementation, when the target device is an edge device, before sending the trigger event to the messaging system, the target device can first determine whether the data connection between the target device and the triggered device is in a normal state. In a normal state, the data connection is used to send the trigger event to the messaging system. Therefore, if the data connection between the target device and the triggered device is in a normal state, the trigger event with the data transmission identifier of the triggered device can be directly sent to the messaging system, allowing the triggered device to retrieve the trigger event from the messaging system based on its own data transmission identifier, thus triggering the corresponding workflow. However, if the data connection between the target device and the triggered device is not in a normal state, the target device can store the trigger event with the data transmission identifier of the triggered device in the target device until the data connection between the target device and the triggered device is restored to a normal state. At this point, the target device sends the stored trigger event to the messaging system, allowing the triggered device to retrieve the accumulated and sent trigger event from the messaging system based on its own data transmission identifier, thus triggering the corresponding workflow.

[0086] The data connection between the target device and the triggered device may include: the data connection between the target device and the messaging system, and the data connection between the triggered device and the messaging system. Based on this, when the target device is an edge device, before sending the trigger event to the messaging system, the target device can first determine whether the data connection between the target device and the messaging system is normal. If the data connection between the target device and the messaging system is normal, the trigger event with the data transmission identifier of the triggered device can be directly sent to the messaging system. This allows the triggered device to obtain the trigger event from the messaging system based on its own data transmission identifier when the data connection with the messaging system is normal, thus triggering the corresponding workflow. If the data connection between the target device and the messaging system is not normal, the target device can save the trigger event with the data transmission identifier of the triggered device in the target device until the data connection between the target device and the messaging system is restored to normal. At this time, the target device will then send the trigger event saved on the target device to the messaging system. Thus, the triggered device can obtain the trigger event accumulated and sent by the target device from the messaging system based on its own data transmission identifier when the data connection with the messaging system is normal, thus triggering the corresponding workflow.

[0087] For example, the target device has two transmission modes: local mode and cloud mode. If the data connection between the target device and the messaging system is normal, the target device is in cloud mode. In this mode, the target device directly sends the trigger event to the messaging system, so that the triggered device can obtain the trigger event from the messaging system according to its own data transmission identifier when the data connection between the target device and the messaging system is normal, in order to trigger the corresponding workflow. If the data connection between the target device and the messaging system is not normal, the target device is in local mode. In this mode, the target device stores the trigger event in the target device until the data connection between the target device and the messaging system is restored to normal, and then sends the stored trigger event to the messaging system. Thus, the triggered device can obtain the trigger event accumulated and sent by the target device from the messaging system according to its own data transmission identifier when the data connection with the messaging system is normal, in order to trigger the corresponding workflow.

[0088] refer to Figure 4This is a schematic diagram of a control device provided in Embodiment 2 of this application. The device can be configured in an electronic device capable of data processing. This electronic device can be a target device among multiple devices, which can be an edge device or a cloud device. The technical solution in this embodiment is mainly used to implement workflow triggering between the edge and the cloud.

[0089] Specifically, the device in this embodiment may include the following units:

[0090] Relationship determination unit 401 is used to determine the workflow triggering relationship between the multiple devices;

[0091] Event acquisition unit 402 is used to acquire triggering events generated in the target device;

[0092] The event sending unit 403 is configured to send the triggering event to at least one of the multiple devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event.

[0093] As can be seen from the above technical solutions, in the control device provided in Embodiment 2 of this application, by determining the workflow triggering relationship between multiple devices, and then after obtaining the triggering event generated in the target device, the triggering event can be sent to at least one of the triggered devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event. It is evident that this embodiment achieves workflow triggering between the target device and the triggered device by establishing a workflow triggering relationship, and the target device and the triggered device are not limited to cloud devices or terminal devices, thereby enabling cloud devices and edge devices to trigger workflows to each other.

[0094] In one implementation, the workflow triggering relationship can be obtained by the cloud device in the following way: the cloud device obtains the listening position parameters in the newly created event source listening object and the trigger position parameters in the newly created workflow triggering object; the event source listening component created by the event source listening object is used to listen to whether the corresponding event source generates the corresponding triggering event; the workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the triggering event, and the workflow engine component is used to execute the triggered workflow; the workflow triggering relationship is generated according to the listening position parameters and the trigger position parameters.

[0095] In one implementation, the workflow triggering relationship represents the correspondence between the event source monitoring object and the workflow triggering object, and the correspondence between the workflow triggering object and the triggered device among the plurality of devices; wherein, the event source monitoring component created by the event source monitoring object is used to monitor whether the corresponding event source generates the corresponding triggering event; the workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the triggering event, and the workflow engine component is used to execute the triggered workflow.

[0096] In one implementation, the target device has an event source listening object, which corresponds to at least one event source; the event source listening object is sent to the target device by the cloud device.

[0097] Specifically, the event acquisition unit 402 is used to: listen to the event source corresponding to the event source listening object through the event source listening component created by the event source listening object, so as to obtain the triggering event generated on the target device, wherein the triggering event includes the listened request event.

[0098] In one implementation, the event sending unit 403 is specifically configured to: determine the target triggering object corresponding to the triggering event according to the correspondence between the event source listening object and the workflow triggering object in the workflow triggering relationship; determine the triggered device where the target triggering object is located according to the correspondence between the workflow triggering object and the triggered device among the multiple devices in the workflow triggering relationship; and send the triggering event to the triggered device where the target triggering object is located, so that the triggered device triggers the corresponding workflow according to the triggering event through the workflow triggering component created by the target triggering object.

[0099] In one implementation, the event sending unit 403 is specifically used to: send the triggering event to the triggering device corresponding to the triggering event using the data transmission identifier corresponding to the triggered device, wherein the data transmission identifier is sent by the cloud device to the triggered device and the target device.

[0100] In one implementation, when the event sending unit 403 sends the trigger event to the triggered device corresponding to the trigger event using the data transmission identifier corresponding to the triggered device, it is specifically configured to: set the data transmission identifier corresponding to the triggered device for the trigger event; and send the trigger event to the message system so that the triggered device can obtain the trigger event from the message system according to its data transmission identifier.

[0101] Based on the above implementation scheme, when the target device is an edge device, the event sending unit 403 is further configured to: determine whether the data connection between the target device and the triggered device is in a normal state before sending the trigger event to the message system; if the data connection is in the normal state, execute the step of: sending the trigger event to the message system; if the data connection is not in the normal state, save the trigger event in the target device until the data connection is restored to the normal state, and then send the trigger event saved in the target device to the message system.

[0102] It should be noted that the specific implementation of each unit in this embodiment can be referred to the corresponding content above, and will not be described in detail here.

[0103] refer to Figure 5 This is a schematic diagram of an electronic device provided in Embodiment 3 of this application. The electronic device can be a target device among multiple devices, which can be an edge device or a cloud device. The technical solution in this embodiment is mainly used to implement workflow triggering between the edge and the cloud.

[0104] Specifically, the electronic device in this embodiment may include the following structure:

[0105] Memory 501 is used to store computer programs and data generated by the execution of said computer programs;

[0106] The processor 502 is configured to execute the computer program to: determine the workflow triggering relationship among the plurality of devices; acquire a triggering event generated in the target device; and send the triggering event to at least one triggered device among the plurality of devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event.

[0107] As can be seen from the above technical solutions, in the electronic device provided in Embodiment 3 of this application, by determining the workflow triggering relationship between multiple devices, and then after obtaining the triggering event generated in the target device, the triggering event can be sent to at least one of the triggered devices according to the workflow triggering relationship, so that the triggered device triggers the workflow in the triggered device according to the triggering event. It is evident that this embodiment achieves workflow triggering between the target device and the triggered device by establishing a workflow triggering relationship, and the target device and the triggered device are not limited to cloud devices or terminal devices, thereby enabling cloud devices and edge devices to trigger workflows to each other.

[0108] Taking edge computing scenarios as an example, in this scenario, it is often necessary for the cloud and the edge to collaborate to complete a complex workflow, and the edge must be able to complete the edge workflow independently even when the network is disconnected, so as to realize the autonomous function of the edge workflow.

[0109] Therefore, in this embodiment, a cloud-edge channel topic (data transmission identifier) ​​is created for each edge node (i.e., edge device, which can be simply referred to as edge or node) as a communication channel between the cloud-edge Event Source controller and the cloud-edge Sensor controller. All Sensors that depend on the Event Source are retrieved, and when an event is triggered, the event is notified to the cloud-edge topic of all edges specified in the Sensor, and the workflow referenced by the Sensor is triggered.

[0110] Furthermore, this embodiment provides an edge workflow engine that supports edge autonomy: It uses promiscuous mode topics as communication channels between the edge (edge-end) sensor and the cloud-edge event source controller, as well as channels for cloud-edge task distribution and workflow status synchronization, thus achieving edge autonomy in the workflow (when the network is down, edge events are cached locally, and local workflows can still be directly triggered; when the network is down, the edge workflow continues to run, and status reports and other information are cached locally first, then automatically uploaded after network recovery). The promiscuous mode topics integrate the characteristics of both cloud and local modes. Local mode is used when processing local messages or when the network is down, while cloud mode is automatically switched when processing cloud-edge communication or when the network is connected (data connection restored to normal).

[0111] The specific plan is as follows:

[0112] like Figure 6 As shown, the following four components are added to the cloud-edge system:

[0113] 1. Cloud Hub, a cloud-based forwarding component: responsible for publishing workflows to the edge.

[0114] 2. Edge Agent component: responsible for subscribing to workflows published in the cloud and executing the workflows on the edge.

[0115] 3. Topic-manager component: It listens to all edge nodes registered in the cloud and the cloud itself, assigns a topic name to each edge and the cloud itself, writes it to the Event Source and Sensor controller of the edge workflow engine, and provides a basis for creating topics in Nats later.

[0116] 4. Topic-agent component: One of each edge runs and is responsible for receiving EventSource and Sensor objects sent from the cloud. These objects record the topics they use, so that the edge knows the mapping relationship between the edge and the topic.

[0117] In addition, this embodiment also modifies the NATS component in the cloud-edge system:

[0118] 1. Create topics for each edge, and allow each user to create their own topic.

[0119] 2. Detect the network status between the cloud and the edge, and between edges. If the network is down, the topic switches to local mode; if the network is connected, the topic mode switches to cloud mode. This ensures edge autonomy and cloud-edge communication capabilities.

[0120] Based on this, at least three processes can be implemented in this embodiment: a process where edge events trigger cloud workflows, a process where edge events trigger other edge workflows, and a process where cloud events trigger edge workflows. The following combines... Figure 6 Here is a brief explanation of the three processes mentioned above:

[0121] First, the cloud-based topic-manager listens to all edge nodes registered in the cloud registration component register-cloud, and creates a promiscuous mode topic for each edge node. The topic-agent is responsible for obtaining the topic corresponding to the edge from the topic-manager and configuring it in the Event Source controller and Sensor controller of the edge workflow engine.

[0122] In addition, when the cloud workflow engine listens for newly created Event Source objects, it removes the runMode field from the Event Source object and automatically synchronizes it to the workflow engine specified by runMode.

[0123] Furthermore, the cloud-based workflow engine monitors newly created Sensor objects. When a new object is created, it removes the `runMode` field from the Sensor object and the workflow objects it depends on, and then synchronizes the Sensor object to the workflow engine specified by its `runMode`. Simultaneously, it checks whether the workflow's dependent images are synchronized to the edge. If not, it automatically triggers an image synchronization task. At the same time, the cloud establishes an Event Source->Sensor->edgeids reference table (i.e., the workflow triggering relationship) and synchronizes it to all edge workflow engines.

[0124] Based on this, in this embodiment, the Event Source controllers (components) in the workflow engines of both the cloud and edge listen to all event sources defined by the Event Source objects within their respective engine domains. If an event is generated: first, based on the EventSource->sensor->edgeids reference table, the list of all Sensors and edge nodes referencing this Event Source is found; then, based on the edge node list, the list of topics to be forwarded to is obtained from the topic-agent; and the event is forwarded to all topics. If there is a problem with the cloud-edge network, promiscuous mode topics will automatically switch to local mode and cache events. Once the network is restored, they will automatically switch to cloud mode and send the events to the cloud.

[0125] For example, the Cloud Event Source component listens to cloud event sources. When it detects a cloud request event, if the workflow triggering component corresponding to the Cloud Event Source is located in the cloud, then the cloud triggers a local (cloud) workflow. This involves setting the cloud request event to the topic-cloud of the cloud device and sending the cloud request event to the messaging system NATS. The cloud workflow triggering component, Cloud Sensor, retrieves the cloud request event from NATS based on its own topic-cloud and sends the cloud request event to the cloud workflow engine component, Cloud Wordflow (also known as the workflow execution component), which then executes the corresponding workflow.

[0126] For example, when a Cloud Event Source listens to cloud event sources and detects a cloud request event, if the workflow triggering component corresponding to the Cloud Event Source is located at the edge, the cloud triggers the edge1 workflow. This involves setting the cloud request event to the topic-edge1 of edge1 and sending the cloud request event to the NATS messaging system. The workflow triggering component on edge1, the Edge Sensor controller, retrieves the cloud request event from the NATS based on its own topic-edge1 and sends the cloud request event to the edge1 workflow engine component, Edge Wordflow. Edge Wordflow executes the corresponding workflow and reports the execution result to the edge agent component, Edge Agent. The edge agent component then sets the execution result to the cloud topic-cloud and sends the execution result to the NATS, enabling the cloud to obtain the execution result from the NATS. In addition, Edge Wordflow can define shadow workflow templates and report them to the edge agent component Edge Agent. Edge1 sets the shadow workflow template to the cloud topic-cloud and then sends the shadow workflow template to NATS so that the cloud can obtain the shadow workflow template from NATS. The shadow workflow template is used to trigger the corresponding workflow in the cloud.

[0127] For example, the Edge Event Source on edge1 listens for edge event sources. When it detects an edge request event, if the workflow triggering component corresponding to the Edge Event Source is located on the edge, the edge triggers the local (edge-side) edge1 workflow. This involves setting the edge request event to edge1's topic-edge1 and sending the edge request event to the messaging system NATS. The workflow triggering component on edge1, the Edge Sensor controller, retrieves the edge request event from NATS based on its own topic-edge1 and sends it to the edge1 workflow engine component, EdgeWordflow. EdgeWordflow executes the corresponding workflow and reports the execution result to the edge agent component, EdgeAgent. The edge agent component sets the execution result to the cloud topic-cloud and then sends the execution result to NATS, so that the cloud can obtain the execution result from NATS.

[0128] For example, the Edge Event Source on edge1 listens for edge event sources. When it detects an edge request event, if the workflow triggering component corresponding to the Edge Event Source is in the cloud, then the edge triggers the cloud workflow. This means that the edge request event is set to the topic-cloud of the cloud device and sent to the messaging system NATS. The cloud workflow triggering component, Cloud Sensor, obtains the cloud request event from NATS based on its own topic-cloud and sends the cloud request event to the cloud workflow engine component, Cloud Wordflow (also known as the workflow execution component), which then executes the corresponding workflow.

[0129] For example, the Edge Event Source on edge1 listens for edge event sources. When it detects an edge request event, if the workflow triggering component corresponding to the Edge Event Source is located on another edge, edge2, then the edge triggers the edge2 workflow. This means setting the edge request event to the topic-edge2 of edge2 and sending the edge request event to the messaging system NATS. The workflow triggering component on edge2, the Edge Sensor Controller, retrieves the edge request event from NATS based on its own topic-edge2 and sends it to the edge2 workflow engine component, Edge Wordflow. Edge Wordflow executes the corresponding workflow and reports the execution result to the edge agent component, Edge Agent. The edge agent component sets the execution result to the cloud topic-cloud and then sends the execution result to NATS, so that the cloud can obtain the execution result from NATS.

[0130] It is evident that this application has the following advantages:

[0131] (1) Supports edge events to trigger cloud workflows, edge events to trigger other edge workflows, and cloud events to trigger edge workflows.

[0132] (2) Support autonomous edge workflows in the event of network outage.

[0133] (3) When communicating with the cloud edge, the data (events) can be cached in the event of network outage and automatically synchronized to the cloud after the network is connected.

[0134] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0135] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0136] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0137] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not 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

1. A control method applied to a target device among multiple devices, wherein the target device is an edge device or a cloud device, the method comprising: Determine the workflow triggering relationships among the multiple devices; The workflow triggering relationship represents the correspondence between the event source listening object and the workflow triggering object, and the correspondence between the workflow triggering object and the triggered device among the multiple devices, so as to represent the triggering relationship between cloud devices or edge devices; Acquire the triggering events generated in the target device; According to the workflow triggering relationship, the triggering event is sent to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, so that the workflow triggering component on the triggered device triggers the workflow engine component created by the corresponding workflow engine object to execute the workflow in the triggered device; The workflow triggering relationship is obtained in the following way: The cloud device obtains the listening position parameters from the newly created event source listening object and the trigger position parameters from the newly created workflow trigger object; the event source listening component created by the event source listening object is used to listen to whether the corresponding event source generates the corresponding trigger event; The workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the triggering event, and the workflow engine component is used to execute the triggered workflow. Based on the monitoring location parameters and the trigger location parameters, a workflow triggering relationship is generated.

2. The method according to claim 1, wherein the target device has an event source monitoring object, and the event source monitoring object corresponds to at least one event source; the event source monitoring object is sent to the target device by the cloud device; in, The acquisition of trigger events generated in the target device includes: The event source listening component created by the event source listening object listens to the event source corresponding to the event source listening object in order to obtain the triggering event generated on the target device, the triggering event including the listened request event.

3. The method according to claim 1, wherein sending the triggering event to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, according to the workflow triggering relationship, comprises: Based on the correspondence between the event source listening object and the workflow triggering object in the workflow triggering relationship, determine the target triggering object corresponding to the triggering event; Based on the correspondence between the workflow triggering object and the triggered device among the multiple devices in the workflow triggering relationship, the triggered device where the target triggering object is located is determined; The trigger event is sent to the triggered device where the target trigger object is located, so that the triggered device triggers the corresponding workflow according to the trigger event through the workflow triggering component created by the target trigger object.

4. The method according to claim 1, wherein the triggering event is sent to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, according to the workflow triggering relationship, comprising: Using the data transmission identifier corresponding to the triggered device, the triggering event is sent to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located. The data transmission identifier is sent by the cloud device to the triggered device and the target device.

5. The method according to claim 4, wherein sending the triggering event to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, using the data transmission identifier corresponding to the triggered device, comprises: Set the triggering event to the data transmission identifier corresponding to the triggered device; The trigger event is sent to the messaging system so that the triggered device can obtain the trigger event from the messaging system based on its data transmission identifier.

6. The method according to claim 5, wherein when the target device is an edge device, the method further comprises, before sending the triggering event to the messaging system: Determine whether the data connection between the target device and the triggered device is in a normal state. In the normal state, the data connection is used to send the triggering event to the messaging system. If the data connection is in the normal state, perform the following: send the triggering event to the messaging system; If the data connection is not in the normal state, the trigger event is saved in the target device until the data connection is restored to the normal state, and then the trigger event saved in the target device is sent to the messaging system.

7. A control device applied to a target device among a plurality of devices, said target device being an edge device or a cloud device, said device comprising: A relationship determination unit is used to determine the workflow triggering relationship among the multiple devices; The workflow triggering relationship represents the correspondence between the event source listening object and the workflow triggering object, and the correspondence between the workflow triggering object and the triggered device among the multiple devices, so as to represent the triggering relationship between cloud devices or edge devices; Event acquisition unit, used to acquire triggering events generated in the target device; An event sending unit is configured to send the triggering event to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, so that the workflow triggering component on the triggered device triggers the workflow engine component created by the corresponding workflow engine object to execute the workflow in the triggered device; The workflow triggering relationship is obtained in the following way: The cloud device obtains the listening position parameters from the newly created event source listening object and the trigger position parameters from the newly created workflow trigger object; the event source listening component created by the event source listening object is used to listen to whether the corresponding event source generates the corresponding trigger event; The workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the triggering event, and the workflow engine component is used to execute the triggered workflow. Based on the monitoring location parameters and the trigger location parameters, a workflow triggering relationship is generated.

8. An electronic device, which is a target device among a plurality of devices, said target device being an edge device or a cloud device, said target device comprising: A memory used to store computer programs and the data generated by the execution of said computer programs; A processor is configured to execute the computer program to: determine the workflow triggering relationship among the plurality of devices; the workflow triggering relationship characterizes the correspondence between the event source monitoring object and the workflow triggering object, and the correspondence between the workflow triggering object and the triggered device among the plurality of devices, so as to characterize the triggering relationship between cloud devices or edge devices; Acquire the triggering events generated in the target device; According to the workflow triggering relationship, the triggering event is sent to the triggered device where the workflow triggering component created by the corresponding workflow triggering object in the workflow triggering relationship is located, so that the workflow triggering component on the triggered device triggers the workflow engine component created by the corresponding workflow engine object to execute the workflow in the triggered device; The workflow triggering relationship is obtained in the following way: The cloud device obtains the listening position parameters from the newly created event source listening object and the trigger position parameters from the newly created workflow trigger object; the event source listening component created by the event source listening object is used to listen to whether the corresponding event source generates the corresponding trigger event; The workflow triggering component created by the workflow triggering object is used to trigger the corresponding workflow engine component according to the triggering event, and the workflow engine component is used to execute the triggered workflow. Based on the monitoring location parameters and the trigger location parameters, a workflow triggering relationship is generated.