Function prewarming method for serverless architecture and apparatus
By analyzing the historical execution logs of the target workflow of the serverless architecture, determining the functions to be preheated and performing intelligent preheating processing, the problem of low function preheating accuracy in the existing technology is solved, and efficient resource utilization and improved response speed are achieved.
Patent Information
- Application Number
- PCT/IB2025/051634
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-25
- Filing Date
- 2025-02-14
- Publication Date
- 2025-10-02
AI Technical Summary
In the prior art, all functions of the serverless architecture are preheated by a timer, resulting in low accuracy of function preheating, serious waste of resources, and inability to dynamically adjust according to actual needs.
By detecting the historical execution logs of the target workflow in the serverless architecture, the target function to be preheated is determined, and intelligent function preheating processing is performed based on the function preheating strategy, including obtaining the function's identification information, performance indicator data, call relationship and dependency relationship, generating a dynamic function preheating strategy, and performing resource allocation and status judgment.
It improves the accuracy of function preheating, significantly reduces cold start time, optimizes resource usage, and improves the response speed and system efficiency of the serverless architecture.
Smart Images

Figure IB2025051634_02102025_PF_FP_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application number 202410346546.6, filed with the Chinese Patent Office on March 25, 2024, entitled "Function Preheating Method and Apparatus for Serverless Architecture," the entire contents of which are incorporated herein by reference. Technical Field: This application relates to the field of data processing technology, and more specifically, to a function preheating method and apparatus for serverless architecture. Background: Serverless computing is a cloud computing execution model in which the cloud provider manages machine operations, while the client only provides the code to be run. This architecture is favored by enterprises and developers for its cost-efficiency and simplified operations and maintenance. In serverless architectures, cold starts are a significant performance bottleneck, impacting response time and overall system efficiency. When a function is triggered for the first time or has not been called for a period of time, it undergoes an initialization process, which causes delays. This problem is particularly prominent in applications requiring high performance and high availability, and has become a consideration for many developers and enterprises when choosing a serverless architecture. Currently, most existing solutions are static, for example, periodically triggering functions to maintain their "warm-up" state. This approach is not only resource-intensive but also lacks intelligence and cannot dynamically adjust to actual needs, resulting in low accuracy and resource waste. Currently, no effective solution has been proposed to address the problem in the related art of preheating all functions in a serverless architecture using a timer, resulting in relatively low accuracy in function preheating. SUMMARY OF THE INVENTION The present invention provides a function preheating method and apparatus for a serverless architecture, at least to address the technical problem in the related art of preheating all functions in a serverless architecture using a timer, resulting in relatively low accuracy in function preheating. According to one aspect of an embodiment of the present application, a function preheating method for a serverless architecture is provided, comprising: upon detecting that a target workflow in the serverless architecture is in a startup state, determining a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on a historical execution log of the target workflow; and performing preheating processing on the target function to obtain a preheating result.Furthermore, determining a target function to be preheated from the multiple initial functions included in the target workflow according to the function preheating strategy includes: obtaining identification information of an initial function from the multiple initial functions included in the target workflow; obtaining identification information of a function currently being executed in the target workflow; and determining the target function to be preheated based on the identification information of the initial function from the multiple initial functions, the identification information of the currently being executed function, and function preheating conditions in the function preheating strategy. Furthermore, before determining the target function to be preheated from the multiple initial functions included in the target workflow according to the function preheating strategy, the method further includes: obtaining historical execution logs of the target workflow; obtaining first call data information of an initial function from the multiple initial functions based on the historical execution logs, wherein the first call data information includes at least performance indicator data of the initial function from the multiple initial functions and call relationships between different initial functions; and determining the function preheating strategy based on the first call data information. Furthermore, determining the function warm-up strategy based on the first call data includes: determining, based on performance indicator data of an initial function among the multiple initial functions in the first call data, an impact value of the initial function on the response time of the target workflow; determining, based on the number of times the initial function is called in the first call data, a call frequency of the initial function; determining, based on call relationships between different initial functions in the first call data, function dependencies among the multiple initial functions; and determining the function warm-up strategy based on the impact value, the call frequency, and the function dependencies. Furthermore, determining the function warm-up strategy based on the impact value, the call frequency, and the function dependencies includes: generating a first function warm-up condition based on the impact value and the call frequency; generating a second function warm-up condition based on the function dependencies; and determining the function warm-up strategy based on the first function warm-up condition and the second function warm-up condition. Furthermore, performing preheating processing on the objective function to obtain a preheating result includes: performing wake-up processing on the objective function to obtain a processing result; performing resource allocation on the objective function based on attribute information of the objective function to obtain a resource allocation result, wherein the attribute information is used to characterize resource information required by the objective function; and obtaining the preheating result based on the processing result and the resource allocation result.Furthermore, after performing a preheating process on the target function and obtaining a preheating result, the method further includes: if the preheating result indicates that the preheating was successful, obtaining current state information of the target function; determining whether the target function is in a responsive state based on the current state information; and if the target function is not in the responsive state, performing a preheating process on the target function again. Furthermore, after performing a preheating process on the target function and obtaining a preheating result, the method further includes: determining whether the target workflow has completed execution; if the target workflow has completed execution, obtaining an execution log of the target workflow; and optimizing the function preheating strategy based on the execution log of the target workflow. According to one aspect of an embodiment of the present application, a function preheating method for a serverless architecture is provided, comprising: upon detecting that the serverless architecture currently meets a preset function preheating trigger condition, determining a target function to be preheated from multiple initial functions of the serverless architecture according to a function preheating strategy, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and performing a preheating process on the target function to obtain a preheating result. Furthermore, before determining the target function to be preheated from the multiple initial functions of the serverless architecture according to the function preheating strategy, the method further comprises: obtaining historical call logs of the multiple initial functions in the serverless architecture; obtaining second call data information of an initial function among the multiple initial functions according to the historical call logs; and determining the function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. Furthermore, before determining the target function to be preheated from the multiple initial functions of the serverless architecture according to the function preheating strategy, the method further includes: obtaining performance data information of the initial functions in the multiple initial functions and the number of calls of the initial functions in the multiple initial functions according to the historical call logs of the multiple initial functions; determining the weight value of the initial function in the multiple initial functions according to the performance data information and the number of calls; and determining the function preheating strategy according to the weight value. According to another aspect of an embodiment of the present application, a function preheating device for a serverless architecture is also provided, comprising: a first determining unit, configured to determine the target function to be preheated from the multiple initial functions included in the target workflow according to the function preheating strategy when detecting that the target workflow in the serverless architecture is in a startup state, wherein the function preheating strategy is determined based on the historical execution log of the target workflow; and a first preheating unit, configured to perform preheating processing on the target function to obtain a preheating result.Furthermore, the first determination unit includes: a first acquisition module configured to acquire identification information of an initial function from among multiple initial functions included in the target workflow; a second acquisition module configured to acquire identification information of a function currently being executed in the target workflow; and the first determination module configured to determine the target function to be preheated based on the identification information of the initial functions from among the multiple initial functions, the identification information of the currently being executed function, and the function preheating conditions in the function preheating policy. Furthermore, the apparatus further includes: a first acquisition unit configured to acquire historical execution logs of the target workflow before determining the target function to be preheated from among the multiple initial functions included in the target workflow based on the function preheating policy; a second acquisition unit configured to acquire first call data information of an initial function from among the multiple initial functions based on the historical execution logs, wherein the first call data information includes at least performance indicator data of the initial functions from among the multiple initial functions and call relationships between different initial functions; and a second determination unit configured to determine the function preheating policy based on the first call data information. Furthermore, the second determination unit includes: a second determination module configured to determine, based on performance indicator data of an initial function among the multiple initial functions in the first call data information, an impact value of the initial function on the response time of the target workflow; a third determination module configured to determine, based on the number of times the initial function is called in the first call data information, a call frequency of the initial function; a fourth determination module configured to determine, based on call relationships between different initial functions in the first call data information, a function dependency relationship among the multiple initial functions; and a fifth determination module configured to determine the function warm-up strategy based on the impact value, the call frequency, and the function dependency relationship. Furthermore, the fifth determination module includes: a first generation submodule configured to generate a first function warm-up condition based on the impact value and the call frequency; a second generation submodule configured to generate a second function warm-up condition based on the function dependency relationship; and a determination submodule configured to determine the function warm-up strategy based on the first function warm-up condition and the second function warm-up condition. Furthermore, the first preheating unit includes: an awakening module, configured to perform awakening processing on the target function to obtain a processing result; an allocation module, configured to allocate resources to the target function based on the attribute information of the target function to obtain a resource allocation result, wherein the attribute information is used to characterize the resource information required for the target function; and a processing module, configured to obtain the preheating result based on the processing result and the resource allocation result.Furthermore, the apparatus further includes: a third acquisition unit configured to, after performing preheat processing on the target function and obtaining a preheat result, obtain current state information of the target function if the preheat result indicates successful preheating; a first judgment unit configured to determine whether the target function is in a responsive state based on the current state information; and a second preheat unit configured to perform preheat processing on the target function again if the target function is not in the responsive state. Furthermore, the apparatus further includes: a second judgment unit configured to, after performing preheat processing on the target function and obtaining a preheat result, determine whether the target workflow has completed execution; a fourth acquisition unit configured to, if the target workflow has completed execution, obtain an execution log of the target workflow; and an optimization unit configured to optimize the function preheating strategy based on the execution log of the target workflow. According to another aspect of an embodiment of the present application, a function preheating apparatus for a serverless architecture is provided, comprising: a third determining unit configured to, upon detecting that the serverless architecture currently meets a preset function preheating trigger condition, determine a target function to be preheated from multiple initial functions in the serverless architecture according to a function preheating strategy, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and a third preheating unit configured to perform a preheating process on the target function to obtain a preheating result. Furthermore, the apparatus further comprises: a fifth acquiring unit configured to, before determining the target function to be preheated from the multiple initial functions in the serverless architecture according to the function preheating strategy, acquire historical call logs of the multiple initial functions in the serverless architecture; a sixth acquiring unit configured to acquire second call data information of an initial function from the multiple initial functions based on the historical call logs; and a fourth determining unit configured to determine the function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. Furthermore, the device also includes: a seventh acquisition unit, configured to obtain performance data information of the initial functions in the multiple initial functions and the number of calls of the initial functions in the multiple initial functions based on historical call logs of the multiple initial functions before determining the target function to be preheated from the multiple initial functions of the serverless architecture according to the function preheating strategy; a fifth determination unit, configured to determine the weight value of the initial function in the multiple initial functions based on the performance data information and the number of calls; and a sixth determination unit, configured to determine the function preheating strategy based on the weight value.According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein when the program is executed, the device containing the storage medium is controlled to execute any one of the above-described function preheating methods for a serverless architecture. According to another aspect of an embodiment of the present application, a computer terminal is provided, comprising a memory storing an executable program; and a processor for executing the program, wherein when the program is executed, any one of the above-described function preheating methods for a serverless architecture is executed. According to another aspect of an embodiment of the present application, a computer program product is provided, wherein the computer program product includes a stored computer program, wherein when the computer program is executed by the processor, any one of the above-described function preheating methods for a serverless architecture is implemented. In an embodiment of the present application, the following steps are employed: upon detecting that a target workflow in a serverless architecture is in the startup state, a target function to be preheated is determined from multiple initial functions included in the target workflow based on a function preheating strategy, wherein the function preheating strategy is determined based on the historical execution logs of the target workflow; and the target function is preheated to obtain a preheating result. This solves the technical problem in related art where a timer is used to preheat all functions in a serverless architecture, resulting in relatively low function preheating accuracy. In the present application, the call and execution information of each function in the target workflow can be clearly identified using the historical execution logs of the target workflow. Therefore, the function preheating strategy can be accurately determined. When the target workflow is started, the function preheating strategy can be used to more accurately determine which functions will be called in subsequent data processing. Compared to the static preheating strategies used in the prior art, the present application effectively improves the accuracy of function prediction through intelligent analysis of workflows and function preheating strategies. Furthermore, through effective function preheating, the cold start time of serverless applications is significantly reduced, thereby improving the responsiveness of the serverless architecture. BRIEF DESCRIPTION OF THE DRAWINGS The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.In the accompanying drawings: Figure 1 is a hardware structure block diagram of a computer terminal provided according to Example 1 of the present application; Figure 2 is a flowchart of a function preheating method for a serverless architecture provided according to Example 1 of the present application; Figure 3 is a flowchart of a function preheating method for a serverless architecture provided according to Example 1 of the present application; Figure 4 is a flowchart of a function preheating method for a serverless architecture provided according to Example 2 of the present application; Figure 5 is a flowchart of a function preheating method for a serverless architecture provided according to Example 2 of the present application; Figure 6 is a schematic diagram of a function preheating device for a serverless architecture provided according to Example 3 of the present application; Figure 7 is a schematic diagram of a function preheating device for a serverless architecture provided according to Example 4 of the present application; Figure 8 is a schematic diagram of a function preheating system for a serverless architecture provided according to Example 5 of the present application; and Figure 9 is a structural block diagram of a computer terminal provided according to Example 6 of the present application. Specific Implementation In order to enable those skilled in the art to better understand the present application solution, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of this application, all other embodiments derived by persons of ordinary skill in the art without inventive effort shall fall within the scope of protection of this application. It should be noted that the terms "first," "second," and so on in the specification and claims of this application, as well as in the accompanying drawings, are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that such terms are interchangeable where appropriate, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to the steps or units expressly listed, but may include other steps or units not expressly listed or inherent to such process, method, product, or apparatus. First, some nouns or terms appearing in the description of the embodiments of this application are subject to the following interpretations:
[0002] Serverless computing is a cloud computing model based on Platform as a Service (PaaS). Serverless computing provides a micro-architecture where end customers do not need to deploy, configure, or manage server services. Instead, the server services required to run the code are provided by the cloud platform.
[0003] Server ESS Workflow: A fully managed Server ESS cloud service for coordinating the execution of multiple distributed tasks. It aims to simplify the tedious tasks of developing and running task processes, such as task coordination, state management, and error handling, allowing users to focus on developing task logic. Users can orchestrate distributed tasks in sequential, branching, or parallel ways. The service will reliably coordinate task execution according to the predefined order, track each task's state transitions, and execute user-defined retry logic when necessary to ensure smooth workflow completion. 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, storage, and display) involved in this application are all authorized by the user or fully authorized by all parties. The collection, use, and processing of such data must comply with relevant laws, regulations, and standards in the relevant region, and corresponding entry points are provided for users to choose to authorize or deny. Example 1 According to an embodiment of the present application, a function preheating method for a serverless architecture is also provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions. Furthermore, although the flowcharts illustrate a logical sequence, in some cases, the steps shown or described can be executed in a different order than that shown. The method embodiment provided in Example 1 of the present application can be executed in a mobile terminal, computer terminal, or similar computing device. Figure 1 shows a hardware block diagram of a computer terminal (or mobile device) for implementing the function preheating method for a serverless architecture. As shown in FIG1 , a computer terminal (or mobile device) 10 may include a processor assembly 102 (processor assembly 102 may include, but is not limited to, a processing device such as a microprocessor (MCU) or a programmable logic device (FPGA), and processor assembly 102 may include a processor assembly, as shown in FIG1 by 102 a, 102 b, ..., 102 n), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, the computer terminal (or mobile device) 10 may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS), a network interface, a power supply, and / or a camera.Those skilled in the art will appreciate that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the electronic device described above. For example, the computer terminal 10 may include more or fewer components than shown in FIG. 1 , or may have a configuration different from that shown in FIG. It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." This data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of this application, this data processing circuitry serves as a processor control (e.g., selecting a variable resistor terminal path connected to an interface). Memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the function preheating method for a serverless architecture in the embodiments of the present application. Processor 102 executes the software programs and modules stored in memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned function preheating method for a serverless architecture. Memory 104 may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located from processor 102, which can be connected to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Transmission device 106 is used to receive or transmit data via a network. Specific examples of such networks include wireless networks provided by the communications provider of computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a radio frequency (RF) module for wireless communication with the Internet. The display can be a touch-screen liquid crystal display that allows a user to interact with the user interface of the computer terminal 10 (or mobile device). In the above operating environment, the present application provides a function preheating method for a serverless architecture as shown in Figure 2.Figure 2 is a flowchart of a function preheating method for a serverless architecture according to Embodiment 1 of the present application. The function prediction method includes the following steps: Step S201: Upon detecting that a target workflow in the serverless architecture is in the startup state, a target function to be preheated is determined from multiple initial functions included in the target workflow according to a function preheating strategy. The function preheating strategy is determined based on the historical execution logs of the target workflow. Optionally, a detection tool is used to detect whether the target workflow in the serverless architecture is in the startup state, that is, to determine whether the target workflow is in an executed state. It should be noted that a workflow is a fully managed Serverless cloud service used to coordinate the execution of multiple distributed tasks. Users can orchestrate distributed tasks in sequential, branching, or parallel ways. The service reliably coordinates task execution according to the predefined order, tracks each task's state transitions, and executes user-defined retry logic when necessary to ensure the successful completion of the workflow. After the target workflow is in the startup state, the function to be used next is predicted based on the function preheating strategy and the multiple initial functions included in the target workflow, and then the function is used as the target function to be preheated. It should be noted that the function preheating strategy is determined based on the historical execution logs of the target workflow. Using this strategy, functions can be preheated more accurately. In step S202, the target function is preheated to obtain a preheating result. Optionally, the target function is preheated to improve its data processing efficiency. In summary, the target workflow's historical execution logs provide clear information about the call and execution of each function in the target workflow. Therefore, the function preheating strategy can be accurately determined. When the target workflow is initiated, the function preheating strategy can be used to more accurately determine which functions will be called during subsequent data processing. Compared to static preheating strategies in the prior art, this application effectively improves the accuracy of function predictions through intelligent analysis of workflows and function preheating strategies. Furthermore, effective function preheating significantly reduces the cold start time of serverless applications, thereby improving the responsiveness of serverless architectures. To improve the accuracy of determining the target function, in the function preheating method for a serverless architecture provided in Example 1 of the present application, determining the target function to be preheated from multiple initial functions included in the target workflow based on the function preheating strategy includes: obtaining identification information of the initial function among the multiple initial functions included in the target workflow; obtaining identification information of the currently executing function in the target workflow; and determining the target function to be preheated based on the identification information of the initial function among the multiple initial functions, the identification information of the currently executing function, and the function preheating conditions in the function preheating strategy.Optionally, the multiple initial functions and their identification information included in the target workflow are first determined, followed by the identification information of the currently executing function in the target workflow. Finally, the target function to be preheated is determined based on the identification information of the initial functions, the identification information of the currently executing function, and the function preheating conditions in the function preheating strategy. It should be noted that the function preheating strategy is constructed based on the preheating conditions of the triggering function. For example, a function prediction condition can be generated based on the number of times a function in the target workflow is executed. For example, if function A in the target workflow is executed 99 times out of 100 times, then function A is the target function. For another example, if function B is executed after function A in the target workflow, then a prediction can be made for function B during the execution of function A. Using the function preheating strategy, the function to be preheated can be accurately determined, improving the accuracy of function preheating. To improve the accuracy of generating a function warmup strategy, in a function warmup method for a serverless architecture provided in Example 1 of the present application, before determining a target function to be warmed up from multiple initial functions included in a target workflow based on the function warmup strategy, the method further includes: obtaining historical execution logs of the target workflow; obtaining first call data information of an initial function from the multiple initial functions based on the historical execution logs, wherein the first call data information includes at least performance indicator data of the initial function from the multiple initial functions and call relationships between different initial functions; and determining a function warmup strategy based on the first call data information. Optionally, to improve the accuracy of generating a function warmup strategy, the following steps are employed to obtain the aforementioned function warmup strategy: obtaining historical execution logs of the target workflow from a logging device; then obtaining performance indicator data of the initial function from the multiple initial functions in the target workflow and call relationships between different initial functions based on the historical execution logs. The performance indicator data includes, but is not limited to, performance indicator data such as response time, execution time, and resource consumption of each function; and finally, obtaining the aforementioned function warmup strategy based on the performance indicator data and the call relationships between different initial functions. It should be noted that the initial function among the multiple initial functions is an unused initial function and can be a partial initial function. Performance indicator data can be used to assess the impact of a function on the execution time of the entire target workflow. By analyzing the impact on execution time and the calling relationships between functions, a function warm-up strategy can be derived to effectively warm up the function, thereby improving data processing efficiency.To improve the accuracy of generating a function warm-up strategy, in a function warm-up method for a serverless architecture provided in Example 1 of the present application, determining a function warm-up strategy based on first call data information includes: determining the impact of an initial function on the response time of a target workflow based on performance indicator data of an initial function among multiple initial functions in the first call data information; determining the call frequency of the initial function based on the number of times the initial function is called in the first call data information; determining the function dependencies among the multiple initial functions based on the call relationships between different initial functions in the first call data information; and determining a function warm-up strategy based on the impact, call frequency, and function dependencies. Optionally, determining a function warm-up strategy based on the first call data information includes the following steps: determining the impact of an initial function on the response time of a target workflow based on performance indicator data such as response time, execution time, and resource consumption among the initial functions among the multiple initial functions. During function warm-up, targeted warm-up can be performed on functions that have a significant impact on the overall workflow response time, thereby helping to improve the workflow response time. Then, based on the number of times the initial function in the first call data is called, the call frequency of the initial function is calculated. By identifying frequently called functions and preheating them, the effectiveness of function preheating can be effectively improved, avoiding resource waste. Secondly, based on the call relationships between the different initial functions in the first call data, the function dependencies of the multiple initial functions are determined. This determines the call chain between functions, namely, how one function triggers another, and identifies data dependencies between functions. For example, the output of one function is the input of another. By leveraging these relationships between functions, the next function to be executed can be preheated in advance while the previous function is executing, thereby improving data processing efficiency. Finally, the function preheating strategy is implemented based on the impact level, call frequency, and function dependencies. This data provides precise guidance for function preheating in Serverless workflows, ensuring efficient resource utilization while minimizing the impact of cold starts on performance. Optionally, in the function preheating method for a serverless architecture provided in Example 1 of the present application, determining the function preheating strategy based on the impact value, call frequency and function dependency includes: generating a first function preheating condition based on the impact value and call frequency; generating a second function preheating condition based on the function dependency; and determining the function preheating strategy based on the first function preheating condition and the second function preheating condition.Optionally, a first function preheating condition is generated based on the impact value and call frequency. For example, functions with higher impact values and call frequencies are identified as functions on the critical path or frequently called, and are then assigned priority preheating weights. A second function preheating condition is generated based on function dependencies. For example, a preheating strategy is determined based on the call chain and dependencies between functions. For example, if function A is often called after function B, function A is preheated simultaneously when function B is called. Finally, a function preheating strategy is determined based on the first and second function preheating conditions. Intelligent preheating logic can effectively reduce cold start delays in Serverless applications while optimizing resource utilization. To improve preheating accuracy, in the function preheating method for a serverless architecture provided in Example 1 of the present application, preheating a target function to obtain a preheating result includes: waking up the target function to obtain a processing result; allocating resources to the target function based on attribute information of the target function to obtain a resource allocation result, wherein the attribute information represents the resource information required by the target function; and obtaining a preheating result based on the processing result and the resource allocation result. Optionally, after preheating the target function to obtain a preheating result, the method further includes: if the preheating result indicates that the preheating was successful, obtaining current state information of the target function; determining whether the target function is in a responsive state based on the current state information; and if the target function is not in a responsive state, preheating the target function again. Optionally, a dormant function is "awakened" through a brief initialization call to obtain a processing result, and then resources (e.g., memory and CPU) are allocated to the target function based on the resource information required by the target function and the expected amount of data to be processed. Finally, a preheating result is obtained based on the processing results and resource allocation results. After obtaining the preheating result, to improve preheating accuracy, a determination is made as to whether the target function was preheated successfully. If the preheating result indicates success, the target function is then determined to be responsive based on its current state information. It should be noted that responsiveness refers to the state in which the target function is able to process the required data. If the target function is responsive, the process waits until the data transmission that requires processing begins. If it is not responsive, the target function is preheated again. In an alternative embodiment, if the preheating operation fails, a backup solution (e.g., manual processing or no preheating) can be used to maintain service availability. In an alternative embodiment, resource usage is optimized during preheating to avoid unnecessary overhead.Preheating strategies can also be configured based on actual needs. For example, whether to preheat in parallel or serially can be determined based on the relationships between functions and resource constraints. For resource-intensive functions, a gradual preheating approach can also be used to prevent one-time resource usage spikes. In an optional embodiment, if a resource conflict exists during preheating, function preheating is stopped. The above steps improve the accuracy of function preheating and significantly reduce delays caused by cold starts. This not only improves system responsiveness and user experience, but also helps reduce operating costs by optimizing resource utilization. To further improve the accuracy of the preheating strategy, in the function preheating method for a serverless architecture provided in Example 1 of the present application, after preheating the target function and obtaining the preheating results, the method further includes: determining whether the target workflow has completed execution; if so, obtaining the target workflow's execution log; and optimizing the function preheating strategy based on the target workflow's execution log. Optionally, a check is performed to determine whether the target workflow has completed execution. If so, the execution log of the target workflow is obtained to optimize the function preheating strategy based on the execution log. In an alternative embodiment, function performance metrics, such as startup time, execution time, and resource usage, are continuously tracked and recorded. The operating status of the entire Serverless system, including load distribution, resource utilization, and function health, is also monitored. Based on the detection data and performance analysis results, the preheating strategy is adjusted, such as by changing the preheating frequency or adjusting the set of preheated functions. This allows the preheating strategy to automatically adapt to workflow changes, such as changes in user behavior or the deployment of new features. When performance degradation or system anomalies are detected, real-time alerts can be triggered for rapid response to avoid service interruptions. In an alternative embodiment, function preheating can be implemented using the flowchart shown in Figure 3: Step 1: Workflow Analysis: Analyze the calling patterns and relationships of each function in the Serverless workflow to identify critical paths and frequently used functions. Step 2: Intelligent Preheating Logic: Set the preheating strategy based on the analysis results. Step 3: Dynamic Warmup Execution: When the workflow starts, predict the next function that might be called. Based on the predictions, dynamically warm up the relevant functions. Optimize the warmup timing and sequence to minimize resource consumption and response time. Step 4: Continuous Monitoring and Adjustment: Detect actual function call patterns. Based on this data, adjust the warmup strategy to improve accuracy and efficiency. Workflow analysis in Step 1 also includes: 1. Data Collection, Function Call Logs: Collect data on when and how each function is called.Performance metrics: Measure performance metrics such as response time, execution time, and resource consumption of each function. User behavior analysis: Analyze user behavior or external events that trigger each function call.
[0004] 2. Relationship identification and call chain analysis: Identify the call chain between functions, that is, how one function triggers another. Dependency mapping: Identify data dependencies between functions, for example, if the output of one function is the input of another.
[0005] 3. Importance Assessment, Critical Path Identification: Identify the critical path in the workflow, that is, the sequence of functions that has the greatest impact on overall response time. High-Frequency Function Identification: Identify frequently called functions that are critical to overall performance.
[0006] 4. Behavioral pattern analysis and usage pattern recognition: Analyze the temporal patterns of function usage, such as peak and trough periods. Predictive analysis: Use statistical or machine learning methods to predict which functions are likely to be triggered in specific situations.
[0007] 5. Identify performance bottlenecks. Latency analysis: Identify which functions' startup or execution delays have the greatest impact on the overall workflow. Resource utilization analysis: Identify which functions consume significant resources during execution.
[0008] 6. Continuous Optimization and Feedback Loop: Use actual operational data to continuously optimize the accuracy of relationship identification and behavioral pattern analysis. Dynamic Adjustment: Adjust the identification criteria for critical paths and high-frequency functions based on application changes and data analysis results. Step 2, the intelligent preheating logic, also includes: 1. Preheating Strategy Development, Relationship-Based Preheating: Determine the preheating strategy based on the call chain and dependencies between functions. For example, if function A is frequently called after function B, preheat function A simultaneously when function B is called. Importance-based preheating prioritizes preheating for functions identified as being on the critical path or being frequently called. Dynamic Adjustment Mechanism: Preheating strategies should be able to dynamically adjust based on real-time detection data to address changes in usage patterns and workflows.
[0009] 2. Optimize the warmup process to minimize resource consumption: Optimize the warmup process to use the fewest resources. For example, warm up only enough to respond to initial requests. Latency control: Ensure that the warmup operation itself does not introduce excessive latency by controlling the timing and order of warmup operations.
[0010] 3. Preheating Execution Strategy: Parallel vs. Serial Preheating: Parallel or serial preheating is determined based on the relationships between functions and resource constraints. Gradual Preheating: For resource-intensive functions, a gradual preheating approach is used to prevent one-time resource usage spikes.
[0011] 4. Continuous monitoring and feedback: Detect preheating effectiveness: Real-time monitoring of post-preheating function performance, including startup time and response speed. Feedback loop: Feedback monitoring results into the preheating strategy to optimize and adjust the preheating logic.
[0012] 5. Exception handling and handling of preheating failures: When preheating fails, quickly respond and implement alternative solutions (for example, a second preheating or stopping preheating). Resource conflict resolution: Addressing resource contention between preheating operations and actual requests (for example, stopping preheating when resource contention exists). In the function preheating method for a serverless architecture provided in Example 1 of the present application, upon detecting that a target workflow in the serverless architecture is in the startup state, the method determines a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy based on the historical execution logs of the target workflow. The target function is then preheated to obtain a preheating result. This addresses the technical issue in related arts where a timer is used to preheat all functions in a serverless architecture, resulting in low function preheating accuracy. In this application, the target workflow's historical execution logs can be used to clearly identify the call and execution information of each function in the target workflow. Therefore, a function warm-up strategy can be accurately determined. When the target workflow is initiated, the function warm-up strategy can more accurately determine which functions will be called during subsequent data processing. Compared to the static warm-up strategy in the prior art, this application effectively improves the accuracy of function prediction through intelligent analysis of workflows and function warm-up strategies. Furthermore, through effective function warm-up, the cold start time of serverless applications is significantly reduced, thereby improving the responsiveness of serverless architectures. It should be noted that the aforementioned method embodiments are described as a series of actions for simplicity. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, as certain steps can be performed in a different order or simultaneously. Furthermore, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for this application. Through the above description of the embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software and a necessary general-purpose hardware platform. Hardware implementation is also possible, but in many cases the former is a more preferred implementation method. Based on this understanding, the technical solution of the present application, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the methods of the various embodiments of the present application.Example 2 According to an embodiment of the present application, a function preheating method for a serverless architecture is also provided. As shown in FIG4 , the function prediction method includes the following steps: Step S401: Upon detecting that the serverless architecture currently meets a preset function preheating trigger condition, a target function to be preheated is determined from multiple initial functions in the serverless architecture according to a function preheating strategy. The function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture. Optionally, a status detection device is used to detect whether the serverless architecture currently meets a preset function preheating trigger condition. For example, the function preheating trigger condition can be a time condition or an event condition. If it is detected that the serverless architecture currently meets the preset function preheating trigger condition, a target function to be preheated is determined from the multiple initial functions in the serverless architecture according to the function preheating strategy. It should be noted that the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture. Using the function preheating strategy, functions can be preheated more accurately. Step S402: Preheating the target function is performed to obtain a preheating result. Optionally, the target function is preheated to improve the target function's data processing efficiency. In summary, historical call logs of multiple initial functions in a serverless architecture can clearly identify the call and execution information of each function, accurately analyzing and deriving a function preheating strategy. Furthermore, based on the function preheating strategy, it is possible to more accurately determine which functions will be called in subsequent data processing. This addresses the technical issue in related art where a timer is used to preheat all functions in a serverless architecture, resulting in relatively low function preheating accuracy. This improves the accuracy of function preheating and effectively improves data processing efficiency. To improve the accuracy of setting function preheating trigger conditions, in a function preheating method for a serverless architecture provided in Example 2 of the present application, before determining a target function to be preheated from multiple initial functions in the serverless architecture based on the function preheating strategy, the method further includes: obtaining historical call logs of the multiple initial functions in the serverless architecture; obtaining second call data information of an initial function among the multiple initial functions based on the historical call logs; and determining the function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. Optionally, historical call logs of multiple initial functions in the serverless architecture are obtained through a logging device. Then, data about when and how each function was called is collected through the historical call logs, which is the aforementioned second call data information. By analyzing the second call data information, the time patterns of function usage, such as peak and trough periods, and the specific events that triggered the function (such as new user requests, specific data input, etc.) are analyzed.Finally, based on the analysis results (i.e., the aforementioned call time and call conditions), the function preheating trigger conditions are determined. In an optional embodiment, the function preheating trigger conditions may include the following two types: Time-based triggering: Automatically triggering the preheating logic at a specific time (e.g., before a peak period); Event-driven triggering: Triggering the preheating logic based on a specific event (e.g., a new user request, specific data input, etc.). By analyzing historical call logs, it is possible to accurately obtain information about the regularity of function calls, and thus accurately determine the aforementioned function preheating trigger conditions. To improve the accuracy of determining the function preheating strategy, in the function preheating method for a serverless architecture provided in Example 2 of the present application, before determining the target function to be preheated from multiple initial functions in the serverless architecture based on the function preheating strategy, the method further includes: obtaining performance data information and the call count of an initial function in the multiple initial functions based on the historical call logs of the multiple initial functions; determining weights of the initial functions in the multiple initial functions based on the performance data and the call count; and determining the function preheating strategy based on the weights. Optionally, historical call logs for multiple initial functions are obtained. Performance data for these initial functions, such as performance indicators such as response time, execution time, and resource consumption, are obtained from these historical call logs. The call counts of these initial functions are also obtained from these historical call logs. Key functions and frequently called functions are then identified based on these performance indicators and call counts. After obtaining these performance data and call counts, weights for the initial functions are determined based on these data. A function preheating strategy is then generated based on these weights. For example, functions identified as key or frequently called functions are assigned a priority preheating weight. In an alternative embodiment, function preheating can be implemented using the flowchart shown in FIG5 : 1. Preheating triggering: Automated triggering: Automatically initiates the preheating process based on preset trigger conditions (e.g., time or event). Real-time adjustment: Dynamically adjusts the preheating time and range based on real-time data and system load.
[0013] 2. Warm-up operation, function startup: "Wake up" dormant functions through a short initialization call. Resource allocation: Adjust the amount of allocated resources (such as memory and CPU) based on the characteristics and expected load of each function.
[0014] 3. Resource management and optimization: Optimize resource usage during the warm-up process to avoid unnecessary overhead. Load balancing: Ensure that warm-up operations do not burden other parts of the system and distribute resource consumption through load balancing.
[0015] 4. Status detection and status tracking: Detect the status of each function, including whether it has been preheated and current performance indicators. Health check: Regularly check preheated functions to ensure they are in a responsive state.
[0016] 5. Scheduling and Coordination. Intelligent Scheduling: Intelligently schedules the execution of preheating tasks based on preheating logic and current system status. Coordination: Ensures that preheating activities are coordinated with normal workflow operations to avoid conflicts and resource competition.
[0017] 6. Performance and effectiveness evaluation: Evaluate the impact of warm-up operations on cold start time and overall performance. Feedback application: Adjust warm-up strategies and execution based on performance evaluation results.
[0018] 7. Exception Management and Error Handling: When errors occur during the warm-up process, measures are taken to ensure stable system operation. Fallback Mechanism: If the warm-up operation fails, a backup plan is activated to maintain service availability. This series of sophisticated dynamic warm-up execution steps ensures that functions in the Serverless application can respond quickly when needed, significantly reducing delays caused by cold starts. This not only improves system responsiveness and user experience, but also helps reduce operating costs by optimizing resource utilization. In summary, effective function warm-up significantly reduces the cold start time of Serverless applications and improves overall responsiveness. It should be noted that the aforementioned method embodiments are described as a series of actions for simplicity. However, those skilled in the art should understand that this application is not limited to the order of the actions described, as certain steps may be performed in a different order or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for this application. Through the above description of the embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software and a necessary general-purpose hardware platform. Hardware implementation is also possible, but in many cases the former is a more preferred implementation method. Based on this understanding, the technical solution of the present application, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the methods of the various embodiments of the present application. Example 3 According to an embodiment of the present application, a function preheating device for a serverless architecture is also provided for implementing the function preheating method for a serverless architecture in Example 1. As shown in Figure 6, the device includes: a first determination unit 601 and a first preheating unit 602. The first determination unit 601 is configured to determine the target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy when detecting that the target workflow in the serverless architecture is in a startup state, wherein the function preheating strategy is determined based on the historical execution log of the target workflow; the first preheating unit 602 is configured to preheat the target function to obtain a preheating result.In the function preheating device for a serverless architecture provided in Example 3 of the present application, when the first determination unit 601 detects that the target workflow in the serverless architecture is in the startup state, the target function to be preheated is determined from multiple initial functions included in the target workflow according to the function preheating strategy, wherein the function preheating strategy is determined based on the historical execution log of the target workflow; the first preheating unit 602 preheats the target function to obtain a preheating result, which solves the technical problem in the related art that all functions of the serverless architecture are preheated by a timer at regular intervals, resulting in relatively low accuracy of function preheating. In the present application, the call and execution information of each function in the target workflow can be clearly identified through the historical execution log of the target workflow. Therefore, the function preheating strategy can be accurately determined. When the target workflow is started, the function preheating strategy can more accurately determine which functions will be called in the subsequent data processing process. Compared with the static preheating strategy in the prior art, the present application can effectively improve the accuracy of function prediction through intelligent analysis of workflows and function preheating strategies. Moreover, through effective function preheating, the cold start time of serverless applications can be significantly reduced, thereby achieving the effect of improving the response speed of the serverless architecture. Optionally, in the function preheating device for a serverless architecture provided in Example 3 of the present application, the first determination unit includes: a first acquisition module, configured to obtain identification information of an initial function from multiple initial functions included in the target workflow; a second acquisition module, configured to obtain identification information of the currently executing function in the target workflow; and a first determination module, configured to determine the target function to be preheated based on the identification information of the initial function from the multiple initial functions, the identification information of the currently executing function, and the function preheating conditions in the function preheating strategy. Optionally, in the function preheating device for a serverless architecture provided in Example 3 of the present application, the device also includes: a first acquisition unit, configured to obtain a historical execution log of the target workflow before determining the target function to be preheated from multiple initial functions included in the target workflow based on the function preheating strategy; a second acquisition unit, configured to obtain first call data information of an initial function among multiple initial functions based on the historical execution log, wherein the first call data information includes at least: performance indicator data of the initial function among the multiple initial functions and the call relationship between different initial functions; a second determination unit, configured to determine the function preheating strategy based on the first call data information.Optionally, in the function preheating device for a serverless architecture provided in the third embodiment of the present application, the second determination unit includes: a second determination module configured to determine, based on performance indicator data of an initial function among multiple initial functions in the first call data information, an impact value of the initial function on the response time of the target workflow; a third determination module configured to determine the call frequency of the initial function based on the number of times the initial function is called in the first call data information; a fourth determination module configured to determine the function dependencies of the multiple initial functions based on the call relationships between different initial functions in the first call data information; and a fifth determination module configured to determine a function preheating strategy based on the impact value, call frequency, and function dependencies. Optionally, in the function preheating device for a serverless architecture provided in the third embodiment of the present application, the fifth determination module includes: a first generation submodule configured to generate a first function preheating condition based on the impact value and call frequency; a second generation submodule configured to generate a second function preheating condition based on the function dependencies; and a determination submodule configured to determine the function preheating strategy based on the first function preheating condition and the second function preheating condition. Optionally, in the function preheating device for a serverless architecture provided in the third embodiment of the present application, the first preheating unit includes: a wakeup module configured to perform a wakeup process on the target function and obtain a process result; an allocation module configured to allocate resources to the target function based on attribute information of the target function and obtain a resource allocation result, wherein the attribute information is used to represent resource information required by the target function; and a processing module configured to obtain a preheating result based on the processing result and the resource allocation result. Optionally, in the function preheating device for a serverless architecture provided in the third embodiment of the present application, the device further includes: a third acquisition unit configured to, after performing the preheating process on the target function and obtaining the preheating result, obtain current state information of the target function if the preheating result indicates that the preheating was successful; a first determination unit configured to determine whether the target function is in a responsive state based on the current state information; and a second preheating unit configured to perform the preheating process on the target function again if the target function is not in a responsive state. Optionally, in the function preheating device for a serverless architecture provided in Example 3 of the present application, the device further includes: a second judgment unit, configured to preheat the target function and determine whether the target workflow has been completed after obtaining the preheating result; a fourth acquisition unit, configured to obtain the execution log of the target workflow if the target workflow has been completed; and an optimization unit, configured to optimize the function preheating strategy based on the execution log of the target workflow.It should be noted that the first determination unit 601 and the first preheating unit 602 described above correspond to steps S201 and S202 in Example 1. The examples and application scenarios implemented by these two units and the corresponding steps are the same, but are not limited to the content disclosed in Example 1. It should be noted that the above modules, as part of the apparatus, can be run in the computer terminal 10 provided in Example 1. It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios, and implementation processes provided in Example 1, but are not limited to the schemes provided in Example 1. Example 4 According to an embodiment of the present application, a function preheating device for a serverless architecture is provided for implementing the function preheating method for a serverless architecture in Example 2. As shown in Figure 7, the device includes: a third determination unit 701 and a third preheating unit 702. The third determination unit 701 is configured to determine a target function to be preheated from multiple initial functions of the serverless architecture according to a function preheating strategy when it is detected that the serverless architecture currently meets the preset function preheating trigger condition, wherein the function preheating strategy is determined based on the historical call logs of multiple initial functions in the serverless architecture; the third preheating unit 702 is configured to preheat the target function to obtain a preheating result. Optionally, in the function preheating device for a serverless architecture provided in Example 4 of the present application, the device further includes: a fifth acquisition unit, configured to obtain historical call logs of multiple initial functions in the serverless architecture before determining the target function to be preheated from the multiple initial functions of the serverless architecture based on the function preheating strategy; a sixth acquisition unit, configured to obtain second call data information of the initial function among the multiple initial functions based on the historical call log; and a fourth determination unit, configured to determine the function preheating trigger condition based on the calling time and calling condition of the initial function in the second call data information. Optionally, in the function preheating device for a serverless architecture provided in Example 4 of the present application, the device further includes: a seventh acquisition unit, configured to obtain performance data information of an initial function and the number of calls of an initial function in multiple initial functions based on historical call logs of multiple initial functions before determining a target function to be preheated from multiple initial functions of the serverless architecture based on a function preheating strategy; a fifth determination unit, configured to determine a weight value of an initial function in multiple initial functions based on the performance data information and the number of calls; and a sixth determination unit, configured to determine the function preheating strategy based on the weight value.It should be noted that the third determination unit 701 and the third preheating unit 702 described above correspond to steps S401 and S402 in Example 2. The examples and application scenarios implemented by these two units and the corresponding steps are the same, but are not limited to the content disclosed in Example 2. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1. It should be noted that the preferred implementation schemes involved in the above-mentioned embodiments of this application are the same as those provided in Example 2, as well as the application scenarios and implementation processes, but are not limited to the scheme provided in Example 2. Example 5 According to an embodiment of this application, a function preheating system for implementing a function preheating method for a serverless architecture is also provided. As shown in Figure 8 , the function preheating system includes an analysis engine 80, a preheating scheduler 81, and a detection system 82. The analysis engine 80 is responsible for analyzing the relationship between workflows and functions. The preheating scheduler 81 determines which functions require preheating based on the analysis engine's output. The detection system 82 tracks the actual usage of functions, providing data support for the analysis engine and the preheating scheduler. It should be noted that the preferred implementation schemes involved in the above-mentioned embodiments of this application are the same as the solutions, application scenarios, and implementation processes provided in Examples 1 and 2, but are not limited to the solutions provided in Examples 1 and 2. Example 6: The embodiments of this application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may be replaced with a terminal device such as a mobile terminal. Optionally, in this embodiment, the computer terminal may be located on at least one of multiple network devices in a computer network. In this embodiment, the computer terminal may execute program code for the following steps in a function preheating method for a serverless architecture: upon detecting that a target workflow in the serverless architecture is in the startup state, determining a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on the historical execution log of the target workflow; and performing preheating processing on the target function to obtain a preheating result.The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: Determining a target function to be preheated from multiple initial functions included in a target workflow based on a function preheating strategy includes: obtaining identification information of an initial function from the multiple initial functions included in the target workflow; obtaining identification information of a function currently being executed in the target workflow; and determining the target function to be preheated based on the identification information of the initial function from the multiple initial functions, the identification information of the currently being executed function, and function preheating conditions in the function preheating strategy. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: Before determining the target function to be preheated from the multiple initial functions included in the target workflow based on the function preheating strategy, the method further includes: obtaining historical execution logs of the target workflow; obtaining first call data information of an initial function from the multiple initial functions based on the historical execution logs, wherein the first call data information includes at least performance indicator data of the initial function from the multiple initial functions and call relationships between different initial functions; and determining a function preheating strategy based on the first call data information. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: Determining a function preheating strategy based on the first call data information includes: determining an impact value of an initial function on the response time of a target workflow based on performance indicator data of an initial function among multiple initial functions in the first call data information; determining a call frequency of the initial function based on the number of times the initial function is called in the first call data information; determining function dependencies among the multiple initial functions based on call relationships between different initial functions in the first call data information; and determining a function preheating strategy based on the impact value, call frequency, and function dependencies. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: Determining a function preheating strategy based on the impact value, call frequency, and function dependencies includes: generating a first function preheating condition based on the impact value and call frequency; generating a second function preheating condition based on the function dependencies; and determining a function preheating strategy based on the first function preheating condition and the second function preheating condition. The above-mentioned computer terminal can execute the program code of the following steps in the function preheating method for the serverless architecture: preheating the target function to obtain the preheating result includes: waking up the target function to obtain the processing result; allocating resources to the target function based on the attribute information of the target function to obtain the resource allocation result, wherein the attribute information is used to characterize the resource information required by the target function; obtaining the preheating result based on the processing result and the resource allocation result.The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: After preheating the target function and obtaining a preheating result, the method further includes: if the preheating result indicates successful preheating, obtaining current state information of the target function; determining whether the target function is in a responsive state based on the current state information; and if the target function is not in a responsive state, preheating the target function again. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: After preheating the target function and obtaining a preheating result, the method further includes: determining whether the target workflow has completed execution; if the target workflow has completed execution, obtaining an execution log of the target workflow; and optimizing the function preheating strategy based on the execution log of the target workflow. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: upon detecting that the serverless architecture currently meets a preset function preheating trigger condition, determining a target function to be preheated from multiple initial functions in the serverless architecture based on a function preheating strategy, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and performing a preheating process on the target function to obtain a preheating result. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: before determining the target function to be preheated from multiple initial functions in the serverless architecture based on the function preheating strategy, the method further includes: obtaining historical call logs of multiple initial functions in the serverless architecture; obtaining second call data information of an initial function among the multiple initial functions based on the historical call logs; and determining a function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. The computer terminal can execute program code for the following steps in a function preheating method for a serverless architecture: Before determining a target function to be preheated from multiple initial functions in the serverless architecture based on a function preheating strategy, the method further includes: obtaining performance data and call counts of initial functions from the multiple initial functions based on historical call logs of the multiple initial functions; determining weights of the initial functions from the multiple initial functions based on the performance data and call counts; and determining a function preheating strategy based on the weights. Optionally, Figure 9 is a block diagram of a computer terminal according to an embodiment of the present application. As shown in Figure 9, the computer terminal 10 may include one or more (only one is shown in Figure 9) processors 102 and a memory 104. oThe computing terminal 10 may also include a storage controller to control and manage the memory 104. The computing terminal 10 may also include a peripheral interface to connect to a radio frequency module, an audio module, and a display screen. The memory may be used to store software programs and modules, such as the program instructions / modules corresponding to the function preheating method for a serverless architecture in the embodiments of the present application. The processor executes the software programs and modules stored in the memory to execute various functional applications and data processing, thereby implementing the function preheating method for a serverless architecture. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory located remotely from the processor, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The processor may call information and applications stored in the memory through a transmission device to execute the following steps: upon detecting that a target workflow in a serverless architecture is in an activated state, determine a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on historical execution logs of the target workflow; and perform preheating on the target function to obtain a preheating result. Optionally, the processor may further execute program code for the following steps: determining the target function to be preheated from multiple initial functions included in the target workflow according to the function preheating strategy includes: obtaining identification information of an initial function from the multiple initial functions included in the target workflow; obtaining identification information of a currently executing function in the target workflow; and determining the target function to be preheated based on the identification information of the initial function from the multiple initial functions, the identification information of the currently executing function, and function preheating conditions in the function preheating strategy. Optionally, the processor may further execute program code of the following steps: before determining a target function to be preheated from multiple initial functions included in the target workflow based on the function preheating strategy, the method may further include: obtaining a historical execution log of the target workflow; obtaining first call data information of an initial function among the multiple initial functions based on the historical execution log, wherein the first call data information includes at least performance indicator data of the initial function among the multiple initial functions and call relationships between different initial functions; and determining the function preheating strategy based on the first call data information.Optionally, the processor may further execute program code for the following steps: determining a function warm-up strategy based on the first call data information includes: determining an impact value of an initial function on the response time of a target workflow based on performance indicator data of an initial function among the multiple initial functions in the first call data information; determining a call frequency of the initial function based on the number of times the initial function is called in the first call data information; determining function dependencies among the multiple initial functions based on call relationships between different initial functions in the first call data information; and determining a function warm-up strategy based on the impact value, call frequency, and function dependencies. Optionally, the processor may further execute program code for the following steps: determining a function warm-up strategy based on the impact value, call frequency, and function dependencies includes: generating a first function warm-up condition based on the impact value and call frequency; generating a second function warm-up condition based on the function dependencies; and determining the function warm-up strategy based on the first function warm-up condition and the second function warm-up condition. Optionally, the processor may further execute program code for the following steps: performing preheat processing on the target function to obtain a preheat result includes: performing wake-up processing on the target function to obtain a processing result; allocating resources to the target function based on attribute information of the target function to obtain a resource allocation result, wherein the attribute information is used to represent resource information required by the target function; and obtaining a preheat result based on the processing result and the resource allocation result. Optionally, the processor may further execute program code for the following steps: after performing preheat processing on the target function to obtain a preheat result, the method further includes: if the preheat result indicates that the preheat was successful, obtaining current state information of the target function; determining whether the target function is in a responsive state based on the current state information; and if the target function is not in a responsive state, performing preheat processing on the target function again. Optionally, the processor may further execute program code for the following steps: after preheating the target function and obtaining a preheating result, the method may further include: determining whether the target workflow has completed execution; if the target workflow has completed execution, obtaining the execution log of the target workflow; and optimizing the function preheating strategy based on the execution log of the target workflow. Optionally, the processor may further execute program code for the following steps: upon detecting that the serverless architecture currently meets preset function preheating trigger conditions, determining a target function to be preheated from multiple initial functions in the serverless architecture based on the function preheating strategy, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and performing preheating on the target function to obtain a preheating result.Optionally, the processor may further execute program code for the following steps: before determining a target function to be preheated from multiple initial functions in the serverless architecture based on a function preheating strategy, the method may further include: obtaining historical call logs of the multiple initial functions in the serverless architecture; obtaining second call data information of an initial function in the multiple initial functions based on the historical call logs; and determining a function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. Optionally, the processor may further execute program code for the following steps: before determining a target function to be preheated from multiple initial functions in the serverless architecture based on a function preheating strategy, the method may further include: obtaining performance data information and call counts of the initial functions in the multiple initial functions based on the historical call logs of the multiple initial functions; determining weights of the initial functions in the multiple initial functions based on the performance data information and call counts; and determining a function preheating strategy based on the weights. Those skilled in the art will appreciate that the structure shown in FIG9 is merely illustrative, and the computer terminal may also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD, or other terminal device. FIG9 does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG9 , or have a configuration different from that shown in FIG9 . Those skilled in the art will appreciate that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by a program instructing the hardware related to the terminal device. The program may be stored in a computer-readable storage medium, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Example 7 The embodiments of the present application also provide a computer-readable storage medium. Optionally, in this embodiment, the storage medium may be used to store program code executed by the function preheating method for a serverless architecture provided in the first embodiment. Optionally, in this embodiment, the storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: upon detecting that a target workflow in a serverless architecture is in a startup state, determining a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on historical execution logs of the target workflow; and performing a preheating process on the target function to obtain a preheating result. Furthermore, determining the target function to be preheated from the multiple initial functions included in the target workflow according to the function preheating strategy includes: obtaining identification information of an initial function from the multiple initial functions included in the target workflow; obtaining identification information of a currently executing function in the target workflow; and determining the target function to be preheated based on the identification information of the initial function from the multiple initial functions, the identification information of the currently executing function, and function preheating conditions in the function preheating strategy. The storage medium is configured to store program code for executing the following steps: before determining a target function to be preheated from multiple initial functions included in a target workflow based on a function preheating strategy, the method further includes: obtaining historical execution logs of the target workflow; obtaining first call data information of an initial function among the multiple initial functions based on the historical execution logs, wherein the first call data information includes at least performance indicator data of the initial function among the multiple initial functions and call relationships between different initial functions; and determining a function preheating strategy based on the first call data information. The storage medium is configured to store program code for executing the following steps: determining the function preheating strategy based on the first call data information includes: determining an impact value of the initial function on the response time of the target workflow based on the performance indicator data of the initial function among the multiple initial functions in the first call data information; determining a call frequency of the initial function based on the number of times the initial function is called in the first call data information; determining function dependencies among the multiple initial functions based on the call relationships between different initial functions in the first call data information; and determining the function preheating strategy based on the impact value, call frequency, and function dependencies. The above-mentioned storage medium is configured to store program code for executing the following steps: determining a function preheating strategy based on the impact value, the call frequency and the function dependency, including: generating a first function preheating condition based on the impact value and the call frequency; generating a second function preheating condition based on the function dependency; and determining the function preheating strategy based on the first function preheating condition and the second function preheating condition.The storage medium is configured to store program code for executing the following steps: performing preheat processing on the target function to obtain a preheat result includes: performing wake-up processing on the target function to obtain a processing result; allocating resources to the target function based on attribute information of the target function to obtain a resource allocation result, wherein the attribute information is used to represent resource information required by the target function; and obtaining a preheat result based on the processing result and the resource allocation result. The storage medium is configured to store program code for executing the following steps: after performing preheat processing on the target function to obtain a preheat result, the method further includes: if the preheat result indicates that the preheat was successful, obtaining current state information of the target function; determining whether the target function is in a responsive state based on the current state information; and if the target function is not in a responsive state, performing preheat processing on the target function again. The storage medium is configured to store program code for executing the following steps: After preheating the target function and obtaining a preheating result, the method further includes: determining whether the target workflow has completed execution; if the target workflow has completed execution, obtaining the execution log of the target workflow; and optimizing the function preheating strategy based on the execution log of the target workflow. The storage medium is configured to store program code for executing the following steps: upon detecting that the serverless architecture currently meets preset function preheating trigger conditions, determining a target function to be preheated from multiple initial functions in the serverless architecture according to the function preheating strategy, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and performing preheating on the target function to obtain a preheating result. The storage medium is configured to store program code for executing the following steps: before determining a target function to be preheated from multiple initial functions in a serverless architecture based on a function preheating strategy, the method further comprises: obtaining historical call logs of the multiple initial functions in the serverless architecture; obtaining second call data information of an initial function in the multiple initial functions based on the historical call logs; and determining a function preheating trigger condition based on the call time and call conditions of the initial function in the second call data information. The storage medium is configured to store program code for executing the following steps: before determining a target function to be preheated from multiple initial functions in a serverless architecture based on a function preheating strategy, the method further comprises: obtaining performance data information and call counts of the initial functions in the multiple initial functions based on the historical call logs of the multiple initial functions; determining a weight value of the initial function in the multiple initial functions based on the performance data information and call counts; and determining a function preheating strategy based on the weight value. The serial numbers of the embodiments of the present application are for descriptive purposes only and do not represent the merits or demerits of the embodiments.In the above embodiments of this application, the descriptions of each embodiment have their own specific focus. For portions not detailed in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. In the several embodiments provided herein, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other divisions may be employed. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. Furthermore, the coupling or direct coupling or communication connection shown or discussed between each other may be through interfaces, or indirect coupling or communication connection between units or modules may be electrical or other forms. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one location or distributed across multiple network units. Some or all of these units may be selected to achieve the objectives of this embodiment according to actual needs. In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in either hardware or software functional units. If the integrated units are implemented as software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the portion that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (such as a personal computer, server, or network device) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), removable hard drives, magnetic disks, or optical disks. The above description is only a preferred embodiment of the present application. It should be noted that a person skilled in the art can make several improvements and modifications without departing from the principles of the present application, and such improvements and modifications should also be considered within the scope of protection of the present application.Industrial Applicability: The function preheating method for a serverless architecture provided in the embodiments of the present application can clearly identify the call and execution information of each function in the target workflow through the historical execution log of the target workflow. Therefore, the function preheating strategy can be accurately determined. When the target workflow is started, the function preheating strategy can be used to more accurately determine which functions will be called in the subsequent data processing process. Compared with the static preheating strategy in the prior art, the present application can effectively improve the accuracy of function prediction through intelligent analysis of workflows and function preheating strategies. Moreover, through effective function preheating, the cold start time of serverless applications can be significantly reduced, thereby achieving the effect of improving the response speed of the serverless architecture.
Claims
Claims 1. A function preheating method for a serverless architecture, comprising: When it is detected that a target workflow in a serverless architecture is in a startup state, a target function to be preheated is determined from multiple initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on a historical execution log of the target workflow; and a preheating process is performed on the target function to obtain a preheating result.
2. The method according to claim 1, wherein: Determining a target function to be preheated from multiple initial functions included in the target workflow according to a function preheating strategy includes: obtaining identification information of an initial function among the multiple initial functions included in the target workflow; obtaining identification information of a function currently being executed in the target workflow; and determining the target function to be preheated based on the identification information of the initial function among the multiple initial functions, the identification information of the currently being executed function, and a function preheating condition in the function preheating strategy.
3. The method according to claim 1, wherein: Before determining a target function to be preheated from multiple initial functions included in the target workflow based on the function preheating strategy, the method further includes: obtaining a historical execution log of the target workflow; obtaining first call data information of an initial function among the multiple initial functions based on the historical execution log, wherein the first call data information includes at least performance indicator data of the initial function among the multiple initial functions and call relationships between different initial functions; and determining the function preheating strategy based on the first call data information.
4. The method according to claim 3, wherein: Determining the function warm-up strategy based on the first call data includes: determining, based on performance indicator data of an initial function among the multiple initial functions in the first call data, a degree of influence of the initial function on the response time of the target workflow; determining, based on the number of times the initial function in the first call data is called, a call frequency of the initial function; and determining, based on call relationships between different initial functions in the first call data, function dependencies among the multiple initial functions. 26 Determine the function preheating strategy according to the impact value, the call frequency, and the function dependency.
5. The method according to claim 4, wherein: Determining the function preheating strategy based on the impact value, the call frequency, and the function dependency includes: generating a first function preheating condition based on the impact value and the call frequency; generating a second function preheating condition based on the function dependency; and determining the function preheating strategy based on the first function preheating condition and the second function preheating condition.
6. The method according to claim 1, wherein: Performing preheating processing on the objective function to obtain a preheating result includes: performing wake-up processing on the objective function to obtain a processing result; performing resource allocation on the objective function based on attribute information of the objective function to obtain a resource allocation result, wherein the attribute information is used to represent resource information required by the objective function; and obtaining the preheating result based on the processing result and the resource allocation result.
7. The method according to claim 1, wherein: After preheating the objective function and obtaining a preheating result, the method further includes: if the preheating result indicates that the preheating is successful, obtaining current state information of the objective function; judging whether the objective function is in a responsive state based on the current state information; and if the objective function is not in the responsive state, preheating the objective function again.
8. The method according to claim 1, wherein: After preheating the target function and obtaining a preheating result, the method further includes: determining whether the target workflow has been executed and completed; if the target workflow has been executed and completed, obtaining an execution log of the target workflow; and optimizing the function preheating strategy based on the execution log of the target workflow.
9. A function preheating method for a serverless architecture, comprising: When it is detected that the serverless architecture currently meets the preset function preheating trigger conditions, A preheating strategy is provided, wherein a target function to be preheated is determined from multiple initial functions of the serverless architecture, wherein the function preheating strategy is determined based on historical call logs of the multiple initial functions in the serverless architecture; and a preheating process is performed on the target function to obtain a preheating result.
10. The method according to claim 9, wherein: Before determining a target function to be preheated from multiple initial functions of the serverless architecture based on a function preheating strategy, the method further includes: obtaining historical call logs of multiple initial functions in the serverless architecture; obtaining second call data information of an initial function among the multiple initial functions based on the historical call logs; and determining the function preheating triggering condition based on the calling time and calling condition of the initial function in the second call data information.
11. The method according to claim 9, wherein: Before determining a target function to be preheated from multiple initial functions of the serverless architecture based on a function preheating strategy, the method further includes: obtaining performance data information of an initial function in the multiple initial functions and a call count of the initial function in the multiple initial functions based on historical call logs of the multiple initial functions; determining a weight value of the initial function in the multiple initial functions based on the performance data information and the call count; and determining the function preheating strategy based on the weight value.
12. A function preheating device for a serverless architecture, comprising: The first determining unit is configured to, upon detecting that a target workflow in a serverless architecture is in a startup state, determine a target function to be preheated from a plurality of initial functions included in the target workflow according to a function preheating strategy, wherein the function preheating strategy is determined based on a historical execution log of the target workflow; and the first preheating unit is configured to perform a preheating process on the target function to obtain a preheating result.
13. A function preheating device for a serverless architecture, comprising: The third determining unit is configured to determine a target function to be preheated from a plurality of initial functions of the serverless architecture according to a function preheating strategy when detecting that the serverless architecture currently meets a preset function preheating trigger condition, wherein the function preheating strategy is based on the plurality of initial functions in the serverless architecture. The historical call log of the function is determined; a third preheating unit is configured to preheat the target function to obtain a preheating result.
14. A computer-readable storage medium comprising a stored program, wherein: When the program is running, the device where the storage medium is located is controlled to execute the function preheating method for serverless architecture described in any one of claims 1 to 11.
15. A computer terminal, comprising: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the function preheating method for a serverless architecture as described in any one of claims 1 to 11 when running.
16. A computer program product, comprising a stored computer program, wherein when the computer program is executed by a processor, the function preheating method for a serverless architecture according to any one of claims 1 to 11 is implemented. 29
Citation Information
Patent Citations
Warm start technique for cloud-hosted functions
CN111052086A
Cloud computing resource scheduling method and device, electronic equipment and storage medium
CN113656179A
Container preheating and keep-alive method and device for edge device and storage medium
CN117742833A