Edge function combination operation method and device and computer equipment

By combining multiple edge functions to run on the FAAS platform, the problem that lightweight edge functions are difficult to perform time-consuming tasks is solved, and the complex business needs are dynamically met, business complexity is reduced, and system efficiency and availability are improved.

CN119862027APending Publication Date: 2025-04-22CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411781389.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

Lightweight edge functions are difficult to perform time-consuming tasks, limited by CPU and memory resources.

Method used

Through the FAAS platform, multiple edge functions are combined to run, dynamically meet business needs of various orders of magnitude complexity, simplify function logic, reduce function complexity, and improve function multiplexing capabilities.

Benefits of technology

It realizes dynamic meeting complex business needs, reduces business complexity, improves system efficiency, reliability and availability, and has the advantages of low cost, high deployment efficiency, high availability and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862027A_ABST
    Figure CN119862027A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of edge computing, and discloses an edge function combination running method and device and computer device.The edge function combination running method is applied to a function, namely a service platform, of an edge server side and comprises the steps that in response to operation of a user, a function workflow is created, the function workflow comprises a plurality of edge functions and a first routing rule, and the first routing rule comprises external access addresses corresponding to the plurality of edge functions and indication information of an execution sequence of the plurality of edge functions; generating a configuration file based on the function workflow; the configuration file is sent to at least one edge device, so that after the target edge device receives a request message generated by a client based on the target service, the multiple edge functions are triggered to run in sequence according to the execution sequence to achieve the target service, and the edge device is provided with at least one edge function in the multiple edge functions during function running. By means of a function, namely a service platform, a plurality of edge functions can be combined for operation to complete a complex business process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing technology, and in particular to an edge function combination operation method, device and computer equipment. Background Art

[0002] Edge computing distributes some of the data and computing functions that were originally processed in cloud computing centers to devices at the edge of the network, such as edge servers and gateways close to sensors and terminal devices. Edge computing can reduce data transmission delays, improve response speed, and better meet the needs of application scenarios with high real-time requirements. With the rise of edge computing, scenarios that use edge functions for task computing are increasingly being used.

[0003] Compared with traditional Internet services, edge functions have the advantages of being lightweight, fast to start, and taking up less resources. However, when the complexity of the business increases, lightweight edge functions are limited by the central processing unit (CPU) and memory resources, making it difficult to execute time-consuming tasks. Summary of the invention

[0004] In view of this, the present invention provides an edge function combination operation method, apparatus and computer equipment to solve the problem that lightweight edge functions are difficult to execute time-consuming tasks.

[0005] In a first aspect, the present invention provides a method for running a combination of edge functions, which is applied to a function-as-a-service platform on an edge server, the method comprising: creating a function workflow in response to a user's operation, the function workflow comprising multiple edge functions and a first routing rule, the combination of multiple edge functions being used to implement a target business, the first routing rule comprising external access addresses corresponding to the multiple edge functions and indication information of the execution order of the multiple edge functions; generating a configuration file based on the function workflow; sending the configuration file to at least one edge device, so that after the target edge device receives a request message generated by a client based on the target business, the multiple edge functions are triggered to run in sequence in the execution order to implement the target business, and the function runtime of at least one edge function among the multiple edge functions is deployed on the edge device.

[0006] The edge function combination operation method provided in this embodiment, with the help of the FAAS platform, realizes the target business through the combination operation of multiple edge functions, can dynamically meet business needs of various levels of complexity, simplify function logic, and reduce function complexity. Moreover, it can also improve the function reuse capability, add functions with the same functions to different workflows, and reduce business complexity. At the same time, the edge function combination operation method provided in this embodiment also has the advantages of low cost, high deployment efficiency, high availability and fault tolerance, convenient management, reusability and security, which can better meet the ever-changing business needs.

[0007] In an optional embodiment, after generating a configuration file based on the function workflow, the method also includes: determining whether the edge device has the resources required by the corresponding edge function; when the edge device has the resources required by the corresponding edge function, loading the resources into the function runtime of the corresponding edge function; when the edge device does not have the resources required by the corresponding edge function, downloading the resources required by the corresponding edge function from cloud storage, and loading the resources into the function runtime of the corresponding edge function.

[0008] In an optional implementation, when each edge device deploys multiple edge function runtimes, the multiple edge functions are executed sequentially on the same edge device in an execution order.

[0009] In an optional implementation, the function runtimes of multiple edge functions are deployed on different edge devices in the same local area network, and the multiple edge functions are executed sequentially on different edge devices in an execution order.

[0010] In this embodiment, the function runtime of the same edge function is deployed on different edge devices, and the workload of the function workflow can be distributed to multiple edge devices to avoid performance degradation, response delay, or even crash of a single resource due to excessive load. At the same time, the processing power of multiple resources is fully utilized to improve the efficiency, reliability, and availability of the overall system and achieve load balancing.

[0011] In a second aspect, the present invention provides a method for combined operation of edge functions, which is applied to the function operation of an edge device, when the edge device deploys the function operation of at least one edge function, and at least one edge function includes a first execution function, and the first execution function is the first edge function executed in the function workflow corresponding to the target business. The method includes: receiving a configuration file from a function as a service platform; parsing the configuration file to generate a second routing rule, the second routing rule including internal access addresses of multiple edge functions and indication information of the execution order of multiple edge functions; after receiving a request message formed by a client based on the target business, running the first execution function to process the request message to obtain a processed request message; based on the internal access address and the execution order of multiple edge functions, sending the processed request message to the next edge function until the next edge function is the last edge function executed in the function workflow or a stop indication information is received.

[0012] In an optional embodiment, context component information is added to the request message, and the processed request message is sent to the next edge function based on the internal access address and the execution order of multiple edge functions, including: based on the internal access address and the execution order of multiple edge functions, the processed request message is sent to the next edge function by setting the context component information.

[0013] In an optional implementation, the function runtime of the same edge function is deployed on multiple edge devices, and the same edge function corresponds to multiple internal access addresses. The method also includes: when the first execution function fails to run, reselecting the internal access address of the first execution function; running the first execution function through the function runtime corresponding to the new internal access address to obtain a processed request message.

[0014] In a third aspect, the present invention provides an edge function combination operation device, the device comprising: a creation module, used to create a function workflow in response to a user's operation, the function workflow comprising multiple edge functions and a first routing rule, the combination of multiple edge functions is used to implement a target business, the first routing rule comprising external access addresses corresponding to multiple edge functions and indication information of the execution order of multiple edge functions; a generation module, used to generate a configuration file based on the function workflow; a first sending module, used to send the configuration file to at least one edge device, so that after the target edge device receives a request message generated by a client based on the target business, multiple edge functions are triggered to run in sequence in the execution order to implement the target business, and the function runtime of at least one edge function among the multiple edge functions is deployed on the edge device.

[0015] In a fourth aspect, the present invention provides an edge function combination operation device, the device comprising: a receiving module, used to receive a configuration file from a function as a service platform; a parsing module, used to parse the configuration file to generate a second routing rule, the second routing rule including internal access addresses of multiple edge functions and indication information of the execution order of multiple edge functions; an operation module, used to run a first execution function to process the request message after receiving a request message formed by a client based on a target business, to obtain a processed request message; a second sending module, used to send the processed request message to the next edge function based on the internal access address and the execution order of multiple edge functions, until the next edge function is the last edge function executed in the function workflow or a stop indication information is received.

[0016] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method of the above-mentioned first aspect or any corresponding embodiment thereof, or executes the method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0017] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof, or to execute the method of the second aspect or any corresponding embodiment thereof.

[0018] In a seventh aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the method of the above-mentioned first aspect or any corresponding embodiment thereof, or to execute the method of the above-mentioned second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a flow chart of a method for combining and running edge functions according to an embodiment of the present invention;

[0021] Figure 2 is a flow chart of another edge function combination operation method according to an embodiment of the present invention;

[0022] Figure 3 is a flow chart of another edge function combination operation method according to an embodiment of the present invention;

[0023] Figure 4 is a structural block diagram of an edge function combination operation device according to an embodiment of the present invention;

[0024] Figure 5 is a structural block diagram of another edge function combination operation device according to an embodiment of the present invention;

[0025] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] With the rise of edge computing, billions of devices are connected to edge networks, generating a large number of computing tasks at the edge, and the use of edge functions for task computing is becoming more and more common. Edge functions are usually code logic units running in edge computing environments, deployed on edge devices (such as edge servers, gateways, etc.) close to data sources or user terminals, and use the computing resources of edge devices to perform tasks locally without having to send data to remote cloud computing centers for processing and then returning results. They can quickly process and analyze real-time incoming data, and then output corresponding results to meet specific business needs.

[0028] Edge functions are usually lightweight, short-running tasks that can be started and stopped quickly as needed. However, when processing complex combined services such as authentication, encryption and decryption, data processing, and data storage, for example, services such as image compression, content review, thumbnail generation, and face recognition after uploading images, processing price increase orders in shopping scenarios, and triggering updates to systems such as payment systems, inventory systems, and purchase records, etc., lightweight edge functions are limited by CPU and memory resources and find it difficult to execute time-consuming or logically complex services.

[0029] In view of this, the present invention provides an edge function combination operation method, which uses the Function as a Service (FAAS) platform to reasonably combine multiple edge functions to complete complex business processes, and can dynamically meet business needs of various levels of complexity.

[0030] Specifically, the FAAS platform is a cloud computing service model that allows designers to upload code in the form of functions to the cloud platform. The platform is responsible for automatically running and managing these functions, so that designers do not need to worry about the construction and operation of the underlying infrastructure, and can focus more on writing business logic code, thereby efficiently implementing application development and deployment operations.

[0031] The edge function combination operation method provided by the present invention can be applied to various edge computing scenarios, such as unified authentication of Internet of Things (IoT) devices, data encryption and decryption processes and data calculation, real-time analysis, and edge artificial intelligence training.

[0032] In some examples, the edge function combination operation method provided by the present invention can be used to process, filter and analyze data streams. For example, a monitoring system can pass data to different functions to perform complex event processing.

[0033] The edge function combination operation method provided by the present invention can also be used to automate and coordinate business processes. For example, approval processes, order processing, customer request processing, etc. Different functions represent different steps, and the execution of each step can be automatically triggered, monitored, and recorded.

[0034] The present invention can provide edge function capabilities that meet business needs through function combination operation, so that the edge functions on edge devices or edge nodes can complete complex business processes according to predetermined rules. Edge computing can improve function programming capabilities, simplify business processes, and provide more efficient computing power and freedom.

[0035] According to an embodiment of the present invention, an embodiment of an edge function combination operation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system, terminal device or server such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] In this embodiment, a method for running edge function combination is provided, which can be used for the FAAS platform of the edge server, and the edge server can be a computer device or a server, etc. Figure 1 is a flow chart of a method for combining and running edge functions according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0037] Step S101, creating a function workflow in response to a user's operation.

[0038] The function workflow includes multiple edge functions and a first routing rule. The combination of the multiple edge functions is used to implement the target business. The first routing rule includes external access addresses of the multiple edge functions and indication information of the execution order of the multiple edge functions.

[0039] The external access address can be the public Internet Protocol (IP) address of the edge device where the function runtime of the edge function is deployed. The function runtimes of multiple edge functions can be deployed on the same edge device or on different edge devices within the same local area network (LAN).

[0040] Specifically, when the user needs the edge device to execute a specific business (i.e., target business), he can create multiple edge functions required to execute the target business on the FAAS platform according to the business logic, and add a first routing rule to limit the external access addresses of the multiple edge functions and the execution order of the multiple edge functions, so that the client can find the function runtime of the edge function corresponding to the target business, and prompt multiple edge functions to run in sequence according to preset rules.

[0041] For example, executing the target business requires a combination of four edge functions. At this time, the process of creating a function workflow can be: the FAAS platform generates four edge functions f1, f2, f3 and f4 based on the user's input operation; the FAAS platform creates the workflow w1 and adds the first routing rule based on the user's input operation; the FAAS platform adds the four edge functions f1, f2, f3 and f4 to the workflow w1 based on the user's input operation to form a function workflow.

[0042] Specifically, the code constituting the edge function can reasonably use the Application Programming Interface (API) such as Context.next and Context.end. The execution order of multiple edge functions can be represented by the order in which the four edge functions f1, f2, f3 and f4 are added. For example, if the execution order of multiple edge functions is f1, f2, f3 and f4, then f1, f2, f3 and f4 are added to the workflow w1 in sequence.

[0043] When the first routing rule does not characterize the execution order of the edge function, the execution order of the edge function can be determined by the code logic of the edge function, and the edge function can be called by Context.next(Request, name). For example, if the first routing rule does not characterize the execution order of f4, f4 can be called by the Context.next(Request, f4) command. Specifically, the edge function corresponding to name needs to be registered in the function workflow in advance. If the edge function corresponding to name does not exist in the function workflow, an error prompt will be returned.

[0044] After adding four edge functions f1, f2, f3 and f4 to workflow w1, the first edge function in the execution order (such as f1) is designated as the first execution function to receive the client's request message, wherein the client's request message can be a Hypertext Transfer Protocol (HTTP) request message.

[0045] After the function workflow is formed, that is, after the workflow w1 is bound to the four edge functions f1, f2, f3 and f4, the function workflow can be saved in the database of the FAAS platform.

[0046] Step S102, generating a configuration file based on the function workflow.

[0047] Specifically, the configuration file may be a configuration file in a lightweight data exchange format (JavaScript Object Notation, JSON).

[0048] Exemplarily, the configuration file may include information such as resources that multiple edge functions depend on (such as memory size or CPU usage limit, etc.), the name of the function workflow, and multiple edge functions.

[0049] Step S103, sending a configuration file to at least one edge device, so that after the target edge device receives a request message generated by the client based on the target business, multiple edge functions are triggered to run in sequence in an execution order to implement the target business.

[0050] Among them, the function runtime of at least one edge function among the multiple edge functions is deployed on the edge device. For example, each edge device can deploy the function runtime of multiple edge functions, and the multiple edge functions are sequentially executed in the execution order on the same edge device. The function runtimes of the multiple edge functions can also be deployed on different edge devices, and the multiple edge functions are sequentially executed on the different edge devices.

[0051] Function runtime refers to the operating environment used to execute function code logic in related computing environments such as FAAS platforms. Function runtime is equivalent to a container or execution engine, which provides the basic conditions and resources required for function code execution, so that the edge function code created by the user can be loaded, parsed and executed on the specified edge device, and then output the corresponding results to meet specific business needs.

[0052] Specifically, after the FAAS platform generates the configuration file, it sends the configuration file to the node of the function runtime of at least one edge device. After the function runtime receives the configuration file, it generates the environment required for the edge function to run based on the configuration file, and sends the second routing rule generated based on the configuration file to the gateway of at least one edge device, so that after the target edge device receives the request message, it runs the corresponding edge function to process the request message, and passes the processed request message to other edge functions based on the second routing rule, so that multiple edge functions run and process the request message in sequence in the execution order to achieve the target business.

[0053] Among them, the second routing rule includes internal access addresses of multiple edge functions and indication information of the execution order of multiple edge functions. The internal access address can be the private IP address of the edge device when the function of the edge function is deployed.

[0054] The edge function combination operation method provided in this embodiment, with the help of the FAAS platform, realizes the target business through the combination operation of multiple edge functions, can dynamically meet the business needs of various levels of complexity, simplify function logic, and reduce function complexity. Moreover, it can also improve the function reuse capability, add functions with the same functions to different workflows, and reduce business complexity.

[0055] At the same time, the edge function combination operation method provided in this embodiment also has the advantages of low cost, high deployment efficiency, high availability and fault tolerance, convenient management, reusability and security, which can better meet the ever-changing business needs.

[0056] Specifically, edge function combination operation only requires payment for the actual execution time of the function, so function computing is usually more cost-effective than maintaining the traditional server architecture, reducing infrastructure costs and maintenance costs. Splitting the business into multiple edge functions can be released and deployed faster, and each edge function can be developed and debugged independently without affecting other functions, which helps to quickly iterate to meet market needs. FAAS platforms usually have built-in high availability features to ensure the availability of functions. In addition, since edge functions are stateless and more fault-tolerant, failures can be handled more easily.

[0057] Moreover, the FAAS platform is responsible for managing the resource usage, automatic scaling, and high availability of functions, reducing the pressure of operation and maintenance. Users only need to focus on their own business logic without worrying about server management and load balancing. The edge functions after business splitting can also be used as general functions and reused in different workflows, which can reduce the amount of coding and improve maintainability. The FAAS platform provides security and permission control functions. When edge functions are combined, permission control can be added to limit the execution and access to edge functions, which helps to enhance the security of the application. In addition, the FAAS platform can also provide message queues, databases, and other cloud services.

[0058] In some optional implementations, after generating a configuration file based on the function workflow, the edge function combination operation method further includes steps a1 to a3:

[0059] Step a1, determining whether the edge device has the resources required by the corresponding edge function.

[0060] Specifically, the resource may be memory size, CPU time, etc.

[0061] Step a2, when the edge device has the resources required by the corresponding edge function, the resources are loaded into the function runtime of the corresponding edge function;

[0062] Step a3: When the edge device does not have the resources required by the corresponding edge function, the resources required by the corresponding edge function are downloaded from the cloud storage, and the resources are loaded into the function runtime of the corresponding edge function.

[0063] Exemplarily, the configuration file may also include information indicating the resources that multiple edge functions depend on. The FAAS platform can determine the resources that the edge functions depend on through the configuration information, and then determine whether the edge device has the resources required by the corresponding edge function. If so, it is directly loaded into the function runtime to run the corresponding edge function; if not, the resource is downloaded from the cloud storage and loaded into the function runtime.

[0064] In this embodiment, a method for running an edge function combination is provided, which can be used for the above-mentioned edge device, wherein the edge device deploys at least one edge function, and the at least one edge function includes a first execution function, and the first execution function is the first edge function executed in the function workflow corresponding to the target business. Figure 2 is a flow chart of a method for combining and running edge functions according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0065] Step S201, receiving a configuration file from a function-as-a-service platform.

[0066] Specifically, after the edge device receives the configuration file sent by the FAAS platform, the function runtime on the edge device is configured based on the configuration file so that the function runtime can run the corresponding edge function.

[0067] Step S202: parsing the configuration file to generate a second routing rule.

[0068] Among them, the second routing rule includes internal access addresses of multiple edge functions and indication information of the execution order of multiple edge functions. The internal access address can be the private IP address of the edge device when the function of the edge function is deployed.

[0069] Specifically, after the edge device receives the request message, it parses the configuration file, obtains the configuration information of each edge function in the function workflow, determines the internal access address and execution order of the edge function to generate a second routing rule, and sends the second routing rule to the local gateway of the edge device.

[0070] Exemplarily, the function runtime of the same edge function is deployed on multiple edge devices in the same local area network. At this time, the process of step S02 can be specifically as follows: the function runtime parses the received configuration file of the function workflow, obtains the configuration information of each edge function in the function workflow, and obtains the IP address of the same 192.168.x network segment (i.e., the internal access address). When the function runtime, randomly selects up to three 192.168.x IP addresses in the same local area network for each edge function, as well as the local 127.0.0.1 address, to generate a second routing rule.

[0071] In this embodiment, the function runtime of the same edge function is deployed on different edge devices, and the workload of the function workflow can be distributed to multiple edge devices to avoid performance degradation, response delay, or even crash of a single resource due to excessive load. At the same time, the processing power of multiple resources is fully utilized to improve the efficiency, reliability, and availability of the overall system and achieve load balancing.

[0072] Step S203: after receiving the request message formed by the client based on the target service, run the first execution function to process the request message to obtain a processed request message.

[0073] Specifically, after the edge function (here is the first execution function) is triggered by the client's request message, a context component (Context) is added to the request message to record the currently executed edge function. When the first execution function is executed, Context.set(key,data) can be used to write data required for subsequent function execution, for example, the decrypted original data. Subsequent functions can obtain data through the Context.get(key) command.

[0074] Among them, the subsequent function refers to an edge function among multiple edge functions whose execution order is after the current execution function. For example, the function workflow includes four edge functions f1 to f4, and the execution order of the edge functions is f1, f2, f3 and f4. At this time, if the current execution function is f1 (also the first execution function), the subsequent function can be f2.

[0075] Step S204, based on the internal access address and the execution order of multiple edge functions, the processed request message is sent to the next edge function until the next edge function is the last edge function executed in the function workflow or a stop indication message is received.

[0076] The next edge function also refers to an edge function whose execution order is after the currently executed function among multiple edge functions.

[0077] Exemplarily, the request message is added with context component information, and the processed request message can be sent to the next edge function by setting the context component information based on the internal access address and the execution order of multiple edge functions.

[0078] Specifically, after obtaining the processed request message, you can call the Context.next(Request) command to pass the processed request message to the internal access address of the next edge function, triggering the next edge function to run and process the received processed request message. After processing, repeat the above process until the next edge function is the last edge function executed in the function workflow.

[0079] After the last edge function processes the received request message, the final processing result, such as the HTTP response body (Response), can be generated. The process can then be ended through Context.end(Response) and the processing result can be sent to the client.

[0080] Exemplarily, during the execution of multiple edge functions, it can also be determined based on current business data whether to continue executing (next()) the next execution function or to terminate execution (end()) and return.

[0081] The edge function combination operation method provided in this embodiment, with the help of the FAAS platform, realizes the target business through the combination operation of multiple edge functions, can dynamically meet business needs of various levels of complexity, simplify function logic, and reduce function complexity.

[0082] In some implementations, the function runtime of the same edge function is deployed on multiple edge devices in the same local area network, each edge function corresponds to multiple (such as two or three) internal access addresses, and the edge function combined operation method further includes step b1 and step b2:

[0083] Step b1, when the first execution function fails to run, reselect the internal access address corresponding to the first execution function when the function runs.

[0084] Step b2, running the first execution function when the function corresponding to the new internal access address is running, to obtain a processed request message.

[0085] Specifically, when running the first execution function, if the function runtime at the local 127.0.0.1 address fails to run the first execution function, the function runtime at the 192.168.x address will be accessed sequentially, and the first execution function will be executed through the function runtime at the 192.168.x address until the first execution function runs successfully.

[0086] In this implementation, the function runtime of the same edge function is deployed on different edge devices. When the edge function fails to execute when a function runtime with an internal access address is executed, the edge function can be switched to another function runtime with an internal access address to execute the edge function, thereby ensuring that multiple edge functions can run in sequence to complete the target task.

[0087] The following example takes four edge functions (f1, f2, f3 and f4) required to execute the target business as an example. Figure 3 The process of the edge function combination operation method provided by the present invention is described in detail.

[0088] Specifically, Figure 3 As shown, the FAAS platform first creates edge functions f1, f2, f3, and f4 based on user operations, and creates a workflow w1, then defines triggers and the execution order of multiple edge functions, and adds edge functions f1, f2, f3, and f4 to the workflow to complete the creation of the function workflow. Then, a configuration file is generated based on the function workflow, and the configuration file is sent to the function runtime of at least one edge device. After that, it is determined whether the edge device has the resources required for the edge function. If so, the resources are loaded into the function runtime of the corresponding edge function. If not, the resources are downloaded from the cloud storage, and then loaded into the function runtime of the corresponding edge function.

[0089] After the resources are loaded into the function runtime, the function runtime parses the configuration file, reads the IP address of the edge device where the edge function is deployed, generates a second routing rule, and sends the second routing rule to the gateway.

[0090] After receiving the request message sent by the client, the edge function can be executed when the function at the 127.0.0.1 address is running. If the 127.0.0.1 address fails to run or for load balancing considerations, the edge function can be executed when the function at the 192.168.x address is running. After executing the four edge functions f1, f2, f3 and f4 based on the second routing rule, the processing result of the request message is obtained and the processing result is returned.

[0091] In this embodiment, an edge function combination operation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0092] This embodiment provides an edge function combination operation device, such as Figure 4 As shown, including:

[0093] A creation module 401 is used to create a function workflow in response to a user operation, where the function workflow includes a plurality of edge functions and a first routing rule, where the combination of the plurality of edge functions is used to implement a target business, and where the first routing rule includes external access addresses corresponding to the plurality of edge functions and indication information of an execution order of the plurality of edge functions;

[0094] A generating module 402, used to generate a configuration file based on the function workflow;

[0095] The first sending module 403 is used to send a configuration file to at least one edge device so that after the target edge device receives a request message generated by the client based on the target business, multiple edge functions are triggered to run in sequence in an execution order to implement the target business, and a function runtime of at least one edge function among the multiple edge functions is deployed on the edge device.

[0096] In some optional embodiments, the device further comprises:

[0097] A determination module, used to determine whether the edge device has the resources required by the corresponding edge function;

[0098] A loading module, used to load resources into the function runtime of the corresponding edge function when the edge device has the resources required by the corresponding edge function;

[0099] The download module is used to download the resources required by the corresponding edge function from the cloud storage when the edge device does not have the resources required by the corresponding edge function, and load the resources into the function runtime of the corresponding edge function.

[0100] In some optional implementations, when each edge device deploys multiple edge function runtimes, the multiple edge functions are executed sequentially on the same edge device in an execution order.

[0101] In some optional implementations, the function runtimes of multiple edge functions are deployed on different edge devices within the same local area network, and the multiple edge functions are executed sequentially on different edge devices in an execution order.

[0102] This embodiment also provides an edge function combination operation device, such as Figure 5 As shown, including:

[0103] A receiving module 501 is used to receive a configuration file from a function-as-a-service platform;

[0104] A parsing module 502, used to parse the configuration file to generate a second routing rule, wherein the second routing rule includes indication information of internal access addresses of multiple edge functions and execution order of the multiple edge functions;

[0105] An operation module 503 is used to execute a first execution function to process the request message after receiving the request message formed by the client based on the target service, so as to obtain a processed request message;

[0106] The second sending module 504 is used to send the processed request message to the next edge function based on the internal access address and the execution order of multiple edge functions, until the next edge function is the last edge function executed in the function workflow or a stop indication message is received.

[0107] In some optional implementations, the request message is added with context component information, and the second sending module 504 includes:

[0108] The sending unit is used to send the processed request message to the next edge function by setting context component information based on the internal access address and the execution order of multiple edge functions.

[0109] In some optional implementations, the function runtime of the same edge function is deployed on multiple edge devices, and the same edge function corresponds to multiple internal access addresses, and the apparatus further includes:

[0110] A selection module, used for reselecting the internal access address of the first execution function when the first execution function fails to run;

[0111] The processing module is used to run the first execution function when the function corresponding to the new internal access address is running, so as to obtain a processed request message.

[0112] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0113] The edge function combination operation device in this embodiment is presented in the form of a functional unit, where the unit refers to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0114] The embodiment of the present invention also provides a computer device, such as Figure 6As shown, the computer device includes: one or more processors 610, memory 620, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 610 is taken as an example.

[0115] The processor 610 may be a central processing unit, a network processor or a combination thereof. The processor 610 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0116] The memory 620 stores instructions executable by at least one processor 610, so that the at least one processor 610 executes the method shown in the above embodiment.

[0117] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0118] The memory 620 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 620 may also include a combination of the above types of memory.

[0119] The computer device also includes an input device 630 and an output device 640. The processor 610, the memory 620, the input device 630 and the output device 640 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0120] The input device 630 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0121] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0122] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0123] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0124] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0125] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0126] In the description of this specification, the description with reference to the terms "this embodiment", "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0127] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0128] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the present invention.

Claims

1. A method for combining edge functions, characterized in that: A function-as-a-service platform applied to an edge server, the method comprising: In response to a user operation, a function workflow is created, the function workflow comprising a plurality of edge functions and a first routing rule, the combination of the plurality of edge functions being used to implement a target business, the first routing rule comprising external access addresses corresponding to the plurality of edge functions and indication information of an execution order of the plurality of edge functions; Based on the function workflow, generate a configuration file; The configuration file is sent to at least one edge device so that after the target edge device receives a request message generated by the client based on the target business, the multiple edge functions are triggered to run in sequence in an execution order to implement the target business, and a function runtime of at least one edge function among the multiple edge functions is deployed on the edge device.

2. The method according to claim 1, characterized in that After generating a configuration file based on the function workflow, the method further includes: Determine whether the edge device has resources required by the corresponding edge function; When the edge device has resources required by the corresponding edge function, the resources are loaded into the function runtime of the corresponding edge function; When the edge device does not have the resources required by the corresponding edge function, the resources required by the corresponding edge function are downloaded from the cloud storage, and the resources are loaded into the function runtime of the corresponding edge function.

3. The method according to claim 2, characterized in that When the function runtime of the multiple edge functions is deployed on each edge device, the multiple edge functions are sequentially executed in the execution order on the same edge device.

4. The method according to claim 2, characterized in that: The multiple edge functions are deployed on different edge devices in the same local area network when they are run, and the multiple edge functions are run sequentially on different edge devices in the execution order.

5. A method for combining edge functions, characterized in that: When a function runtime is applied to an edge device, the edge device deploys a function runtime of at least one edge function, and the at least one edge function includes a first execution function, and the first execution function is the first edge function executed in a function workflow corresponding to a target business, the method includes: Receive the configuration file from the function-as-a-service platform; Parsing the configuration file to generate a second routing rule, wherein the second routing rule includes internal access addresses of a plurality of edge functions and indication information of an execution order of the plurality of edge functions; After receiving a request message formed by the client based on the target service, running the first execution function to process the request message to obtain a processed request message; Based on the internal access address and the execution order of the plurality of edge functions, the processed request message is sent to the next edge function until the next edge function is the last edge function executed in the function workflow or a stop indication message is received.

6. The method according to claim 5, characterized in that The request message is added with context component information, and the processed request message is sent to the next edge function based on the internal access address and the execution order of the plurality of edge functions, including: Based on the inbound access address and the execution order of the plurality of edge functions, the processed request message is sent to the next edge function by setting context component information.

7. The method according to claim 5 or 6, characterized in that: The function runtime of the same edge function is deployed on multiple edge devices, and the same edge function corresponds to multiple internal access addresses. The method also includes: When the first execution function fails to run, reselecting the internal access address of the first execution function; The first execution function is executed when the function corresponding to the new internal access address is executed to obtain a processed request message.

8. A device for combining and running edge functions, characterized in that: The device comprises: A creation module, configured to create a function workflow in response to a user operation, wherein the function workflow includes a plurality of edge functions and a first routing rule, wherein a combination of the plurality of edge functions is used to implement a target business, and the first routing rule includes external access addresses corresponding to the plurality of edge functions and indication information of an execution order of the plurality of edge functions; A generation module, used to generate a configuration file based on the function workflow; The first sending module is used to send the configuration file to at least one edge device, so that after the target edge device receives the request message generated by the client based on the target business, the multiple edge functions are triggered to run in sequence in the execution order to implement the target business, and the function runtime of at least one edge function among the multiple edge functions is deployed on the edge device.

9. A marginal function combination operation device, characterized in that: The device comprises: A receiving module, used to receive a configuration file from the function-as-a-service platform; A parsing module, used for parsing the configuration file to generate a second routing rule, wherein the second routing rule includes internal access addresses of a plurality of edge functions and indication information of an execution order of the plurality of edge functions; An operation module, configured to execute a first execution function to process a request message formed by a client based on a target service after receiving the request message, so as to obtain a processed request message; The second sending module is used to send the processed request message to the next edge function based on the internal access address and the execution order of the multiple edge functions, until the next edge function is the last edge function executed in the function workflow or a stop indication message is received.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method of any one of claims 1 to 4 or the method of any one of claims 5 to 7 by executing the computer instructions.