Server non-aware system and method

Through the back-end proxy service separated from the function Pod in the Serverless platform, including client container and Proxy container, the problem of high complexity of interaction between functions and back-end services is solved, efficient data interaction and quick startup are achieved, and improved System performance and user experience.

CN118803040APending Publication Date: 2024-10-18CHINA MOBILE FINANCIAL TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311251502.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The existing serverless platform has high complexity when functions interact with back-end services, resulting in long cold start times for functions and the inability to effectively decouple functions' access to back-end services, affecting efficiency.

Method used

Through the back-end proxy service separated from the function Pod, including the client container and Proxy container, the data interaction between the function and the back-end service is realized, the load balancing service and the automatic scaling function are provided, the user writing complexity is reduced, and the function startup speed is improved.

Benefits of technology

It reduces the complexity of functions written by users, improves the cold start speed of functions, realizes efficient interaction between functions and back-end services, conforms to the Serverless concept, and improves system processing capabilities and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803040A_ABST
    Figure CN118803040A_ABST
Patent Text Reader

Abstract

The invention discloses a server non-perception system and method. Comprising a back-end proxy service stripped from a function Pod, and the back-end proxy service comprises a client container and a Proxy container; the client container is used for receiving a data request sent by a function Pod and forwarding the data request to a back-end service; the client container is used for receiving response data fed back by the back-end service based on the data request; the Proxy container is used for monitoring the response data received by the client container and acquiring the response data; and the Proxy container is also used for forwarding the response data to a function Pod corresponding to the response data. According to the method, data interaction between the function Pod and the back-end service is realized through the back-end proxy service stripped from the function Pod, so that the complexity of compiling the function by a user is reduced, and the starting speed of the function is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a server non-perception system and method. Background Art

[0002] The generally accepted definition of Serverless in the industry is Serverless = FaaS + BaaS, but most of the current cloud vendors and open source Serverless platforms focus on FaaS, which is function as a service. If the function written by the user wants to interact with the backend service (BaaS), it needs to generate a client to access the backend service, establish a connection, call the API, and close the connection. The implementation method of the above FaaS platform has increased the complexity of user function writing, and also deviated from the original intention of allowing the user's function to focus on its own business logic. When the function is started, it will also cause the function's cold start time to be too long. Therefore, how to decouple the function's access to the backend service and improve the function's cold start speed has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the present invention is to provide a server-unaware system and method, aiming to solve the technical problem of low efficiency in accessing backend services by functions in cloud-native server-unawareness in the prior art.

[0004] To achieve the above object, the present invention provides a server-unaware system, wherein the server-unaware system includes a backend proxy service separated from a function Pod, wherein the backend proxy service includes a client container and a Proxy container;

[0005] The client container is used to receive the data request sent by the function Pod and forward the data request to the backend service;

[0006] The client container is used to receive response data fed back by the backend service based on the data request;

[0007] The Proxy container is used to monitor the response data received by the client container and obtain the response data;

[0008] The Proxy container is also used to forward the response data to the function Pod corresponding to the response data.

[0009] Optionally, the function Pod has multiple copies, and the server-unaware system further includes a load balancing service;

[0010] The Proxy container is used to forward the response data to the load balancing service;

[0011] The load balancing service is used to forward the response data to the function Pod corresponding to the response data according to a preset load balancing strategy.

[0012] Optionally, the server-unaware system includes at least one of the backend proxy services;

[0013] The function Pod is used to send the data request to the load balancing service;

[0014] The load balancing service is also used to forward the data request to the backend proxy service according to a preset load balancing strategy.

[0015] Optionally, the server has no perception system, which is used to obtain business load information and automatically scale functions according to the business load information.

[0016] Optionally, the server has no perception system and is further used to determine function information of a newly added function when a new function copy is needed;

[0017] The server has no perception system and is also used to copy the function image from the image warehouse according to the function information, and start the function image to obtain a newly added function copy.

[0018] Optionally, the server has no perception system and is further used to determine the running information of each function Pod started according to the business load information;

[0019] The server has no perception system and is also used to recycle the function Pod when the running information meets a preset recycling condition.

[0020] Optionally, the backend service is used to determine common information of distributed applications, determine reusable services according to the common information, encapsulate the reusable services, and provide access interfaces for the reusable services;

[0021] The client container is used to forward the data request to the backend service based on the access interface.

[0022] Optionally, the backend proxy service is used to provide a universal data interaction protocol;

[0023] The function Pod is further used to send the data request to the backend proxy service based on the data interaction protocol;

[0024] The backend proxy service is further used to convert the data request into a data request recognizable by the backend service.

[0025] Optionally, the server has no perception system and is further used to receive function codes uploaded by users, and compile the function codes to obtain compilation results;

[0026] The server has no perception system and is also used to build a function image based on the compilation result and store the built function image in an image warehouse.

[0027] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a server-unaware method, which is applied to a server-unaware system, wherein the server-unaware system includes a backend proxy service separated from a function Pod, wherein the backend proxy service includes a client container and a Proxy container, and the server-unaware method includes:

[0028] The client container receives the data request sent by the function Pod and forwards the data request to the backend service;

[0029] The client container receives response data fed back by the backend service based on the data request;

[0030] The proxy container monitors the response data received by the client container and obtains the response data;

[0031] The Proxy container forwards the response data to the function Pod corresponding to the response data.

[0032] The server-unaware system of the present invention includes a backend proxy service separated from a function Pod, and the backend proxy service includes a client container and a Proxy container; the client container is used to receive a data request sent by the function Pod, and forward the data request to the backend service; the client container is used to receive response data fed back by the backend service based on the data request; the Proxy container is used to monitor the response data received by the client container and obtain the response data; the Proxy container is also used to forward the response data to the function Pod corresponding to the response data. The present invention implements data interaction between the function Pod and the backend service by using the backend proxy service separated from the function Pod, which reduces the complexity of user-written functions and improves the startup speed of functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a structural block diagram of the first embodiment of the server-unaware system of the present invention;

[0034] Figure 2 This is a system architecture diagram of the second embodiment of the server-unaware system of the present invention;

[0035] Figure 3 This is a flow chart of the first embodiment of the server-unaware method of the present invention.

[0036] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0037] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0038] Reference Figure 1 , Figure 1 This is a structural block diagram of the first embodiment of the server-unaware system of the present invention. The server-unaware system includes a backend proxy service 200 separated from the function Pod 100, and the backend proxy service includes a client container 300 and a proxy container 400;

[0039] The client container 300 is used to receive the data request sent by the function Pod and forward the data request to the backend service;

[0040] The client container 300 is used to receive response data fed back by the backend service based on the data request;

[0041] The proxy container 400 is used to monitor the response data received by the client container and obtain the response data;

[0042] The Proxy container 400 is also used to forward the response data to the function Pod corresponding to the response data.

[0043] It should be understood that this embodiment separates the distributed application runtime from the function Pod to form a separate BaaS Proxy service, namely the backend proxy service 200, which can be shared by all copies of the function, so that the function instance starts faster and can also use the capabilities of the distributed application runtime to interact with various backend services for data.

[0044] Furthermore, in order to improve the data processing speed of the server-unaware system, the function Pod has multiple copies, and the server-unaware system also includes a load balancing service;

[0045] The Proxy container is used to forward the response data to the load balancing service;

[0046] The load balancing service is used to forward the response data to the function Pod corresponding to the response data according to a preset load balancing strategy.

[0047] The server-unaware system includes at least one of the backend proxy services;

[0048] The function Pod is used to send the data request to the load balancing service;

[0049] The load balancing service is also used to forward the data request to the backend proxy service according to a preset load balancing strategy.

[0050] It should be noted that the preset load balancing strategy may be a forwarding rule for response data that is preset in order to achieve load balancing of multiple function Pods.

[0051] In a specific implementation, the function Pod sends the data request to the load balancing service, and the load balancing service forwards the data request to the client container in the backend proxy service according to a preset load balancing strategy. The client container forwards the data request to the backend service. The proxy container listens to the response data received by the client container, and forwards the response data to the load balancing service, and the load balancing service forwards the response data to the corresponding function Pod according to the preset load balancing strategy. The function Pod corresponding to the response data may include multiple functions or function replicas with the same functions.

[0052] The server-unaware system of this embodiment includes a backend proxy service separated from the function Pod, and the backend proxy service includes a client container and a Proxy container; the client container is used to receive a data request sent by the function Pod and forward the data request to the backend service; the client container is used to receive response data fed back by the backend service based on the data request; the Proxy container is used to monitor the response data received by the client container and obtain the response data; the Proxy container is also used to forward the response data to the function Pod corresponding to the response data. This embodiment realizes data interaction between the function Pod and the backend service by means of the backend proxy service separated from the function Pod, which reduces the complexity of user-written functions and improves the startup speed of functions.

[0053] Reference Figure 2 , Figure 2 This is a system architecture diagram of the second embodiment of the server-unaware system of the present invention. The server-unaware system is used to obtain business load information and automatically scale functions according to the business load information.

[0054] It should be noted that, please refer to Figure 2In this embodiment, the server-unaware system includes an image warehouse, which includes images of multiple functions. The business load information may include task information to be executed by each function. The automatic scaling of functions according to the business load information may be to increase the number of function replicas to execute business tasks when the business load is large, and to delete the function replicas in time after the function replicas complete the tasks.

[0055] The server has no perception system, and is also used to determine the function information of the newly added function when a new function copy is needed;

[0056] The server has no perception system and is also used to copy the function image from the image warehouse according to the function information, and start the function image to obtain a newly added function copy.

[0057] The server has no perception system, and is also used to determine the running information of each function Pod started according to the business load information;

[0058] The server has no perception system and is also used to recycle the function Pod when the running information meets a preset recycling condition.

[0059] It should be noted that the function information may be the functional information of the function to be added or the identifier of the function. The copying of the function image from the image repository according to the function information and starting the function image to obtain the newly added function copy may be copying the function image from the image repository according to the functional information of the function or the identifier of the function and starting the function image to obtain the newly added function copy. The running information may include the running status of the function Pod, and the running status includes running and idle states. When the running information meets the preset recycling condition, recycling the function Pod may be deleting the function Pod when it is determined that the function Pod is in an idle state, that is, when there is no running thread.

[0060] Furthermore, in order to improve the response speed of the backend service and increase the reuse rate of the backend service, the backend service is used to determine the common information of the distributed application, determine the reusable service according to the common information, encapsulate the reusable service, and provide an access interface for the reusable service;

[0061] The client container is used to forward the data request to the backend service based on the access interface.

[0062] It should be understood that this embodiment abstracts the commonality of distributed applications into reusable capabilities such as state management, publish and subscribe, IO binding, etc., and exposes them in the form of a unified API for use by distributed applications. The reusable services may be services with certain commonalities. The access interface may be an interface that reusable services uniformly expose to the outside for external calls. For example, the reusable services abstracted from the backend services include state management, publish and subscribe, IO binding, etc., and state management, publish and subscribe, and IO binding each correspond to an external interface for external calls.

[0063] Furthermore, the complexity of user-written functions is reduced, which reflects the true concept of Serverless. The backend proxy service is used to provide a universal data interaction protocol.

[0064] The function Pod is further used to send the data request to the backend proxy service based on the data interaction protocol;

[0065] The backend proxy service is further used to convert the data request into a data request recognizable by the backend service.

[0066] It should be noted that the data interaction protocol may include HTTP or gRPC.

[0067] In a specific implementation, when the backend proxy service receives data sent by the backend service or function Pod through HTTP or gRPC API, it converts the language or format of the received data according to the data type that the forwarding target can recognize, and sends the converted data to the forwarding target.

[0068] Furthermore, the server has no perception system and is also used to receive the function code uploaded by the user and compile the function code to obtain a compilation result;

[0069] The server has no perception system and is also used to build a function image based on the compilation result and store the built function image in an image warehouse.

[0070] The overall process of the function startup method of the distributed application runtime based on the backend service proxy (BaaS Proxy) model includes: defining the function, specifically including the definition of the necessary information required to build the function image; the necessary information required to run the function in a Serverless manner; and the corresponding Serverless framework; the definition of the backend service to be accessed, the input of the function from the backend service, and the function output to be sent to the backend service. After the function is defined and created, the function building process will be started. The function building process first compiles the function into a container image and pushes the image to the image repository. After monitoring the completion of the function building process, the function controller will generate the workload of the corresponding Serverless framework according to the function definition. The workload has the characteristics of dynamic scaling and can be dynamically scaled between 0 copies and multiple copies according to HTTP traffic or specific indicators. Various cloud and open source backend services can trigger the operation of the function through BaaS Proxy as the input of the function, and the function can also output the results to various backend services through BaaS Proxy.

[0071] In the specific implementation, please refer to Figure 2 , Figure 2 Users can upload function codes written in languages ​​such as go and Nodejs to the server-unaware system. The function builder in the server-unaware system compiles the function code, packages it into an image that complies with the OCI standard and stores it in the image warehouse. When the server-unaware system determines that the number of function copies needs to be increased based on the business load, the business load determines the function of the function to be added, and then determines the function to be added, copies the function image from the image warehouse, starts the function image, executes tasks through the started function, and monitors the running information of each function in real time. When the function is in idle state, delete the function in time. Figure 2 It can be seen that the number of function Pods is 0-N. The function Pod sends data requests to the Service (i.e., the load balancing service). The load balancing service forwards the data requests to 1-N backend proxy services through the load balancing algorithm. The Client container in the backend proxy service forwards the data requests to the backend service. Since the reusable functions in the backend service share an external interface, the Client container needs to forward the data request to the backend service through the corresponding interface according to the type of data request. Figure 2The backend service in contains three reusable functions, namely state management, publish-subscribe and IO binding. The backend service processes the data request, generates response data, and sends the response data to the Client container. The Proxy container monitors the response data received in the Client container, obtains the response data, and sends the response data to the Service (i.e., the load balancing service). The load balancing service forwards the response data to the function Pod through the load balancing algorithm.

[0072] It should be understood that the common distributed application runtime is usually run in the same Pod as the function (application) container in the form of a Sidecar container. However, when the distributed application is running, the Sidecar startup time is longer and occupies more resources than the function container. If this method is applied to the function computing platform (FaaS), it will cause the function (cold) start speed to slow down and affect performance. To this end, this embodiment proposes a backend service proxy (BaaS Proxy) mode to solve this problem: the distributed application runtime is separated from the function Pod to form a separate BaaS Proxy service for all copies of the function to share and use, so that the function instance starts faster and can also use the capabilities of the distributed application runtime to interact with various backend services. Inside the BaaS Proxy, there will be a client responsible for interacting with various cloud or open source backend services; at the same time, there will also be a Proxy responsible for forwarding the messages of various backend services received by the client to multiple copies of the function in a load-balanced manner as the input of the function. If the function needs to be output to the backend service, the output is directly sent to the Client in the BaaSProxy through the API, and then output to various backend services. In addition, when the distributed application of this embodiment is running, the common features of the distributed application are abstracted and converted into reusable capabilities such as state management, publish-subscribe, IO binding, etc., and are exposed in the form of a unified API for use by the distributed application, thereby simplifying application development.

[0073] The server-unaware system in this embodiment also obtains business load information, and automatically scales functions according to the business load information. When a new function copy is needed, the function information of the new function is determined, the function image is copied from the image warehouse according to the function information, and the function image is started to obtain the new function copy for executing business tasks. This can improve the ability of the server-unaware system to process business and improve user experience.

[0074] Moreover, the server-unaware system provided in this embodiment can reduce the complexity of user function writing, solve the problem of long function (cold) start time caused by the runtime of distributed applications, and at the same time, can quickly start function instances and interact with back-end services.

[0075] Based on the above server-unaware system embodiment, a first embodiment of a server-unaware method is proposed. Figure 3 , Figure 3 The flowchart of the first embodiment of the server-unaware method of the present invention is as follows; the server-unaware method of this embodiment is applied to a server-unaware system, wherein the server-unaware system includes a backend proxy service separated from a function Pod, wherein the backend proxy service includes a client container and a Proxy container, and the server-unaware method includes:

[0076] Step S10: The client container receives the data request sent by the function Pod, and forwards the data request to the backend service;

[0077] Step S20: the client container receives the response data fed back by the backend service based on the data request;

[0078] Step S30: the proxy container monitors the response data received by the client container and obtains the response data;

[0079] Step S40: The Proxy container forwards the response data to the function Pod corresponding to the response data.

[0080] The server-unaware method of this embodiment is applied to a server-unaware system, wherein the server-unaware system includes a backend proxy service separated from a function Pod, wherein the backend proxy service includes a client container and a Proxy container, and the server-unaware method includes: the client container receives a data request sent by the function Pod, and forwards the data request to the backend service; the client container receives response data fed back by the backend service based on the data request; the Proxy container monitors the response data received by the client container, and obtains the response data; the Proxy container forwards the response data to the function Pod corresponding to the response data. This embodiment implements data interaction between the function Pod and the backend service by using a backend proxy service separated from the function Pod, thereby reducing the complexity of user-written functions and improving the startup speed of functions.

[0081] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0082] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0083] In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third etc. do not indicate any order. These words may be interpreted as names.

[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0085] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A server-unaware system, characterized in that: The server-unaware system includes a backend proxy service separated from the function Pod, and the backend proxy service includes a client container and a proxy container; The client container is used to receive the data request sent by the function Pod and forward the data request to the backend service; The client container is used to receive response data fed back by the backend service based on the data request; The Proxy container is used to monitor the response data received by the client container and obtain the response data; The Proxy container is also used to forward the response data to the function Pod corresponding to the response data.

2. The server-unaware system according to claim 1, characterized in that: The function Pod has multiple copies, and the server-unaware system also includes a load balancing service; The Proxy container is used to forward the response data to the load balancing service; The load balancing service is used to forward the response data to the function Pod corresponding to the response data according to a preset load balancing strategy.

3. The server-unaware system according to claim 2, characterized in that: The server-unaware system includes at least one of the backend proxy services; The function Pod is used to send the data request to the load balancing service; The load balancing service is also used to forward the data request to the backend proxy service according to a preset load balancing strategy.

4. The server-unaware system according to any one of claims 1 to 3, characterized in that: The server has no perception system, which is used to obtain business load information and automatically scale functions according to the business load information.

5. The server-unaware system according to claim 4, characterized in that: The server has no perception system, and is also used to determine the function information of the newly added function when a new function copy is needed; The server has no perception system and is also used to copy the function image from the image warehouse according to the function information, and start the function image to obtain a newly added function copy.

6. The server-unaware system according to claim 4, characterized in that: The server has no perception system, and is also used to determine the running information of each function Pod started according to the business load information; The server has no perception system and is also used to recycle the function Pod when the running information meets a preset recycling condition.

7. The server-unaware system according to any one of claims 1 to 3, characterized in that: The backend service is used to determine the common information of distributed applications, determine the reusable service according to the common information, encapsulate the reusable service, and provide an access interface for the reusable service; The client container is used to forward the data request to the backend service based on the access interface.

8. The server-unaware system according to any one of claims 1 to 3, characterized in that: The backend proxy service is used to provide a general data interaction protocol; The function Pod is further used to send the data request to the backend proxy service based on the data interaction protocol; The backend proxy service is further used to convert the data request into a data request recognizable by the backend service.

9. The server-unaware system according to any one of claims 1 to 3, characterized in that: The server has no perception system and is also used to receive the function code uploaded by the user and compile the function code to obtain a compilation result; The server has no perception system and is also used to build a function image based on the compilation result and store the built function image in an image warehouse.

10. A server-unaware method, characterized in that: The server-unaware method is applied to a server-unaware system, wherein the server-unaware system includes a backend proxy service separated from a function Pod, wherein the backend proxy service includes a client container and a proxy container, and the server-unaware method includes: The client container receives the data request sent by the function Pod and forwards the data request to the backend service; The client container receives response data fed back by the backend service based on the data request; The proxy container monitors the response data received by the client container and obtains the response data; The Proxy container forwards the response data to the function Pod corresponding to the response data.