WO2023050410A1 - Workflow operation method and apparatus - Google Patents

Workflow operation method and apparatus Download PDF

Info

Publication number
WO2023050410A1
WO2023050410A1 PCT/CN2021/122423 CN2021122423W WO2023050410A1 WO 2023050410 A1 WO2023050410 A1 WO 2023050410A1 CN 2021122423 W CN2021122423 W CN 2021122423W WO 2023050410 A1 WO2023050410 A1 WO 2023050410A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
workflow
event
functional
functional function
Prior art date
Application number
PCT/CN2021/122423
Other languages
French (fr)
Chinese (zh)
Inventor
高永峰
高亮
Original Assignee
西门子股份公司
西门子(中国)有限公司
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 西门子股份公司, 西门子(中国)有限公司 filed Critical 西门子股份公司
Priority to CN202180102095.6A priority Critical patent/CN117940904A/en
Priority to PCT/CN2021/122423 priority patent/WO2023050410A1/en
Publication of WO2023050410A1 publication Critical patent/WO2023050410A1/en

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Definitions

  • the present application relates to the field of computer technology, and more specifically, to a workflow operation method and device.
  • the multiple edge devices may come from different vendors. Therefore, in addition to the need to develop and integrate heterogeneous systems of different devices, the above-mentioned problems will also be encountered during deployment, which not only wastes manpower but also reduces efficiency.
  • the present application provides a workflow operation method and device, which can effectively improve work efficiency on the basis of reducing manpower.
  • a workflow operation method which is characterized by comprising: the first device obtains the workflow, and the workflow is used to indicate at least one function function called by an event and the execution sequence of the at least one function function ; After the first device receives the first event, according to the workflow, determine the first function to be called by the first event, the event includes the first event, and the at least one function Including the first functional function; if the first device is the device where the first functional function is located, then the first device calls the first functional function; if the second device is the first functional function device, the first device routes the first event to the second device.
  • the entire workflow can be completed on the device, that is, the application can be processed through remote deployment without going to the site, which greatly reduces manpower.
  • the device completes the entire workflow according to the workflow used to indicate the at least one functional function invoked by the event and the execution sequence of the at least one functional function, which can effectively improve work efficiency.
  • the device can obtain the workflow, no matter which device the function is deployed on, the device can determine the function called by the event according to the workflow, even if the device is not the device where the function is located, the event can also be routed to the device where the function is located to call the function, so that the flexibility of the entire system can be improved.
  • the functional functions deployed on the first device are determined according to the resources of the first device, and the functional functions deployed on the second device are determined according to the resources of the second device If the resources of the first device are greater than the resources of the second device, more functional functions are deployed on the first device than on the second device.
  • the functional functions are deployed on the device according to the resources of the device. More functional functions are deployed on the device with more resources, and relatively fewer functional functions are deployed on the device with few resources, so that the rational allocation of resources and the allocation of resources can be realized. use efficiently. Further, deploying functional functions on devices according to device resources avoids the problem that a certain functional function must be deployed to a certain device, and improves the flexibility of deploying functional functions.
  • the method further includes: the first device receives feedback information sent by the second device, and the feedback information uses Feedback of an execution result of the first functional function executed by the second device.
  • the device where the function called by the event is located will feed back the result of executing the function to the device receiving the event after executing the function , so that the device receiving the event can continue to execute the next step, avoiding the invalid waiting time of the device receiving the event, and greatly reducing the time for executing the entire workflow.
  • the method further includes: the first device determines the device where the first functional function is located according to record information, and the record information is used to record each of the at least one functional function The device on which the function function resides.
  • the device receiving the event can accurately route the event to the device where the function called by the event is located by recording the recorded information of the device where each functional function is located.
  • the acquiring the workflow by the first device includes: receiving, by the first device, workflow scheduling information sent by a system, where the workflow scheduling information identifies the workflow.
  • the first device receiving the workflow scheduling information sent by the system includes: before the first device leaves the factory, the first device receives the workflow scheduling information sent by the system .
  • the workflow can be obtained before the device receiving the event leaves the factory. In this way, even if the device is disconnected from the central cluster, the workflow can still be executed, which greatly ensures the normal operation of the workflow.
  • the first event includes first information, and the first information is an input of the first functional function.
  • the first device and the second device are edge devices.
  • an apparatus for workflow operation including units for executing the method in the above first aspect or various implementations thereof.
  • a device for workflow operation including: a memory for storing programs; a processor for executing the programs stored in the memory, and when the programs stored in the memory are executed, the processing
  • the device is configured to execute the method in the above first aspect or its various implementation manners.
  • a computer-readable storage medium storing program code for execution by a device, where the program code includes instructions for executing the steps in the method in the above-mentioned first aspect or each implementation manner thereof.
  • Fig. 1 is a schematic diagram of a workflow operation method according to an embodiment of the present application.
  • Fig. 2 is a schematic diagram of a service mesh according to an embodiment of the present application.
  • Fig. 3 is a schematic diagram of step 1 in the flow of an event-triggered workflow according to an embodiment of the present application.
  • Fig. 4 is a schematic diagram of step 2 in the flow of an event-triggered workflow according to an embodiment of the present application.
  • Fig. 5 is a schematic diagram of step 3 in the flow of an event-triggered workflow according to an embodiment of the present application.
  • Fig. 6 is a schematic block diagram of an apparatus for workflow operation according to an embodiment of the present application.
  • Fig. 7 is a schematic block diagram of an apparatus for workflow operation according to an embodiment of the present application.
  • the first device acquires a workflow
  • the first device After the first device receives the first event, determine the first function to be called by the first event according to the workflow;
  • the first device If the first device is the device where the first function is located, the first device calls the first function
  • the first device routes the first event to the second device
  • control panel control panel
  • SC sidecar (sidecar);
  • serial numbers of the processes do not mean the order of execution, and the execution order of the processes should be determined by their functional functions and internal logic, and should not be used in the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the embodiment of the present application proposes a method for invoking a function, which can effectively improve work efficiency on the basis of reducing manpower.
  • FIG. 1 shows a schematic flowchart of a workflow operation method 100 according to an embodiment of the present application.
  • the method 100 may be executed by a first device.
  • the method 100 may include at least part of the following contents.
  • step 110 the first device obtains the workflow.
  • step 120 after the first device receives the first event, according to the workflow, determine the first function to be called by the first event.
  • step 130 if the first device is the device where the first function resides, the first device calls the first function.
  • step 140 if the second device is the device where the first function resides, the first device routes the first event to the second device.
  • the first device is different from the second device, and the first device and/or the second device may be an edge device.
  • An edge device can be a device that provides an entry point into an enterprise or service provider core network.
  • edge devices may include edge routers, routing switches, firewalls, multiplexers, and other wide area network (wide area network, WAN) devices.
  • wide area network wide area network
  • edge devices With the development of artificial intelligence and Internet of things (IoT) technology, edge devices generally have built-in processors with onboard analysis or artificial intelligence capabilities. These devices may include sensors, drivers, and IoT gateways.
  • first device and the second device may also be other devices except the edge device, which is not specifically limited in this embodiment of the present application.
  • the above functional functions may be, but not limited to, message queuing telemetry transport (message queuing telemetry transport, MQTT) protocol analysis functional functions, data processing functional functions, and the like.
  • message queuing telemetry transport messages queuing telemetry transport, MQTT
  • MQTT message queuing telemetry transport
  • a workflow may be used to indicate at least one functional function invoked by an event (event) of the workflow and an execution sequence of the at least one functional function. It can be seen that workflow can be used to orchestrate functional functions into coordinated microservice applications, that is, to combine functional functions and events into a coherent unit, and to describe the execution of functional functions and the information delivered in a prescribed manner.
  • FIG. 2 shows a schematic diagram of a possible network in the embodiment of the present application.
  • the workflow is: event 1 calls function 1, and after function 1 is executed, function 2 is called. After function function 2 is executed, event 2 calls function function 3.
  • event 1 may also call function function 3
  • event 2 may also call function function 1 and function function 2.
  • events and workflows can be defined by referring to the specification CloudEvents.
  • CloudEvents is a specification for describing event data in a common format to provide interoperability across services, platforms, and systems.
  • the definition of events and workflow can also refer to the cloud native computing foundation (cloud native computing foundation, CNCF) serverless workflow (serverless workflow).
  • Each function in the workflow can be driven by events from different sources, that is, the workflow in this embodiment of the present application is triggered by events.
  • an event can call one or more function functions. As shown in FIG. 2 , event 1 calls function function 1 and function function 2 , and event 2 calls function function 3 .
  • multiple events can call a single function.
  • workflows can be developer-created and pre-configured on the built system.
  • the system here may be, but not limited to, a function as a service (function as a service, FaaS) system.
  • FaaS function as a service
  • the FaaS system may include two parts, one of which is a function management module.
  • the functional function management module can be used to be responsible for the full life cycle management of functional functions, such as creation, release, update, destruction, etc.
  • the functional function management module can refer to the following actions to control the life cycle of the functional function:
  • the other part is the workflow management module, as shown in Figure 2, the workflow management module includes workflow.
  • the developer may first join the first device and/or the second device to the network.
  • the network may be a service mesh (service mesh).
  • the service mesh may include a control plane (control plane) and equipment.
  • control plane control plane
  • the control panel can also perform other actions, such as routing control management, function registration, function discovery, monitoring and traffic tracking.
  • developers can create functional functions according to business requirements, and configure the created functional functions on the functional function management module in the FaaS system.
  • the functional function management module can hot-deploy these functional functions to the device.
  • the functional function management module can hot-deploy these functional functions into containers (containers) on the device.
  • the functional function management module can hot-deploy these functional functions to different devices according to the resources of each device. That is, the functional functions deployed on the first device may be determined according to the resources of the first device, and similarly, the functional functions deployed on the second device may also be determined according to the resources of the second device.
  • the resources of the first device and the resources of the second device may be central processing unit (central processing unit, CPU) resources, gateway resources, etc. of the first device.
  • the resource of the first device may be the total resource of the first device, or may be a resource not used by the first device at the current moment.
  • the resources of the second device may also be the total resources of the second device or the resources not used by the second device at the current moment.
  • the service mesh can monitor the resource status of the first device and the second device. After the service mesh monitors the resource status of the first device and the resource status of the second device, it can control the function management module to deploy the function to the first device and the second device.
  • the function deployed on the device with more resources Functions can be more than functional functions deployed on devices with few resources.
  • the resource of device 1 is more than that of device 2
  • the functional functions deployed on device 1 are more than those deployed on device 2, that is, functional function 1 and functional function 2 are deployed on device 1
  • Function 2 is deployed on device 2.
  • function 2 and function 3 may also be deployed on device 1
  • function 1 may be deployed on device 2.
  • the embodiment of the present application does not specifically limit which device the function function is deployed on, as long as the number of function functions deployed on the device with more resources is greater than the number of function functions deployed on the device with fewer resources.
  • the functional functions are deployed on the device according to the resources of the device. More functional functions are deployed on the device with more resources, and relatively fewer functional functions are deployed on the device with few resources, so that the rational allocation of resources and the allocation of resources can be realized. use efficiently. Further, deploying functional functions on devices according to device resources avoids the problem that a certain functional function must be deployed to a certain device, and improves the flexibility of deploying functional functions.
  • the developer may determine it according to the input of the function function.
  • the event may include information, which is an input of a function called by the event.
  • a first event calls a first function
  • the first event includes first information
  • the first information is an input of the first function.
  • step 110 may specifically include: the first device receives workflow scheduling information sent by the FaaS system, where the workflow scheduling information identifies a workflow.
  • the FaaS system may send workflow scheduling information to the first device every preset time period.
  • the preset time period may be 5s. In this way, the probability that the first device obtains the workflow can be improved.
  • the first device may receive workflow scheduling information sent to it by the FaaS system.
  • the workflow can be obtained before the first device leaves the factory, so that even if the first device is disconnected from the central cluster, the workflow can still be executed, which greatly ensures the normal execution of the workflow.
  • the method 100 may further include: the first device determines the device where the first functional function is located according to the record information, where the record information is used to record the device where each functional function of the at least one functional function is located.
  • the functional function management module after the functional function management module deploys at least one functional function to different devices, the functional function management module sends record information to each device, so as to notify the device of the device where each functional function in the at least one functional function is located .
  • each device may include a sidecar, and the function management module may send record information to the sidecar, so that the sidecar of each device may record the functions deployed on each device.
  • the sidecar of device 1 may record function 1 and function 3 on device 1, and function 2 on device 2.
  • the first device After the first device receives the first event, if the first device determines that it is the device where the first function resides according to the recorded information, the first device may directly call the first function.
  • the first device may route the first event to the second device.
  • device 2 receives event 1, determines that event 1 invokes function 1 according to the workflow, and determines that function 1 is on device 1, therefore, device 2 routes event 1 to device 1, so that event 1 The functional function 1 is called, and the device 1 executes the functional function 1.
  • device 2 receives event 1 and device 2 routes event 1 to device 1, both of which are executed by the sidecar of the device. That is, the sidecar of device 2 receives event 1 and routes event 1 to the sidecar of device 1.
  • device 2 receiving event 1 and device 2 routing event 1 to device 1 may also be executed by other modules of the device, which is not specifically limited in this embodiment of the present application.
  • the second device may also send feedback information to the first device, where the feedback information is used to feed back an execution result of the second device executing the first function.
  • the second device may send feedback information to the first device during the process of executing the first function, such as sending a negative acknowledgment (negative acknowledgment, NACK), so that the first device knows that the second device is executing the first function.
  • NACK negative acknowledgment
  • the second device may send feedback information to the first device after executing the first function, such as sending an acknowledgment (acknowledgment, ACK), so that the first device knows that the second device has completed the execution of the first function.
  • ACK acknowledgment
  • the device where the function called by the event is located will feed back the result of executing the function to the device receiving the event after executing the function , so that the device receiving the event can continue to execute the next step, avoiding the invalid waiting time of the device receiving the event, and greatly reducing the time for executing the entire workflow.
  • Device 1 and Device 2 wait for an event to trigger.
  • event 1 invokes function 1 according to the workflow. Since function 1 is deployed on device 1, the sidecar routes event 1 to device 1 to invoke function 1.
  • device 1 After executing function 1, device 1 sends feedback information to the sidecar of device 2 through the sidecar, so that device 2 determines that device 1 has executed function 1.
  • the device 2 again determines to call the functional function 2 according to the workflow, and the functional function 2 is deployed on the device 2. Therefore, the device 2 directly calls the functional function 2.
  • the event 2 may trigger the workflow to call the functional function 3 . Therefore, after executing function 2, the system waits for event 2 to be triggered.
  • the sidecar in device 2 determines that event 2 calls function 3 according to the workflow. Since function 3 is deployed on device 1, the sidecar routes event 2 to device 1 to invoke function 3.
  • the container in device 1 can send feedback information to the sidecar of device 1. At this point, the workflow execution is complete.
  • the entire workflow can be completed on the device, that is, the application can be processed through remote deployment without going to the site, which greatly reduces manpower.
  • the device completes the entire workflow according to the workflow used to indicate the at least one functional function invoked by the event and the execution sequence of the at least one functional function, which can effectively improve work efficiency.
  • the device can obtain the workflow, no matter which device the function is deployed on, the device can determine the function called by the event according to the workflow, even if the device is not the device where the function is located, the event can also be routed to the device where the function is located to call the function, so that the flexibility of the entire system can be improved.
  • FIG. 6 shows a schematic block diagram of an apparatus 600 for workflow operation according to an embodiment of the present application.
  • the workflow operation apparatus 600 may execute the workflow operation method 100 in the embodiment of the present application, and the workflow operation apparatus 600 may be the first device in the aforementioned method.
  • the device 600 for the workflow operation includes:
  • An acquiring unit 610 configured to acquire workflow scheduling information, where the workflow scheduling information is used to indicate at least one functional function called by an event of the workflow and an execution order of the at least one functional function;
  • the determining unit 620 is configured to determine a first function to be called by the first event according to the workflow scheduling information after the first device receives the first event, the event of the workflow includes the a first event, said at least one functional function comprising said first functional function;
  • a calling unit 630 configured to call the first functional function if the first device is the device where the first functional function is located;
  • the routing unit 640 is configured to route the first event to the second device if the second device is the device where the first function resides.
  • the functional functions deployed on the first device are determined according to the resources of the first device, and the functional functions deployed on the second device are determined according to the second The resources of the device are determined.
  • the resources of the first device are greater than the resources of the second device, more functional functions are deployed on the first device than on the second device.
  • the apparatus 600 may further include: a communication unit configured to receive feedback information sent by the second device, so The feedback information is used to feed back an execution result of the second device executing the first function.
  • the determining unit 620 may be further configured to: determine the device where the first functional function is located according to the record information, where the record information is used to record each of the at least one functional function The device where the function is located.
  • the apparatus 600 may further include: a communication unit, configured to receive the workflow scheduling information sent by the system.
  • the communication unit is specifically configured to: receive the workflow scheduling information sent by the system before the first device leaves the factory.
  • the first event includes first information, and the first information is an input of the first functional function.
  • the first device and the second device are edge devices.
  • FIG. 7 is a schematic diagram of a hardware structure of an apparatus for workflow operation according to an embodiment of the present application.
  • the workflow operation apparatus 700 shown in FIG. 7 may be a first device, and the workflow operation apparatus 700 includes a memory 701 , a processor 702 , a communication interface 703 and a bus 704 .
  • the memory 701 , the processor 702 , and the communication interface 703 are connected to each other through a bus 704 .
  • the memory 701 may be a read-only memory (read-only memory, ROM), a static storage device and a random access memory (random access memory, RAM).
  • the memory 701 can store a program. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute each step of the workflow operation method of the embodiment of the present application.
  • the processor 702 may adopt a general-purpose CPU, a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits for executing related programs, In order to realize the functional functions to be executed by the units in the device of the embodiment of the present application, or execute the workflow operation method of the embodiment of the present application.
  • ASIC application specific integrated circuit
  • GPU graphics processing unit
  • the processor 702 may also be an integrated circuit chip, which has a signal processing capability.
  • each step of the workflow operation method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 702 or instructions in the form of software.
  • processor 702 can also be general-purpose processor, digital signal processor (digital signal processing, DSP), ASIC, off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC off-the-shelf programmable gate array
  • FPGA field programmable gate array
  • Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701, and combines its hardware to complete the functions required by the units included in the device of the embodiment of the present application, or execute the workflow operation of the embodiment of the present application method.
  • the communication interface 703 implements communication between the workflow operation apparatus 700 and other devices or communication networks by using a transceiver device such as but not limited to a transceiver.
  • the apparatus 700 may receive the feedback information sent by the second device through the communication interface 703 .
  • the bus 704 may include pathways for transferring information between various components of the apparatus 700 (eg, memory 701 , processor 702 , communication interface 703 ) for workflow operations.
  • workflow operation device 700 only shows a memory, a processor, and a communication interface
  • the workflow operation device 700 may also include other necessary devices.
  • the workflow operation apparatus 700 may also include hardware devices for implementing other additional functions.
  • the apparatus 700 for workflow operation may only include components necessary to realize the embodiment of the present application, and does not necessarily include all the components shown in FIG. 7 .
  • the embodiment of the present application also provides a computer-readable storage medium, which stores program code for execution by a device, and the program code includes instructions for executing the steps in the above-mentioned workflow operation method.
  • the embodiment of the present application also provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by the computer, the The computer executes the above-mentioned workflow operation method.
  • the above-mentioned computer-readable storage medium may be a transitory computer-readable storage medium, or a non-transitory computer-readable storage medium.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function function division.
  • multiple units or components can be combined Or it can be integrated into another system, or some features can be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the aspects, implementations, implementations or features of the described embodiments can be used alone or in any combination. Aspects of the described embodiments can be implemented by software, hardware or a combination of hardware and software.
  • the described embodiments may also be embodied by a computer-readable medium storing computer-readable code comprising instructions executable by at least one computing device.
  • the computer readable medium can be associated with any data storage device that can store data that can be read by a computer system.
  • Exemplary computer readable media may include read-only memory, random access memory, compact disc read-only memory (CD-ROM), hard disk drive (HDD), digital Video disc (digital video disc, DVD), magnetic tape, and optical data storage device, etc.
  • the computer readable medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.

Landscapes

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

Abstract

Embodiments of the present application provide a workflow operation method and apparatus, capable of effectively improving the work efficiency on the basis of reducing manpower. The method comprises: a first device obtains a workflow, the workflow being used for indicating at least one function invoked by an event and an execution sequence of the at least one function; after receiving a first event, the first device determines, according to the workflow, a first function to be invoked by the first event, the event comprising the first event, and the at least one function comprising the first function; if the first device is a device where the first function is located, the first device invokes the first function; and if a second device is a device where the first function is located, the first device routes the first event to the second device.

Description

工作流操作的方法和装置Method and apparatus for workflow operation 技术领域technical field
本申请涉及计算机技术领域,并且更为具体地,涉及一种工作流操作的方法和装置。The present application relates to the field of computer technology, and more specifically, to a workflow operation method and device.
背景技术Background technique
目前,在工程师需要对应用程序进行部署或运维时,一般需要花费大量的时间在现场通过数据线直连到设备等方式为不同设备进行解决方案的现场部署。如果对应用程序进行了修改,则需要重新部署应用程序,使得工程师又要重复之前复杂繁琐的流程。At present, when engineers need to deploy or operate and maintain applications, it generally takes a lot of time to deploy solutions for different devices on site by directly connecting them to devices through data cables. If the application is modified, the application needs to be redeployed, causing engineers to repeat the previous complicated and tedious process.
进一步地,如果需要跨多个边缘设备运行任务来完成一系列的业务流程,由于多个边缘设备可能来自不同的厂商。因此,除了需要对不同设备的异构系统进行开发和集成,在部署时也会遇到上述问题,不仅浪费人力而且效率较低。Furthermore, if tasks need to be run across multiple edge devices to complete a series of business processes, the multiple edge devices may come from different vendors. Therefore, in addition to the need to develop and integrate heterogeneous systems of different devices, the above-mentioned problems will also be encountered during deployment, which not only wastes manpower but also reduces efficiency.
发明内容Contents of the invention
本申请提供了一种工作流操作的方法和装置,能够在减少人力的基础上有效提高工作效率。The present application provides a workflow operation method and device, which can effectively improve work efficiency on the basis of reducing manpower.
第一方面,提供了一种工作流操作的方法,其特征在于,包括:第一设备获取工作流,所述工作流用于指示事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;在所述第一设备接收到第一事件后,根据所述工作流,确定所述第一事件待调用的第一功能函数,所述事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;若所述第一设备为所述第一功能函数所在的设备,则所述第一设备调用所述第一功能函数;若第二设备为所述第一功能函数所在的设备,则所述第一设备将所述第一事件路由到所述第二设备。According to the first aspect, there is provided a workflow operation method, which is characterized by comprising: the first device obtains the workflow, and the workflow is used to indicate at least one function function called by an event and the execution sequence of the at least one function function ; After the first device receives the first event, according to the workflow, determine the first function to be called by the first event, the event includes the first event, and the at least one function Including the first functional function; if the first device is the device where the first functional function is located, then the first device calls the first functional function; if the second device is the first functional function device, the first device routes the first event to the second device.
上述技术方案,通过在设备上部署功能函数,使得整个工作流可以在设 备上完成,即通过远程部署而不用去现场即可实现对应用程序的处理,极大地减少了人力。此外,设备根据用于指示事件调用的至少一个功能函数以及该至少一个功能函数的执行顺序的工作流,来完成整个工作流程,能够有效提高工作效率。In the above technical solution, by deploying functional functions on the device, the entire workflow can be completed on the device, that is, the application can be processed through remote deployment without going to the site, which greatly reduces manpower. In addition, the device completes the entire workflow according to the workflow used to indicate the at least one functional function invoked by the event and the execution sequence of the at least one functional function, which can effectively improve work efficiency.
进一步地,由于设备可以获取到工作流,这样不论功能函数部署到哪个设备上,设备都可以根据工作流确定事件调用的功能函数,即使该设备不是该功能函数所在的设备,也可以将事件路由到该功能函数所在的设备,以调用该功能函数,从而可以提高整个系统的灵活性。Furthermore, because the device can obtain the workflow, no matter which device the function is deployed on, the device can determine the function called by the event according to the workflow, even if the device is not the device where the function is located, the event can also be routed to the device where the function is located to call the function, so that the flexibility of the entire system can be improved.
在一些可能的实现方式中,所述第一设备上部署的功能函数是根据所述第一设备的资源确定的,所述第二设备上部署的功能函数是根据所述第二设备的资源确定的;若所述第一设备的资源大于所述第二设备的资源,则在所述第一设备上部署的功能函数多于在所述第二设备上部署的功能函数。In some possible implementation manners, the functional functions deployed on the first device are determined according to the resources of the first device, and the functional functions deployed on the second device are determined according to the resources of the second device If the resources of the first device are greater than the resources of the second device, more functional functions are deployed on the first device than on the second device.
上述技术方案,根据设备的资源在设备上部署功能函数,资源多的设备上部署的功能函数较多,资源少的设备上部署的功能函数相对较少,从而能够实现资源的合理分配和资源的有效利用。进一步地,根据设备的资源在设备上部署功能函数,避免了某个功能函数必须部署到某个设备的问题,提高了部署功能函数的灵活性。In the above technical solution, the functional functions are deployed on the device according to the resources of the device. More functional functions are deployed on the device with more resources, and relatively fewer functional functions are deployed on the device with few resources, so that the rational allocation of resources and the allocation of resources can be realized. use efficiently. Further, deploying functional functions on devices according to device resources avoids the problem that a certain functional function must be deployed to a certain device, and improves the flexibility of deploying functional functions.
在一些可能的实现方式中,若第二设备为所述第一功能函数所在的设备,所述方法还包括:所述第一设备接收所述第二设备发送的反馈信息,所述反馈信息用于反馈所述第二设备执行所述第一功能函数的执行结果。In some possible implementation manners, if the second device is the device where the first functional function is located, the method further includes: the first device receives feedback information sent by the second device, and the feedback information uses Feedback of an execution result of the first functional function executed by the second device.
上述技术方案,在接收事件的设备不是该事件调用的功能函数所在的设备的情况下,该事件调用的功能函数所在的设备在执行完该功能函数后向接收事件的设备反馈执行功能函数的结果,使得接收事件的设备能够继续执行下一个步骤,避免了接收事件的设备无效等待的时间,有利于大大减小执行整个工作流的时间。In the above technical solution, when the device receiving the event is not the device where the function called by the event is located, the device where the function called by the event is located will feed back the result of executing the function to the device receiving the event after executing the function , so that the device receiving the event can continue to execute the next step, avoiding the invalid waiting time of the device receiving the event, and greatly reducing the time for executing the entire workflow.
在一些可能的实现方式中,所述方法还包括:所述第一设备根据记录信息,确定所述第一功能函数所在的设备,所述记录信息用于记录所述至少一个功能函数中每个功能函数所在的设备。In some possible implementation manners, the method further includes: the first device determines the device where the first functional function is located according to record information, and the record information is used to record each of the at least one functional function The device on which the function function resides.
上述技术方案,接收事件的设备通过记录的每个功能函数所在的设备的记录信息,可以准确地将事件路由到该事件调用的功能函数所在的设备。In the above technical solution, the device receiving the event can accurately route the event to the device where the function called by the event is located by recording the recorded information of the device where each functional function is located.
在一些可能的实现方式中,所述第一设备获取工作流,包括:所述第一设备接收系统发送的工作流调度信息,所述工作流调度信息标识出所述工作流。In some possible implementation manners, the acquiring the workflow by the first device includes: receiving, by the first device, workflow scheduling information sent by a system, where the workflow scheduling information identifies the workflow.
在一些可能的实现方式中,所述第一设备接收系统发送的工作流调度信息,包括:在所述第一设备出厂前,所述第一设备接收所述系统发送的所述工作流调度信息。In some possible implementation manners, the first device receiving the workflow scheduling information sent by the system includes: before the first device leaves the factory, the first device receives the workflow scheduling information sent by the system .
上述技术方案,在接收事件的设备出厂之前即可获取到工作流,这样,即使该设备与中央集群断开连接仍然可以执行工作流,极大地保证了工作流的正常运行。In the above technical solution, the workflow can be obtained before the device receiving the event leaves the factory. In this way, even if the device is disconnected from the central cluster, the workflow can still be executed, which greatly ensures the normal operation of the workflow.
在一些可能的实现方式中,所述第一事件包括第一信息,所述第一信息为所述第一功能函数的输入。In some possible implementation manners, the first event includes first information, and the first information is an input of the first functional function.
在一些可能的实现方式中,所述第一设备和所述第二设备为边缘设备。In some possible implementation manners, the first device and the second device are edge devices.
第二方面,提供了一种工作流操作的装置,包括用于执行上述第一方面或其各实现方式中的方法的各单元。In a second aspect, an apparatus for workflow operation is provided, including units for executing the method in the above first aspect or various implementations thereof.
第三方面,提供了一种工作流操作的装置,包括:存储器,用于存储程序;处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行上述第一方面或其各实现方式中的方法。In a third aspect, a device for workflow operation is provided, including: a memory for storing programs; a processor for executing the programs stored in the memory, and when the programs stored in the memory are executed, the processing The device is configured to execute the method in the above first aspect or its various implementation manners.
第四方面,提供了一种计算机可读存储介质,存储用于设备执行的程序代码,所述程序代码包括用于执行上述第一方面或其各实现方式中的方法中的步骤的指令。In a fourth aspect, a computer-readable storage medium is provided, storing program code for execution by a device, where the program code includes instructions for executing the steps in the method in the above-mentioned first aspect or each implementation manner thereof.
附图说明Description of drawings
图1是本申请实施例的工作流操作的方法的示意性图。Fig. 1 is a schematic diagram of a workflow operation method according to an embodiment of the present application.
图2是本申请实施例的一种service mesh的示意性图。Fig. 2 is a schematic diagram of a service mesh according to an embodiment of the present application.
图3是本申请实施例的一种事件触发工作流的流程中步骤1的示意性图。Fig. 3 is a schematic diagram of step 1 in the flow of an event-triggered workflow according to an embodiment of the present application.
图4是本申请实施例的一种事件触发工作流的流程中步骤2的示意性图。Fig. 4 is a schematic diagram of step 2 in the flow of an event-triggered workflow according to an embodiment of the present application.
图5是本申请实施例的一种事件触发工作流的流程中步骤3的示意性图。Fig. 5 is a schematic diagram of step 3 in the flow of an event-triggered workflow according to an embodiment of the present application.
图6是本申请实施例的工作流操作的装置的示意性框图。Fig. 6 is a schematic block diagram of an apparatus for workflow operation according to an embodiment of the present application.
图7是本申请实施例的工作流操作的装置的示意性框图。Fig. 7 is a schematic block diagram of an apparatus for workflow operation according to an embodiment of the present application.
附图标记列表:List of reference signs:
100,本申请实施例的工作流操作的方法100. The workflow operation method of the embodiment of the present application
110,第一设备获取工作流;110. The first device acquires a workflow;
120,在第一设备接收到第一事件后,根据工作流,确定第一事件待调用的第一功能函数;120. After the first device receives the first event, determine the first function to be called by the first event according to the workflow;
130,若第一设备为第一功能函数所在的设备,则第一设备调用第一功能函数;130. If the first device is the device where the first function is located, the first device calls the first function;
140,若第二设备为,第一功能函数所在的设备,则第一设备将第一事件路由到第二设备;140. If the second device is the device where the first function resides, the first device routes the first event to the second device;
CP,控制面板(control plane);CP, control panel (control plane);
F1,功能函数1;F1, function function 1;
F2,功能函数2;F2, function function 2;
F3,功能函数3;F3, function function 3;
S,开始;S, start;
S1-S3,步骤1-3;S1-S3, steps 1-3;
E,结束;E, end;
e1,事件1;e1, event 1;
e2,事件2;e2, event 2;
D1,设备1;D1, device 1;
D2,设备2;D2, device 2;
C,容器(container);C, container (container);
SC,边车(sidecar);SC, sidecar (sidecar);
600,工作流操作的装置;600. A device for workflow operation;
610,获取单元;610. Acquire a unit;
620,确定单元;620. Determine the unit;
630,调用单元;630, call the unit;
640,路由单元;640, a routing unit;
700,工作流操作的装置;700. A device for workflow operation;
701,存储器;701, memory;
702,处理器;702, a processor;
703,通信接口;703, communication interface;
704,总线。704, bus.
具体实施方式Detailed ways
下面结合附图,对本申请实施例中的技术方案进行描述。应理解,本说明书中的具体的例子只是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围。The technical solutions in the embodiments of the present application are described below with reference to the accompanying drawings. It should be understood that the specific examples in this specification are only to help those skilled in the art better understand the embodiments of the present application, rather than limiting the scope of the embodiments of the present application.
应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能函数和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in various embodiments of the present application, the serial numbers of the processes do not mean the order of execution, and the execution order of the processes should be determined by their functional functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.
还应理解,本说明书中描述的各种实施方式,既可以单独实施,也可以组合实施,本申请实施例对此不作限定。It should also be understood that the various implementation manners described in this specification can be implemented alone or in combination, which is not limited in this embodiment of the present application.
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请的范围。Unless otherwise specified, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments, and are not intended to limit the scope of the present application.
目前,在工程师需要对应用程序进行部署或运维时,一般需要花费大量的时间在现场通过数据线直连到设备等方式为不同设备进行解决方案的现场部署。如果对应用程序进行了修改,则需要重新部署应用程序,使得工程师又要重复之前复杂繁琐的流程。At present, when engineers need to deploy or operate and maintain applications, it generally takes a lot of time to deploy solutions for different devices on site by directly connecting them to devices through data cables. If the application is modified, the application needs to be redeployed, causing engineers to repeat the previous complicated and tedious process.
进一步地,如果需要跨多个边缘设备运行任务来完成一系列的业务流程,由于多个边缘设备可能来自不同的厂商。因此,除了需要大量的精力去处理异构系统的开发、通信、调试和集成,在部署时也会遇到上述问题,不仅浪费人力而且效率较低。Furthermore, if tasks need to be run across multiple edge devices to complete a series of business processes, the multiple edge devices may come from different vendors. Therefore, in addition to requiring a lot of energy to deal with the development, communication, debugging, and integration of heterogeneous systems, the above-mentioned problems will also be encountered during deployment, which not only wastes manpower but also reduces efficiency.
鉴于此,本申请实施例提出了一种功能函数(function)调用的方法,能够在减少人力的基础上有效提高工作效率。In view of this, the embodiment of the present application proposes a method for invoking a function, which can effectively improve work efficiency on the basis of reducing manpower.
图1示出了本申请实施例的工作流操作的方法100的示意性流程图。方法100可以由第一设备执行。如图1所示,方法100可以包括以下内容中的至少部分内容。FIG. 1 shows a schematic flowchart of a workflow operation method 100 according to an embodiment of the present application. The method 100 may be executed by a first device. As shown in FIG. 1 , the method 100 may include at least part of the following contents.
在步骤110中,第一设备获取工作流。In step 110, the first device obtains the workflow.
在步骤120中,在第一设备接收到第一事件后,根据工作流,确定第一 事件待调用的第一功能函数。In step 120, after the first device receives the first event, according to the workflow, determine the first function to be called by the first event.
在步骤130中,若第一设备为第一功能函数所在的设备,则第一设备调用第一功能函数。In step 130, if the first device is the device where the first function resides, the first device calls the first function.
在步骤140中,若第二设备为第一功能函数所在的设备,则第一设备将第一事件路由到第二设备。In step 140, if the second device is the device where the first function resides, the first device routes the first event to the second device.
其中,第一设备不同于第二设备,第一设备和/或第二设备可以是边缘设备。边缘设备可以是向企业或服务提供商核心网络提供入口点的设备。例如,边缘设备可以包括边缘路由器、路由交换机、防火墙、多路复用器和其他广域网(wide area network,WAN)设备。随着人工智能和物联网(internet of things,IoT)技术的发展,边缘设备一般还有内置的处理器,具有板载分析或人工智能能力,这些设备可能包括传感器、驱动器和物联网网关等。Wherein, the first device is different from the second device, and the first device and/or the second device may be an edge device. An edge device can be a device that provides an entry point into an enterprise or service provider core network. For example, edge devices may include edge routers, routing switches, firewalls, multiplexers, and other wide area network (wide area network, WAN) devices. With the development of artificial intelligence and Internet of things (IoT) technology, edge devices generally have built-in processors with onboard analysis or artificial intelligence capabilities. These devices may include sensors, drivers, and IoT gateways.
当然,第一设备和第二设备也可以是除边缘设备之外的其他设备,本申请实施例对此不作具体限定。Certainly, the first device and the second device may also be other devices except the edge device, which is not specifically limited in this embodiment of the present application.
需要说明的是,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。It should be noted that the term "and/or" in this article is only an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, and A exists at the same time and B, there are three cases of B alone.
可选地,上文中的功能函数可以为但不限于消息队列遥测传输(message queuing telemetry transport,MQTT)协议解析功能函数、数据处理功能函数等。Optionally, the above functional functions may be, but not limited to, message queuing telemetry transport (message queuing telemetry transport, MQTT) protocol analysis functional functions, data processing functional functions, and the like.
工作流(workflow)可用于指示工作流的事件(event)调用的至少一个功能函数以及该至少一个功能函数的执行顺序。可以看出,工作流可以用于将功能函数编排为协调的微服务应用程序,即将功能函数和事件组合成一个连贯的单元,并描述功能函数的执行和以规定方式传递的信息。A workflow (workflow) may be used to indicate at least one functional function invoked by an event (event) of the workflow and an execution sequence of the at least one functional function. It can be seen that workflow can be used to orchestrate functional functions into coordinated microservice applications, that is, to combine functional functions and events into a coherent unit, and to describe the execution of functional functions and the information delivered in a prescribed manner.
举例说明,图2示出了本申请实施例的一种可能的网络示意性图。在图2中,工作流为:事件1调用功能函数1,在执行完功能函数1后,调用功能函数2。在执行完功能函数2后,事件2调用功能函数3。As an example, FIG. 2 shows a schematic diagram of a possible network in the embodiment of the present application. In FIG. 2 , the workflow is: event 1 calls function 1, and after function 1 is executed, function 2 is called. After function function 2 is executed, event 2 calls function function 3.
应理解,图2仅是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围。比如,事件1也可以调用功能函数3,在执行完功能函数3后,事件2也可以调用功能函数1和功能函数2。It should be understood that FIG. 2 is only intended to help those skilled in the art better understand the embodiment of the present application, rather than limit the scope of the embodiment of the present application. For example, event 1 may also call function function 3, and after function function 3 is executed, event 2 may also call function function 1 and function function 2.
可选地,事件和工作流的定义可以参考规范CloudEvents。CloudEvents 是一种用通用格式描述事件数据的规范,以提供跨服务、平台和系统的互操作性。当然,事件和工作流的定义也可以参考云原生计算基金会(cloud native computing foundation,CNCF)无服务器工作流(serverless workflow)。Optionally, events and workflows can be defined by referring to the specification CloudEvents. CloudEvents is a specification for describing event data in a common format to provide interoperability across services, platforms, and systems. Of course, the definition of events and workflow can also refer to the cloud native computing foundation (cloud native computing foundation, CNCF) serverless workflow (serverless workflow).
工作流中的每个功能函数都可以由来自不同来源的事件驱动,即本申请实施例的工作流是由事件触发的。可选地,一个事件可以调用一个或者多个功能函数。如图2所示,事件1调用功能函数1和功能函数2,事件2调用功能函数3。Each function in the workflow can be driven by events from different sources, that is, the workflow in this embodiment of the present application is triggered by events. Optionally, an event can call one or more function functions. As shown in FIG. 2 , event 1 calls function function 1 and function function 2 , and event 2 calls function function 3 .
或者,多个事件可以调用一个功能函数。Alternatively, multiple events can call a single function.
可选地,工作流可以是开发人员创建的,并预配置在构建的系统上。这里的系统可以是但不限于函数即服务(function as a service,FaaS)系统。为了描述方便,下文以系统为FaaS系统为例进行说明。Optionally, workflows can be developer-created and pre-configured on the built system. The system here may be, but not limited to, a function as a service (function as a service, FaaS) system. For the convenience of description, the following description takes the system as an example of a FaaS system.
继续参考图2,FaaS系统可包括两个部分,其中一个部分为功能函数管理模块。功能函数管理模块可以用于负责功能函数的全生命周期管理,如创建、发布、更新、销毁等。示例性地,功能函数管理模块可以参照以下动作控制功能函数的生命周期:Continuing to refer to FIG. 2 , the FaaS system may include two parts, one of which is a function management module. The functional function management module can be used to be responsible for the full life cycle management of functional functions, such as creation, release, update, destruction, etc. Exemplarily, the functional function management module can refer to the following actions to control the life cycle of the functional function:
(a)创建:创建新功能函数,包括其规格和代码;(a) Create: Create new functional functions, including their specifications and codes;
(b)发布:创建可以在集群(cluster)上部署的新版本;(b) release: create a new version that can be deployed on the cluster;
(c)更新别名/标签(版本):更新版本别名;(c) update alias/label (version): update version alias;
(d)获取:返回功能函数元数据和规格;(d) Acquisition: return function metadata and specifications;
(e)更新:修改功能函数的最新版本;(e) Update: modify the latest version of the function;
(f)删除:删除功能函数,可以删除特定版本或所有版本的功能函数;(f) Deletion: To delete a function, you can delete a specific version or all versions of the function;
(g)列表:显示功能函数及其元数据的列表;(g) list: display a list of functional functions and their metadata;
(h)获取统计信息:返回有关功能函数运行时使用情况的统计信息;(h) Obtain statistical information: return statistical information about the usage of the function when it is running;
(i)获取日志:返回功能函数生成的日志。(i) Get log: return the log generated by the function function.
另外一个部分为工作流管理模块,如图2所示,工作流管理模块包括工作流。The other part is the workflow management module, as shown in Figure 2, the workflow management module includes workflow.
开发人员在创建工作流之前,开发人员可以先将第一设备和/或第二设备加入网络。其中,该网络可以是服务网格(service mesh)。Before the developer creates the workflow, the developer may first join the first device and/or the second device to the network. Wherein, the network may be a service mesh (service mesh).
继续以图2为例进行说明,service mesh可包括控制面板(control plane)和设备。其中,控制面板除了包括FaaS系统之外,还可以执行其他动作, 如路由控制管理、功能函数注册、功能函数发现、监控和流量追踪等。Continuing to take Figure 2 as an example for illustration, the service mesh may include a control plane (control plane) and equipment. Among them, besides including the FaaS system, the control panel can also perform other actions, such as routing control management, function registration, function discovery, monitoring and traffic tracking.
可选地,开发人员可以根据业务需求创建功能函数,并将创建的功能函数配置在FaaS系统中的功能函数管理模块上。之后,功能函数管理模块可将这些功能函数热部署到设备。例如,功能函数管理模块可以将这些功能函数热部署到设备上容器(container)中。Optionally, developers can create functional functions according to business requirements, and configure the created functional functions on the functional function management module in the FaaS system. Afterwards, the functional function management module can hot-deploy these functional functions to the device. For example, the functional function management module can hot-deploy these functional functions into containers (containers) on the device.
在一种可能的实现方式中,功能函数管理模块可根据每个设备的资源将这些功能函数热部署到不同的设备上。也就是说,第一设备上部署的功能函数可以是根据第一设备的资源确定的,类似地,第二设备上部署的功能函数也可以是根据第二设备的资源确定的。In a possible implementation manner, the functional function management module can hot-deploy these functional functions to different devices according to the resources of each device. That is, the functional functions deployed on the first device may be determined according to the resources of the first device, and similarly, the functional functions deployed on the second device may also be determined according to the resources of the second device.
第一设备的资源和第二设备的资源可以是第一设备的中央处理器(central processing unit,CPU)资源、网关资源等。第一设备的资源可以是第一设备的总资源,也可以是第一设备当前时刻未使用的资源。相应地,第二设备的资源也可以是第二设备的总资源或者第二设备当前时刻未使用的资源。The resources of the first device and the resources of the second device may be central processing unit (central processing unit, CPU) resources, gateway resources, etc. of the first device. The resource of the first device may be the total resource of the first device, or may be a resource not used by the first device at the current moment. Correspondingly, the resources of the second device may also be the total resources of the second device or the resources not used by the second device at the current moment.
具体来说,service mesh能够监控第一设备和第二设备的资源状况。在service mesh监控到第一设备的资源状况和第二设备的资源状况后,可以控制功能函数管理模块将功能函数部署到第一设备和第二设备上,其中,资源多的设备上部署的功能函数可以多于资源少的设备上部署的功能函数。继续参考图2,设备1的资源多于设备2的资源,则在设备1上部署的功能函数多于在设备2上部署的功能函数,即设备1上部署有功能函数1和功能函数2,设备2上部署有功能函数2。当然,设备1上也可以部署功能函数2和功能函数3,设备2上部署功能函数1。Specifically, the service mesh can monitor the resource status of the first device and the second device. After the service mesh monitors the resource status of the first device and the resource status of the second device, it can control the function management module to deploy the function to the first device and the second device. Among them, the function deployed on the device with more resources Functions can be more than functional functions deployed on devices with few resources. Continuing to refer to Figure 2, if the resource of device 1 is more than that of device 2, then the functional functions deployed on device 1 are more than those deployed on device 2, that is, functional function 1 and functional function 2 are deployed on device 1, Function 2 is deployed on device 2. Of course, function 2 and function 3 may also be deployed on device 1, and function 1 may be deployed on device 2.
应理解,本申请实施例对功能函数具体部署到哪个设备上不作具体限定,只需资源多的设备上部署的功能函数的数量大于资源少的设备上部署的功能函数即可。It should be understood that the embodiment of the present application does not specifically limit which device the function function is deployed on, as long as the number of function functions deployed on the device with more resources is greater than the number of function functions deployed on the device with fewer resources.
上述技术方案,根据设备的资源在设备上部署功能函数,资源多的设备上部署的功能函数较多,资源少的设备上部署的功能函数相对较少,从而能够实现资源的合理分配和资源的有效利用。进一步地,根据设备的资源在设备上部署功能函数,避免了某个功能函数必须部署到某个设备的问题,提高了部署功能函数的灵活性。In the above technical solution, the functional functions are deployed on the device according to the resources of the device. More functional functions are deployed on the device with more resources, and relatively fewer functional functions are deployed on the device with few resources, so that the rational allocation of resources and the allocation of resources can be realized. use efficiently. Further, deploying functional functions on devices according to device resources avoids the problem that a certain functional function must be deployed to a certain device, and improves the flexibility of deploying functional functions.
可选地,开发人员在确定事件调动的功能函数时,可以根据功能函数的输入确定。具体而言,事件中可以包括信息,该信息为该事件调用的功能函数的输入。比如,第一事件调用第一功能函数,第一事件包括第一信息,第一信息为第一功能函数的输入。Optionally, when determining the function function called by the event, the developer may determine it according to the input of the function function. Specifically, the event may include information, which is an input of a function called by the event. For example, a first event calls a first function, the first event includes first information, and the first information is an input of the first function.
可选地,步骤110具体可以包括:第一设备接收FaaS系统发送的工作流调度信息,该工作流调度信息标识出工作流。Optionally, step 110 may specifically include: the first device receives workflow scheduling information sent by the FaaS system, where the workflow scheduling information identifies a workflow.
作为一种示例,FaaS系统可以每隔预设时间段向第一设备发送工作流调度信息。示例性地,预设时间段可以是5s。如此,能够提高第一设备获取到工作流的概率。As an example, the FaaS system may send workflow scheduling information to the first device every preset time period. Exemplarily, the preset time period may be 5s. In this way, the probability that the first device obtains the workflow can be improved.
作为另一种示例,在第一设备出厂前,第一设备可以接收FaaS系统向其发送的工作流调度信息。该技术方案,在第一设备出厂之前即可获取到工作流,这样,即使第一设备与中央集群断开连接仍然可以执行工作流,极大地保证了工作流的正常执行。As another example, before the first device leaves the factory, the first device may receive workflow scheduling information sent to it by the FaaS system. In this technical solution, the workflow can be obtained before the first device leaves the factory, so that even if the first device is disconnected from the central cluster, the workflow can still be executed, which greatly ensures the normal execution of the workflow.
进一步地,方法100还可以包括:第一设备根据记录信息,确定第一功能函数所在的设备,该记录信息用于记录至少一个功能函数中每个功能函数所在的设备。Further, the method 100 may further include: the first device determines the device where the first functional function is located according to the record information, where the record information is used to record the device where each functional function of the at least one functional function is located.
可选地,在功能函数管理模块将至少一个功能函数部署到不同的设备之后,功能函数管理模块向每个设备发送记录信息,以将至少一个功能函数中每个功能函数所在的设备通知给设备。Optionally, after the functional function management module deploys at least one functional function to different devices, the functional function management module sends record information to each device, so as to notify the device of the device where each functional function in the at least one functional function is located .
作为示例,每个设备都可以包括边车(sidecar),功能函数管理模块可以将记录信息发送给sidecar,这样,每个设备的sidecar可以记录有每个设备上部署的功能函数。继续以图2为例进行说明,设备1的sidecar可以记录有功能函数1和功能函数3在设备1上,功能函数2在设备2上。As an example, each device may include a sidecar, and the function management module may send record information to the sidecar, so that the sidecar of each device may record the functions deployed on each device. Continuing to take FIG. 2 as an example for illustration, the sidecar of device 1 may record function 1 and function 3 on device 1, and function 2 on device 2.
在第一设备接收到第一事件后,若第一设备根据记录信息,确定自己为第一功能函数所在的设备,则第一设备可以直接调用第一功能函数。After the first device receives the first event, if the first device determines that it is the device where the first function resides according to the recorded information, the first device may directly call the first function.
若第一设备根据记录信息,确定自己不是第一功能函数所在的设备,而第二设备为第一功能函数所在的设备,则第一设备可以将第一事件路由到第二设备。If the first device determines, according to the record information, that it is not the device where the first function resides, but the second device is the device where the first function resides, then the first device may route the first event to the second device.
如图3所示,设备2接收到事件1,根据工作流确定事件1调用功能函数1,并确定功能函数1在设备1上,因此,设备2将事件1路由到设备1, 以使事件1调用功能函数1,并且设备1执行功能函数1。As shown in Figure 3, device 2 receives event 1, determines that event 1 invokes function 1 according to the workflow, and determines that function 1 is on device 1, therefore, device 2 routes event 1 to device 1, so that event 1 The functional function 1 is called, and the device 1 executes the functional function 1.
从图3中可以看出,设备2接收事件1以及设备2将事件1路由到设备1,均是由设备的sidecar执行的。也就是说,设备2的sidecar接收事件1并将事件1路由到设备1的sidecar。It can be seen from Figure 3 that device 2 receives event 1 and device 2 routes event 1 to device 1, both of which are executed by the sidecar of the device. That is, the sidecar of device 2 receives event 1 and routes event 1 to the sidecar of device 1.
当然,设备2接收事件1以及设备2将事件1路由到设备1,也可以由设备的其他模块执行的,本申请实施例对此不作具体限定。Of course, device 2 receiving event 1 and device 2 routing event 1 to device 1 may also be executed by other modules of the device, which is not specifically limited in this embodiment of the present application.
可选地,第二设备还可以向第一设备发送反馈信息,该反馈信息用于反馈第二设备执行第一功能函数的执行结果。Optionally, the second device may also send feedback information to the first device, where the feedback information is used to feed back an execution result of the second device executing the first function.
比如,第二设备可以在执行第一功能函数的过程中向第一设备发送反馈信息,比如,发送否定应答(negative acknowledgment,NACK),以使第一设备知道第二设备正在执行第一功能函数。For example, the second device may send feedback information to the first device during the process of executing the first function, such as sending a negative acknowledgment (negative acknowledgment, NACK), so that the first device knows that the second device is executing the first function. .
或者,第二设备可以在执行完第一功能函数后,向第一设备发送反馈信息,比如,发送肯定应答(acknowledgment,ACK),以使第一设备知道第二设备以执行完第一功能函数。Alternatively, the second device may send feedback information to the first device after executing the first function, such as sending an acknowledgment (acknowledgment, ACK), so that the first device knows that the second device has completed the execution of the first function. .
上述技术方案,在接收事件的设备不是该事件调用的功能函数所在的设备的情况下,该事件调用的功能函数所在的设备在执行完该功能函数后向接收事件的设备反馈执行功能函数的结果,使得接收事件的设备能够继续执行下一个步骤,避免了接收事件的设备无效等待的时间,有利于大大减小执行整个工作流的时间。In the above technical solution, when the device receiving the event is not the device where the function called by the event is located, the device where the function called by the event is located will feed back the result of executing the function to the device receiving the event after executing the function , so that the device receiving the event can continue to execute the next step, avoiding the invalid waiting time of the device receiving the event, and greatly reducing the time for executing the entire workflow.
为了更加清楚地理解本申请实施例,下面在图2的基础上进一步结合图3-图5举例说明本申请实施例的事件触发工作流的具体流程。In order to understand the embodiment of the present application more clearly, on the basis of FIG. 2 , the specific flow of the event-triggered workflow of the embodiment of the present application will be further illustrated below in conjunction with FIGS. 3-5 .
步骤1 step 1
初始状态下,设备1和设备2等待事件触发。当设备2中的sidecar接收到事件1时,根据工作流,确定事件1调用功能函数1。由于功能函数1部署在设备1上,因此sidecar将事件1路由到设备1上,以调用功能函数1。In the initial state, Device 1 and Device 2 wait for an event to trigger. When the sidecar in device 2 receives event 1, it is determined that event 1 invokes function 1 according to the workflow. Since function 1 is deployed on device 1, the sidecar routes event 1 to device 1 to invoke function 1.
步骤2 step 2
在执行完功能函数1后,设备1通过sidecar向设备2的sidecar发送反馈信息,从而设备2确定设备1已执行完功能函数1。After executing function 1, device 1 sends feedback information to the sidecar of device 2 through the sidecar, so that device 2 determines that device 1 has executed function 1.
接下来,设备2再次根据工作流,确定调用功能函数2,功能函数2部署在设备2上,因此,设备2直接调用功能函数2。Next, the device 2 again determines to call the functional function 2 according to the workflow, and the functional function 2 is deployed on the device 2. Therefore, the device 2 directly calls the functional function 2.
根据工作流可以知道,在执行完功能函数2后,事件2可以触发工作流,以调用功能函数3。因此,执行功能函数2后,系统等待事件2的触发。According to the workflow, it can be known that after the functional function 2 is executed, the event 2 may trigger the workflow to call the functional function 3 . Therefore, after executing function 2, the system waits for event 2 to be triggered.
步骤3 step 3
设备2中的sidecar接收到事件2后,根据工作流,确定事件2调用功能函数3。由于功能函数3部署在设备1上,因此sidecar将事件2路由到设备1上,以调用功能函数3。After receiving event 2, the sidecar in device 2 determines that event 2 calls function 3 according to the workflow. Since function 3 is deployed on device 1, the sidecar routes event 2 to device 1 to invoke function 3.
在执行完功能函数3后,设备1中的容器可向设备1的sidecar发送反馈信息。至此,工作流执行完毕。After executing function 3, the container in device 1 can send feedback information to the sidecar of device 1. At this point, the workflow execution is complete.
本申请实施例,通过在设备上部署功能函数,使得整个工作流可以在设备上完成,即通过远程部署而不用去现场即可实现对应用程序的处理,极大地减少了人力。此外,设备根据用于指示事件调用的至少一个功能函数以及该至少一个功能函数的执行顺序的工作流,来完成整个工作流程,能够有效提高工作效率。In the embodiment of the present application, by deploying functional functions on the device, the entire workflow can be completed on the device, that is, the application can be processed through remote deployment without going to the site, which greatly reduces manpower. In addition, the device completes the entire workflow according to the workflow used to indicate the at least one functional function invoked by the event and the execution sequence of the at least one functional function, which can effectively improve work efficiency.
进一步地,由于设备可以获取到工作流,这样不论功能函数部署到哪个设备上,设备都可以根据工作流确定事件调用的功能函数,即使该设备不是该功能函数所在的设备,也可以将事件路由到该功能函数所在的设备,以调用该功能函数,从而可以提高整个系统的灵活性。Furthermore, because the device can obtain the workflow, no matter which device the function is deployed on, the device can determine the function called by the event according to the workflow, even if the device is not the device where the function is located, the event can also be routed to the device where the function is located to call the function, so that the flexibility of the entire system can be improved.
上文详细描述了本申请实施例的方法实施例,下面描述本申请实施例的装置实施例,装置实施例与方法实施例相互对应,因此未详细描述的部分可参见前面各方法实施例,装置可以实现上述方法中任意可能实现的方式。The method embodiments of the embodiments of the present application are described in detail above, and the device embodiments of the embodiments of the present application are described below. The device embodiments correspond to the method embodiments. Therefore, for the parts that are not described in detail, please refer to the previous method embodiments and device embodiments. Any possible implementation manner in the above methods can be implemented.
图6示出了本申请一个实施例的工作流操作的装置600的示意性框图。该工作流操作的装置600可以执行上述本申请实施例的工作流操作的方法100,该工作流操作的装置600可以为前述方法中的第一设备。FIG. 6 shows a schematic block diagram of an apparatus 600 for workflow operation according to an embodiment of the present application. The workflow operation apparatus 600 may execute the workflow operation method 100 in the embodiment of the present application, and the workflow operation apparatus 600 may be the first device in the aforementioned method.
如图6所示,该工作流操作的装置600包括:As shown in FIG. 6, the device 600 for the workflow operation includes:
获取单元610,用于获取工作流调度信息,所述工作流调度信息用于指示工作流的事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;An acquiring unit 610, configured to acquire workflow scheduling information, where the workflow scheduling information is used to indicate at least one functional function called by an event of the workflow and an execution order of the at least one functional function;
确定单元620,用于在所述第一设备接收到第一事件后,根据所述工作流调度信息,确定所述第一事件待调用的第一功能函数,所述工作流的事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;The determining unit 620 is configured to determine a first function to be called by the first event according to the workflow scheduling information after the first device receives the first event, the event of the workflow includes the a first event, said at least one functional function comprising said first functional function;
调用单元630,用于若所述第一设备为所述第一功能函数所在的设备,则调用所述第一功能函数;a calling unit 630, configured to call the first functional function if the first device is the device where the first functional function is located;
路由单元640,用于若第二设备为所述第一功能函数所在的设备,则将所述第一事件路由到所述第二设备。The routing unit 640 is configured to route the first event to the second device if the second device is the device where the first function resides.
可选地,在本申请一个实施例中,所述第一设备上部署的功能函数是根据所述第一设备的资源确定的,所述第二设备上部署的功能函数是根据所述第二设备的资源确定的。Optionally, in an embodiment of the present application, the functional functions deployed on the first device are determined according to the resources of the first device, and the functional functions deployed on the second device are determined according to the second The resources of the device are determined.
若所述第一设备的资源大于所述第二设备的资源,则在所述第一设备上部署的功能函数多于在所述第二设备上部署的功能函数。If the resources of the first device are greater than the resources of the second device, more functional functions are deployed on the first device than on the second device.
可选地,在本申请一个实施例中,若第二设备为所述第一功能函数所在的设备,装置600还可以包括:通信单元,用于接收所述第二设备发送的反馈信息,所述反馈信息用于反馈所述第二设备执行所述第一功能函数的执行结果。Optionally, in one embodiment of the present application, if the second device is the device where the first functional function resides, the apparatus 600 may further include: a communication unit configured to receive feedback information sent by the second device, so The feedback information is used to feed back an execution result of the second device executing the first function.
可选地,在本申请一个实施例中,确定单元620还可以用于:根据记录信息,确定所述第一功能函数所在的设备,所述记录信息用于记录所述至少一个功能函数中每个功能函数所在的设备。Optionally, in one embodiment of the present application, the determining unit 620 may be further configured to: determine the device where the first functional function is located according to the record information, where the record information is used to record each of the at least one functional function The device where the function is located.
可选地,在本申请一个实施例中,装置600还可以包括:通信单元,用于接收系统发送的所述工作流调度信息。Optionally, in an embodiment of the present application, the apparatus 600 may further include: a communication unit, configured to receive the workflow scheduling information sent by the system.
可选地,在本申请一个实施例中,通信单元具体用于:在所述第一设备出厂前,接收所述系统发送的所述工作流调度信息。Optionally, in an embodiment of the present application, the communication unit is specifically configured to: receive the workflow scheduling information sent by the system before the first device leaves the factory.
可选地,在本申请一个实施例中,所述第一事件包括第一信息,所述第一信息为所述第一功能函数的输入。Optionally, in an embodiment of the present application, the first event includes first information, and the first information is an input of the first functional function.
可选地,在本申请一个实施例中,所述第一设备和所述第二设备为边缘设备。Optionally, in an embodiment of the present application, the first device and the second device are edge devices.
图7是本申请实施例的工作流操作的装置的硬件结构示意图。图7所示的工作流操作的装置700可以为第一设备,工作流操作的装置700包括存储器701、处理器702、通信接口703以及总线704。其中,存储器701、处理器702、通信接口703通过总线704实现彼此之间的通信连接。FIG. 7 is a schematic diagram of a hardware structure of an apparatus for workflow operation according to an embodiment of the present application. The workflow operation apparatus 700 shown in FIG. 7 may be a first device, and the workflow operation apparatus 700 includes a memory 701 , a processor 702 , a communication interface 703 and a bus 704 . Wherein, the memory 701 , the processor 702 , and the communication interface 703 are connected to each other through a bus 704 .
存储器701可以是只读存储器(read-only memory,ROM),静态存储设备和随机存取存储器(random access memory,RAM)。存储器701可以存储 程序,当存储器701中存储的程序被处理器702执行时,处理器702和通信接口703用于执行本申请实施例的工作流操作的方法的各个步骤。The memory 701 may be a read-only memory (read-only memory, ROM), a static storage device and a random access memory (random access memory, RAM). The memory 701 can store a program. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute each step of the workflow operation method of the embodiment of the present application.
处理器702可以采用通用的CPU,微处理器,应用专用集成电路(application specific integrated circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的装置中的单元所需执行的功能函数,或者执行本申请实施例的工作流操作的方法。The processor 702 may adopt a general-purpose CPU, a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits for executing related programs, In order to realize the functional functions to be executed by the units in the device of the embodiment of the present application, or execute the workflow operation method of the embodiment of the present application.
处理器702还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的工作流操作的方法的各个步骤可以通过处理器702中的硬件的集成逻辑电路或者软件形式的指令完成。The processor 702 may also be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the workflow operation method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 702 or instructions in the form of software.
上述处理器702还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、ASIC、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器701,处理器702读取存储器701中的信息,结合其硬件完成本申请实施例的装置中包括的单元所需执行的功能函数,或者执行本申请实施例的工作流操作的方法。Above-mentioned processor 702 can also be general-purpose processor, digital signal processor (digital signal processing, DSP), ASIC, off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701, and combines its hardware to complete the functions required by the units included in the device of the embodiment of the present application, or execute the workflow operation of the embodiment of the present application method.
通信接口703使用例如但不限于收发器一类的收发装置,来实现工作流操作的装置700与其他设备或通信网络之间的通信。例如,装置700可以通过通信接口703接收第二设备发送的反馈信息。The communication interface 703 implements communication between the workflow operation apparatus 700 and other devices or communication networks by using a transceiver device such as but not limited to a transceiver. For example, the apparatus 700 may receive the feedback information sent by the second device through the communication interface 703 .
总线704可包括在工作流操作的装置700各个部件(例如,存储器701、处理器702、通信接口703)之间传送信息的通路。The bus 704 may include pathways for transferring information between various components of the apparatus 700 (eg, memory 701 , processor 702 , communication interface 703 ) for workflow operations.
应注意,尽管上述工作流操作的装置700仅仅示出了存储器、处理器、通信接口,但是在具体实现过程中,本领域的技术人员应当理解,工作流操作的装置700还可以包括实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当理解,工作流操作的装置700还可包括实现其 他附加功能函数的硬件器件。此外,本领域的技术人员应当理解,工作流操作的装置700也可仅仅包括实现本申请实施例所必须的器件,而不必包括图7中所示的全部器件。It should be noted that although the above-mentioned workflow operation device 700 only shows a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the workflow operation device 700 may also include other necessary devices. Meanwhile, according to specific requirements, those skilled in the art should understand that the workflow operation apparatus 700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the apparatus 700 for workflow operation may only include components necessary to realize the embodiment of the present application, and does not necessarily include all the components shown in FIG. 7 .
本申请实施例还提供了一种计算机可读存储介质,存储用于设备执行的程序代码,所述程序代码包括用于执行上述工作流操作的方法中的步骤的指令。The embodiment of the present application also provides a computer-readable storage medium, which stores program code for execution by a device, and the program code includes instructions for executing the steps in the above-mentioned workflow operation method.
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述工作流操作的方法。The embodiment of the present application also provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by the computer, the The computer executes the above-mentioned workflow operation method.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The above-mentioned computer-readable storage medium may be a transitory computer-readable storage medium, or a non-transitory computer-readable storage medium.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and details are not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能函数划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined Or it can be integrated into another system, or some features can be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”和“所述”旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。The terms used in the present application are used to describe the embodiments only and are not used to limit the claims. As used in the examples and description of the claims, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. Similarly, the term "and/or" as used in this application is meant to include any and all possible combinations of one or more of the associated listed ones. Additionally, when used in this application, the term "comprising" refers to the presence of stated features, integers, steps, operations, elements, and/or components, but does not exclude one or more other features, integers, steps, operations, The presence or addition of elements, components and/or groupings of these.
所描述的实施例中的各方面、实施方式、实现或特征能够单独使用或以任意组合的方式使用。所描述的实施例中的各方面可由软件、硬件或软硬件 的结合实现。所描述的实施例也可以由存储有计算机可读代码的计算机可读介质体现,该计算机可读代码包括可由至少一个计算装置执行的指令。所述计算机可读介质可与任何能够存储数据的数据存储装置相关联,该数据可由计算机系统读取。用于举例的计算机可读介质可以包括只读存储器、随机存取存储器、紧凑型光盘只读储存器(compact disc read-only memory,CD-ROM)、硬盘驱动器(hard disk drive,HDD)、数字视频光盘(digital video disc,DVD)、磁带以及光数据存储装置等。所述计算机可读介质还可以分布于通过网络联接的计算机系统中,这样计算机可读代码就可以分布式存储并执行。The aspects, implementations, implementations or features of the described embodiments can be used alone or in any combination. Aspects of the described embodiments can be implemented by software, hardware or a combination of hardware and software. The described embodiments may also be embodied by a computer-readable medium storing computer-readable code comprising instructions executable by at least one computing device. The computer readable medium can be associated with any data storage device that can store data that can be read by a computer system. Exemplary computer readable media may include read-only memory, random access memory, compact disc read-only memory (CD-ROM), hard disk drive (HDD), digital Video disc (digital video disc, DVD), magnetic tape, and optical data storage device, etc. The computer readable medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.
上述技术描述可参照附图,这些附图形成了本申请的一部分,并且通过描述在附图中示出了依照所描述的实施例的实施方式。虽然这些实施例描述的足够详细以使本领域技术人员能够实现这些实施例,但这些实施例是非限制性的;这样就可以使用其它的实施例,并且在不脱离所描述的实施例的范围的情况下还可以做出变化。比如,流程图中所描述的操作顺序是非限制性的,因此在流程图中阐释并且根据流程图描述的两个或两个以上操作的顺序可以根据若干实施例进行改变。作为另一个例子,在若干实施例中,在流程图中阐释并且根据流程图描述的一个或一个以上操作是可选的,或是可删除的。另外,某些步骤或功能函数可以添加到所公开的实施例中,或两个以上的步骤顺序被置换。所有这些变化被认为包含在所公开的实施例以及权利要求中。The above technical description may refer to the accompanying drawings, which form a part hereof, and in which are shown by way of description implementations in accordance with the described embodiments. While these embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments, these embodiments are not limiting; as such, other embodiments can be used and without departing from the scope of the described embodiments Circumstances can also be changed. For example, the order of operations described in the flow diagrams is non-limiting, and thus the order of two or more operations illustrated in and described with respect to the flow diagrams may be changed according to several embodiments. As another example, in several embodiments, one or more operations illustrated in and described with respect to the flowcharts are optional, or may be deleted. Additionally, certain steps or functions may be added to the disclosed embodiments, or the order of two or more steps permuted. All such variations are considered to be encompassed by the disclosed embodiments as well as the claims.
另外,上述技术描述中使用术语以提供所描述的实施例的透彻理解。然而,并不需要过于详细的细节以实现所描述的实施例。因此,实施例的上述描述是为了阐释和描述而呈现的。上述描述中所呈现的实施例以及根据这些实施例所公开的例子是单独提供的,以添加上下文并有助于理解所描述的实施例。上述说明书不用于做到无遗漏或将所描述的实施例限制到本申请的精确形式。根据上述教导,若干修改、选择适用以及变化是可行的。在某些情况下,没有详细描述为人所熟知的处理步骤以避免不必要地影响所描述的实施例。Additionally, terminology was used in the above technical description to provide a thorough understanding of the described embodiments. However, undue detail is not required to implement the described embodiments. Thus, the foregoing description of the embodiments has been presented for purposes of illustration and description. The embodiments presented in the foregoing description, and examples disclosed according to these embodiments, are provided individually to add context and to facilitate understanding of the described embodiments. The above description is not intended to be exhaustive or to limit the described embodiments to the precise form of the application. Several modifications, alternatives, and variations are possible in light of the above teachings. In some instances, well known process steps have not been described in detail in order not to unnecessarily obscure the described embodiments.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的 技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above is only the specific implementation of the embodiment of the present application, but the scope of protection of the embodiment of the present application is not limited thereto. Anyone familiar with the technical field can easily Any changes or substitutions that come to mind should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.

Claims (11)

  1. 一种工作流操作的方法,其特征在于,包括:A workflow operation method, characterized by comprising:
    第一设备获取(110)工作流,所述工作流用于指示事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;The first device acquires (110) a workflow, where the workflow is used to indicate at least one functional function called by the event and an execution sequence of the at least one functional function;
    在所述第一设备接收到第一事件后,根据所述工作流,确定(120)所述第一事件待调用的第一功能函数,所述事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;After the first device receives the first event, according to the workflow, determine (120) the first function to be called by the first event, the event includes the first event, and the at least one the functional functions include said first functional function;
    若所述第一设备为所述第一功能函数所在的设备,则所述第一设备调用(130)所述第一功能函数;If the first device is the device where the first functional function is located, the first device calls (130) the first functional function;
    若第二设备为所述第一功能函数所在的设备,则所述第一设备将所述第一事件路由(140)到所述第二设备。If the second device is the device where the first functional function resides, the first device routes (140) the first event to the second device.
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备上部署的功能函数是根据所述第一设备的资源确定的,所述第二设备上部署的功能函数是根据所述第二设备的资源确定的;The method according to claim 1, wherein the functional functions deployed on the first device are determined according to the resources of the first device, and the functional functions deployed on the second device are determined according to the resources of the first device. 2. The resources of the equipment are determined;
    若所述第一设备的资源大于所述第二设备的资源,则在所述第一设备上部署的功能函数多于在所述第二设备上部署的功能函数。If the resources of the first device are greater than the resources of the second device, more functional functions are deployed on the first device than on the second device.
  3. 根据权利要求1或2所述的方法,其特征在于,若第二设备为所述第一功能函数所在的设备,所述方法还包括:The method according to claim 1 or 2, wherein if the second device is the device where the first functional function is located, the method further comprises:
    所述第一设备接收所述第二设备发送的反馈信息,所述反馈信息用于反馈所述第二设备执行所述第一功能函数的执行结果。The first device receives feedback information sent by the second device, where the feedback information is used to feed back an execution result of the first function executed by the second device.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    所述第一设备根据记录信息,确定所述第一功能函数所在的设备,所述记录信息用于记录所述至少一个功能函数中每个功能函数所在的设备。The first device determines the device where the first functional function is located according to the record information, where the record information is used to record the device where each functional function of the at least one functional function is located.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述第一设备获取(110)工作流,包括:The method according to any one of claims 1 to 4, wherein the acquiring (110) workflow by the first device includes:
    所述第一设备接收系统发送的工作流调度信息,所述工作流调度信息标识出所述工作流。The first device receives workflow scheduling information sent by the system, where the workflow scheduling information identifies the workflow.
  6. 根据权利要求5所述的方法,其特征在于,所述第一设备接收系统 发送的工作流调度信息,包括:The method according to claim 5, wherein the workflow scheduling information sent by the first device receiving system includes:
    在所述第一设备出厂前,所述第一设备接收所述系统发送的所述工作流调度信息。Before the first device leaves the factory, the first device receives the workflow scheduling information sent by the system.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述第一事件包括第一信息,所述第一信息为所述第一功能函数的输入。The method according to any one of claims 1 to 6, wherein the first event includes first information, and the first information is an input of the first functional function.
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述第一设备和所述第二设备为边缘设备。The method according to any one of claims 1 to 7, wherein the first device and the second device are edge devices.
  9. 一种工作流操作的装置(600),其特征在于,所述装置为第一设备,包括:A workflow operation device (600), characterized in that the device is a first device, comprising:
    获取单元(610),用于获取工作流,所述工作流用于指示事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;An acquisition unit (610), configured to acquire a workflow, where the workflow is used to indicate at least one functional function invoked by an event and an execution sequence of the at least one functional function;
    确定单元(620),用于在所述第一设备接收到第一事件后,根据所述工作流,确定所述第一事件待调用的第一功能函数,所述事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;A determining unit (620), configured to determine, according to the workflow, a first function to be called by the first event after the first device receives the first event, the event includes the first event , the at least one functional function includes the first functional function;
    调用单元(630),用于若所述第一设备为所述第一功能函数所在的设备,则调用所述第一功能函数;A calling unit (630), configured to call the first functional function if the first device is the device where the first functional function is located;
    路由单元(640),用于若第二设备为所述第一功能函数所在的设备,则将所述第一事件路由到所述第二设备。A routing unit (640), configured to route the first event to the second device if the second device is the device where the first function resides.
  10. 一种工作流操作的装置,其特征在于,包括:A device for workflow operation, characterized by comprising:
    存储器(701),用于存储程序;memory (701), for storing programs;
    处理器(702),用于执行所述存储器(701)存储的程序,当所述存储器(701)存储的程序被执行时,所述处理器(702)用于执行根据权利要求1至8中任一项所述的工作流操作的方法。A processor (702), configured to execute the program stored in the memory (701), when the program stored in the memory (701) is executed, the processor (702) is configured to execute the program according to claims 1 to 8. A method of workflow operation as described in any one.
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读介质存储用于设备执行的程序代码,所述程序代码包括用于执行根据权利要求1至8中任一项所述的工作流操作的方法中的步骤的指令。A computer-readable storage medium, characterized in that the computer-readable medium stores program code for execution by a device, and the program code includes a program code for executing the workflow according to any one of claims 1 to 8 An instruction for a step in an action's method.
PCT/CN2021/122423 2021-09-30 2021-09-30 Workflow operation method and apparatus WO2023050410A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180102095.6A CN117940904A (en) 2021-09-30 2021-09-30 Workflow operation method and device
PCT/CN2021/122423 WO2023050410A1 (en) 2021-09-30 2021-09-30 Workflow operation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/122423 WO2023050410A1 (en) 2021-09-30 2021-09-30 Workflow operation method and apparatus

Publications (1)

Publication Number Publication Date
WO2023050410A1 true WO2023050410A1 (en) 2023-04-06

Family

ID=85781189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/122423 WO2023050410A1 (en) 2021-09-30 2021-09-30 Workflow operation method and apparatus

Country Status (2)

Country Link
CN (1) CN117940904A (en)
WO (1) WO2023050410A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305551A (en) * 2005-11-09 2008-11-12 诺基亚公司 Method for the construction and execution of a distributed workflow in a communication system
CN106488057A (en) * 2015-08-25 2017-03-08 三星电子株式会社 For generating method and the image processing system of the workflow of image formation operation
US20190205186A1 (en) * 2017-12-29 2019-07-04 Futurewei Technologies, Inc. Event-driven serverless function orchestration
US20200241944A1 (en) * 2019-01-30 2020-07-30 Salesforce.Com, Inc. Orchestration of a Sequence of Computations by External Systems
CN113067898A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for scheduling computing services for business process contracts

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305551A (en) * 2005-11-09 2008-11-12 诺基亚公司 Method for the construction and execution of a distributed workflow in a communication system
CN106488057A (en) * 2015-08-25 2017-03-08 三星电子株式会社 For generating method and the image processing system of the workflow of image formation operation
US20190205186A1 (en) * 2017-12-29 2019-07-04 Futurewei Technologies, Inc. Event-driven serverless function orchestration
US20200241944A1 (en) * 2019-01-30 2020-07-30 Salesforce.Com, Inc. Orchestration of a Sequence of Computations by External Systems
CN113067898A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for scheduling computing services for business process contracts

Also Published As

Publication number Publication date
CN117940904A (en) 2024-04-26

Similar Documents

Publication Publication Date Title
US10440138B2 (en) Provisioning IaaS services
US8443347B2 (en) Translating declarative models
JP5067833B2 (en) Highly available heterogeneous cluster manager
CN110262902B (en) Information processing method and system, medium, and computing device
WO2019200984A1 (en) Life cycle management method for distributed application, managers, device and medium
WO2016121834A1 (en) Method, system, device, and program for managing network function virtualization
CN102339234A (en) Device for operating protocol stack and method
CN111262908A (en) Task construction method and system based on jenkins
CN111371898B (en) Message monitoring method, device, equipment and storage medium
US8438573B2 (en) Dependency on a resource type
CN113835911B (en) Intranet penetration agent method, system, host and computer readable storage medium
US11223522B1 (en) Context-based intelligent re-initiation of microservices
CN111193610B (en) Intelligent monitoring data system and method based on Internet of things
US20100228951A1 (en) Parallel processing management framework
CN114338722A (en) Cloud-edge storage resource management system and method, storage medium and electronic device
WO2020062914A1 (en) Method and device for updating algorithm
US20240086236A1 (en) Computing node management method and system
CN112583630A (en) Device management method, device, system, device and storage medium
WO2023050410A1 (en) Workflow operation method and apparatus
CN117194039A (en) K8S drive integrated system, request processing method, device and storage medium
US7802253B2 (en) System for session management of resources and tasks having records in the lookup table for the session
US20220394211A1 (en) Information transmission method and related device
US20220365822A1 (en) Data Processing Method and Computer Device
CN115202820A (en) Method, device and equipment for creating Pod unit and storage medium
CN114546648A (en) Task processing method and task processing platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21958978

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180102095.6

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE