FaaS distributed computing system, method and storage medium based on sidecar pattern
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-08-11
AI Technical Summary
为了实现一个函数需要维护一个项目,开发完成后再编译构建生成容器镜像,执行函数时需要调度镜像、启动容器再执行函数,导致非常高的冷启动延迟
[0027]The beneficial technical effects of this invention include: balancing ease of use, performance, security, and completeness; developers only need to write function logic code blocks online, eliminating the need to download project templates and manage complex dependencies to complete microservice development, making it simple and easy to use; interpreting and executing function logic code blocks fulfills business requirements, eliminating the need for lengthy processes such as downloading images, starting containers, starting projects, and initialization, resulting in low cold start latency; a single compute node container can handle multiple functions, leading to high resource utilization; revoking local resource access permissions on compute nodes ensures that untrusted function code execution on compute nodes poses no security risk; simultaneously, operations of microservice middleware such as databases, caches, and messaging are unified to a distributed runtime, and data access permissions between different users are controlled through security policies, ensuring high overall system security.
Smart Images

Figure CN116010968B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, specifically to a FaaS distributed computing system, method, and storage medium based on the sidecar model. Background Technology
[0002] FaaS is a new type of cloud computing service delivery model. Developers do not need to worry about the hardware and software infrastructure; they only need to write function logic units to complete business development. In current common FaaS system implementations, the top-down process needs to provide the following functional modules: 1. Function Gateway: Exposing function triggering entry points to the outside world via protocols such as HTTP and AMQP; 2. Function Scheduling: Parsing requests entering the function gateway, starting the function execution environment, and injecting function code blocks; 3. Function Execution: Providing the runtime environment and system resources such as network and storage for function execution, compiling, interpreting, and executing the function to return results; 4. Resource Scheduling: Providing the ability to expand and shrink function execution units.
[0003] The aforementioned process modules are all indispensable components in building a FaaS system. Usability, performance, security, and completeness are key metrics for FaaS platforms, and current FaaS platforms tend to prioritize one of these metrics. A common approach is to focus on security and completeness, using a scheme where each function corresponds to a project and an execution container. This approach sacrifices usability and performance. Implementing a function requires maintaining a project, compiling and building a container image after development, and then scheduling the image, starting the container, and finally executing the function, resulting in very high cold start latency. Therefore, it is necessary to research FaaS distributed computing technologies that can balance usability, performance, security, and completeness. Summary of the Invention
[0004] The technical problem this invention aims to solve is the current lack of FaaS distributed computing technology that balances ease of use, performance, security, and completeness. This invention proposes a FaaS distributed computing system, method, and storage medium based on the sidecar model, which can achieve FaaS distributed computing that balances ease of use, performance, security, and completeness.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a FaaS distributed computing system based on the sidecar mode, comprising a function gateway, a middleware service layer, and at least one computing node.
[0006] The function gateway provides a business function access interface, which receives business function call requests and returns business function results.
[0007] The middleware service layer provides database services, caching services, message queue services, and file storage services to the function gateway and compute nodes. The database service includes a business function query service.
[0008] After receiving a business function call request, the function gateway calls the business function query service of the middleware service layer in the sidecar mode to obtain business function information. The function gateway submits the business function information to the computing node for execution. When the computing node executes the business function information, it calls the middleware service layer in the sidecar mode. The computing node then feeds back the business function execution result to the function gateway.
[0009] Preferably, the business function call request includes a business function name and parameter data. The function gateway obtains the corresponding business function body through the business function name and business function query service, uses the business function body and parameter data as business function information, and submits the business function information to the computing node.
[0010] Preferably, the computing node runs at least one virtual machine, which is connected to the middleware service layer via a sidecar mode.
[0011] Preferably, the computing node runs multiple virtual machines, and the multiple virtual machines support different function languages. After receiving the business function information, the computing node submits the business function information to the virtual machine of the corresponding function language.
[0012] Preferably, the middleware service layer also provides monitoring services and logging services. The monitoring service is used to monitor the execution efficiency of the virtual machine, and the logging service is used to record the logs of the compute node and the virtual machine running on the compute node.
[0013] Preferably, the middleware service layer has a function service self-discovery module. The virtual machine runs function services. The function service self-discovery module intercepts the virtual machine's inbound and outbound messages through the sidecar mode. Based on the inbound and outbound messages and the function service call message template, it discovers the function services provided by the virtual machine. The middleware service layer also provides a function service call service, which provides function service call interfaces for other virtual machines.
[0014] The FaaS distributed computing method based on the sidecar pattern is executed by the aforementioned FaaS distributed computing system based on the sidecar pattern, and includes the following steps:
[0015] Expose the business function access interface to receive business function call requests and return business function results;
[0016] Middleware services are provided through the sidecar pattern. These middleware services include database services, caching services, message queue services, and file storage services. The database services include business function query services.
[0017] The function access interface obtains business function information through the business function query service based on the business function call request;
[0018] A computing node is established, which receives the business function information and executes the business function information by calling the middleware service through the sidecar mode.
[0019] The computing node feeds back the execution results of the business function information to the business function access interface.
[0020] Preferably, the method by which the computing node completes the execution of business function information includes:
[0021] The computing node establishes at least one virtual machine;
[0022] The computing node sends the business function information to the virtual machine;
[0023] The virtual machine executes business function information by calling middleware services through the sidecar mode.
[0024] Preferably, the computing node establishes multiple virtual machines, and the multiple virtual machines support different function languages. After receiving the business function information, the computing node submits the business function information to the virtual machine of the corresponding function language.
[0025] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the FaaS distributed computing method based on the sidecar pattern as described above.
[0026] A computer-readable storage medium storing a computer program that, when executed by a distributed computer system, implements the FaaS distributed computing method based on the sidecar pattern as described above.
[0027] The beneficial technical effects of this invention include: balancing ease of use, performance, security, and completeness; developers only need to write function logic code blocks online, eliminating the need to download project templates and manage complex dependencies to complete microservice development, making it simple and easy to use; interpreting and executing function logic code blocks fulfills business requirements, eliminating the need for lengthy processes such as downloading images, starting containers, starting projects, and initialization, resulting in low cold start latency; a single compute node container can handle multiple functions, leading to high resource utilization; revoking local resource access permissions on compute nodes ensures that untrusted function code execution on compute nodes poses no security risk; simultaneously, operations of microservice middleware such as databases, caches, and messaging are unified to a distributed runtime, and data access permissions between different users are controlled through security policies, ensuring high overall system security.
[0028] Other features and advantages of the present invention will be disclosed in detail in the following detailed description and accompanying drawings. Attached Figure Description
[0029] The invention will be further described below with reference to the accompanying drawings:
[0030] Figure 1 This is a schematic diagram of the FaaS distributed computing system architecture according to an embodiment of the present invention.
[0031] Figure 2 This is a schematic diagram of the FaaS distributed computing method according to an embodiment of the present invention.
[0032] Figure 3 This is a schematic diagram of the method for executing business function information by a computing node according to an embodiment of the present invention.
[0033] Figure 4 This is a schematic diagram of the computer system structure according to an embodiment of the present invention.
[0034] Among them: 10, Function Gateway; 20, Middleware Service Layer; 30, Compute Node; 40, Computer System; 41, Memory; 42, Computer Program; 43, Processor. Detailed Implementation
[0035] The technical solutions of the embodiments of the present invention will be explained and described below with reference to the accompanying drawings. However, the following embodiments are only preferred embodiments of the present invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments in the implementation methods without creative effort are all within the protection scope of the present invention.
[0036] In the following description, terms such as “inner,” “outer,” “upper,” “lower,” “left,” and “right” are used only to indicate orientation or positional relationship for the convenience of describing the embodiments and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0037] Before introducing the technical solution of this embodiment, the application scenario of this embodiment will be introduced.
[0038] FaaS: Function as a Service. A service provider offers a platform that allows customers to develop, run, and manage application functionality without the complexities of building and maintaining the infrastructure typically associated with developing and launching applications. Building applications according to this model is one way to implement a Function as a Service architecture, often used when building microservice applications.
[0039] In current common FaaS system implementations, the following functional modules need to be provided from top to bottom: Function Gateway 10, which exposes function triggering entry points to the outside world through protocols such as HTTP and AMQP; Function Scheduling, which parses requests entering Function Gateway 10, starts the function execution environment, and injects function code blocks; Function Execution, which provides the runtime environment and system resources such as network and storage for function execution, compiles, interprets, and executes the function to return results; and Resource Scheduling, which provides the ability to expand and shrink function execution units.
[0040] The above-mentioned process modules are all indispensable components in building a FaaS system. Among them, ease of use, performance, security, and completeness have become important metrics for FaaS platforms. Currently, most FaaS platforms tend to focus on improving some of these metrics.
[0041] To balance ease of use, performance, security, and completeness, this embodiment provides a FaaS distributed computing system based on the sidecar pattern. Please refer to the appendix. Figure 1 It includes a function gateway 10, a middleware service layer 20, and at least one computing node 30.
[0042] Function Gateway 10 provides a business function access interface, which receives business function call requests and returns business function results.
[0043] Middleware service layer 20 provides database services, caching services, message queue services, and file storage services to function gateway 10 and compute node 30. Database services include business function query services.
[0044] After receiving a business function call request, the function gateway 10 calls the business function query service of the middleware service layer 20 through the sidecar mode to obtain the business function information. The function gateway 10 submits the business function information to the computing node 30 for execution. When the computing node 30 executes the business function information, it calls the middleware service layer 20 through the sidecar mode. The computing node 30 then feeds back the business function execution result to the function gateway 10.
[0045] The business function call request includes the business function name and parameter data. The function gateway 10 obtains the corresponding business function body through the business function name and business function query service, and submits the business function body and parameter data as business function information to the computing node 30.
[0046] Compute node 30 runs at least one virtual machine, which connects to middleware service layer 20 via sidecar mode.
[0047] Compute node 30 runs multiple virtual machines, which support different function languages. After receiving business function information, compute node 30 submits the business function information to the virtual machine of the corresponding function language.
[0048] The middleware service layer 20 also provides monitoring and logging services. The monitoring service is used to monitor the execution efficiency of virtual machines, and the logging service is used to record logs of compute node 30 and the virtual machines running on compute node 30.
[0049] The middleware service layer 20 has a function service self-discovery module. The virtual machine runs function services. The function service self-discovery module intercepts the virtual machine's inbound and outbound messages through the sidecar mode. Based on the inbound and outbound messages and the function service call message template, it discovers the function services provided by the virtual machine. The middleware service layer 20 also provides a function service call service, which provides function service call interfaces for other virtual machines.
[0050] On the other hand, this embodiment provides a FaaS distributed computing method based on the sidecar mode, which is executed by the aforementioned FaaS distributed computing system based on the sidecar mode. Please refer to the appendix. Figure 2 This includes the following steps:
[0051] Step A01) Expose the business function access interface, receive business function call requests, and return business function results;
[0052] Step A02) Provide middleware services through the sidecar pattern. The middleware services include database services, caching services, message queue services, and file storage services. The database services include business function query services.
[0053] Step A03) The function access interface obtains business function information through the business function query service based on the business function call request;
[0054] Step A04) Establish computing node 30. Computing node 30 receives business function information and executes the business function information by calling middleware services through the sidecar mode.
[0055] Step A05) The compute node 30 feeds back the execution result of the business function information to the business function access interface.
[0056] This embodiment balances ease of use, performance, security, and completeness. Developers only need to write function logic code blocks online, without needing to download project templates or manage complex dependencies to complete microservice development, making it simple and easy to use. Interpreting and executing function logic code blocks fulfills business requirements, eliminating the need for lengthy processes such as downloading images, starting containers, starting projects, and initialization, resulting in low cold start latency. A single compute node 30 container can handle multiple functions, leading to high resource utilization. Revoking local resource access permissions on compute node 30 eliminates security risks even when untrusted function code executes on compute node 30. Furthermore, operations on microservice middleware such as databases, caches, and messaging are unified to a distributed runtime environment. By controlling data access permissions between different users through security policies, the overall system security is guaranteed to be high.
[0057] Please see the appendix Figure 3 The methods by which computing node 30 completes the execution of business function information include:
[0058] Step B01) At least one virtual machine is established on compute node 30;
[0059] Step B02) Compute node 30 sends the business function information to the virtual machine;
[0060] Step B03) The virtual machine calls the middleware service through the sidecar mode to complete the execution of the business function information.
[0061] Compute node 30 establishes multiple virtual machines, which support different function languages. After receiving business function information, compute node 30 submits the business function information to the virtual machine of the corresponding function language.
[0062] On the other hand, this application provides a computer system, please refer to the appendix. Figure 4 The computer system 40 includes a memory 41, a processor 43, and a computer program 42 stored in the memory 41 and executable on the processor 43. When the computer program 42 is executed by the processor 43, it implements the FaaS distributed computing method based on the sidecar mode as described above.
[0063] The computer system can be a general-purpose computer system or a special-purpose computer system. In specific implementations, the computer system can be a server cluster including multiple servers, such as a blockchain system including multiple nodes. Those skilled in the art will understand that... Figure 4 This is merely an example of a computer system and does not constitute a limitation on the computer system. It may include more or fewer components than shown in the figure, or combinations of certain components, or different components, such as input / output devices, network access devices, etc.
[0064] Processor 43 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processor 43 can be a microprocessor or any conventional processor.
[0065] In some embodiments, memory 41 may be an internal storage unit of a computer system, such as a hard disk or RAM. In other embodiments, memory 41 may be an external storage device of a computer system, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Furthermore, memory 41 may include both internal and external storage units of the computer system. Memory 41 is used to store the operating system, applications, boot loader, data, and other programs. Memory 41 can also be used to temporarily store data that has been output or will be output.
[0066] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program 42, which, when executed by a processor 43, implements the FaaS distributed computing method based on the sidecar mode as described above.
[0067] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.
Claims
1. A FaaS distributed computing system based on the sidecar mode, characterized in that, It includes a function gateway, a middleware service layer, and at least one compute node. The function gateway provides a business function access interface, which receives business function call requests and returns business function results. The middleware service layer provides database services, caching services, message queue services, and file storage services to the function gateway and compute nodes. The database service includes a business function query service. After receiving a business function call request, the function gateway calls the business function query service of the middleware service layer in the sidecar mode to obtain business function information. The function gateway submits the business function information to the computing node for execution. When the computing node executes the business function information, it calls the middleware service layer in the sidecar mode. The computing node then feeds back the business function execution result to the function gateway.
2. The FaaS distributed computing system based on the sidecar mode according to claim 1, characterized in that, The business function call request includes a business function name and parameter data. The function gateway obtains the corresponding business function body through the business function name and business function query service, and submits the business function body and parameter data as business function information to the computing node.
3. The FaaS distributed computing system based on the sidecar mode according to claim 1 or 2, characterized in that, The compute node runs at least one virtual machine, which is connected to the middleware service layer via a sidecar mode.
4. The FaaS distributed computing system based on the sidecar mode according to claim 3, characterized in that, The computing node runs multiple virtual machines, and the multiple virtual machines support different function languages. After receiving the business function information, the computing node submits the business function information to the virtual machine of the corresponding function language.
5. The FaaS distributed computing system based on the sidecar mode according to claim 1 or 2, characterized in that, The middleware service layer also provides monitoring and logging services. The monitoring service is used to monitor the execution efficiency of the virtual machine, and the logging service is used to record the logs of the compute node and the virtual machine running on the compute node.
6. The FaaS distributed computing system based on the sidecar mode according to claim 3, characterized in that, The middleware service layer has a function service self-discovery module. The virtual machine runs function services. The function service self-discovery module intercepts the virtual machine's inbound and outbound messages through the sidecar mode. Based on the inbound and outbound messages and the function service call message template, it discovers the function services provided by the virtual machine. The middleware service layer also provides a function service call service, which provides function service call interfaces for other virtual machines.
7. A FaaS distributed computing method based on the sidecar mode, executed by the FaaS distributed computing system based on the sidecar mode as described in any one of claims 1 to 6. Its features are, Includes the following steps: Expose the business function access interface to receive business function call requests and return business function results; Middleware services are provided through the sidecar pattern. These middleware services include database services, caching services, message queue services, and file storage services. The database services include business function query services. The function access interface obtains business function information through the business function query service based on the business function call request; A computing node is established, which receives the business function information and executes the business function information by calling the middleware service through the sidecar mode. The computing node feeds back the execution results of the business function information to the business function access interface.
8. The FaaS distributed computing method based on the sidecar mode according to claim 7, characterized in that, The method by which the computing node completes the execution of business function information includes: The computing node establishes at least one virtual machine; The computing node sends the business function information to the virtual machine; The virtual machine executes business function information by calling middleware services through the sidecar mode.
9. The FaaS distributed computing method based on the sidecar mode according to claim 8, characterized in that, The computing node establishes multiple virtual machines, and the multiple virtual machines support different function languages. After receiving the business function information, the computing node submits the business function information to the virtual machine of the corresponding function language.
10. A computer system, characterized in that, The computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements the FaaS distributed computing method based on the sidecar mode as described in any one of claims 7 to 9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a distributed computer system, implements the FaaS distributed computing method based on the sidecar mode as described in any one of claims 7 to 9.
Citation Information
Patent Citations
Dynamic sharing in secure memory environments using edge service sidecars
CN112583583A
Data processing method and device in micro-service system based on service grid architecture
CN113722070A