Resource image data collection method and system, resource scheduling method of FaaS platform and related device

CN122924978APending Publication Date: 2026-10-16CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510442502.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

然而,基于根据经验为容器配置的资源规格确定的资源分配量与容器运行时实际的资源使用量之间可能存在极大的差异,容易出现资源过度分配或不足的情况

Benefits of technology

[0011]本申请实施例还提供一种计算机程序产品,包括计算机程序/指令,当计算机程序/指令被处理器执行时,致使处理器能够实现执行资源画像数据采集方法或FaaS平台的资源调度方法中的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122924978A_ABST
    Figure CN122924978A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a resource image data collection method and system, a resource scheduling method of a FaaS platform, and related devices. A container-side proxy component is added to the FaaS platform to specifically collect request-level resource usage, and the resource usage collection process can perceive the start and end of the execution of an access request, so that the actual resource usage of the function calculation container during the running process can be accurately obtained, providing the possibility for accurately depicting the resource image data of the function instance. The request-level resource usage collected by the container-side proxy component generates access log information of the access request through the node-side proxy component and is directly transmitted from the FaaS platform to an external log service, without the need for additional data processing or aggregation operations on the working node side of the FaaS platform, thereby reducing the resource consumption of the FaaS platform. The access log information of the access request is imported into an offline data warehouse for resource image data analysis, and the storage cost and calculation cost are relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a resource profiling data acquisition method, system, resource scheduling method for a FaaS platform, and related equipment. Background Technology

[0002] FaaS (Function as a Service) platforms allow developers to deploy code as functions without worrying about the maintenance and management of the underlying servers. In the FaaS model, developers only need to focus on writing code related to the service logic and uploading this code as independent functions to the FaaS platform. When a specific event is triggered, the FaaS platform automatically executes the corresponding function. This serverless architecture enables developers to develop and deploy applications more efficiently while reducing the need for infrastructure management. With FaaS, developers can quickly respond to changes in application requirements, achieve agile development, and only pay for the computing resources actually used, thereby optimizing costs.

[0003] In the FaaS (Fast as a Service) domain, the high-frequency destruction and creation of containers, their high-density deployment, and their request-level service characteristics make it extremely difficult to accurately collect resource profile data during container runtime. In this context, resource scheduling strategies in Function Compute (FC) scenarios typically allocate resources to containers based on resource specifications configured by developers based on experience. However, there can be a significant discrepancy between the resource allocation determined by these experience-based configurations and the actual resource usage during container runtime, easily leading to over-allocation or under-allocation of resources. Over-allocation results in a large amount of idle resources, reducing resource utilization; under-allocation limits the execution capabilities of function instances, leading to increased latency, longer response times, performance bottlenecks, and negatively impacting user experience. Therefore, it is essential to research how to accurately collect resource profile data during container runtime. Summary of the Invention

[0004] This application provides a resource profile data acquisition method, system, FaaS platform resource scheduling method, and related equipment to improve a mechanism for accurately acquiring resource profile data of function instances.

[0005] This application provides a resource profiling data collection method applied to a FaaS platform. The FaaS platform includes a request forwarding component, a resource scheduling component, and multiple computing nodes. Each computing node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function computing container. The function computing container deploys function instances. The method includes: receiving a first access request sent by a client through the request forwarding component, and requesting the resource scheduling component to apply for an idle first function computing container and its access information; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node; forwarding the first access request and access information through the request forwarding component to the first container-side proxy component in the first container group of the first container group according to the access information via the first node-side proxy component in the first computing node; and forwarding the first access request and access information through the first container-side proxy component according to the access information. The compute container is activated from an idle state to an active state, and the first resource usage of the first function compute container up to the first time point is recorded; the first function instance is requested to respond to the first access request, and the first response information is obtained; after receiving the first response information returned by the active first function compute container, the first container-side proxy component freezes the first function compute container from the active state to an idle state, and records the second resource usage of the idle first function compute container up to the second time point; the target resource usage is returned to the first node-side proxy component, which is associated with the first resource usage and the second resource usage; the first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance, and saves the access log information of the first access request to the log service through the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service.

[0006] This application embodiment also provides a resource scheduling method for a FaaS platform. The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple computing nodes. Each computing node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function computing container. The function computing container deploys function instances. The method includes: receiving a first access request sent by a client through the request forwarding component, and requesting the resource scheduling component to apply for an idle first function computing container and its access information; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node; forwarding the first access request and access information through the request forwarding component to the first container-side proxy component in the first container group via the first node-side proxy component in the first computing node according to the access information; activating the first function computing container from an idle state to an active state through the first container-side proxy component according to the access information, and recording the first access request and access information. The function compute container calculates the first resource usage up to the first time point; requests the first function instance to respond to the first access request and obtains the first response information; after receiving the first response information returned by the active first function compute container, the first container-side proxy component freezes the first function compute container from the active state to the idle state and records the second resource usage of the idle first function compute container up to the second time point; and returns the first response information and the target resource usage to the first node-side proxy component, the target resource usage being associated with the first resource usage and the second resource usage; the first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance; and saves the access log information of the first access request to the log service via the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service; and returns the first response information to the client via the request forwarding component through the first node-side proxy component.

[0007] This application embodiment also provides a resource profiling data acquisition system, including: a FaaS platform, a log service, and an offline data warehouse; the FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple computing nodes, each computing node including a node-side proxy component and at least one container group, each container group including a container-side proxy component and at least one function computing container, and the function computing container deploying function instances;

[0008] A request forwarding component receives a first access request from a client and requests a resource scheduling component to allocate an idle first function computing container and its access information. The first function computing container has already deployed the first function instance required by the first access request. The access information indicates that the first function computing container is deployed in a first container group on a first computing node. Based on the access information, the first access request and access information are forwarded via a first node-side proxy component on the first computing node to a first container-side proxy component in the first container group. The first container-side proxy component activates the first function computing container from an idle state to an active state based on the access information, records the first resource usage of the first function computing container up to a first time point, and requests the first function instance to respond to the first access request. Upon receiving the first response information from the first function computation container in the active state, the first function computation container is frozen from the active state to the idle state, and the second resource usage of the idle first function computation container up to the second time point is recorded. The target resource usage is returned to the first node-side proxy component, which is associated with the first resource usage and the second resource usage. The first node-side proxy component is used to generate access log information for the first access request based on the target resource usage and the function name of the first function instance, and saves the access log information of the first access request to the log service through the request forwarding component. The offline data warehouse is used to determine the resource profile data of each function instance based on the access log information of each access request in the log service.

[0009] This application also provides an electronic device, including: a memory and a processor; the memory for storing a computer program; the processor coupled to the memory for executing the computer program to perform steps in a resource profiling data acquisition method or a resource scheduling method of a FaaS platform.

[0010] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform steps in the resource profiling data acquisition method or the resource scheduling method of a FaaS platform.

[0011] This application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps in the resource profiling data acquisition method or the resource scheduling method of the FaaS platform.

[0012] In this embodiment, a container-side proxy component is added to the FaaS platform to specifically collect request-level resource usage. This ensures that the resource usage collection process is aware of the start and end of access requests, thereby accurately obtaining the resource usage during the actual operation of the function computing container. This provides the possibility of accurately characterizing resource profile data for function instances. The request-level resource usage collected by the container-side proxy component is used by the node-side proxy component to generate access log information for access requests. This access log information is directly transmitted from the FaaS platform to an external log service, requiring minimal additional data processing or aggregation operations on the FaaS platform's worker nodes, thus reducing FaaS platform resource consumption. Importing the access log information into an offline data warehouse for resource profile data analysis results in relatively low storage and computational costs, and provides significant flexibility for subsequent data processing. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0014] Figure 1 This is a system architecture diagram of an existing container resource profiling scheme.

[0015] Figure 2 A system architecture diagram of a resource profiling data acquisition system provided in this application embodiment;

[0016] Figure 3 A flowchart illustrating a resource profiling data acquisition method provided in this application embodiment;

[0017] Figure 4 Resource profiles for exemplary function instances;

[0018] Figure 5 This is an example of a data analysis diagram for an offline data warehouse;

[0019] Figure 6 A flowchart illustrating a resource scheduling method for a FaaS platform provided in this application embodiment;

[0020] Figure 7 This is a diagram illustrating the state changes of a container lifecycle on an exemplary FaaS platform.

[0021] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the access relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship. Furthermore, in the embodiments of this application, "first," "second," "third," etc., are only used to distinguish the content of different objects and have no other special meaning.

[0024] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0025] The following is a description of some terms used in the embodiments of this application:

[0026] Kubernetes (K8s) is a powerful container orchestration system that provides a standardized platform for the deployment, management, and automatic scaling of containerized applications.

[0027] Pod (container group): A Pod is a lightweight group of containers consisting of one or more containers. Pods can be used to run containerized applications, such as cloud gaming applications.

[0028] Function Compute (FC) is an event-driven, fully managed computing service. With Function Compute, users don't need to purchase and manage server infrastructure; they simply write and upload code or images.

[0029] FaaS (Functions as a Service) platforms allow developers to execute code snippets or functions without managing the underlying servers. This serverless computing model enables developers to focus on writing service logic without managing infrastructure.

[0030] Container resource specifications define the quantity of various computing resources required for container runtime, including but not limited to: CPU resource requirements, memory resource requirements, GPU resource requirements, and disk resource requirements. Container resource specifications help to effectively schedule and manage containers and ensure that applications have sufficient resources to maintain stable performance during runtime. In practice, CPU resources are typically expressed in "cores," with CPU resource requirements such as 0.1 cores or 0.5 cores. Memory resources are generally specified in bytes, with memory resource requirements such as 64 Mi (megabytes). Disk resources are generally specified in bytes, with disk resource requirements such as 128 Mi (megabytes). GPU resource requirements are generally specified in terms of video memory capacity and GPU cores, for example, 4GB of video memory and 8704 GPU cores.

[0031] Resource profiling data refers to a series of data describing the resource consumption characteristics of containers during runtime, obtained by monitoring and analyzing their resource usage. Resource profiling data includes, but is not limited to, CPU resource usage, memory resource usage, GPU resource usage, and disk resource usage.

[0032] Figure 1 This is a system architecture diagram for an existing container resource profiling scheme. See also... Figure 1 A FaaS platform based on the Kubernetes (K8s) architecture can include a Metrics Server and a cluster of worker nodes. The Metrics Server is a resource usage data aggregation tool specifically designed for K8s clusters. It collects resource usage data (such as CPU and memory usage) from each worker node and exposes this information to the API Server. In this way, users can query and utilize this data to optimize container resource configurations. The node cluster includes multiple worker nodes, such as Worker Node 1, Worker Node 2, etc. Each worker node deploys an agent component; for ease of distinction, the agent deployed on the worker node is referred to as the node-side agent. Each worker node can deploy multiple Pods, and each Pod can deploy multiple containers, such as Container 1, Container 2, etc. The working principle of existing container resource profiling solutions is described below:

[0033] During the data acquisition phase, see Figure 1 As shown in ①, the node-side agent periodically collects container resource usage data. That is, each worker node uses the node-side agent to periodically collect the resource usage data of the containers in each Pod on that worker node.

[0034] In the data analysis phase, see Figure 1 As shown in ②, the node-side Agent periodically reports container resource usage data to the Metrics Server. The Metrics Server analyzes this data to obtain container resource profile data, which includes, but is not limited to, the analyzed runtime CPU, GPU, memory, and disk resource usage. Users can then refer to this container resource profile data from the Metrics Server to configure and adjust container resource specifications as needed.

[0035] Existing container resource profiling solutions have the following drawbacks:

[0036] 1. Lack of Accuracy: A major drawback of existing solutions is the need for periodic resource usage data collection from all containers via node-side agents. However, on FaaS platforms, resource usage data is only meaningful when a container is processing a request. Because this solution cannot identify whether a container is active (i.e., processing a request) or idle (i.e., not processing a request), and considering the typically short lifespan of containers, the periodically collected resource usage data often lacks accuracy and is almost worthless for analysis and use.

[0037] 2. High resource consumption and cost on the node side: In FaaS scenarios, containers are created and destroyed extremely frequently, generating tens of millions of container instances and handling hundreds of billions of requests daily. Performing preliminary aggregation analysis on the worker nodes directly on the collected container resource usage data would consume significant resources, leading to high operating costs. Similarly, storing large amounts of container resource usage data in a metrics server would incur substantial storage costs.

[0038] The technical solutions of this application and how they solve the aforementioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The technical solutions provided by each embodiment of this application are described in detail below with reference to the accompanying drawings.

[0039] Figure 2This is a system architecture diagram of a resource profiling data acquisition system provided in an embodiment of this application. See also... Figure 2 The system may include: a FaaS platform, a log service, and an offline data warehouse.

[0040] See Figure 1 The FaaS platform may include, but is not limited to: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container. The function compute container deploys function instances.

[0041] The request forwarding component is responsible for receiving access requests sent by clients and routing them to the corresponding function instances for processing.

[0042] The resource scheduling component is primarily responsible for container scheduling and container state management. During container scheduling, it can select the compute node to run a newly created container by analyzing resource usage or node health on each compute node; or, it can select the container to handle access requests, etc. During container state management, the resource scheduling component can perform operations such as container creation, activation, freezing, and destruction, achieving fine-grained control over the container lifecycle. The resource scheduling component can dynamically adjust the number and distribution of containers based on real-time load, and can maximize resource utilization while ensuring service quality.

[0043] In practical applications, the resource scheduling component can perform resource scheduling in a cold start manner, that is, create a new container on the compute node and schedule requests to the newly created container for processing. Alternatively, it can perform resource scheduling in a warm start manner, that is, schedule requests to existing, available containers for processing.

[0044] Container creation refers to creating a new container based on demand. The resource scheduling component can select the most suitable compute node to create the new container based on the resource status of each compute node. Container activation refers to restoring an existing but inactive container (such as one that is frozen or has just been created but has not yet started processing requests) to an executable task state. The inactive state of a container can be understood as an idle or idle state; the active state of a container can be understood as a state where it can execute tasks or process requests. Container freezing refers to temporarily suspending a currently unused container, putting it into a low-power state to save resources. Container destruction refers to completely stopping and deleting a container, releasing all resources it occupies to reclaim all related resources.

[0045] A compute node is a unit of computing resources that actually provides computing power to run containers, including but not limited to: Virtual Machines (VMs), Bare Metal Servers, Physical Machines, Elastic Compute Services, etc.

[0046] An agent is a software program deployed on a compute node to perform monitoring, management, and maintenance tasks. For clarity, agent components deployed on compute nodes are called node-side agent components, which maintain and manage the various container groups within the compute node. Agent components deployed within container groups on a compute node are called container-side agent components, which maintain and manage the individual containers within those container groups.

[0047] In practical applications, a FaaS platform can deploy one or more compute nodes, such as compute node 1, compute node 2, and so on. Each compute node can deploy one or more node-side proxy components, and also one or more container groups. For example, compute node 1 deploys node-side proxy component 1, container group 1, container group 2, etc. Each container group includes a container-side proxy component and at least one function compute container; a function compute container is a container environment specifically used to run function instances, which can be understood as a container with function instances deployed; a function instance is a specific version of a function running within a container, responsible for handling access requests. Different function compute containers can deploy the same function instance or different function instances. For example, container group 1 deploys container-side proxy component 1, function compute container 1, function compute container 2, etc., and both function compute container 1 and function compute container 2 deploy function instance 1; container group 2 deploys container-side proxy component 2, function compute container 3, function compute container 4, etc., and function compute container 3 deploys function instance 1, function compute container 2 deploys function instance 2, and so on.

[0048] Log service provides a variety of functions such as collecting, storing, managing and analyzing log data, helping users to process log data efficiently.

[0049] An offline data warehouse, also known as a batch data warehouse, is a data warehouse system used to store and manage large amounts of historical data. Offline data warehouses provide a variety of functions such as ETL (Extract, Transform, Load), batch processing, structured storage, and multidimensional data analysis.

[0050] The following is combined with Figure 3 This section provides a detailed introduction to the data collection methods for resource profiling. Figure 3This is a flowchart illustrating a resource profiling data acquisition method provided in an embodiment of this application. The method uses a FaaS platform as the execution entity; see [link to relevant documentation]. Figure 3 The method may include the following steps:

[0051] 301. Receive the first access request sent by the client through the request forwarding component, and request the resource scheduling component to apply for a first function computing container in an idle state and its access information; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node.

[0052] Specifically, the client sends an access request to the FaaS platform. Here, the access request currently sent by the client is referred to as the first access request, and the function instance that the first access request needs to access is referred to as the first function instance. After receiving the first access request sent by the client, the request forwarding component in the FaaS platform requests the resource scheduling component to perform resource scheduling.

[0053] During resource scheduling, the resource scheduling component requests an idle function compute container to handle the first access request. For ease of understanding, the function compute container requested by the resource scheduling component for the first access request will be referred to as the first function compute container. The idle first function compute container can be an existing idle function compute container in the FaaS platform that has deployed the first function instance, or it can be a newly created function compute container that has deployed the first function instance.

[0054] The resource scheduling component returns access information for the idle first function compute container to the request forwarding component, which then sends the first access request to the first function instance for response based on the access information. Specifically, the access information indicates that the first function compute container is deployed in the first container group of the first compute node. This access information includes, but is not limited to: node information of the first compute node, container group information of the first container group, and container information of the first function compute container. The node information of the first compute node includes, but is not limited to: the node ID (identifier) ​​and IP address of the first compute node. The container group information of the first container group includes, but is not limited to: the container group ID and container group status (e.g., running, stopped). The container information of the first function compute container includes, but is not limited to: the container ID and service port number of the first function compute container.

[0055] For specific examples, see Figure 2In steps ①, ②, and ③, the client sends a first access request. The request forwarding component requests an idle first function compute container from the resource scheduling component. After resource scheduling, the resource scheduling component sends access information for the idle first function compute container to the request forwarding component, allowing the request forwarding component to access the corresponding first function instance based on the access information. For example, the node ID of the first compute node is node-001, the IP address is 192.168.1.10, the container group ID of the first container group is pod-abc123, the container ID of the first function compute container is container-def456, and the service port number is 8080. The request forwarding component uses the above access information to forward the first access request to the specified first function compute container. The first function compute container is container-def456 in the pod-abc123 container group on the first compute node at 192.168.1.10, and the first function compute container communicates externally through port 8080.

[0056] 302. The request forwarding component forwards the first access request and access information to the first container-side proxy component in the first container group through the first node-side proxy component in the first computing node, based on the access information.

[0057] Specifically, see Figure 2 In steps ④ and ⑤, after the request forwarding component obtains the access information returned by the resource scheduling component, the request forwarding component sends the first access request and access information to the first computing node based on the access information. The first node-side proxy component in the first computing node... Figure 2 Taking node-side proxy component 1 as an example, based on the access information, the first container-side proxy component in the first container group (…) Figure 2 (Taking container-side proxy component 1 as an example) forwards the first access request and access information.

[0058] 303. The first container-side proxy component activates the first function computing container from an idle state to an active state based on the access information, records the first resource usage of the first function computing container up to the first moment, and requests the first function instance to respond to the first access request to obtain the first response information.

[0059] Specifically, see Figure 2 In steps ⑥ and ⑦, the first container-side proxy component first activates the container before forwarding the first access request. During container activation, the first container-side proxy component determines the first function to be activated (compute container) based on the access information. Figure 2Taking function computing container 1 as an example, the first function computing container is activated from an idle state to an active state. Optionally, for better container control, the first container-side agent component can perform container activation operations through control groups (cgroups), but this is not a limitation. Cgroups are a resource isolation mechanism provided by the kernel for allocating, limiting, and monitoring resources for process groups. Based on the above, the implementation method of activating the first function computing container from an idle state to an active state by the first container-side agent component according to access information is as follows: the first container-side agent component requests the control group to activate the first function computing container from an idle state to an active state according to the access information.

[0060] In this embodiment, after the first function computation container is activated, the first container-side proxy component can record the first resource usage of the first function computation container up to a first moment, where the first moment can be understood as the current moment after the first function computation container is activated. In practical applications, the rules for recording resource usage may differ depending on the resource type. Some resources may need to record the actual resource usage over a period of time, some resources may need to record the average resource usage over a period of time, and some resources may need to record the maximum resource usage over a period of time.

[0061] For example, regarding CPU resources, the focus is usually on the actual resource usage during request execution. It's necessary to record CPU resource usage before and after request execution, and the CPU resource usage during the entire request execution process can be determined based on these pre- and post-execution values. This means recording CPU usage before and after the request begins to determine the actual CPU resource consumption throughout the entire request processing. In practical applications, CPU resource usage before and after request execution can be recorded as CPU time slice information, and CPU resource usage during request execution can also be recorded as CPU time slice information. Furthermore, CPU resource usage during request execution can be calculated based on CPU time slice information and the request execution duration, resulting in CPU core data. Assume that the CPU resource usage of the first function's computation container at 17:58 on March 12, 2025 (the first moment) is 112342342793 nanoseconds. After the request execution ends, check the CPU usage again, assuming it is 112344057119 nanoseconds. Based on the data from these two time points, it can be inferred that the CPU usage during the request execution process was 1,714,326 nanoseconds, which is equivalent to consuming 0.1 cores.

[0062] For example, regarding memory resources, the focus is on the maximum resource usage during request execution, rather than the instantaneous actual resource usage. Therefore, memory resource usage is initialized to 0 before a request begins, and peak memory usage is continuously monitored during request execution. For instance, the memory usage of the First Function Compute container is initialized to 0MB before a certain request is executed. As the request executes, peak memory usage is continuously monitored and recorded. If the maximum memory usage reaches 150MB during this request execution, the memory resource usage will be updated to 150MB after the request is completed. Therefore, the memory resource usage of the First Function Compute container at 17:58 on March 12, 2025 (the first moment) is recorded as 0.

[0063] In this embodiment, after recording the first resource usage of the first function computing container up to the first time point, the first container-side proxy component forwards a first access request to the first function computing container to trigger the first function instance in the first function computing container. Figure 2 (Taking function example 1 as an example) Respond to the first access request and obtain the first response information.

[0064] 304. After receiving the first response information returned by the first function computation container in the active state, the first container-side proxy component freezes the first function computation container from the active state to the idle state and records the second resource usage of the first function computation container in the idle state up to the second time; and returns the target resource usage to the first node-side proxy component, the target resource usage being associated with the first resource usage and the second resource usage.

[0065] Specifically, see Figure 2 As shown in ⑧ and ⑨, after the first container-side agent component receives the first response information returned by the first function computation container in the active state, it needs to freeze the container, that is, the first container-side agent component freezes the first function computation container from the active state to the idle state. Optionally, the first container-side agent component can perform the container freezing operation through a control group, but it is not limited to this.

[0066] In this embodiment, after the first function computing container is frozen, the second resource usage of the idle first function computing container up to the second time point can be recorded. The second time point can be understood as the current time after the first function computing container is frozen. For example, the CPU resource usage of the first function computing container at the second time point (e.g., 17:59 on March 12, 2025) is 112344057119 nanoseconds, and the memory resource usage is 150MB. It is worth noting that the memory resource usage of 150MB is the maximum value of memory resource usage detected during the request execution process, that is, the maximum memory resource usage of the active first function computing container during the processing of the first access request.

[0067] See Figure 2 As shown in ⑩, in addition to forwarding the first response information to the first node-side proxy component, the first container-side proxy component also needs to forward the target resource usage. The target resource usage is related to the first resource usage and the second resource usage. Of course, the first container-side proxy component can also forward more related information without limitation.

[0068] The target resource usage may include the first resource usage and the second resource usage, or it may include the resource usage obtained by various calculations such as summation, averaging or difference based on the first resource usage and the second resource usage, without any restriction.

[0069] It is worth noting that the first container-side proxy group can achieve request-level resource usage collection and ensure that the resource usage collection process can be aware of the start and end of the execution access request, thereby accurately obtaining the resource usage during the actual operation of the first function computing container. For example, the accurate resource usage of the first function computing container can be determined precisely for all time periods throughout the day.

[0070] 305. The first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance. The access log information for the first access request is then saved to the log service via the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service.

[0071] In this embodiment, after receiving the first response information, first resource usage, and second resource usage forwarded by the first container-side proxy component, the first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance. See also... Figure 2 In As shown, the first node-side proxy component forwards the first response information and access log information corresponding to the first access request to the request forwarding component. See also... Figure 2 In As shown, the request forwarding component returns the first response information to the client. See also... Figure 2 In As shown, the request forwarding component saves the access log information of the first access request to the log service; see also Figure 2 In As shown, the offline data warehouse determines the resource profile data of each function instance based on the access log information of each access request in the log service.

[0072] In this embodiment, the first node-side proxy component can generate access log information for the first access request based on the first resource usage, the second resource usage, and the function name of the first function instance.

[0073] It is worth noting that the access log information of the access request includes at least the function name of the function instance and the resource usage of the function compute container before and after executing the access request. This ensures that the resource usage of the function compute container during actual operation can be accurately obtained when performing resource profiling.

[0074] Optionally, the first node-side proxy component can determine the third resource usage during the first function's response to the first access request based on the first resource usage and the second resource usage. For example, the third resource usage is obtained by subtracting the first resource usage from the second resource usage.

[0075] Optionally, the first node-side proxy component can also record the sending time of forwarding the first access request to the first container-side proxy component; and the first node-side proxy component can also record the receiving time of receiving the first response information returned by the first container-side proxy component; the first node-side proxy component determines the request execution duration of the first access request based on the sending time and the receiving time. For example, the request execution duration of the first access request is obtained by subtracting the sending time from the receiving time.

[0076] In some optional embodiments, the method by which the first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance is as follows: the first node-side proxy component determines the request execution duration of the first access request based on the sending time and receiving time; the first node-side proxy component determines the third resource usage during the process of the first function computing container responding to the first access request based on the first resource usage and the second resource usage; and the first node-side proxy component generates access log information for the first access request based on the request execution duration of the first access request, the third resource usage, the sending time, the receiving time, and the function name of the first function instance.

[0077] In practical applications, the access log information of the first access request can record various related log information, such as, but not limited to: the function name of the first function instance (e.g., pr-soss-data-uploader), the first resource usage (e.g., CPU resource usage of 112342342793 nanoseconds, memory resource usage of 0), the second resource usage (e.g., CPU resource usage of 112344057119 nanoseconds, memory resource usage of 150MB), the third resource usage (e.g., CPU resource usage of 0.1 cores (i.e., corresponding to a CPU time slice of 1714326 nanoseconds), memory resource usage of 150MB), the request execution duration of the first access request (e.g., 60 seconds), the timestamp of the first access request (e.g., March 12, 2025, 17:58), the container ID of the first function compute container (e.g., container-def456), the IP address of the first compute node (e.g., 192.168.1.10), and the unique identifier corresponding to the client. The resource specifications of the first function computing container include its Identifier (UID), container specifications, and runtime environment. These specifications may include CPU or memory resource specifications. CPU resource specifications determine the maximum number of CPU cores the first function computing container can use; for example, a maximum of 1 CPU core. Memory resource specifications determine the maximum amount of memory the first function computing container can use; for example, a maximum of 200MB of available memory.

[0078] It's worth noting that the entire log collection process is very lightweight, requiring only a small amount of data collection during the execution of access requests within the Function Compute container. The resource consumption of this part is negligible. Access request log information is directly transmitted from the FaaS platform to an external log service, requiring virtually no additional data processing or aggregation operations on the FaaS platform's worker nodes, thus reducing FaaS platform resource consumption. Importing access request log information into an offline data warehouse for resource profiling data analysis results in relatively low storage and computational costs, and provides significant flexibility for subsequent data processing.

[0079] In practical applications, as the number of access requests initiated by clients increases, the amount of access log information stored in the log service of the FaaS platform will also gradually increase. In order to effectively manage and analyze massive amounts of access log information, the offline data warehouse can import access log information from the log service for analysis after a scheduled task or a specified event is triggered.

[0080] Optionally, the offline data warehouse determines the resource profile data of each function instance based on the access log information of each access request in the log service as follows: Historical access log information is obtained from the log service, including access log information for each access request corresponding to multiple fine-grained time units within a historical time period; the historical access log information is cleaned to obtain cleaned historical access log information; the cleaned historical access log information is aggregated according to the function name and fine-grained time unit to obtain fine-grained profile data for each function instance in each fine-grained time unit; the function profiles of each function instance in each fine-grained time unit are aggregated according to coarse-grained time units to obtain coarse-grained profile data for each function instance in each coarse-grained time unit; the coarse-grained profile data of each function instance in multiple coarse-grained time units are sorted and combined according to the time order from earliest to latest to obtain resource profile data with time-series characteristics for each function instance.

[0081] In practical applications, after a scheduled task or a specified event is triggered, the offline data warehouse retrieves historical access log information from the log service. This historical access log information includes access logs for each access request corresponding to multiple fine-grained time units within a historical time period. The historical time period is the period preceding the current time, such as the past 24 hours. Fine-grained time units can be set flexibly as needed, such as per second, per minute, or per five minutes.

[0082] Offline data warehouses can clean historical access log information to obtain cleaned historical access log information. For example, offline data warehouses use ETL (Extract, Transform, Load) processes to extract data from log services and perform necessary cleaning and transformation (such as filtering useless data, formatting, etc.).

[0083] Optionally, to accurately profile function instances as resources, filtering rules can be used during log cleaning to filter out abnormal access log information, reducing the impact of noisy data on resource profiling and improving its accuracy. Therefore, the method for cleaning historical access log information to obtain cleaned historical access log information is as follows: historical access log information is cleaned according to pre-defined filtering rules to obtain cleaned historical access log information.

[0084] In practical applications, filtering rules can be flexibly set as needed. Preferably, the filtering rules are: filtering out access log data with a request execution time shorter than a set duration, filtering out access log data with a CPU time slice shorter than a set value, and / or filtering out access log data with resource usage less than a set value during the function compute container's response to access requests. For example, filtering out access log data with a request execution time less than 0.1 milliseconds, access log data with a CPU time slice less than 1 nanosecond, access log data with memory resource usage less than 1 MB during the function compute container's response to access requests, and access log data with CPU resource usage less than 0.01 cores during the function compute container's response to access requests.

[0085] In this embodiment, the offline data warehouse aggregates the cleaned historical access log information according to function name and fine-grained unit time, obtaining fine-grained profile data for each function instance within each fine-grained unit time. In practical applications, access log information for access requests to the same function instance can be aggregated into the same group based on function name. Then, the access log information for each access request to the same function instance is further grouped according to fine-grained unit time, and the access requests are assigned to the corresponding fine-grained unit time based on the timestamp information of the access requests. The timestamp information of the access requests characterizes the time when the client sent the access request. Through this secondary grouping, fine-grained profile data for each function instance within each fine-grained unit time can be obtained. For example, fine-grained profile data for a function instance every minute over the past day.

[0086] In this embodiment, the offline data warehouse aggregates the function profiles of each function instance within each fine-grained unit of time, based on a coarse-grained unit of time, to obtain coarse-grained profile data for each function instance within each coarse-grained unit of time. The duration of the coarse-grained unit of time is longer than that of the fine-grained unit of time; for example, the fine-grained unit of time is every minute, and the coarse-grained unit of time is every five minutes, etc. In practical applications, for each function instance, the fine-grained profile data within the fine-grained unit of time (e.g., every minute) is aggregated according to the time interval of the coarse-grained unit of time (e.g., every five minutes).

[0087] In practical applications, resource profile data for function instances can be characterized from multiple dimensions. For example, see [link to relevant documentation]. Figure 4Resource profile data for a function instance includes, but is not limited to: the number of requests, resource usage (e.g., CPU or memory usage), resource specifications (e.g., memory or CPU specifications), average request duration, container activity rate, or number of active containers for each coarse-grained unit of time. The resource usage of a function instance per coarse-grained unit of time can be understood as the resource usage of the function instance during the process of responding to access requests within each coarse-grained unit of time.

[0088] Optionally, the implementation of aggregating the function profiles of each function instance within each fine-grained unit of time according to coarse-grained unit of time to obtain the coarse-grained profile data of each function instance within each coarse-grained unit of time includes: for each function instance, summing the number of access requests for the function instance in each fine-grained unit of time within each coarse-grained unit of time to obtain the number of requests for the function instance in each coarse-grained unit of time; summing the third resource usage corresponding to the access requests for the function instance in each fine-grained unit of time within each coarse-grained unit of time to obtain the resource usage of the function instance in each coarse-grained unit of time; summing the request usage corresponding to the access requests for the function instance in each fine-grained unit of time within each coarse-grained unit of time. The execution time is averaged to obtain the average request time of the function instance in each coarse-grained unit time. Based on the function computing containers corresponding to the access requests of the function instance in each fine-grained unit time in each coarse-grained unit time, the number of active containers of the function instance in each coarse-grained unit time is determined. Based on the number of active containers of the function instance in each coarse-grained unit time and the corresponding duration in each coarse-grained unit time, the container activity rate of the function instance in each coarse-grained unit time is determined. Based on one or more of the access request quantity, resource usage, average request time, number of active containers, and container activity rate of the function instance in each coarse-grained unit time, coarse-grained profile data of each function instance in each coarse-grained unit time is obtained.

[0089] For example, if a function instance handles 3 access requests within a five-minute period, then the number of requests for that function instance within those five minutes is 3. The average execution time of the function instance within those five minutes is calculated by averaging the execution time of each of the three access requests. The resource usage consumed during the response process of each of the three access requests is then summed to obtain the resource usage of the function instance within those five minutes. The resource specifications of the function compute container indicate the maximum number of CPU cores and the maximum memory usage. The resource specifications of the function compute container corresponding to the function instance usually remain unchanged and do not need to be aggregated. The number of active containers for that function instance within those five minutes is 3. The total active time of the active containers corresponding to each of the three access requests is summed to obtain the total active time of the three access requests. The container activity rate is determined by the ratio between the total active time and the five-minute duration.

[0090] In this embodiment, the offline data warehouse sorts and combines the coarse-grained profile data of each function instance across multiple coarse-grained time units, arranged chronologically from earliest to latest, to obtain time-series resource profile data for each function instance. It can be understood that sorting and combining data chronologically yields time-series resource profile data for each function instance. Based on this time-series resource profile data, the changing trends of resource usage over time can be observed, identifying peak and off-peak periods, thus providing a basis for resource scheduling.

[0091] To facilitate understanding of how offline data warehouses work, the following will combine... Figure 5 The following explanation is provided. Taking a fine-grained unit of time as every minute and a coarse-grained unit of time as every five minutes as an example, specifically, the offline data warehouse retrieves access logs from the previous day's access requests from the log service. Next, the offline data warehouse performs log cleaning to filter out abnormal access logs. Then, a minute-by-minute aggregation operation is performed on each function instance to obtain its profile data for that function instance. Next, a five-minute aggregation operation is performed on each function instance; that is, the minute-by-minute profile data is grouped into five-minute groups, and the grouping results are statistically analyzed to obtain profile data for each function instance, such as the number of access requests, resource usage, average request duration, number of active containers, and container activity rate within each five-minute period. Finally, the profile data for each function instance within each five-minute period is sorted and combined in chronological order to obtain resource profile data with time-series characteristics for each function instance.

[0092] In some optional embodiments, the resource profile data with time-series characteristics of each function instance obtained from offline data warehouse analysis can be uploaded to the performance index analysis system, so that relevant personnel can use the performance index analysis system to perform performance index analysis on the resource profile data with time-series characteristics of each function instance.

[0093] The resource profiling data collection scheme provided in this application adds a container-side proxy component to the FaaS platform to specifically collect request-level resource usage. This ensures that the resource usage collection process is aware of the start and end of access requests, thereby accurately obtaining the resource usage during the actual operation of the function computing container. This provides the possibility for accurately characterizing resource profiling data for function instances. The request-level resource usage collected by the container-side proxy component is used by the node-side proxy component to generate access log information for the access requests. This access log information is directly transmitted from the FaaS platform to an external log service, requiring minimal additional data processing or aggregation operations on the FaaS platform's worker nodes, thus reducing FaaS platform resource consumption. Importing the access log information into an offline data warehouse for resource profiling data analysis results in relatively low storage and computational costs, and provides significant flexibility for subsequent data processing.

[0094] In some optional embodiments, after the FaaS platform generates access log information for access requests, it can also save the access log information for access requests locally on the FaaS platform. For example, the node-side proxy component can periodically obtain the saved access log information for each access request and perform data mining on the saved access log information for each access request to obtain resource profile data for each function instance.

[0095] Figure 6 This is a flowchart illustrating a resource scheduling method for a FaaS platform provided in an embodiment of this application. The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container. The function compute container deploys function instances. See also... Figure 6 The method includes:

[0096] 601. Receive the first access request sent by the client through the request forwarding component, and request the resource scheduling component to apply for a first function computing container in an idle state and its access information; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node.

[0097] 602. The request forwarding component forwards the first access request and access information to the first container-side proxy component in the first container group through the first node-side proxy component in the first computing node, based on the access information.

[0098] 603. The first container-side proxy component activates the first function computing container from an idle state to an active state based on the access information, and records the first resource usage of the first function computing container up to the first moment; and requests the first function instance to respond to the first access request, and obtains the first response information.

[0099] 604. After receiving the first response information returned by the first function computation container in the active state, the first container-side proxy component freezes the first function computation container from the active state to the idle state and records the second resource usage of the first function computation container in the idle state up to the second time. The first response information and the target resource usage are returned to the first node-side proxy component, and the target resource usage is associated with the first resource usage and the second resource usage.

[0100] 605. The first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance; and the access log information for the first access request is saved to the log service by the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service.

[0101] 606. The first response information is returned to the client via the request forwarding component through the first node-side proxy component.

[0102] Optionally, to improve resource utilization and reduce resource waste, a resource scheduling component can be used to determine whether the first function computing container has timed out during its idle period; if it has, the first function computing container is destroyed. Specifically, a maximum allowed idle time for the function computing container can be set as needed. If the idle time of the first function computing container exceeds the maximum allowed time, it times out; otherwise, it does not.

[0103] Optionally, the implementation of requesting an idle first function computation container and its access information from the resource scheduling component via the request forwarding component is as follows: the request forwarding component sends a resource scheduling request to the resource scheduling component; the resource scheduling component determines whether an idle first function computation container exists in the FaaS platform as required by the first access request; if it exists, the resource scheduling component returns the access information of the idle first function computation container to the request forwarding component; if it does not exist, resource scheduling is performed based on the time-series resource profile data of the first function instance in the offline data warehouse to obtain a resource scheduling result, which indicates that an idle first function computation container has been created and deployed in the first container group of the first compute node; the resource scheduling component returns the access information of the idle first function computation container to the request forwarding component.

[0104] Specifically, the FaaS platform effectively utilizes time-series characteristic resource profile data in offline data warehouses for intelligent resource scheduling, rather than allocating resources to containers based on resource specifications configured by developers based on experience. This can greatly reduce the situation of over-allocation or under-allocation of resources, maximize resource utilization, and at the same time ensure service quality and response speed.

[0105] In practical applications, when scheduling resources based on the time-series resource profile data of the first function instance in the offline data warehouse, time-series data analysis can be performed on the resource profile data of the first function instance to predict its operational data in future time periods. This operational data in future time periods includes, but is not limited to, one or more of the following: number of access requests, resource usage, average request duration, number of active containers, and container activity rate. Based on the operational data of the first function instance in future time periods, the resource requirement data of the first function instance is determined, reflecting the resource usage required during the operation of the first function instance. An idle first function compute container is created on the first compute node that provides the resource requirements to meet the first function instance's requirements.

[0106] Among these methods, machine learning can be used to determine the resource requirements of the first function instance based on its running data over a future time period.

[0107] For example, by analyzing the resource profile data with time-series characteristics of the first function instance, a reasonable amount of resource usage during the operation of the first function instance can be determined. For instance, if the CPU resource usage required during the operation of the first function instance is 0.5 cores and the memory resource usage is 100MB, then an idle first function computing container can be created on a computing node that can provide 0.5 CPU cores and 100MB of memory resources.

[0108] The technical solution provided in this application allows the FaaS platform to collect resource usage at the request level during resource scheduling. This ensures the collection process is aware of the start and end of access requests, enabling accurate determination of resource usage during the actual operation of the function computing container. This provides the possibility for accurately characterizing resource profiles of function instances. Access log information is directly transmitted from the FaaS platform to an external log service, requiring minimal additional data processing or aggregation on the FaaS platform's worker nodes, thus reducing resource consumption. Importing access log information into an offline data warehouse for resource profile analysis results in relatively low storage and computational costs, and provides significant flexibility for subsequent data processing. Furthermore, accurate resource profile data assists the FaaS platform in intelligent resource scheduling, rather than allocating resources based on developer-defined resource specifications. This greatly reduces resource over-allocation or under-allocation, maximizing resource utilization while ensuring service quality and response speed.

[0109] The following is combined with Figure 7 This section introduces the container lifecycle of the FaaS platform. Figure 7 This is a diagram illustrating the state changes throughout the container lifecycle of an exemplary FaaS platform. See also... Figure 7 When the FaaS platform receives an access request from a client, it determines whether an idle function instance exists for the requested access. If not, it creates a container, activates it, and executes the access request. If the instance exists, it directly activates the container and executes the access request. The FaaS platform stores access logs for the access requests in a log service. After the container completes executing the access request, the FaaS platform freezes the container, converting the active container into an idle container (i.e., a container in a dormant state). The FaaS platform then determines whether the idle container has timed out. If so, it destroys the container, ending its entire lifecycle.

[0110] This application embodiment also provides a resource profiling data collection method applied to a FaaS platform. The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple computing nodes. Each computing node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function computing container. The function computing container deploys function instances. The method is executed by a first node-side proxy component and includes the following steps:

[0111] S1. Receive the idle first function computing container and its access information forwarded by the request forwarding component, wherein the request forwarding component receives the first access request sent by the client and requests the resource scheduling component to apply for an idle first function computing container and its access information; wherein the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node.

[0112] S2. Based on the access information of the first function computing container in the idle state, forward a first access request and the access information to the first container-side proxy component in the first container group, so as to trigger the first container-side proxy component to activate the first function computing container from the idle state to the active state, and record the first resource usage of the first function computing container up to the first time; and request the first function instance to respond to the first access request to obtain the first response information; after receiving the first response information returned by the first function computing container in the active state, freeze the first function computing container from the active state to the idle state, and record the second resource usage of the first function computing container in the idle state up to the second time.

[0113] S3. Receive the target resource usage returned by the first container-side proxy component, the target resource usage being associated with the first resource usage and the second resource usage; generate and save the access log information of the first access request based on the target resource usage and the function name of the first function instance; wherein, the saved access log information of each access request is used to determine the resource profile data of each function instance.

[0114] This application embodiment also provides a resource profiling data collection method applied to a FaaS platform. The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple computing nodes. Each computing node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function computing container. The function computing container deploys function instances. The method is executed by a first container-side proxy component and includes the following steps:

[0115] S1. Receive a first access request forwarded by the first node-side proxy component and access information of an idle first function computing container; wherein, the request forwarding component receives the first access request sent by the client and requests the resource scheduling component to apply for an idle first function computing container and its access information and forward it to the first node-side proxy component; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node;

[0116] S2. Activate the first function computing container from an idle state to an active state according to the access information, and record the first resource usage of the first function computing container up to the first moment; and request the first function instance to respond to the first access request to obtain the first response information;

[0117] S3. After receiving the first response information returned by the first function computing container in the active state, freeze the first function computing container from the active state to the idle state, and record the second resource usage of the first function computing container in the idle state up to the second time.

[0118] S4. Return the target resource usage to the first node-side proxy component. The target resource usage is associated with the first resource usage and the second resource usage, so that the first node-side proxy component can generate and save the access log information of the first access request based on the target resource usage and the function name of the first function instance. The saved access log information of each access request is used to determine the resource profile data of each function instance.

[0119] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 301 to 305 can be device A; or the execution subject of steps 301 and 302 can be device A, and the execution subject of steps 303 to 305 can be device B; and so on.

[0120] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 301, 302, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0121] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device includes: a memory 81 and a processor 82;

[0122] Memory 81 is used to store computer programs and can be configured to store various other data to support operation on the computing platform. Examples of this data include instructions for any application or method operating on the computing platform, data structures, contact data, phone book data, messages, pictures, videos, etc.

[0123] The processor 82, coupled to the memory 81, is used to execute computer programs in the memory 81 for: performing steps in a resource profiling data acquisition method or a resource scheduling method of a FaaS platform.

[0124] Optional, such as Figure 8 As shown, the electronic device also includes other components such as a communication component 83, a display 84, a power supply component 85, and an audio component 86. Figure 8 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 8 The components shown. Additionally... Figure 8 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a desktop computer, laptop computer, smartphone, or IoT (Internet of Things) device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a desktop computer, laptop computer, or smartphone, it may include... Figure 8 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 8 The component within the dashed box.

[0125] The aforementioned memory can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G (2nd Generation), 3G (3rd Generation), 4G (4th Generation) / LTE (long Term Evolution), 5G (5th Generation), or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from a user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. The aforementioned power supply component provides power to various components of the device in which the power supply component resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component resides. The aforementioned audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device in which the audio component resides is in an operating mode, such as a call mode, recording mode, or voice recognition mode. The received audio signals may be further stored in memory or transmitted via the communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0126] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium may be volatile, non-volatile, or a combination thereof, and may be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium.

[0127] Accordingly, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is able to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. In addition, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, so that the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device can be implemented as a means to implement the corresponding functions in the above method embodiments.

[0128] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0129] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for collecting resource profiling data, characterized in that, Applied to a FaaS platform, the FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container, wherein the function compute container deploys function instances. The method includes: The request forwarding component receives a first access request sent by the client and requests the resource scheduling component to apply for a first function computing container in an idle state and its access information; wherein, the first function computing container has deployed the first function instance that the first access request needs to access, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node; The request forwarding component forwards the first access request and the access information to the first container-side proxy component in the first container group via the first node-side proxy component in the first computing node, based on the access information. The first container-side proxy component activates the first function computing container from an idle state to an active state based on the access information, and records the first resource usage of the first function computing container up to the first moment; and requests the first function instance to respond to the first access request to obtain the first response information. After receiving the first response information returned by the first function computation container in the active state, the first container-side proxy component freezes the first function computation container from the active state to the idle state and records the second resource usage of the first function computation container in the idle state up to the second time. The first node-side proxy component then returns the target resource usage, which is associated with the first resource usage and the second resource usage. The first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance. The access log information for the first access request is then saved to the log service via the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service.

2. The method according to claim 1, characterized in that, The first container-side proxy component activates the first function computation container from an idle state to an active state based on the access information, including: The first container-side proxy component requests the control group to activate the first function computation container from an idle state to an active state based on the access information.

3. The method according to claim 1, characterized in that, Also includes: The first node-side proxy component records the time when the first access request is forwarded to the first container-side proxy component; and records the time when the first response information returned by the first container-side proxy component is received. Accordingly, the first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance, including: The first node-side proxy component determines the request execution duration of the first access request based on the sending time and the receiving time. The first node-side proxy component determines the third resource usage during the process of the first function calculation container responding to the first access request based on the first resource usage and the second resource usage. The first node-side proxy component generates access log information for the first access request based on the request execution duration of the first access request, the usage of the third resource, the sending time, the receiving time, and the function name of the first function instance.

4. The method according to claim 1, characterized in that, The offline data warehouse determines resource profile data for each function instance based on the access log information of each access request in the log service, including: Historical access log information is obtained from the log service. The historical access log information includes access log information for each access request corresponding to multiple fine-grained unit times within a historical time period. The historical access log information is cleaned to obtain cleaned historical access log information; The cleaned historical access log information is aggregated according to the function name and fine-grained unit time to obtain fine-grained profile data for each function instance in each fine-grained unit time. Aggregate the fine-grained profile data of each function instance in each fine-grained unit of time according to the coarse-grained unit of time, and obtain the coarse-grained profile data of each function instance in each coarse-grained unit of time. By sorting and combining the coarse-grained profile data of each function instance in multiple coarse-grained time units in chronological order from morning to night, we obtain the resource profile data of each function instance with time-series characteristics.

5. The method according to claim 4, characterized in that, The historical access log information is cleaned to obtain cleaned historical access log information, including: The historical access log information is cleaned according to a pre-set filtering rule to obtain cleaned historical access log information. The filtering rule is related to at least one of the following: the request execution time of the access request, the CPU time slice usage, and the resource usage of the function computing container in the process of responding to the access request.

6. The method according to claim 4, characterized in that, Aggregating the fine-grained profile data of each function instance within each fine-grained unit of time based on the coarse-grained unit of time, the coarse-grained profile data of each function instance within each coarse-grained unit of time includes: For each function instance, the number of access requests for that function instance in each coarse-grained unit of time is summed up to obtain the number of access requests for that function instance in each coarse-grained unit of time. The resource usage of the function instance in each coarse-grained unit time is obtained by summing up the access requests corresponding to each fine-grained unit time for each coarse-grained unit time. The average request duration of the function instance is obtained by averaging the request execution time corresponding to the access requests in each fine-grained unit of time for each coarse-grained unit of time. Based on the function compute containers corresponding to the access requests of the function instance in each coarse-grained unit of time, determine the number of active containers of the function instance in each coarse-grained unit of time. Based on the number of active containers and the duration of each coarse-grained unit of time for the function instance, determine the container activity rate of the function instance within each coarse-grained unit of time. Based on one or more of the following parameters for each function instance within each coarse-grained unit of time: number of access requests, resource usage, average request duration, number of active containers, and container activity rate, coarse-grained profile data for each function instance within each coarse-grained unit of time is obtained.

7. A resource scheduling method for a FaaS platform, characterized in that, The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container. The function compute container deploys function instances. The method includes: The request forwarding component receives a first access request sent by the client and requests the resource scheduling component to apply for a first function computing container in an idle state and its access information; wherein, the first function computing container has deployed the first function instance that the first access request needs to access, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node; The request forwarding component forwards the first access request and the access information to the first container-side proxy component in the first container group via the first node-side proxy component in the first computing node, based on the access information. The first container-side proxy component activates the first function computing container from an idle state to an active state based on the access information, and records the first resource usage of the first function computing container up to the first moment; and requests the first function instance to respond to the first access request to obtain the first response information. After receiving the first response information returned by the first function computation container in an active state, the first container-side proxy component freezes the first function computation container from an active state to an idle state and records the second resource usage of the idle first function computation container up to the second time. It then returns the first response information and the target resource usage to the first node-side proxy component, wherein the target resource usage is associated with the first resource usage and the second resource usage. The first node-side proxy component generates access log information for the first access request based on the target resource usage and the function name of the first function instance; and the access log information for the first access request is saved to the log service by the request forwarding component, so that the offline data warehouse can determine the resource profile data of each function instance based on the access log information of each access request in the log service. The first response information is returned to the client via the request forwarding component through the first node-side proxy component.

8. The method according to claim 7, characterized in that, The request forwarding component requests the resource scheduling component to allocate an idle first function computation container and its access information, including: The request forwarding component sends a resource scheduling request to the resource scheduling component. The resource scheduling component determines whether there is an idle first function computation container in the FaaS platform that the first access request needs to access. If it does not exist, resource scheduling is performed based on the time-series resource profile data of the first function instance in the offline data warehouse to obtain a resource scheduling result. The resource scheduling result indicates that an idle first function computing container has been created, and the first function computing container is deployed in the first container group of the first computing node. The resource scheduling component returns an idle status to the request forwarding component via a first function that calculates the container's access information.

9. The method according to claim 7, characterized in that, Resource scheduling is performed based on the time-series resource profile data of the first function instance in the offline data warehouse to obtain resource scheduling results, including: Time-series data analysis is performed on the resource profile data with time-series characteristics of the first function instance to predict the running data of the first function instance in the future time period; the resource requirement data of the first function instance is determined based on the running data of the first function instance in the future time period, wherein the resource requirement data of the first function instance reflects the amount of resources required during the operation of the first function instance; an idle first function computing container is created on the first computing node that provides the resource requirement data that meets the first function instance.

10. A resource profiling data acquisition system, characterized in that, include: FaaS platform, log service, and offline data warehouse; The FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple computing nodes. Each computing node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function computing container. The function computing container is deployed with function instances. The request forwarding component is used to receive a first access request sent by the client and request the resource scheduling component to apply for a first function computing container in an idle state and its access information; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in a first container group of a first computing node; according to the access information, the first access request and the access information are forwarded to the first container side proxy component in the first container group via the first node-side proxy component in the first computing node; The first container-side proxy component is configured to activate the first function computation container from an idle state to an active state based on the access information, and record the first resource usage of the first function computation container up to a first time point; and request the first function instance to respond to the first access request to obtain first response information; after receiving the first response information returned by the active first function computation container, freeze the first function computation container from an active state to an idle state, and record the second resource usage of the idle first function computation container up to a second time point; and return a target resource usage to the first node-side proxy component, wherein the target resource usage is associated with the first resource usage and the second resource usage; The first node-side proxy component is used to generate access log information for the first access request based on the target resource usage and the function name of the first function instance, and save the access log information for the first access request to the log service via the request forwarding component. The offline data warehouse is used to determine the resource profile data of each function instance based on the access log information of each access request in the log service.

11. A method for collecting resource profiling data, characterized in that, Applied to a FaaS platform, the FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container, wherein the function compute container deploys function instances. The method is executed by a first node-side proxy component, and the method includes: The system receives a first function computing container in an idle state and its access information forwarded by a request forwarding component. The request forwarding component receives a first access request sent by a client and requests the resource scheduling component to apply for a first function computing container in an idle state and its access information. The first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in a first container group of a first computing node. Based on the access information of the first function computing container in the idle state, a first access request and the access information are forwarded to the first container-side proxy component in the first container group to trigger the first container-side proxy component to activate the first function computing container from the idle state to the active state, and to record the first resource usage of the first function computing container up to the first time point; and to request the first function instance to respond to the first access request to obtain the first response information; after receiving the first response information returned by the first function computing container in the active state, the first function computing container is frozen from the active state to the idle state, and the second resource usage of the first function computing container in the idle state up to the second time point is recorded; The system receives the target resource usage returned by the first container-side proxy component, the target resource usage being associated with the first resource usage and the second resource usage; based on the target resource usage and the function name of the first function instance, it generates and saves the access log information of the first access request; wherein, the saved access log information of each access request is used to determine the resource profile data of each function instance.

12. A method for collecting resource profiling data, characterized in that, Applied to a FaaS platform, the FaaS platform includes: a request forwarding component, a resource scheduling component, and multiple compute nodes. Each compute node includes a node-side proxy component and at least one container group. Each container group includes a container-side proxy component and at least one function compute container, wherein the function compute container deploys function instances. The method is executed by a first container-side proxy component, and the method includes: The system receives a first access request forwarded by a first node-side proxy component and access information of a first function computing container in an idle state; wherein, the request forwarding component receives the first access request sent by the client and requests the resource scheduling component to apply for a first function computing container in an idle state and its access information and forward it to the first node-side proxy component; wherein, the first function computing container has deployed the first function instance required by the first access request, and the access information is used to indicate that the first function computing container is deployed in the first container group of the first computing node; Based on the access information, the first function computing container is activated from an idle state to an active state, and the first resource usage of the first function computing container up to the first moment is recorded; and the first function instance is requested to respond to the first access request to obtain the first response information. After receiving the first response information returned by the first function computing container in the active state, the first function computing container is frozen from the active state to the idle state, and the second resource usage of the first function computing container in the idle state up to the second time point is recorded. The first node-side proxy component returns the target resource usage, which is associated with the first resource usage and the second resource usage, so that the first node-side proxy component can generate and save the access log information of the first access request based on the target resource usage and the function name of the first function instance; wherein, the saved access log information of each access request is used to determine the resource profile data of each function instance.

13. An electronic device, characterized in that, include: Memory and processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to perform the steps of the method according to any one of claims 1-6, 7-9, 11 or 12.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-6, 7-9, 11 or 12.

15. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, causes the processor to perform the steps of the method according to any one of claims 1-6, 7-9, 11 or 12.