CN117940904A - Workflow operation method and device - Google Patents
Workflow operation method and device Download PDFInfo
- Publication number
- CN117940904A CN117940904A CN202180102095.6A CN202180102095A CN117940904A CN 117940904 A CN117940904 A CN 117940904A CN 202180102095 A CN202180102095 A CN 202180102095A CN 117940904 A CN117940904 A CN 117940904A
- Authority
- CN
- China
- Prior art keywords
- function
- workflow
- event
- resources
- present application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 230000006870 function Effects 0.000 claims description 290
- 238000004891 communication Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 16
- 238000007726 management method Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 11
- 230000001960 triggered effect Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000001427 coherent effect Effects 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
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
本申请实施例提供了一种工作流操作的方法和装置,能够在减少人力的基础上有效提高工作效率。所述方法包括:第一设备获取工作流,所述工作流用于指示事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;在所述第一设备接收到第一事件后,根据所述工作流,确定所述第一事件待调用的第一功能函数,所述事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;若所述第一设备为所述第一功能函数所在的设备,则所述第一设备调用所述第一功能函数;若第二设备为所述第一功能函数所在的设备,则所述第一设备将所述第一事件路由到所述第二设备。
The embodiment of the present application provides a method and device for workflow operation, which can effectively improve work efficiency on the basis of reducing manpower. The method includes: a first device obtains a workflow, and the workflow is used to indicate at least one function called by an event and the execution order of the at least one function function; after the first device receives a first event, according to the workflow, a first function function to be called by the first event is determined, the event includes the first event, and the at least one function function includes the first function function; if the first device is the device where the first function function is located, the first device calls the first function function; if the second device is the device where the first function function is located, the first device routes the first event to the second device.
Description
本申请涉及计算机技术领域,并且更为具体地,涉及一种工作流操作的方法和装置。The present application relates to the field of computer technology, and more specifically, to a method and device for workflow operation.
目前,在工程师需要对应用程序进行部署或运维时,一般需要花费大量的时间在现场通过数据线直连到设备等方式为不同设备进行解决方案的现场部署。如果对应用程序进行了修改,则需要重新部署应用程序,使得工程师又要重复之前复杂繁琐的流程。Currently, when engineers need to deploy or maintain applications, they usually need to spend a lot of time on-site to deploy solutions for different devices by directly connecting to the devices through data cables. If the application is modified, the application needs to be redeployed, which requires engineers to repeat the previous complex and tedious process.
进一步地,如果需要跨多个边缘设备运行任务来完成一系列的业务流程,由于多个边缘设备可能来自不同的厂商。因此,除了需要对不同设备的异构系统进行开发和集成,在部署时也会遇到上述问题,不仅浪费人力而且效率较低。Furthermore, if tasks need to be run across multiple edge devices to complete a series of business processes, since multiple edge devices may come from different manufacturers, in addition to the need to develop and integrate heterogeneous systems for different devices, the above problems will also be encountered during deployment, which not only wastes manpower but also has low efficiency.
发明内容Summary of the invention
本申请提供了一种工作流操作的方法和装置,能够在减少人力的基础上有效提高工作效率。The present application provides a method and device for workflow operation, which can effectively improve work efficiency on the basis of reducing manpower.
第一方面,提供了一种工作流操作的方法,其特征在于,包括:第一设备获取工作流,所述工作流用于指示事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;在所述第一设备接收到第一事件后,根据所述工作流,确定所述第一事件待调用的第一功能函数,所述事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;若所述第一设备为所述第一功能函数所在的设备,则所述第一设备调用所述第一功能函数;若第二设备为所述第一功能函数所在的设备,则所述第一设备将所述第一事件路由到所述第二设备。In a first aspect, a method for workflow operation is provided, characterized in that it includes: a first device obtains a workflow, the workflow is used to indicate at least one function function called by an event and the execution order of the at least one function function; after the first device receives a first event, the first function function to be called by the first event is determined according to the workflow, the event includes the first event, and the at least one function function includes the first function function; if the first device is the device where the first function function is located, the first device calls the first function function; if the second device is the device where the first function function is located, the first device routes the first event to the second device.
上述技术方案,通过在设备上部署功能函数,使得整个工作流可以在设 备上完成,即通过远程部署而不用去现场即可实现对应用程序的处理,极大地减少了人力。此外,设备根据用于指示事件调用的至少一个功能函数以及该至少一个功能函数的执行顺序的工作流,来完成整个工作流程,能够有效提高工作效率。The above technical solution enables the entire workflow to be completed on the device by deploying the function on the device, that is, the application can be processed by remote deployment without going to the site, which greatly reduces manpower. In addition, the device completes the entire workflow according to the workflow of at least one function for indicating event call and the execution order of the at least one function, which can effectively improve work efficiency.
进一步地,由于设备可以获取到工作流,这样不论功能函数部署到哪个设备上,设备都可以根据工作流确定事件调用的功能函数,即使该设备不是该功能函数所在的设备,也可以将事件路由到该功能函数所在的设备,以调用该功能函数,从而可以提高整个系统的灵活性。Furthermore, since 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 based on the workflow. Even if the device is not the device where the function is located, the event can be routed to the device where the function is located to call the function, thereby improving the flexibility of the entire system.
在一些可能的实现方式中,所述第一设备上部署的功能函数是根据所述第一设备的资源确定的,所述第二设备上部署的功能函数是根据所述第二设备的资源确定的;若所述第一设备的资源大于所述第二设备的资源,则在所述第一设备上部署的功能函数多于在所述第二设备上部署的功能函数。In some possible implementations, the function functions deployed on the first device are determined based on the resources of the first device, and the function functions deployed on the second device are determined based on the resources of the second device; if the resources of the first device are greater than the resources of the second device, then the function functions deployed on the first device are greater than the function functions deployed on the second device.
上述技术方案,根据设备的资源在设备上部署功能函数,资源多的设备上部署的功能函数较多,资源少的设备上部署的功能函数相对较少,从而能够实现资源的合理分配和资源的有效利用。进一步地,根据设备的资源在设备上部署功能函数,避免了某个功能函数必须部署到某个设备的问题,提高了部署功能函数的灵活性。The above technical solution deploys functional functions on devices according to the resources of the devices. More functional functions are deployed on devices with more resources, and relatively fewer functional functions are deployed on devices with fewer resources, thereby achieving reasonable allocation of resources and effective use of resources. Furthermore, by deploying functional functions on devices according to the resources of the devices, the problem of a certain functional function having to be deployed on a certain device is avoided, and the flexibility of deploying functional functions is improved.
在一些可能的实现方式中,若第二设备为所述第一功能函数所在的设备,所述方法还包括:所述第一设备接收所述第二设备发送的反馈信息,所述反馈信息用于反馈所述第二设备执行所述第一功能函数的执行结果。In some possible implementations, 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 is used to feed back the execution result of the second device executing the first functional function.
上述技术方案,在接收事件的设备不是该事件调用的功能函数所在的设备的情况下,该事件调用的功能函数所在的设备在执行完该功能函数后向接收事件的设备反馈执行功能函数的结果,使得接收事件的设备能够继续执行下一个步骤,避免了接收事件的设备无效等待的时间,有利于大大减小执行整个工作流的时间。According to the above technical solution, when the device receiving the event is not the device where the function function called by the event is located, the device where the function function called by the event is located will feedback the result of executing the function function to the device receiving the event after executing the function 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, which is beneficial to greatly reduce the time of executing the entire workflow.
在一些可能的实现方式中,所述方法还包括:所述第一设备根据记录信息,确定所述第一功能函数所在的设备,所述记录信息用于记录所述至少一个功能函数中每个功能函数所在的设备。In some possible implementations, the method further includes: the first device determines the device where the first function is located based on record information, and the record information is used to record the device where each function of the at least one function is located.
上述技术方案,接收事件的设备通过记录的每个功能函数所在的设备的记录信息,可以准确地将事件路由到该事件调用的功能函数所在的设备。According to the above technical solution, the device receiving the event can accurately route the event to the device where the function function called by the event is located by recording the record information of the device where each function function is located.
在一些可能的实现方式中,所述第一设备获取工作流,包括:所述第一设备接收系统发送的工作流调度信息,所述工作流调度信息标识出所述工作流。In some possible implementations, the first device acquires the workflow, including: the first device receives workflow scheduling information sent by a system, where the workflow scheduling information identifies the workflow.
在一些可能的实现方式中,所述第一设备接收系统发送的工作流调度信息,包括:在所述第一设备出厂前,所述第一设备接收所述系统发送的所述工作流调度信息。In some possible implementations, the first device receives the workflow scheduling information sent by the system, including: before the first device leaves the factory, the first device receives the workflow scheduling information sent by the system.
上述技术方案,在接收事件的设备出厂之前即可获取到工作流,这样,即使该设备与中央集群断开连接仍然可以执行工作流,极大地保证了工作流的正常运行。The above technical solution can obtain the workflow before the device receiving the event leaves the factory, so that the workflow can still be executed even if the device is disconnected from the central cluster, which greatly ensures the normal operation of the workflow.
在一些可能的实现方式中,所述第一事件包括第一信息,所述第一信息为所述第一功能函数的输入。In some possible implementations, the first event includes first information, and the first information is an input of the first functional function.
在一些可能的实现方式中,所述第一设备和所述第二设备为边缘设备。In some possible implementations, the first device and the second device are edge devices.
第二方面,提供了一种工作流操作的装置,包括用于执行上述第一方面或其各实现方式中的方法的各单元。In a second aspect, a workflow operation apparatus is provided, comprising units for executing the method in the first aspect or its implementations.
第三方面,提供了一种工作流操作的装置,包括:存储器,用于存储程序;处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行上述第一方面或其各实现方式中的方法。In a third aspect, a device for workflow operation is provided, comprising: 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 processor is used to execute the method in the above-mentioned first aspect or its various implementation methods.
第四方面,提供了一种计算机可读存储介质,存储用于设备执行的程序代码,所述程序代码包括用于执行上述第一方面或其各实现方式中的方法中的步骤的指令。According to a fourth aspect, a computer-readable storage medium is provided, storing program code for execution by a device, wherein the program code includes instructions for executing the steps in the method of the first aspect or its various implementations.
图1是本申请实施例的工作流操作的方法的示意性图。FIG. 1 is a schematic diagram of a workflow operation method according to an embodiment of the present application.
图2是本申请实施例的一种service mesh的示意性图。Figure 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 a process 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 a process 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 process of an event-triggered workflow according to an embodiment of the present application.
图6是本申请实施例的工作流操作的装置的示意性框图。FIG. 6 is a schematic block diagram of a device for workflow operation according to an embodiment of the present application.
图7是本申请实施例的工作流操作的装置的示意性框图。FIG. 7 is a schematic block diagram of a device for workflow operation according to an embodiment of the present application.
附图标记列表:List of reference numerals:
100,本申请实施例的工作流操作的方法100. Method for operating a workflow according to an embodiment of the present application
110,第一设备获取工作流;110, the first device obtains a workflow;
120,在第一设备接收到第一事件后,根据工作流,确定第一事件待调用的第一功能函数;120, after the first device receives the first event, determining a 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 is located, the first device routes the first event to the second device;
CP,控制面板(control plane);CP, control plane;
F1,功能函数1;F1, functional function 1;
F2,功能函数2;F2, functional function 2;
F3,功能函数3;F3, functional 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;
SC,边车(sidecar);SC, sidecar;
600,工作流操作的装置;600, means for workflow operation;
610,获取单元;610, acquisition unit;
620,确定单元;620, determine the unit;
630,调用单元;630, calling unit;
640,路由单元;640, routing unit;
700,工作流操作的装置;700, means for workflow operation;
701,存储器;701, memory;
702,处理器;702, processor;
703,通信接口;703, communication interface;
704,总线。704, bus.
下面结合附图,对本申请实施例中的技术方案进行描述。应理解,本说明书中的具体的例子只是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围。The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the specific examples in this specification are only to help those skilled in the art to better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application.
应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能函数和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its functional function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
还应理解,本说明书中描述的各种实施方式,既可以单独实施,也可以组合实施,本申请实施例对此不作限定。It should also be understood that the various implementation methods described in this specification can be implemented individually or in combination, and the embodiments of the present application are not limited to this.
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请的范围。Unless otherwise specified, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art of the present application. The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the scope of this application.
目前,在工程师需要对应用程序进行部署或运维时,一般需要花费大量的时间在现场通过数据线直连到设备等方式为不同设备进行解决方案的现场部署。如果对应用程序进行了修改,则需要重新部署应用程序,使得工程师又要重复之前复杂繁琐的流程。Currently, when engineers need to deploy or maintain applications, they usually need to spend a lot of time on-site to deploy solutions for different devices by directly connecting to the devices through data cables. If the application is modified, the application needs to be redeployed, which requires engineers to repeat the previous complex and tedious process.
进一步地,如果需要跨多个边缘设备运行任务来完成一系列的业务流程,由于多个边缘设备可能来自不同的厂商。因此,除了需要大量的精力去处理异构系统的开发、通信、调试和集成,在部署时也会遇到上述问题,不仅浪费人力而且效率较低。Furthermore, if tasks need to be run across multiple edge devices to complete a series of business processes, since multiple edge devices may come from different manufacturers, in addition to requiring a lot of effort to handle the development, communication, debugging, and integration of heterogeneous systems, the above problems will also be encountered during deployment, which not only wastes manpower but also has low efficiency.
鉴于此,本申请实施例提出了一种功能函数(function)调用的方法,能够在减少人力的基础上有效提高工作效率。In view of this, an embodiment of the present application proposes a method for calling a function, which can effectively improve work efficiency while reducing manpower.
图1示出了本申请实施例的工作流操作的方法100的示意性流程图。方法100可以由第一设备执行。如图1所示,方法100可以包括以下内容中的至少部分内容。Fig. 1 shows a schematic flow chart of a method 100 for workflow operation 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 a workflow.
在步骤120中,在第一设备接收到第一事件后,根据工作流,确定第一 事件待调用的第一功能函数。In step 120, after the first device receives the first event, a first functional function to be called by the first event is determined according to the workflow.
在步骤130中,若第一设备为第一功能函数所在的设备,则第一设备调用第一功能函数。In step 130, if the first device is the device where the first function is located, the first device calls the first function.
在步骤140中,若第二设备为第一功能函数所在的设备,则第一设备将第一事件路由到第二设备。In step 140 , if the second device is the device where the first function is located, 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 may be a device that provides an entry point to an enterprise or service provider core network. For example, edge devices may include edge routers, routing switches, firewalls, multiplexers, and other wide area network (WAN) devices. With the development of artificial intelligence and Internet of Things (IoT) technologies, edge devices generally also have built-in processors with onboard analysis or artificial intelligence capabilities. These devices may include sensors, actuators, and IoT gateways.
当然,第一设备和第二设备也可以是除边缘设备之外的其他设备,本申请实施例对此不作具体限定。Of course, the first device and the second device may also be other devices besides edge devices, and this embodiment of the present application does not specifically limit this.
需要说明的是,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。It should be noted that the term "and/or" in this article is only a description of the association relationship between associated objects, indicating that there may be three relationships. For example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
可选地,上文中的功能函数可以为但不限于消息队列遥测传输(message queuing telemetry transport,MQTT)协议解析功能函数、数据处理功能函数等。Optionally, the function function mentioned above may be, but is not limited to, a message queuing telemetry transport (MQTT) protocol parsing function function, a data processing function function, etc.
工作流(workflow)可用于指示工作流的事件(event)调用的至少一个功能函数以及该至少一个功能函数的执行顺序。可以看出,工作流可以用于将功能函数编排为协调的微服务应用程序,即将功能函数和事件组合成一个连贯的单元,并描述功能函数的执行和以规定方式传递的信息。A workflow can be used to indicate at least one function called by an event of the workflow and the execution order of the at least one function. It can be seen that a workflow can be used to orchestrate functions into coordinated microservice applications, that is, to combine functions and events into a coherent unit and describe the execution of functions and the information transmitted in a prescribed manner.
举例说明,图2示出了本申请实施例的一种可能的网络示意性图。在图2中,工作流为:事件1调用功能函数1,在执行完功能函数1后,调用功能函数2。在执行完功能函数2后,事件2调用功能函数3。For example, Fig. 2 shows a possible network schematic diagram of an 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 2 is executed, event 2 calls function 3.
应理解,图2仅是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围。比如,事件1也可以调用功能函数3,在执行完功能函数3后,事件2也可以调用功能函数1和功能函数2。It should be understood that Figure 2 is only to help those skilled in the art better understand the embodiments of the present application, and does not limit the scope of the embodiments of the present application. For example, event 1 can also call function 3, and after function 3 is executed, event 2 can also call function 1 and function 2.
可选地,事件和工作流的定义可以参考规范CloudEvents。CloudEvents 是一种用通用格式描述事件数据的规范,以提供跨服务、平台和系统的互操作性。当然,事件和工作流的定义也可以参考云原生计算基金会(cloud native computing foundation,CNCF)无服务器工作流(serverless workflow)。Optionally, the definition of events and workflows can refer to the CloudEvents specification. CloudEvents is a specification that describes event data in a common format to provide interoperability across services, platforms, and systems. Of course, the definition of events and workflows can also refer to the Cloud Native Computing Foundation (CNCF) 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 of the embodiment of the present application is triggered by events. Optionally, an event can call one or more function functions. As shown in Figure 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, the workflow can be created by the developer and pre-configured on the built system. The system here can be, but is not limited to, a function as a service (FaaS) system. For the sake of convenience, the following takes the FaaS system as an example.
继续参考图2,FaaS系统可包括两个部分,其中一个部分为功能函数管理模块。功能函数管理模块可以用于负责功能函数的全生命周期管理,如创建、发布、更新、销毁等。示例性地,功能函数管理模块可以参照以下动作控制功能函数的生命周期:Continuing to refer to FIG2 , the FaaS system may include two parts, one of which is a function management module. The function management module may be responsible for the full life cycle management of the function, such as creation, release, update, and destruction. Exemplarily, the function management module may control the life cycle of the function with reference to the following actions:
(a)创建:创建新功能函数,包括其规格和代码;(a) Create: Create a new function, including its specification and code;
(b)发布:创建可以在集群(cluster)上部署的新版本;(b) Release: Create a new version that can be deployed on the cluster;
(c)更新别名/标签(版本):更新版本别名;(c)Update alias/tag (version): Update the version alias;
(d)获取:返回功能函数元数据和规格;(d) Get: Returns function metadata and specifications;
(e)更新:修改功能函数的最新版本;(e) Update: modify the latest version of a function;
(f)删除:删除功能函数,可以删除特定版本或所有版本的功能函数;(f) Delete: Delete a function. You can delete a specific version or all versions of the function.
(g)列表:显示功能函数及其元数据的列表;(g) List: Displays a list of functions and their metadata;
(h)获取统计信息:返回有关功能函数运行时使用情况的统计信息;(h) Get statistics: Returns statistics about the runtime usage of the function;
(i)获取日志:返回功能函数生成的日志。(i) Get log: Returns the log generated by the function.
另外一个部分为工作流管理模块,如图2所示,工作流管理模块包括工作流。Another part is the workflow management module, as shown in FIG2 , the workflow management module includes workflow.
开发人员在创建工作流之前,开发人员可以先将第一设备和/或第二设备加入网络。其中,该网络可以是服务网格(service mesh)。Before creating a workflow, the developer may first add the first device and/or the second device to a network, wherein the network may be a service mesh.
继续以图2为例进行说明,service mesh可包括控制面板(control plane)和设备。其中,控制面板除了包括FaaS系统之外,还可以执行其他动作, 如路由控制管理、功能函数注册、功能函数发现、监控和流量追踪等。Continuing with Figure 2 as an example, the service mesh may include a control plane and devices. In addition to the FaaS system, the control plane may also perform other actions, such as routing control management, function registration, function discovery, monitoring, and traffic tracking.
可选地,开发人员可以根据业务需求创建功能函数,并将创建的功能函数配置在FaaS系统中的功能函数管理模块上。之后,功能函数管理模块可将这些功能函数热部署到设备。例如,功能函数管理模块可以将这些功能函数热部署到设备上容器(container)中。Optionally, developers can create function functions according to business needs and configure the created function functions in the function function management module of the FaaS system. Afterwards, the function function management module can hot deploy these function functions to the device. For example, the function function management module can hot deploy these function functions to the container on the device.
在一种可能的实现方式中,功能函数管理模块可根据每个设备的资源将这些功能函数热部署到不同的设备上。也就是说,第一设备上部署的功能函数可以是根据第一设备的资源确定的,类似地,第二设备上部署的功能函数也可以是根据第二设备的资源确定的。In a possible implementation, the function management module can hot deploy these function functions to different devices according to the resources of each device. That is, the function functions deployed on the first device can be determined according to the resources of the first device, and similarly, the function functions deployed on the second device can 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 (CPU) resources, gateway resources, etc. of the first device. The resources of the first device may be the total resources of the first device or the resources that are not currently used by the first device. Correspondingly, the resources of the second device may also be the total resources of the second device or the resources that are not currently used by the second device.
具体来说,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 functions to the first device and the second device, wherein the function functions deployed on the device with more resources can be more than the function functions deployed on the device with fewer resources. Continuing to refer to Figure 2, if device 1 has more resources than device 2, then the function functions deployed on device 1 are more than the function functions deployed on device 2, that is, function function 1 and function function 2 are deployed on device 1, and function function 2 is deployed on device 2. Of course, function function 2 and function function 3 can also be deployed on device 1, and function function 1 is deployed on device 2.
应理解,本申请实施例对功能函数具体部署到哪个设备上不作具体限定,只需资源多的设备上部署的功能函数的数量大于资源少的设备上部署的功能函数即可。It should be understood that the embodiments of the present application do not specifically limit the device on which the functional functions are deployed. It is sufficient that the number of functional functions deployed on devices with more resources is greater than that deployed on devices with fewer resources.
上述技术方案,根据设备的资源在设备上部署功能函数,资源多的设备上部署的功能函数较多,资源少的设备上部署的功能函数相对较少,从而能够实现资源的合理分配和资源的有效利用。进一步地,根据设备的资源在设备上部署功能函数,避免了某个功能函数必须部署到某个设备的问题,提高了部署功能函数的灵活性。The above technical solution deploys functional functions on devices according to the resources of the devices. More functional functions are deployed on devices with more resources, and relatively fewer functional functions are deployed on devices with fewer resources, thereby achieving reasonable allocation of resources and effective use of resources. Furthermore, by deploying functional functions on devices according to the resources of the devices, the problem of a certain functional function having to be deployed on a certain device is avoided, and the flexibility of deploying functional functions is improved.
可选地,开发人员在确定事件调动的功能函数时,可以根据功能函数的输入确定。具体而言,事件中可以包括信息,该信息为该事件调用的功能函数的输入。比如,第一事件调用第一功能函数,第一事件包括第一信息,第一信息为第一功能函数的输入。Optionally, when determining the function function to be called by an event, the developer may determine it based on the input of the function function. Specifically, the event may include information, and the information is the input of the function function called by the event. For example, the first event calls the first function function, and the first event includes the first information, and the first information is the input of the first function 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 the workflow.
作为一种示例,FaaS系统可以每隔预设时间段向第一设备发送工作流调度信息。示例性地,预设时间段可以是5s。如此,能够提高第一设备获取到工作流的概率。As an example, the FaaS system may send workflow scheduling information to the first device every preset time period. For example, the preset time period may be 5 seconds. In this way, the probability of the first device acquiring the workflow can be increased.
作为另一种示例,在第一设备出厂前,第一设备可以接收FaaS系统向其发送的工作流调度信息。该技术方案,在第一设备出厂之前即可获取到工作流,这样,即使第一设备与中央集群断开连接仍然可以执行工作流,极大地保证了工作流的正常执行。As another example, before the first device leaves the factory, the first device can receive the workflow scheduling information sent to it by the FaaS system. This technical solution can obtain the workflow before the first device leaves the factory, so that the workflow can still be executed even if the first device is disconnected from the central cluster, which greatly ensures the normal execution of the workflow.
进一步地,方法100还可以包括:第一设备根据记录信息,确定第一功能函数所在的设备,该记录信息用于记录至少一个功能函数中每个功能函数所在的设备。Furthermore, the method 100 may also include: the first device determines the device where the first functional function is located according to the recording information, and the recording information is used to record the device where each functional function of the at least one functional function is located.
可选地,在功能函数管理模块将至少一个功能函数部署到不同的设备之后,功能函数管理模块向每个设备发送记录信息,以将至少一个功能函数中每个功能函数所在的设备通知给设备。Optionally, after the function management module deploys at least one function to different devices, the function management module sends record information to each device to notify the device of the device where each function in the at least one 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 the record information to the sidecar, so that the sidecar of each device may record the function deployed on each device. Continuing with FIG. 2 as an example, 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 is located according to the recorded information, the first device can directly call the first function.
若第一设备根据记录信息,确定自己不是第一功能函数所在的设备,而第二设备为第一功能函数所在的设备,则第一设备可以将第一事件路由到第二设备。If the first device determines, based on the recorded information, that it is not the device where the first function is located, and the second device is the device where the first function is located, 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 calls 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 calls function 1 and device 1 executes function 1.
从图3中可以看出,设备2接收事件1以及设备2将事件1路由到设备1,均是由设备的sidecar执行的。也就是说,设备2的sidecar接收事件1并将事件1路由到设备1的sidecar。As can be seen from Figure 3, the device 2 receives event 1 and the device 2 routes event 1 to device 1, which is performed by the device's sidecar. In other words, 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, and the embodiment of the present application does not specifically limit this.
可选地,第二设备还可以向第一设备发送反馈信息,该反馈信息用于反馈第二设备执行第一功能函数的执行结果。Optionally, the second device may also send feedback information to the first device, where the feedback information is used to feed back the execution result of the second device executing the first functional 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 (NACK), so that the first device knows that the second device is executing the first function.
或者,第二设备可以在执行完第一功能函数后,向第一设备发送反馈信息,比如,发送肯定应答(acknowledgment,ACK),以使第一设备知道第二设备以执行完第一功能函数。Alternatively, after executing the first function, the second device may send feedback information to the first device, for example, send an acknowledgment (ACK), so that the first device knows that the second device has completed executing the first function.
上述技术方案,在接收事件的设备不是该事件调用的功能函数所在的设备的情况下,该事件调用的功能函数所在的设备在执行完该功能函数后向接收事件的设备反馈执行功能函数的结果,使得接收事件的设备能够继续执行下一个步骤,避免了接收事件的设备无效等待的时间,有利于大大减小执行整个工作流的时间。According to the above technical scheme, when the device receiving the event is not the device where the function function called by the event is located, the device where the function function called by the event is located will feedback the result of executing the function function to the device receiving the event after executing the function 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, which is beneficial to greatly reduce the time of executing the entire workflow.
为了更加清楚地理解本申请实施例,下面在图2的基础上进一步结合图3-图5举例说明本申请实施例的事件触发工作流的具体流程。In order to more clearly understand the embodiment of the present application, the specific process of the event-triggered workflow of the embodiment of the present application is illustrated below with reference to FIG. 2 and further combined with FIG. 3 to FIG. 5 .
步骤1step 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 be triggered. When the sidecar in device 2 receives event 1, it determines that event 1 calls function 1 according to the workflow. Since function 1 is deployed on device 1, the sidecar routes event 1 to device 1 to call function 1.
步骤2Step 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 completed function 1.
接下来,设备2再次根据工作流,确定调用功能函数2,功能函数2部署在设备2上,因此,设备2直接调用功能函数2。Next, device 2 again determines to call function 2 according to the workflow. Function 2 is deployed on device 2, so device 2 directly calls function 2.
根据工作流可以知道,在执行完功能函数2后,事件2可以触发工作流,以调用功能函数3。因此,执行功能函数2后,系统等待事件2的触发。According to the workflow, after executing function function 2, event 2 can trigger the workflow to call function function 3. Therefore, after executing function function 2, the system waits for event 2 to be triggered.
步骤3Step 3
设备2中的sidecar接收到事件2后,根据工作流,确定事件2调用功能函数3。由于功能函数3部署在设备1上,因此sidecar将事件2路由到设备1上,以调用功能函数3。After the sidecar in device 2 receives event 2, it determines, based on the workflow, that event 2 calls function 3. Since function 3 is deployed on device 1, the sidecar routes event 2 to device 1 to call 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 completed.
本申请实施例,通过在设备上部署功能函数,使得整个工作流可以在设备上完成,即通过远程部署而不用去现场即可实现对应用程序的处理,极大地减少了人力。此外,设备根据用于指示事件调用的至少一个功能函数以及该至少一个功能函数的执行顺序的工作流,来完成整个工作流程,能够有效提高工作效率。In the embodiment of the present application, by deploying the function on the device, the entire workflow can be completed on the device, that is, the application can be processed by remote deployment without going to the site, which greatly reduces manpower. In addition, the device completes the entire workflow according to the workflow of at least one function for indicating event call and the execution order of the at least one function, which can effectively improve work efficiency.
进一步地,由于设备可以获取到工作流,这样不论功能函数部署到哪个设备上,设备都可以根据工作流确定事件调用的功能函数,即使该设备不是该功能函数所在的设备,也可以将事件路由到该功能函数所在的设备,以调用该功能函数,从而可以提高整个系统的灵活性。Furthermore, since 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 based on the workflow. Even if the device is not the device where the function is located, the event can be routed to the device where the function is located to call the function, thereby improving the flexibility of the entire system.
上文详细描述了本申请实施例的方法实施例,下面描述本申请实施例的装置实施例,装置实施例与方法实施例相互对应,因此未详细描述的部分可参见前面各方法实施例,装置可以实现上述方法中任意可能实现的方式。The method embodiments of the embodiments of the present application are described in detail above. The device embodiments of the embodiments of the present application are described below. The device embodiments and the method embodiments correspond to each other. Therefore, for the parts not described in detail, reference can be made to the previous method embodiments. The device can implement any possible implementation method of the above method.
图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 apparatus 600 for workflow operation can execute the method 100 for workflow operation according to the embodiment of the present application, and the apparatus 600 for workflow operation can be the first device in the aforementioned method.
如图6所示,该工作流操作的装置600包括:As shown in FIG6 , the apparatus 600 for the workflow operation includes:
获取单元610,用于获取工作流调度信息,所述工作流调度信息用于指示工作流的事件调用的至少一个功能函数以及所述至少一个功能函数的执行顺序;An acquiring unit 610 is used to acquire workflow scheduling information, where the workflow scheduling information is used to indicate at least one function called by an event of the workflow and an execution order of the at least one function;
确定单元620,用于在所述第一设备接收到第一事件后,根据所述工作流调度信息,确定所述第一事件待调用的第一功能函数,所述工作流的事件包括所述第一事件,所述至少一个功能函数包括所述第一功能函数;A determining unit 620 is configured to determine, after the first device receives a first event, a first function to be called by the first event according to the workflow scheduling information, wherein the events of the workflow include the first event, and the at least one function includes the first function;
调用单元630,用于若所述第一设备为所述第一功能函数所在的设备,则调用所述第一功能函数;A calling unit 630, configured to call the first function function if the first device is the device where the first function 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 is located.
可选地,在本申请一个实施例中,所述第一设备上部署的功能函数是根据所述第一设备的资源确定的,所述第二设备上部署的功能函数是根据所述第二设备的资源确定的。Optionally, in one embodiment of the present application, the functional function deployed on the first device is determined based on the resources of the first device, and the functional function deployed on the second device is determined based on the resources of the second device.
若所述第一设备的资源大于所述第二设备的资源,则在所述第一设备上部署的功能函数多于在所述第二设备上部署的功能函数。If the resources of the first device are greater than the resources of the second device, then the function functions deployed on the first device are more than the function functions deployed 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 is located, the apparatus 600 may further include: a communication unit for receiving feedback information sent by the second device, wherein the feedback information is used to feed back the execution result of the second device executing the first functional function.
可选地,在本申请一个实施例中,确定单元620还可以用于:根据记录信息,确定所述第一功能函数所在的设备,所述记录信息用于记录所述至少一个功能函数中每个功能函数所在的设备。Optionally, in one embodiment of the present application, the determination unit 620 may also be used to: determine the device where the first function is located based on the record information, wherein the record information is used to record the device where each function of the at least one function is located.
可选地,在本申请一个实施例中,装置600还可以包括:通信单元,用于接收系统发送的所述工作流调度信息。Optionally, in one 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 one embodiment of the present application, the communication unit is specifically used to: receive the workflow scheduling information sent by the system before the first device leaves the factory.
可选地,在本申请一个实施例中,所述第一事件包括第一信息,所述第一信息为所述第一功能函数的输入。Optionally, in one embodiment of the present application, the first event includes first information, and the first information is input of the first functional function.
可选地,在本申请一个实施例中,所述第一设备和所述第二设备为边缘设备。Optionally, in one 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实现彼此之间的通信连接。FIG7 is a schematic diagram of the hardware structure of the device for workflow operation in an embodiment of the present application. The device for workflow operation 700 shown in FIG7 may be a first device, and the device for workflow operation 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 the 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 (ROM), a static storage device, and a random access memory (RAM). The memory 701 may 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 method for workflow operation of the embodiment of the present application.
处理器702可以采用通用的CPU,微处理器,应用专用集成电路(application specific integrated circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的装置中的单元所需执行的功能函数,或者执行本申请实施例的工作流操作的方法。Processor 702 can adopt a general-purpose CPU, a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functional functions that need to be performed by the units in the device of the embodiment of the present application, or to execute the method of the workflow operation of the embodiment of the present application.
处理器702还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的工作流操作的方法的各个步骤可以通过处理器702中的硬件的集成逻辑电路或者软件形式的指令完成。The processor 702 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the workflow operation method of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 702 or by instructions in software form.
上述处理器702还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、ASIC、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器701,处理器702读取存储器701中的信息,结合其硬件完成本申请实施例的装置中包括的单元所需执行的功能函数,或者执行本申请实施例的工作流操作的方法。The processor 702 may also be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. 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 functional functions required to be executed by the units included in the device of the embodiment of the present application, or executes the method of the workflow operation of the embodiment of the present application.
通信接口703使用例如但不限于收发器一类的收发装置,来实现工作流操作的装置700与其他设备或通信网络之间的通信。例如,装置700可以通过通信接口703接收第二设备发送的反馈信息。The communication interface 703 uses a transceiver such as but not limited to a transceiver to implement communication between the apparatus 700 for workflow operation and other devices or a communication network. For example, the apparatus 700 can receive feedback information sent by the second device through the communication interface 703 .
总线704可包括在工作流操作的装置700各个部件(例如,存储器701、处理器702、通信接口703)之间传送信息的通路。The bus 704 may include a path for transmitting information between various components of the apparatus 700 for workflow operations (eg, the memory 701 , the processor 702 , and the communication interface 703 ).
应注意,尽管上述工作流操作的装置700仅仅示出了存储器、处理器、通信接口,但是在具体实现过程中,本领域的技术人员应当理解,工作流操作的装置700还可以包括实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当理解,工作流操作的装置700还可包括实现其 他附加功能函数的硬件器件。此外,本领域的技术人员应当理解,工作流操作的装置700也可仅仅包括实现本申请实施例所必须的器件,而不必包括图7中所示的全部器件。It should be noted that although the apparatus 700 for workflow operation only shows a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the apparatus 700 for workflow operation may also include other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the apparatus 700 for workflow operation 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 also include only the devices necessary for implementing the embodiments of the present application, and need not include all the devices shown in FIG. 7.
本申请实施例还提供了一种计算机可读存储介质,存储用于设备执行的程序代码,所述程序代码包括用于执行上述工作流操作的方法中的步骤的指令。The embodiment of the present application further provides a computer-readable storage medium storing program code for execution by a device, wherein the program code includes instructions for executing the steps in the above-mentioned workflow operation method.
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述工作流操作的方法。An embodiment of the present application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer is caused to perform the above-mentioned workflow operation method.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The computer-readable storage medium mentioned above may be a transient 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 description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能函数划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”和“所述”旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。The words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular "one" and "said" are intended to include the plural form as well. Similarly, the term "and/or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprising" refers to the existence of stated features, wholes, steps, operations, elements, and/or components, but does not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and/or these groupings.
所描述的实施例中的各方面、实施方式、实现或特征能够单独使用或以任意组合的方式使用。所描述的实施例中的各方面可由软件、硬件或软硬件 的结合实现。所描述的实施例也可以由存储有计算机可读代码的计算机可读介质体现,该计算机可读代码包括可由至少一个计算装置执行的指令。所述计算机可读介质可与任何能够存储数据的数据存储装置相关联,该数据可由计算机系统读取。用于举例的计算机可读介质可以包括只读存储器、随机存取存储器、紧凑型光盘只读储存器(compact disc read-only memory,CD-ROM)、硬盘驱动器(hard disk drive,HDD)、数字视频光盘(digital video disc,DVD)、磁带以及光数据存储装置等。所述计算机可读介质还可以分布于通过网络联接的计算机系统中,这样计算机可读代码就可以分布式存储并执行。The various aspects, implementations, implementations or features of the described embodiments can be used alone or in any combination. The various aspects of the described embodiments can be implemented by software, hardware or a combination of software and hardware. The described embodiments can also be embodied by a computer-readable medium storing computer-readable code, the computer-readable code comprising instructions executable by at least one computing device. The computer-readable medium can be associated with any data storage device capable of storing data that can be read by a computer system. Computer-readable media for example can include read-only memory, random access memory, compact disc read-only memory (CD-ROM), hard disk drive (HDD), digital video disc (DVD), magnetic tape, and optical data storage device. The computer-readable medium can also be distributed in computer systems connected via a network so that the computer-readable code can be stored and executed in a distributed manner.
上述技术描述可参照附图,这些附图形成了本申请的一部分,并且通过描述在附图中示出了依照所描述的实施例的实施方式。虽然这些实施例描述的足够详细以使本领域技术人员能够实现这些实施例,但这些实施例是非限制性的;这样就可以使用其它的实施例,并且在不脱离所描述的实施例的范围的情况下还可以做出变化。比如,流程图中所描述的操作顺序是非限制性的,因此在流程图中阐释并且根据流程图描述的两个或两个以上操作的顺序可以根据若干实施例进行改变。作为另一个例子,在若干实施例中,在流程图中阐释并且根据流程图描述的一个或一个以上操作是可选的,或是可删除的。另外,某些步骤或功能函数可以添加到所公开的实施例中,或两个以上的步骤顺序被置换。所有这些变化被认为包含在所公开的实施例以及权利要求中。The above technical description may refer to the accompanying drawings, which form a part of the present application, and the implementation methods according to the described embodiments are shown in the accompanying drawings by description. Although these embodiments are described in sufficient detail to enable those skilled in the art to implement these embodiments, these embodiments are non-restrictive; other embodiments can be used in this way, and changes can be made without departing from the scope of the described embodiments. For example, the order of operations described in the flowchart is non-restrictive, so the order of two or more operations illustrated in the flowchart and described according to the flowchart can be changed according to several embodiments. As another example, in several embodiments, one or more operations illustrated in the flowchart and described according to the flowchart are optional or deletable. In addition, certain steps or functional functions can be added to the disclosed embodiments, or the order of two or more steps can be replaced. All these changes are considered to be included in the disclosed embodiments and claims.
另外,上述技术描述中使用术语以提供所描述的实施例的透彻理解。然而,并不需要过于详细的细节以实现所描述的实施例。因此,实施例的上述描述是为了阐释和描述而呈现的。上述描述中所呈现的实施例以及根据这些实施例所公开的例子是单独提供的,以添加上下文并有助于理解所描述的实施例。上述说明书不用于做到无遗漏或将所描述的实施例限制到本申请的精确形式。根据上述教导,若干修改、选择适用以及变化是可行的。在某些情况下,没有详细描述为人所熟知的处理步骤以避免不必要地影响所描述的实施例。In addition, terms are used in the above technical description to provide a thorough understanding of the described embodiments. However, overly detailed details are not required to implement the described embodiments. Therefore, the above description of the embodiments is presented for the purpose of explanation and description. The embodiments presented in the above description and the examples disclosed according to these embodiments are provided separately to add context and help understand the described embodiments. The above description is not intended to be exhaustive or to limit the described embodiments to the precise form of the present application. According to the above teachings, several modifications, selective applications and changes are feasible. In some cases, well-known processing steps are not described in detail to avoid unnecessarily affecting the described embodiments.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的 技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiment of the present application, which should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims (11)
- A method of workflow operation, comprising:The first device obtains (110) a workflow for indicating at least one function of an event call and an execution order of the at least one function;After the first device receives a first event, determining (120), according to the workflow, a first function to be invoked by the first event, the event comprising the first event, the at least one function comprising the first function;If the first device is the device in which the first function is located, the first device invokes (130) the first function;if the second device is the device where the first function is located, the first device routes (140) the first event to the second device.
- The method of claim 1, wherein the function deployed on the first device is determined from resources of the first device and the function deployed on the second device is determined from resources of the second device;If the resources of the first device are larger than the resources of the second device, the functions deployed on the first device are more than the functions deployed on the second device.
- The method according to claim 1 or 2, wherein if the second device is the device where the first function is located, the method further comprises:The first device receives feedback information sent by the second device, wherein the feedback information is used for feeding back an execution result of the first function executed by the second device.
- A method according to any one of claims 1 to 3, further comprising:The first device determines the device where the first function is located according to recording information, where the recording information is used for recording the device where each function of the at least one function is located.
- The method according to any one of claims 1 to 4, wherein the first device obtaining (110) a workflow, comprising:The first device receives workflow scheduling information sent by a system, and the workflow scheduling information identifies the workflow.
- The method of claim 5, wherein the first device receiving workflow scheduling information sent by a system comprises:before the first equipment leaves the factory, the first equipment receives the workflow scheduling information sent by the system.
- The method according to any one of claims 1 to 6, wherein the first event comprises first information, the first information being an input of the first function.
- The method of any one of claims 1 to 7, wherein the first device and the second device are edge devices.
- A workflow-operated apparatus (600), the apparatus being a first device, comprising:An acquisition unit (610) for acquiring a workflow for indicating at least one function of an event call and an execution order of the at least one function;A determining unit (620) configured to determine, according to the workflow, a first function to be invoked by a first event after the first device receives the first event, where the event includes the first event, and the at least one function includes the first function;a calling unit (630) configured to call the first function if the first device is a device where the first function is located;A routing unit (640) configured to route the first event to the second device if the second device is a device where the first function is located.
- A workflow-operated apparatus, comprising:a memory (701) for storing a program;-a processor (702) for executing a program stored by the memory (701), the processor (702) being adapted to perform the method of workflow operations according to any one of claims 1 to 8 when the program stored by the memory (701) is executed.
- A computer readable storage medium storing program code for device execution, the program code comprising instructions for performing steps in a method of workflow operations according to any one of claims 1 to 8.
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 |
---|---|
CN117940904A true CN117940904A (en) | 2024-04-26 |
Family
ID=85781189
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202180102095.6A Pending CN117940904A (en) | 2021-09-30 | 2021-09-30 | Workflow operation method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117940904A (en) |
WO (1) | WO2023050410A1 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FI20051137A0 (en) * | 2005-11-09 | 2005-11-09 | Nokia Corp | Method for constructing and executing a distributed case review in a communication system |
KR20170024488A (en) * | 2015-08-25 | 2017-03-07 | 에스프린팅솔루션 주식회사 | Method and image forming divice for generating workform of image forming job |
US10565034B2 (en) * | 2017-12-29 | 2020-02-18 | Futurewei Technologies, Inc. | Event-driven serverless function orchestration |
US10853154B2 (en) * | 2019-01-30 | 2020-12-01 | Salesforce.Com, Inc. | Orchestration of a sequence of computations by external systems |
CN113067898B (en) * | 2021-06-02 | 2021-08-10 | 支付宝(杭州)信息技术有限公司 | Method for scheduling computing services for business process contracts |
-
2021
- 2021-09-30 WO PCT/CN2021/122423 patent/WO2023050410A1/en active Application Filing
- 2021-09-30 CN CN202180102095.6A patent/CN117940904A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
WO2023050410A1 (en) | 2023-04-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9195480B2 (en) | Associated plug-in management method, device and system | |
US7926070B2 (en) | Performing requested commands for model-based applications | |
US11979686B2 (en) | Method and system for software-defined camera and camera | |
CN111443985A (en) | Method and apparatus for instantiating virtual network functions | |
JP7161560B2 (en) | Artificial intelligence development platform management method, device, medium | |
US12035156B2 (en) | Communication method and apparatus for plurality of administrative domains | |
WO2021057605A1 (en) | Device management method, device, system and device, and storage medium | |
CN113835911B (en) | Intranet penetration agent method, system, host and computer readable storage medium | |
CN112688794A (en) | YANG model management method, device, system, equipment and storage medium | |
US20100228951A1 (en) | Parallel processing management framework | |
CN112698817B (en) | Message access method, device and system based on micro-service architecture and storage medium | |
JP5264837B2 (en) | Remote plug-in device, robot plug-in execution engine device, and robot plug-in execution system | |
CN116466973B (en) | Multi-concurrency firmware upgrading method, system, computer equipment and storage medium | |
WO2023050410A1 (en) | Workflow operation method and apparatus | |
CN114553686B (en) | A method, system, equipment and storage medium for active and backup traffic switching | |
CN114844898B (en) | Internet access method, device and system | |
CN117667251A (en) | Data processing methods, devices, electronic equipment and storage media | |
CN118606024A (en) | A unified access method, device, electronic device and medium for platform as a service | |
Machì et al. | Dependable execution of workflow activities on a virtual private grid middleware | |
US20110247009A1 (en) | Distributing events between an integrated development environment process and another process | |
CN120215959A (en) | Execution method, device and equipment of micro-service and storage medium | |
CN114968339A (en) | Method for deploying software infrastructure resources based on directed acyclic graph characteristics | |
CN116016679A (en) | Cloud primary service communication method, device, equipment and storage medium | |
CN115756594A (en) | Dynamic cross resource pool operator deployment method, system and storage medium | |
WO2024129079A1 (en) | Local protect image for critical applications |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |