Life cycle callback processing method, device and equipment based on function calculation

By introducing life cycle callback processing methods in function calculations, the problem of lack of flexibility and complexity in traditional life cycle management is solved, and more efficient resource utilization and processing efficiency is achieved.

CN119473444APending Publication Date: 2025-02-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411741960.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The life cycle management of traditional function calculations lacks flexibility and is difficult to adapt to the needs of different application scenarios. Users need to write complex scripts or modify system configurations when configuring and adjusting life cycle management. The management process is complex and error-prone, resulting in relatively high processing efficiency. Low.

Method used

Provides a life cycle callback processing method based on function calculation. By receiving task processing requests, determining the objective function calculation instance, obtaining its environment variables, and determining the initialization parameter configuration status based on the environment variables. If the status is not initialized, the life cycle configuration parameters are obtained for initialization parameters until the initialization is successful. Then the task processing request is fed back to the user container, and the data processing task is executed through the user container calling the objective function calculation instance.

Benefits of technology

Ensure that before performing the data processing task that handles the requested data processing tasks, all dependent resources have been successfully initialized, improving the reliability and stability of the system, reducing the problem of request failure caused by initialization failure, and improving the processing efficiency and resource utilization of life cycle management .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473444A_ABST
    Figure CN119473444A_ABST
Patent Text Reader

Abstract

The invention relates to a life cycle callback processing method and device based on function calculation, equipment and a storage medium. The method comprises the steps of determining a target function calculation instance associated with a received task processing request, obtaining an environment variable corresponding to the target function calculation instance, and if it is determined that an initialization parameter configuration state corresponding to the target function calculation instance is uninitialized according to the environment variable, executing the task processing operation on the target function calculation instance. And acquiring a life cycle configuration parameter corresponding to the target function calculation instance, and performing initialization parameter configuration on the target function calculation instance according to the life cycle configuration parameter to obtain a configured target initialization parameter. If it is determined that the initialization parameter configuration state is successful initialization according to the target initialization parameter, the task processing request is fed back to the user container, the target function calculation instance is called through the user container, and a data processing task corresponding to the task processing request is executed. By adopting the method, the resource utilization rate of carrying out life cycle management on the calculation function can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for lifecycle callback processing based on function computing. Background Art

[0002] With the development of cloud computing and container technologies, a lightweight function computing model has emerged. Function computing is a cloud computing server model that allows developers to upload and run function codes without having to manage the underlying servers and infrastructure. Function computing can execute code based on event triggers and charge according to actual resource usage, allowing developers to focus on business logic without having to worry about operation and maintenance.

[0003] In traditional technology, when the function computing mode is used for task processing or event processing, container scheduling can be performed based on container orchestration platforms such as Kubernetes (i.e. K8s) to perform task processing or event processing based on the called container.

[0004] However, in actual application, function computing and container management both need to face the problem of lifecycle management. However, the lifecycle management of traditional function computing is usually relatively fixed, lacks flexibility, and is difficult to adapt to the needs of different application scenarios. When users configure and adjust lifecycle management, they still need to write complex scripts for different stages or modify system configurations in sequence. The management process is complex and prone to errors, and there is still a problem of low efficiency in lifecycle management of function computing. Summary of the invention

[0005] Based on this, it is necessary to provide a lifecycle callback processing method, device, computer equipment, computer-readable storage medium and computer program product based on function computing, which can improve the resource utilization rate in the lifecycle management process of computing functions and the processing efficiency of lifecycle management in order to address the above technical problems.

[0006] In the first aspect, the present application provides a lifecycle callback processing method based on function computing, including: receiving a task processing request, determining a target function computing instance associated with the task processing request; obtaining environment variables corresponding to the target function computing instance, and determining the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables; if it is determined that the initialization parameter configuration state is uninitialized, obtaining the lifecycle configuration parameters corresponding to the target function computing instance, and performing initialization parameter configuration on the target function computing instance according to the lifecycle configuration parameters to obtain the configured target initialization parameters; if it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameters, feeding back the task processing request to the user container, so as to call the target function computing instance through the user container to execute the data processing task corresponding to the task processing request.

[0007] In the second aspect, the present application also provides a lifecycle callback processing device based on function computing, including: a target function computing instance determination module, which is used to receive a task processing request and determine the target function computing instance associated with the task processing request; an initialization parameter configuration state determination module, which is used to obtain the environment variables corresponding to the target function computing instance, and determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables; an initialization parameter configuration module, which is used to obtain the lifecycle configuration parameters corresponding to the target function computing instance if it is determined that the initialization parameter configuration state is uninitialized, and perform initialization parameter configuration on the target function computing instance according to the lifecycle configuration parameters to obtain the configured target initialization parameters; a data processing task processing module, which is used to feed back the task processing request to the user container if it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameters, so as to call the target function computing instance through the user container to execute the data processing task corresponding to the task processing request.

[0008] In a third aspect, the present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: receiving a task processing request, and determining an objective function computing instance associated with the task processing request; obtaining environment variables corresponding to the objective function computing instance, and determining an initialization parameter configuration state corresponding to the objective function computing instance based on the environment variables; if it is determined that the initialization parameter configuration state is uninitialized, obtaining a life cycle configuration parameter corresponding to the objective function computing instance, and performing initialization parameter configuration on the objective function computing instance based on the life cycle configuration parameter to obtain configured target initialization parameters; if it is determined that the initialization parameter configuration state is successfully initialized based on the target initialization parameter, the task processing request is fed back to the user container, so as to call the objective function computing instance through the user container to execute the data processing task corresponding to the task processing request.

[0009] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the following steps when executed by a processor: receiving a task processing request, determining an objective function computing instance associated with the task processing request; obtaining environment variables corresponding to the objective function computing instance, and determining an initialization parameter configuration state corresponding to the objective function computing instance based on the environment variables; if it is determined that the initialization parameter configuration state is uninitialized, obtaining a lifecycle configuration parameter corresponding to the objective function computing instance, and performing initialization parameter configuration on the objective function computing instance based on the lifecycle configuration parameter to obtain configured target initialization parameters; if it is determined that the initialization parameter configuration state is successfully initialized based on the target initialization parameter, feeding back the task processing request to a user container, so as to call the objective function computing instance through the user container to execute a data processing task corresponding to the task processing request.

[0010] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the following steps when executed by a processor: receiving a task processing request, determining an objective function computing instance associated with the task processing request; obtaining environment variables corresponding to the objective function computing instance, and determining an initialization parameter configuration state corresponding to the objective function computing instance based on the environment variables; if it is determined that the initialization parameter configuration state is uninitialized, obtaining a lifecycle configuration parameter corresponding to the objective function computing instance, and performing initialization parameter configuration on the objective function computing instance based on the lifecycle configuration parameter to obtain configured target initialization parameters; if it is determined that the initialization parameter configuration state is successfully initialized based on the target initialization parameter, feeding back the task processing request to the user container, so as to call the objective function computing instance through the user container to execute the data processing task corresponding to the task processing request.

[0011] In the above-mentioned lifecycle callback processing method, device, computer equipment, computer-readable storage medium and computer program product based on function computing, by receiving a task processing request, determining the target function computing instance associated with the task processing request, and obtaining the environment variables corresponding to the target function computing instance, so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables. Wherein, when it is determined that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained, and the target function computing instance is configured with the initialization parameters according to the lifecycle configuration parameters to obtain the configured target initialization parameters, so as to feedback the task processing request to the user container when the initialization parameter configuration state is determined to be successfully initialized according to the target initialization parameters, and the target function computing instance is called by the user container to execute the data processing task corresponding to the task processing request, so as to ensure that all dependent resources have been successfully initialized before executing the data processing task corresponding to the task processing request, so as to improve the reliability and stability of the system, reduce the request failure problem caused by initialization failure, and further improve the resource utilization rate in the process of lifecycle management of the computing function, as well as the processing efficiency of lifecycle management. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] FIG1 is an application environment diagram of a lifecycle callback processing method based on function computing in one embodiment;

[0014] Figure 2 The figure is a flowchart of a method for processing a lifecycle callback based on function computing in one embodiment;

[0015] Figure 3 It is a flowchart of a method for processing a lifecycle callback based on function computing in another embodiment;

[0016] Figure 4 A flowchart of a method for processing a lifecycle callback based on function computing in another embodiment;

[0017] Figure 5 1 is a flowchart of a method for processing a lifecycle callback based on function computing in another embodiment;

[0018] Figure 6 The figure is a schematic diagram of the overall processing flow of a lifecycle callback processing method based on function computing in one embodiment;

[0019] Figure 7 It is a structural block diagram of a lifecycle callback processing device based on function computing in one embodiment;

[0020] Figure 8 It is a structural block diagram of a lifecycle callback processing device based on function calculation in another embodiment;

[0021] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] The lifecycle callback processing method based on function computing provided in the embodiment of the present application involves cloud computing technology and can be applied to the application environment shown in FIG1. ​​Among them, the container orchestration platform 102 is deployed with a function computing service platform 104 and a user container 106 for running data processing tasks, and the terminal 108 communicates with the function computing service platform 104 through the network. The data storage system can store the data that the function computing service platform 104 needs to process. The data storage system can be integrated on the function computing service platform 104, or it can be placed on the cloud or other network servers. Among them, the terminal 108 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and aircraft, etc. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, and projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, and head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The function computing service platform 104 can be an independent physical server, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Among them, the terminal 108 and the function computing service platform 104 can be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiments of the present application.

[0024] Among them, the terminal 108 and the function computing service platform 104 can be used alone to execute the life cycle callback processing method based on function computing provided in the embodiment of the present application, and the terminal 108 and the function computing service platform 104 can also cooperate to execute the life cycle callback processing method based on function computing provided in the embodiment of the present application. For example, taking the terminal 108 and the function computing service platform 104 cooperating to execute the life cycle callback processing method based on function computing provided in the embodiment of the present application as an example, the function computing service platform 104 receives the task processing request triggered by the user based on the terminal 108, determines the target function computing instance associated with the task processing request, and obtains the environment variables corresponding to the target function computing instance, so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables. Among them, if the function computing service platform 104 determines that the initialization parameter configuration state is uninitialized, the life cycle configuration parameters corresponding to the target function computing instance are obtained, and the target function computing instance is initialized according to the life cycle configuration parameters. The parameter configuration is configured to obtain the configured target initialization parameters. Further, if the function computing service platform 104 determines that the initialization parameter configuration state is successfully initialized according to the target initialization parameter, the task processing request is fed back to the user container 106, so as to call the target function computing instance through the user container 106 and execute the data processing task corresponding to the task processing request. The data processing result obtained by executing the data processing task can be fed back to the terminal 108 that triggered the task processing request through the function computing service platform 104 for the user to view and access.

[0025] In an exemplary embodiment, Figure 2 As shown, a method for processing a lifecycle callback based on function computing is provided, and the method is applied to the function computing service platform 104 in FIG. 1 as an example for explanation, including the following steps 202 to 208. Among them:

[0026] Step 202: Receive a task processing request and determine an objective function computing instance associated with the task processing request.

[0027] Specifically, the user can trigger a task processing request based on the terminal. After detecting the task processing request triggered by the user, the terminal will feedback the task processing request to the function computing service platform deployed by the container orchestration platform. The function computing service platform receives the task processing request and parses the task processing request to determine the target function computing instance associated with the task processing request, that is, it determines the target function computing instance used to execute the data processing task corresponding to the task processing request.

[0028] Function computing (Function as a Service, Faas) refers to a cloud computing service model that allows developers to upload and run function codes without having to manage the underlying servers and infrastructure. Function computing can specifically execute code based on event triggers and is billed based on actual resource usage, allowing developers to focus on business logic without having to worry about operation and maintenance. Function computing instances refer to task instances that use the function computing model, which can use the function computing model to execute data processing tasks corresponding to task processing requests and obtain corresponding data processing results.

[0029] For example, the container orchestration platform can be a Kubernetes (i.e., K8s) platform, which can be used to realize the deployment, expansion, and management of automated containerized applications, and provides service discovery, load balancing, automatic expansion, and self-repair functions, which can manage containerized applications more efficiently. Among them, the container orchestration platform is a function computing service platform deployed on the Kubernetes platform, which can be a Knative serverless platform (i.e., a local serverless platform based on the Kubernetes container orchestration platform), which is used to build, deploy, and manage modern serverless (i.e., Serverless) applications, and specifically provides event-driven automatic expansion, simplified development processes, and seamless containerization support, which can make it easier to develop and run serverless applications.

[0030] Step 204 , obtaining the environment variables corresponding to the target function computing instance, and determining the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables.

[0031] Specifically, after determining the target function computing instance associated with the task processing request, the function computing service platform obtains the environment variables corresponding to the determined target function computing instance, including the environment variables in the initialization phase, the environment variables in the operation phase, and the environment variables in the resource recovery phase, etc., so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables, such as the environment variables in the initialization phase. Among them, the environment variables in the initialization phase specifically correspond to the stage before the user container deployed in the container orchestration platform receives the task processing request, that is, before the target function computing instance receives the task processing request, the necessary initialization operations need to be performed, such as the establishment of a database connection, to ensure that before responding to the task processing request and executing the data processing task corresponding to the task processing request, the resources on which the target function computing instance depends have been successfully initialized.

[0032] Furthermore, the initialization parameter configuration state corresponding to the target function computing instance specifically includes states such as uninitialized, successful initialization, and failed initialization. If it is determined that the initialization parameter configuration state is uninitialized, the function computing service platform performs initialization parameter configuration on the target function computing instance, and sends the configured target initialization parameters to the environment variables, so that a database connection can be established through the target initialization parameters in the environment variables. If it is determined that the initialization parameter configuration state is failed initialization, the function computing service platform returns an error message and destroys the current function computing instance to ensure system stability.

[0033] In an exemplary embodiment, if the function computing service platform determines that the initialization parameter configuration status is successfully initialized, the task processing request is fed back to the auxiliary container deployed in the container orchestration platform, so that the task processing request is forwarded to the user container deployed in the container orchestration platform through the auxiliary container, and the initialization processing interface is called to establish a database connection according to the target initialization parameters in the environment variables, so that the user container can obtain the target data associated with the task processing request from the connected database, thereby executing the corresponding data processing task according to the target data.

[0034] Exemplarily, the auxiliary container deployed in the container orchestration platform may be a queue-proxy container. The queue-proxy container is a key component corresponding to the function computing service platform. It runs as a sidecar container in each Pod (the smallest scheduling unit of the container orchestration platform) of the container orchestration platform. The user container may be a user container, which is used to run applications. In each Pod, the number of user containers may be one or more, which can be set according to the actual needs of the user.

[0035] Specifically, the queue-proxy container is an auxiliary container that runs in the same Pod as the user container. The auxiliary container enhances or extends the functionality of the user container by providing additional services or functions (such as logging, monitoring, security, or data synchronization) without directly modifying the main application code corresponding to the user container.

[0036] Among them, the main functions of the queue-proxy container include request concurrency statistics and traffic forwarding. Specifically, request concurrency statistics means that the queue-proxy container is responsible for counting the request concurrency arriving at the business container to ensure that it does not exceed the set concurrency. When the request exceeds the set concurrency, the queue-proxy container will temporarily store the excess requests in its own queue until the concurrency is reduced. 1. Traffic forwarding means that all requests sent to the application instance will first pass through the queue-proxy container and then be forwarded to the user container.

[0037] Step 206, if it is determined that the initialization parameter configuration state is uninitialized, obtain the lifecycle configuration parameters corresponding to the target function computing instance, and perform initialization parameter configuration on the target function computing instance according to the lifecycle configuration parameters to obtain the configured target initialization parameters.

[0038] Specifically, if the function computing service platform determines that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained from the service backend. Among them, the lifecycle configuration parameters are usually used to manage the lifecycle of the target function computing instance, and the lifecycle of the target function computing instance specifically includes the creation phase, the running phase, and the destruction phase. Parameters can be configured according to actual needs at different stages of the lifecycle.

[0039] The creation phase refers to the phase of creating a function computing instance, and when calling the function computing instance, the function computing instance is allowed to access the data in the database and the specific methods in the task execution method. The running phase refers to the phase of calling the target function computing instance, that is, in the running phase, the target function computing instance can be called through the user container to execute the data processing task corresponding to the task processing request. The destruction phase refers to the phase of destroying the instance and releasing resources.

[0040] For example, after creating the target function computing instance in the creation phase, the initialization parameters can be configured for the target function computing instance, so that the necessary initialization operations can be performed before the function instance receives the request, such as the establishment of a database connection, to ensure that all dependent resources have been successfully initialized before processing the request, so as to improve the reliability and stability of the system. Similarly, when destroying the instance in the destruction phase, before releasing the resources, the resource recovery parameters are configured for the target function computing instance, so that the resource recovery operation can be performed before the function instance is scaled down or terminated, that is, by performing the cleanup operation before the container is terminated, it can be ensured that all resources are correctly released, reducing resource waste and improving resource utilization efficiency.

[0041] In an exemplary embodiment, the lifecycle configuration parameters in the service backend are obtained by the user based on the service frontend configuration. The lifecycle configuration parameters may include the creation time, end time, and survival time length of the target function instance. Among them, the service frontend can allow users to configure the initialization parameters and stop callback related parameters, including environment variables and timeout time, through the console corresponding to the service frontend by setting the lifecycle management configuration module. At the same time, users can also customize the lifecycle callback behavior according to the specific application scenario requirements to improve the flexibility and adaptability of the system.

[0042] Specifically, when the function computing service platform performs initialization parameter configuration for the target function computing instance according to the lifecycle configuration parameters, it can configure the database connection parameters of the target function computing instance according to the lifecycle configuration parameters such as the creation time, end time, and survival time of the target function instance. The database connection parameters specifically include the database address, user name, and password. After completing the configuration of the database connection parameters, the configured target database connection parameters are obtained and sent to the environment variables of the function computing.

[0043] Step 208: If the initialization parameter configuration state is determined to be successfully initialized according to the target initialization parameter, the task processing request is fed back to the user container to call the target function computing instance through the user container to execute the data processing task corresponding to the task processing request.

[0044] Specifically, if the function computing service platform determines that the initialization parameter configuration status is successful initialization based on the target initialization parameters, the task processing request is fed back to the auxiliary container deployed in the container orchestration platform, so as to forward the task processing request to the user container deployed in the container orchestration platform through the auxiliary container.

[0045] Furthermore, the function computing service platform establishes a database connection according to the target initialization parameters in the environment variables by calling the initialization processing interface, so that the user container can obtain the target data associated with the task processing request from the connected database, thereby executing the corresponding data processing task according to the target data and obtaining the corresponding data processing result.

[0046] In the above-mentioned lifecycle callback processing method based on function computing, by receiving a task processing request, the target function computing instance associated with the task processing request is determined, and the environment variables corresponding to the target function computing instance are obtained, so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables. Wherein, when it is determined that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained, and the target function computing instance is configured with the initialization parameters according to the lifecycle configuration parameters to obtain the configured target initialization parameters, so as to feedback the task processing request to the user container when the initialization parameter configuration state is determined to be successfully initialized according to the target initialization parameters, and the target function computing instance is called by the user container to execute the data processing task corresponding to the task processing request, so as to ensure that all dependent resources have been successfully initialized before executing the data processing task corresponding to the task processing request, so as to improve the reliability and stability of the system, reduce the request failure problem caused by initialization failure, and further improve the resource utilization rate in the process of lifecycle management of the computing function, as well as the processing efficiency of lifecycle management.

[0047] In an exemplary embodiment, Figure 3 As shown, a method for processing lifecycle callbacks based on function computing is provided, and the method is applied to the function computing service platform 104 in FIG. 1 as an example for description, including the following steps 302 to 306. Among them:

[0048] Step 302: If a process termination request signal is received, the resource recovery parameter configuration state corresponding to the target function computing instance is determined according to the environment variables.

[0049] Among them, when the target function computing instance does not receive any further processing request within a preset time period, the function computing service platform will receive a request process termination signal. If the function computing service platform receives a request process termination signal, but resource recovery processing has not yet been performed, that is, the process has not been truly terminated, it is necessary to first call the resource recovery processing interface and perform resource recovery processing based on the target function computing instance, so as to terminate the execution of the data processing task after determining that the resource recovery processing is completed.

[0050] Specifically, if the function computing service platform receives a request process termination signal, it will feed back the request process termination signal to the auxiliary container deployed in the container orchestration platform, and obtain the environment variables corresponding to the target function computing instance through the auxiliary container. The request process termination signal can be a SIGTERM signal, which is used to request the process to terminate gracefully and give the process an opportunity to perform cleanup operations.

[0051] Furthermore, the function computing service platform obtains the processing interface type corresponding to the target function computing instance by traversing the environment variables. The processing interface type corresponding to the target function computing instance may specifically include an initialization processing interface and a resource recovery processing interface, and according to the processing interface type, it can be determined whether a resource recovery processing interface is configured for the target function computing instance, so as to determine the resource recovery parameter configuration status of the target function computing instance according to whether the resource recovery processing interface is configured.

[0052] The resource recovery parameter configuration status of the target function computing instance includes unconfigured and successfully configured. When the resource recovery parameter configuration status is unconfigured, it means that the resource recovery processing interface is not configured for the target function computing instance. When the resource recovery parameter configuration status is successfully configured, it means that the resource recovery processing interface is configured for the target function computing instance.

[0053] Step 304: If it is determined that the resource recycling parameter configuration state is successfully configured, the process is triggered to terminate the delay operation, and the resource recycling processing interface is called to perform resource recycling processing based on the objective function calculation instance.

[0054] Specifically, if it is determined that the resource recovery parameter configuration status is successfully configured, that is, when a resource recovery processing interface is configured for the target function computing instance, the function computing service platform triggers the process termination delay operation through a process termination delay command to ensure that after receiving the request process termination signal, the data task processing operation in the user container will not be terminated immediately, and in the case of delayed process termination, the resource recovery processing interface is called to perform resource recovery processing based on the target function computing instance.

[0055] Step 306: If it is determined that the resource recycling process is completed, a forced termination signal is fed back to the user container to instruct the user container to terminate the execution of the data processing task through the forced termination signal.

[0056] Specifically, if the function computing service platform determines that the resource recycling process is completed, the request process termination signal is fed back to the auxiliary container, and the request process termination signal is forwarded to the user container through the auxiliary container. Among them, the forced termination signal is used to instruct the user container to terminate the execution of the data processing task. After receiving the forced termination signal, the user container terminates the execution of the data processing task.

[0057] Exemplarily, the forced termination signal may specifically be a SIGKILL signal, which is used to forcefully terminate a process without giving the process any opportunity to respond or clean up.

[0058] In the above-mentioned lifecycle callback processing method based on function computing, if a request process termination signal is received, the resource recovery parameter configuration state corresponding to the target function computing instance is determined according to the environment variables, and when it is determined that the resource recovery parameter configuration state is successfully configured, the process termination delay operation is triggered, and the resource recovery processing interface is called to perform resource recovery processing based on the target function computing instance. When it is determined that the resource recovery processing is completed, the request process termination signal is fed back to the user container, so as to instruct the user container to terminate the execution of the data processing task through a forced termination signal, so that after receiving the request process termination signal, the data task processing operation in the user container will not be terminated immediately, but the resource recovery operation will be performed when the process termination is delayed, so that by performing the cleanup operation before the container is terminated, it can be ensured that all resources are correctly released, reduce resource waste, and improve resource utilization efficiency.

[0059] In an exemplary embodiment, Figure 4 As shown, a method for processing lifecycle callbacks based on function computing is provided, and the method is applied to the function computing service platform 104 in FIG. 1 as an example for description, including the following steps 402 to 406. Among them:

[0060] Step 402: If a process termination request signal is received, the resource recovery parameter configuration state corresponding to the target function computing instance is determined according to the environment variables.

[0061] Specifically, if the function computing service platform receives a process termination request signal, the process termination request signal is fed back to the auxiliary container deployed in the container orchestration platform, and the environment variables corresponding to the target function computing instance are obtained through the auxiliary container.

[0062] Furthermore, the function computing service platform obtains the processing interface type corresponding to the target function computing instance by traversing the environment variables. Among them, the processing interface type corresponding to the target function computing instance may specifically include an initialization processing interface and a resource recovery processing interface, and according to the processing interface type, it can be determined whether a resource recovery processing interface is configured for the target function computing instance, so as to determine the resource recovery parameter configuration status of the target function computing instance according to whether the resource recovery processing interface is configured. Among them, the resource recovery parameter configuration status of the target function computing instance specifically includes unconfigured and successfully configured. Among them, when the resource recovery parameter configuration status is unconfigured, it means that the resource recovery processing interface is not configured for the target function computing instance. When the resource recovery parameter configuration status is successfully configured, it indicates that a resource recovery processing interface is configured for the target function computing instance.

[0063] Step 404: If it is determined that the resource recovery parameter configuration state is not configured, the resource recovery parameter configuration is performed on the target function computing instance according to the lifecycle configuration parameters to obtain the configured target resource recovery parameters.

[0064] Among them, if the function computing service platform determines that the resource recovery parameter configuration status is not configured, that is, the resource recovery processing interface is not configured for the target function computing instance, then it is necessary to configure the resource recovery parameters of the target function computing instance to obtain the configured target resource recovery parameters, so that the target resource recovery parameters can be sent to the environment variables corresponding to the target function computing instance to switch the resource recovery parameter configuration status to configuration success, and when the resource recovery parameter configuration status is configuration success, trigger the process termination delay operation, so that when the delayed process is terminated, call the resource recovery processing interface, and perform resource recovery processing based on the target function computing instance, which can ensure that all resources are released correctly, reduce resource waste, and improve resource utilization efficiency.

[0065] Specifically, if the function computing service platform determines that the resource recycling parameter configuration status is not configured, the resource recycling processing interface and timeout configuration are performed on the target function computing instance according to the lifecycle configuration parameters to obtain the configured resource recycling processing interface and target timeout.

[0066] Among them, when the function computing service platform configures the resource recovery processing interface for the target function computing instance, it can specifically configure preStop hooks (i.e., resource recovery processing interface) for the user container used to execute the target function computing instance. Among them, preStop hooks, i.e., resource recovery processing interface, allows specific commands or scripts to be automatically run to perform some necessary operations when the Pod is marked as terminated, which is used for the smooth shutdown of the application, and allows the application to save its state and perform cleanup operations before shutdown to prevent data corruption, while ensuring that the application can be restarted smoothly. Among them, when the function computing service platform configures the timeout time for the target function computing instance, it specifically configures the termination GracePeriod Seconds (i.e., termination grace period) of the target function computing instance, i.e., the target timeout time refers to the maximum time from the pod receiving the request process termination signal (i.e., SIGTERM signal) to the final termination of the process, i.e., the buffer time given to the user container in the pod, which is used to handle the link shutdown, application cache cleanup, and ensure that it will not be forcibly terminated within the timeout time.

[0067] Furthermore, based on the resource recycling processing interface, the function computing service platform configures the process termination delay command for the target function computing instance according to the target timeout time, and obtains the configured target resource recycling parameters. Among them, the function computing service platform can trigger the process termination delay operation through the process termination delay command to instruct the user container to delay the termination of the data processing task.

[0068] For example, on the function computing service platform, when configuring the process termination delay command for the target function computing instance, the process termination delay command of the "sleep({user-configured target timeout time}) command" can be specifically configured, so that the process termination delay operation is triggered by the process termination delay command, ensuring that after receiving the request process termination signal (i.e., SIGTERM signal), the data processing task is not terminated immediately, but the "target timeout time" is delayed. During the delay process, the function computing service platform performs resource recovery processing based on the target function computing instance by calling the resource recovery processing interface.

[0069] Step 406: Send the target resource recovery parameter to the environment variable corresponding to the target function computing instance to switch the resource recovery parameter configuration state to configuration success.

[0070] Specifically, the function computing service platform sends the target resource recovery parameters, including the configured resource recovery processing interface and target timeout period, as well as the configured process termination delay command, to the environment variables corresponding to the target function computing instance, so that the environment variables corresponding to the target function computing instance are configured with the resource recovery processing interface, thereby switching the resource recovery parameter configuration status to configuration success.

[0071] In the above-mentioned lifecycle callback processing method based on function computing, if a request process termination signal is received, the resource recovery parameter configuration state corresponding to the target function computing instance is determined according to the environment variables, and when it is determined that the resource recovery parameter configuration state is not configured, the resource recovery parameter configuration is performed on the target function computing instance according to the lifecycle configuration parameters to obtain the configured target resource recovery parameters, and the target resource recovery parameters are sent to the environment variables corresponding to the target function computing instance to switch the resource recovery parameter configuration state to configuration success, so that when the resource recovery parameter configuration state is configuration success, the process termination delay operation is triggered, and when the delayed process is terminated, the resource recovery processing interface is called to perform resource recovery processing based on the target function computing instance, which can ensure that all resources are released correctly, reduce resource waste, and improve resource utilization efficiency.

[0072] In an exemplary embodiment, Figure 5As shown, a method for processing lifecycle callbacks based on function computing is provided, and the method is applied to the function computing service platform 104 in FIG. 1 as an example for description, including the following steps 501 to 513. Among them:

[0073] Step 501: If the function computing service platform receives a task processing request, the target function computing instance associated with the task processing request is determined.

[0074] Specifically, the user can trigger a task processing request based on the terminal. After detecting the task processing request triggered by the user, the terminal will feedback the task processing request to the function computing service platform deployed by the container orchestration platform. The function computing service platform receives the task processing request and parses the task processing request to determine the target function computing instance associated with the task processing request, that is, it determines the target function computing instance used to execute the data processing task corresponding to the task processing request.

[0075] Step 502: The function computing service platform obtains the environment variables corresponding to the target function computing instance, and determines the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables.

[0076] Specifically, the function computing service platform determines the initialization parameter configuration state corresponding to the target function computing instance by obtaining the environment variables corresponding to the determined target function computing instance, such as the environment variables in the initialization phase. The environment variables in the initialization phase are necessary initialization operations that need to be performed before the target function computing instance receives a task processing request, such as establishing a database connection.

[0077] Step 503: If the function computing service platform determines that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained, and the initialization parameters of the target function computing instance are configured according to the lifecycle configuration parameters to obtain the configured target initialization parameters.

[0078] Specifically, if the function computing service platform determines that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained from the service backend. The lifecycle configuration parameters in the service backend are obtained by the user based on the service frontend configuration, and the lifecycle configuration parameters may include the creation time, end time, and survival time length of the target function instance.

[0079] Furthermore, the function computing service platform can configure the database connection parameters of the target function computing instance according to the lifecycle configuration parameters of the target function instance, such as the creation time, end time, and survival time, etc. The database connection parameters specifically include the database address, user name, and password, etc., to obtain the configured target database connection parameters.

[0080] Step 504: If the function computing service platform determines that the initialization parameter configuration state is successfully initialized according to the target initialization parameters, the initialization processing interface is called to establish a database connection according to the target initialization parameters in the environment variables.

[0081] Specifically, if the function computing service platform determines that the initialization parameter configuration status is successfully initialized based on the target initialization parameters, the initialization processing interface is called to establish a database connection based on the target initialization parameters in the environment variables, so that the user container can obtain the target data associated with the task processing request from the connected database.

[0082] In step 505, the function computing service platform obtains the data processing task corresponding to the task processing request, and feeds back the task processing request and the data processing task corresponding to the task processing request to the user container, so as to call the target function computing instance through the user container, obtain the target data associated with the data processing task from the connected database, and execute the corresponding data processing task according to the target data.

[0083] Specifically, the function computing service platform obtains the data processing task corresponding to the task processing request, and feeds the task processing request and the data processing task corresponding to the task processing request back to the auxiliary container, so as to forward the task processing request and the data processing task corresponding to the task processing request to the user container through the auxiliary container. After the user container receives the task processing request and the data processing task corresponding to the task processing request, it determines the target data required to execute the data processing task, calls the target function computing instance, and obtains the target data associated with the data processing task from the connected database, so as to execute the corresponding data processing task according to the target data.

[0084] Step 506: If the function computing service platform receives a process termination request signal, the process termination request signal is fed back to the auxiliary container, and the environment variables corresponding to the target function computing instance are obtained through the auxiliary container.

[0085] Specifically, if the function computing service platform receives a request process termination signal, it will feed back the request process termination signal to the auxiliary container deployed in the container orchestration platform, and obtain the environment variables corresponding to the target function computing instance through the auxiliary container. The request process termination signal can be a SIGTERM signal, which is used to request the process to terminate gracefully and give the process an opportunity to perform cleanup operations.

[0086] Step 507: The function computing service platform traverses the environment variables to obtain the processing interface type corresponding to the target function computing instance.

[0087] Specifically, the function computing service platform obtains the processing interface type corresponding to the target function computing instance by traversing the environment variables. The processing interface type corresponding to the target function computing instance may specifically include an initialization processing interface and a resource recovery processing interface.

[0088] Step 508: The function computing service platform determines the resource recycling parameter configuration state corresponding to the target function computing instance according to the processing interface type.

[0089] Specifically, the function computing service platform can determine whether a resource recovery processing interface is configured for the target function computing instance according to the processing interface type, and determine the resource recovery parameter configuration status of the target function computing instance according to whether the resource recovery processing interface is configured.

[0090] The resource recovery parameter configuration status of the target function computing instance includes unconfigured and successfully configured. When the resource recovery parameter configuration status is unconfigured, it means that the resource recovery processing interface is not configured for the target function computing instance. When the resource recovery parameter configuration status is successfully configured, it means that the resource recovery processing interface is configured for the target function computing instance.

[0091] Step 509: If the function computing service platform determines that the resource recycling parameter configuration state is not configured, the resource recycling processing interface and timeout configuration are performed on the target function computing instance according to the lifecycle configuration parameters to obtain the configured resource recycling processing interface and target timeout.

[0092] Specifically, if the function computing service platform determines that the resource recovery parameter configuration status is not configured, that is, the resource recovery processing interface is not configured for the target function computing instance, the resource recovery processing interface and timeout time are configured for the target function computing instance according to the lifecycle configuration parameters to obtain the configured resource recovery processing interface and target timeout time.

[0093] Step 510: The function computing service platform configures a process termination delay command for the target function computing instance based on the resource recycling processing interface and the target timeout period, and obtains the configured target resource recycling parameters. The process termination delay command is used to trigger the process termination delay operation to instruct the user container to delay the termination of the data processing task.

[0094] Specifically, the function computing service platform configures a process termination delay command for the target function computing instance based on the resource recovery processing interface and the target timeout time. Specifically, the process termination delay command of the "sleep({target timeout time configured by the user}) command" can be configured, thereby triggering the process termination delay operation through the process termination delay command, ensuring that after receiving the request process termination signal (i.e., SIGTERM signal), the data processing task is not terminated immediately, but the "target timeout time" is delayed. During the delay process, the function computing service platform performs resource recovery processing based on the target function computing instance by calling the resource recovery processing interface.

[0095] In step 511, the function computing service platform sends the target resource recycling parameters to the environment variables corresponding to the target function computing instance to switch the resource recycling parameter configuration state to configuration success.

[0096] Specifically, the function computing service platform sends the target resource recovery parameters, including the configured resource recovery processing interface and target timeout period, as well as the configured process termination delay command, to the environment variables corresponding to the target function computing instance, so that the environment variables corresponding to the target function computing instance are configured with the resource recovery processing interface, thereby switching the resource recovery parameter configuration status to configuration success.

[0097] Step 512: If the function computing service platform determines that the resource recycling parameter configuration status is successfully configured, the process termination delay operation is triggered, and the resource recycling processing interface is called to perform resource recycling processing based on the target function computing instance.

[0098] Specifically, if it is determined that the resource recovery parameter configuration status is successfully configured, that is, a resource recovery processing interface is configured for the target function computing instance, the function computing service platform triggers the process termination delay operation through a process termination delay command, and when the delayed process is terminated, calls the resource recovery processing interface to perform resource recovery processing based on the target function computing instance.

[0099] Step 513: If the function computing service platform determines that the resource recycling process is completed, a forced termination signal is fed back to the user container to instruct the user container to terminate the data processing task through the forced termination signal.

[0100] Specifically, if the function computing service platform determines that the resource recycling process is completed, the request process termination signal is fed back to the auxiliary container, and the request process termination signal is forwarded to the user container through the auxiliary container. Among them, the forced termination signal is used to instruct the user container to terminate the execution of the data processing task. After receiving the forced termination signal, the user container terminates the execution of the data processing task.

[0101] In the above-mentioned lifecycle callback processing method based on function computing, by receiving a task processing request, the target function computing instance associated with the task processing request is determined, and the environment variables corresponding to the target function computing instance are obtained, so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables. Wherein, when it is determined that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained, and the target function computing instance is configured with initialization parameters according to the lifecycle configuration parameters to obtain the configured target initialization parameters, so as to feedback the task processing request to the user container when the initialization parameter configuration state is determined to be successfully initialized according to the target initialization parameters, and the target function computing instance is called by the user container to execute the data processing task corresponding to the task processing request, so as to ensure that all dependent resources have been successfully initialized before executing the data processing task corresponding to the task processing request, so as to improve the reliability and stability of the system and reduce the request failure problem caused by initialization failure. Furthermore, when a request process termination signal is received, the resource recovery parameter configuration state corresponding to the target function computing instance is determined according to the environment variables, and when it is determined that the resource recovery parameter configuration state is successfully configured, the process termination delay operation is triggered, and the resource recovery processing interface is called to perform resource recovery processing based on the target function computing instance, so that when it is determined that the resource recovery processing is completed, the request process termination signal is fed back to the user container, so as to instruct the user container to terminate the execution of the data processing task through a forced termination signal, so that the resource recovery operation can be performed before the function instance is reduced in size or terminated, ensuring that all resources are correctly released, reducing resource waste, and improving resource utilization efficiency. In particular, by ensuring the correct execution of initialization and stop operations, the reliability and stability of the system are significantly improved, and system failures caused by initialization failure or improper resource recovery are reduced.

[0102] In an exemplary embodiment, Figure 6 As shown in the figure, an overall processing flow of the lifecycle callback processing method based on function calculation is provided. Figure 6It can be seen that taking a typical function computing application as an example, the function computing application specifically involves the service front-end, service back-end, terminal, container orchestration platform, and the function computing service platform, auxiliary container and user container deployed on the container orchestration platform. Among them, the auxiliary container and user container are specifically deployed in the smallest scheduling unit pod of the container orchestration platform. The following is the specific implementation content:

[0103] P1. The service front end feeds back the lifecycle configuration parameters corresponding to the target function computing instance to the service back end.

[0104] P2, Initialize interface (i.e., initialization processing interface) is used to establish database connection: 1. User configures database connection parameters: According to the lifecycle configuration parameters, configure the parameters required for database connection, such as database address, user name, password, etc., and send these parameters to the environment variables of Function Compute. 2. User sends a request: When the Function Compute service platform receives a task processing request sent by the user, it first checks whether the database connection has been initialized. 3. Check and perform initialization: 1) If the database connection is not initialized, the Function Compute service platform will perform the initialization operation and establish a database connection through the parameters in the environment variables. 2) If the database connection is initialized successfully, the Function Compute service platform will continue to process the user request and forward the task processing request to the user container user-container through the auxiliary container queue-porxy. 3) If the database connection initialization fails or times out, an error message will be returned and the current instance will be destroyed to ensure system stability.

[0105] P3, PreStop interface (i.e. resource recovery processing interface) is used for resource recovery: 1. Configure resource recovery parameters: According to the lifecycle configuration parameters, configure resource recovery parameters and timeouts, etc., and send these parameters to the environment variables of Function Compute. 2. Configure PreStop Hooks: Configure the preStop hooks (resource recovery processing interface) of the user container in the container orchestration platform, and execute a sleep({user-configured target timeout}) command to ensure that the user container will not terminate immediately after receiving the SIGTERM signal (i.e. request process termination signal). 3. Process SIGTERM signal: 1) When the Function Compute instance has no request for a period of time, the Function Compute service platform sends a SIGTERM signal to the Function Compute instance. 2) After receiving the SIGTERM signal, the auxiliary container queue-porxy will check whether the preStop interface is configured in the environment variables. If so, it will call the interface to perform resource recovery operations.

[0106] P4. If it is determined that the resource recovery process is completed, the function computing service platform will feedback the request process termination signal to the user container. After receiving the request process termination signal, the user container terminates the data processing task.

[0107] In an exemplary embodiment, referring to Figure 6 It can be seen that the lifecycle callback processing method based on function calculation specifically includes:

[0108] 1) The service front end feeds back the lifecycle configuration parameters corresponding to the target function computing instance to the service back end. 2) The terminal feeds back the detected task processing request to the function computing service platform. The function computing service platform receives the task processing request and determines the target function computing instance associated with the task processing request. 3) The function computing service platform obtains the environment variables corresponding to the target function computing instance and determines the initialization parameter configuration state corresponding to the target function computing instance based on the environment variables. 4) If the function computing service platform determines that the initialization parameter configuration state is uninitialized, it obtains the lifecycle configuration parameters corresponding to the target function computing instance from the service back end and configures the initialization parameters for the target function computing instance based on the lifecycle configuration parameters to obtain the configured target initialization parameters. 5) If the function computing service platform determines that the initialization parameter configuration state is successfully initialized based on the target initialization parameters, it calls the initialization processing interface and establishes a database connection based on the target initialization parameters in the environment variables. 6) The function computing service platform obtains the data processing task corresponding to the task processing request and feeds back the task processing request and the data processing task corresponding to the task processing request to the auxiliary container, which is then forwarded to the user container through the auxiliary container. 7) After receiving the task processing request and the data processing task corresponding to the task processing request, the user container calls the target function computing instance, obtains the target data associated with the data processing task from the connected database, and executes the corresponding data processing task according to the target data. 8) If the function computing service platform receives the request process termination signal, it feeds back the request process termination signal to the auxiliary container, and obtains the environment variables corresponding to the target function computing instance through the auxiliary container. 9) The function computing service platform traverses the environment variables to obtain the processing interface type corresponding to the target function computing instance, and determines the resource recycling parameter configuration status corresponding to the target function computing instance according to the processing interface type. 10) If the function computing service platform determines that the resource recycling parameter configuration status is not configured, it configures the resource recycling processing interface and timeout time for the target function computing instance according to the life cycle configuration parameters, and obtains the configured resource recycling processing interface and target timeout time. 11) Based on the resource recycling processing interface, the function computing service platform configures the process termination delay command for the target function computing instance according to the target timeout time, and obtains the configured target resource recycling parameters. Among them, the process termination delay command is used to trigger the process termination delay operation to instruct the user container to delay the termination of the data processing task. 12) The function computing service platform sends the target resource recovery parameters to the environment variables corresponding to the target function computing instance to switch the resource recovery parameter configuration state to configuration success. 13) When it is determined that the resource recovery parameter configuration state is configuration success, the function computing service platform triggers the process termination delay operation and calls the resource recovery processing interface to perform resource recovery processing based on the target function computing instance.14) If it is determined that the resource recovery process is completed, the Function Compute service platform will feed back a request process termination signal to the user container. After receiving the request process termination signal, the user container terminates the data processing task.

[0109] In an exemplary embodiment, the specific application scenarios of the lifecycle callback processing method based on function computing in the embodiments of the present application include: 1. Financial transaction system: In a financial transaction system, by quickly initializing the connection to the transaction database and ensuring the safe recovery of data and resources when stopping, the reliability and security of the transaction can be improved. 2. Internet of Things (IoT) applications: In IoT applications, through automated initialization and resource recovery, the connection and data processing of a large number of devices are managed to improve the response speed and resource utilization efficiency of the system. 3. Network security monitoring: In a network security monitoring system, through fast initialization and efficient resource management, security threats can be detected and responded to in real time, improving the system's protection capabilities.

[0110] In the above-mentioned lifecycle callback processing method based on function computing, the function computing service platform determines the target function computing instance associated with the task processing request by receiving the task processing request, and obtains the environment variables corresponding to the target function computing instance, so as to determine the initialization parameter configuration state corresponding to the target function computing instance according to the environment variables. Wherein, when the function computing service platform determines that the initialization parameter configuration state is uninitialized, the lifecycle configuration parameters corresponding to the target function computing instance are obtained, and the target function computing instance is configured with the initialization parameters according to the lifecycle configuration parameters to obtain the configured target initialization parameters, so as to feedback the task processing request to the user container when the initialization parameter configuration state is determined to be successfully initialized according to the target initialization parameters, and the target function computing instance is called by the user container to execute the data processing task corresponding to the task processing request, so as to ensure that all dependent resources have been successfully initialized before executing the data processing task corresponding to the task processing request, so as to improve the reliability and stability of the system and reduce the request failure problem caused by initialization failure. Furthermore, when the function computing service platform receives the request process termination signal, it determines the resource recovery parameter configuration status corresponding to the target function computing instance according to the environment variables, and when it is determined that the resource recovery parameter configuration status is successfully configured, it triggers the process termination delay operation, and calls the resource recovery processing interface to perform resource recovery processing based on the target function computing instance. When it is determined that the resource recovery processing is completed, the request process termination signal is fed back to the user container, so as to instruct the user container to terminate the execution of the data processing task through a forced termination signal, so that the resource recovery operation can be performed before the function instance is reduced or terminated, ensuring that all resources are correctly released, reducing resource waste, and improving resource utilization efficiency.

[0111] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0112] Based on the same inventive concept, the embodiment of the present application also provides a lifecycle callback processing device based on function computing for implementing the lifecycle callback processing method based on function computing involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the lifecycle callback processing device based on function computing provided below can be referred to the limitations of the lifecycle callback processing method based on function computing above, and will not be repeated here.

[0113] In an exemplary embodiment, Figure 7 As shown, a lifecycle callback processing device based on function computing is provided, including: a target function computing instance determination module 702, an initialization parameter configuration state determination module 704, an initialization parameter configuration module 706 and a data processing task processing module 708, wherein:

[0114] The objective function computing instance determination module 702 is used to receive a task processing request and determine the objective function computing instance associated with the task processing request; the initialization parameter configuration state determination module 704 is used to obtain the environment variables corresponding to the objective function computing instance, and determine the initialization parameter configuration state corresponding to the objective function computing instance according to the environment variables; the initialization parameter configuration module 706 is used to obtain the life cycle configuration parameters corresponding to the objective function computing instance if it is determined that the initialization parameter configuration state is uninitialized, and perform initialization parameter configuration on the objective function computing instance according to the life cycle configuration parameters to obtain the configured target initialization parameters; the data processing task processing module 708 is used to feed back the task processing request to the user container if it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameters, so as to call the objective function computing instance through the user container and execute the data processing task corresponding to the task processing request.

[0115] The above-mentioned lifecycle callback processing device based on function computing can ensure that all dependent resources have been successfully initialized before executing the data processing task corresponding to the task processing request, so as to improve the reliability and stability of the system, reduce the request failure problem caused by initialization failure, and further improve the resource utilization rate in the process of lifecycle management of the computing function, as well as the processing efficiency of lifecycle management.

[0116] In an exemplary embodiment, the data processing task processing module is also used to: if the initialization parameter configuration state is determined to be successful initialization according to the target initialization parameters, call the initialization processing interface, and establish a database connection according to the target initialization parameters in the environment variables; obtain the data processing task corresponding to the task processing request; feed back the task processing request and the data processing task corresponding to the task processing request to the user container, so as to call the target function computing instance through the user container, obtain the target data associated with the data processing task from the connected database, and execute the corresponding data processing task according to the target data.

[0117] In an exemplary embodiment, Figure 8 As shown, a lifecycle callback processing device based on function computing is provided, including: a resource recycling parameter configuration state determination module 802, a resource recycling processing module 804, and a process termination module 806. Among them:

[0118] The resource recovery parameter configuration state determination module 802 is used to determine the resource recovery parameter configuration state corresponding to the target function computing instance according to the environment variables if a request process termination signal is received; the resource recovery processing module 804 triggers the process termination delay operation if it is determined that the resource recovery parameter configuration state is successfully configured, and calls the resource recovery processing interface to perform resource recovery processing based on the target function computing instance; the process termination module 806 is used to feed back a forced termination signal to the user container if it is determined that the resource recovery processing is completed, so as to instruct the user container to terminate the execution of the data processing task through the forced termination signal.

[0119] The above-mentioned lifecycle callback processing device based on function calculation will not immediately terminate the data task processing operation in the user container after receiving the request process termination signal, but will perform resource recovery operations while delaying the process termination. Therefore, by performing the cleanup operation before the container is terminated, it can ensure that all resources are correctly released, reduce resource waste, and improve resource utilization efficiency.

[0120] In an exemplary embodiment, a lifecycle callback processing device based on function computing is provided, which also includes a resource recovery parameter configuration module, which is used to: if it is determined that the resource recovery parameter configuration state is not configured, then according to the lifecycle configuration parameters, configure the resource recovery parameters of the target function computing instance to obtain the configured target resource recovery parameters; send the target resource recovery parameters to the environment variables corresponding to the target function computing instance to switch the resource recovery parameter configuration state to configuration success.

[0121] In an exemplary embodiment, the resource recovery parameter configuration module is also used to: configure the resource recovery processing interface and timeout time for the target function computing instance according to the lifecycle configuration parameters, and obtain the configured resource recovery processing interface and target timeout time; based on the resource recovery processing interface, according to the target timeout time, configure the process termination delay command for the target function computing instance to obtain the configured target resource recovery parameters; the process termination delay command is used to trigger the process termination delay operation to instruct the user container to delay the termination of the data processing task.

[0122] In an exemplary embodiment, the resource recovery parameter configuration state determination module is also used to: if a request process termination signal is received, feed back the request process termination signal to the auxiliary container, and obtain the environment variables corresponding to the objective function calculation instance through the auxiliary container; traverse the environment variables to obtain the processing interface type corresponding to the objective function calculation instance; and determine the resource recovery parameter configuration state corresponding to the objective function calculation instance according to the processing interface type.

[0123] Each module in the above-mentioned lifecycle callback processing device based on function calculation can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0124] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as an objective function calculation instance, an environment variable corresponding to the objective function calculation instance, an initialization parameter configuration state, a life cycle configuration parameter, a target initialization parameter, and a data processing task. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a life cycle callback processing method based on function calculation is implemented.

[0125] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0126] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0128] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0131] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application. The above embodiments only express several implementation methods of the present application, and the description is relatively specific and detailed, but it cannot be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the attached claims.

Claims

1. A lifecycle callback processing method based on function calculation, characterized in that: The method comprises: receiving a task processing request, and determining an objective function computing instance associated with the task processing request; Acquire an environment variable corresponding to the objective function computing instance, and determine an initialization parameter configuration state corresponding to the objective function computing instance according to the environment variable; If it is determined that the initialization parameter configuration state is uninitialized, then obtaining the life cycle configuration parameters corresponding to the objective function computing instance, and performing initialization parameter configuration on the objective function computing instance according to the life cycle configuration parameters to obtain the configured target initialization parameters; If it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameter, the task processing request is fed back to the user container, so as to call the target function computing instance through the user container to execute the data processing task corresponding to the task processing request.

2. The method according to claim 1, characterized in that: If it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameter, the task processing request is fed back to the user container, so as to call the target function computing instance through the user container to execute the data processing task corresponding to the task processing request, including: If it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameter, the initialization processing interface is called to establish a database connection according to the target initialization parameter in the environment variable; Obtaining a data processing task corresponding to the task processing request; The task processing request and the data processing task corresponding to the task processing request are fed back to the user container, so as to call the objective function calculation instance through the user container, obtain the target data associated with the data processing task from the connected database, and execute the corresponding data processing task according to the target data.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: If a request process termination signal is received, determining a resource recovery parameter configuration state corresponding to the objective function computing instance according to the environment variable; If it is determined that the resource recycling parameter configuration state is successfully configured, the process is triggered to terminate the delay operation, and the resource recycling processing interface is called to perform resource recycling processing based on the objective function calculation instance; If it is determined that the resource recycling process is completed, a forced termination signal is fed back to the user container, so as to instruct the user container to terminate the execution of the data processing task through the forced termination signal.

4. The method according to claim 3, characterized in that The method further comprises: If it is determined that the resource recovery parameter configuration state is not configured, then configuring the resource recovery parameters for the objective function computing instance according to the life cycle configuration parameters to obtain the configured target resource recovery parameters; The target resource recovery parameter is sent to the environment variable corresponding to the target function calculation instance to switch the resource recovery parameter configuration state to configuration success.

5. The method according to claim 4, characterized in that The configuring resource recycling parameters for the objective function computing instance according to the lifecycle configuration parameters to obtain the configured target resource recycling parameters includes: According to the lifecycle configuration parameters, configure the resource recovery processing interface and the timeout time for the objective function computing instance to obtain the configured resource recovery processing interface and the target timeout time; Based on the resource recovery processing interface, according to the target timeout time, the process termination delay command is configured for the target function computing instance to obtain the configured target resource recovery parameters; the process termination delay command is used to trigger the process termination delay operation to instruct the user container to delay the termination of the data processing task.

6. The method according to claim 3, characterized in that If a request process termination signal is received, determining the resource recovery parameter configuration state corresponding to the objective function computing instance according to the environment variable includes: If a request process termination signal is received, the request process termination signal is fed back to the auxiliary container, and the environment variables corresponding to the objective function calculation instance are obtained through the auxiliary container; Traversing the environment variables to obtain a processing interface type corresponding to the objective function calculation instance; According to the processing interface type, a resource recycling parameter configuration state corresponding to the objective function calculation instance is determined.

7. A lifecycle callback processing device based on function calculation, characterized in that: The device comprises: An objective function computing instance determining module, configured to receive a task processing request and determine an objective function computing instance associated with the task processing request; An initialization parameter configuration state determination module, used to obtain environment variables corresponding to the objective function calculation instance, and determine the initialization parameter configuration state corresponding to the objective function calculation instance according to the environment variables; An initialization parameter configuration module, for obtaining life cycle configuration parameters corresponding to the objective function computing instance if it is determined that the initialization parameter configuration state is uninitialized, and performing initialization parameter configuration on the objective function computing instance according to the life cycle configuration parameters to obtain configured target initialization parameters; The data processing task processing module is used to feed back the task processing request to the user container if it is determined that the initialization parameter configuration state is successfully initialized according to the target initialization parameter, so as to call the target function computing instance through the user container and execute the data processing task corresponding to the task processing request.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.