Resource consumption attribution method and apparatus for streaming service, storage medium, and product

CN122909097APending Publication Date: 2026-10-13BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610887318.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

然而,目前的方案难以确定资源消耗变化的具体原因,进而导致难以为流媒体服务的性能优化和资源治理提供准确的依据

Benefits of technology

[0010]本公开通过将流媒体服务中承载业务处理逻辑的执行单元作为执行上下文,并为每个执行上下文绑定至少一个维度的业务标签,根据目标维度的业务标签,将多个执行上下文的资源消耗增量进行聚合,并结合业务负载量计算单位资源消耗指标,根据单位资源消耗指标确定导致资源消耗发生变化的原因,实现了资源消耗从整体变化到业务维度和/或处理逻辑维度的归因,有助于有效区分资源消耗变化是由业务结构变化还是由内部实现劣化所导致,从而为流媒体服务的性能优化和/或资源治理提供了准确的决策依据,进而有助于提升流媒体服务的运行效率和稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122909097A_ABST
    Figure CN122909097A_ABST
Patent Text Reader

Abstract

The present disclosure provides a resource consumption attribution method and device of a streaming service, a storage medium and a product, relates to the technical field of computers, network communication and streaming processing, and in particular to the streaming service, live streaming, resource consumption analysis technology. The method comprises the following steps: taking an execution unit carrying a business processing logic in the streaming service as an execution context; binding a business tag to the execution context; obtaining a resource consumption increment of the execution context in a target period; according to the business tag of a target dimension, aggregating the resource consumption increments of the multiple execution contexts to obtain a total resource consumption increment of the target dimension; according to the total resource consumption increment and a business load of the target dimension, calculating a unit resource consumption index of the target dimension; and according to the unit resource consumption index, determining a cause of the change in resource consumption. The present disclosure can realize fine-grained attribution analysis of the resource consumption of the streaming service, and is helpful to improving the efficiency of performance optimization of the streaming service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of computer, network communication, and streaming media processing technology, and in particular to streaming media services, live streaming, resource consumption analysis, and problem attribution technology. Specifically, it relates to a method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product for attributing resource consumption in streaming media services. Background Technology

[0002] With the rapid development of internet technology, streaming media services (such as live streaming, real-time audio and video, and media distribution) have been widely used in many scenarios such as online education, e-commerce live streaming, and social entertainment. In streaming media services, a service cluster typically consists of multiple edge nodes, machines, processes, and service instances, simultaneously handling various business operations such as client-side streaming, inter-node streaming, origin pull, push streaming, connection management, and background tasks.

[0003] Resource consumption is a crucial indicator of service quality during the operation of streaming media services. However, current solutions struggle to pinpoint the specific reasons for changes in resource consumption, thus hindering the provision of accurate data for performance optimization and resource management in streaming media services. Summary of the Invention

[0004] In view of the above, embodiments of this disclosure provide a method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product for attributing resource consumption of streaming media services.

[0005] According to one aspect of this disclosure, embodiments of this disclosure provide a resource consumption attribution method for a streaming media service, comprising: taking an execution unit carrying business processing logic in the streaming media service as an execution context; binding at least one dimension of business tags to each execution context; obtaining the resource consumption increment of each execution context in a target period; aggregating the resource consumption increments of multiple execution contexts under the target dimension according to the business tags of the target dimension to obtain the total resource consumption increment of the target dimension in the target period; obtaining the business load of the target dimension in the target period, and calculating the unit resource consumption index of the target dimension according to the total resource consumption increment and the business load; and determining the cause of the change in resource consumption according to the unit resource consumption index.

[0006] According to another aspect of this disclosure, embodiments of this disclosure provide a resource consumption attribution device for a streaming media service, comprising: an identification module, configured to identify execution units carrying business processing logic in the streaming media service as execution contexts; a binding module, configured to bind at least one dimension of business tags to each execution context; an acquisition module, configured to acquire the resource consumption increment of each execution context in a target period; an aggregation module, configured to aggregate the resource consumption increments of multiple execution contexts under a target dimension according to the business tags of the target dimension, to obtain the total resource consumption increment of the target dimension in the target period; a calculation module, configured to acquire the business load of the target dimension in the target period, and calculate the unit resource consumption index of the target dimension according to the total resource consumption increment and the business load; and an attribution module, configured to determine the cause of the change in resource consumption according to the unit resource consumption index.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a resource consumption attribution method for a streaming media service.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to perform a resource consumption attribution method for a streaming media service.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a resource consumption attribution method for a streaming media service.

[0010] This disclosure uses the execution unit carrying business processing logic in a streaming media service as the execution context, and binds at least one business tag of the target dimension to each execution context. Based on the business tag of the target dimension, the resource consumption increment of multiple execution contexts is aggregated, and a unit resource consumption index is calculated in combination with the business load. The cause of the change in resource consumption is determined based on the unit resource consumption index. This realizes the attribution of resource consumption changes from the overall perspective to the business dimension and / or processing logic dimension. It helps to effectively distinguish whether the change in resource consumption is caused by changes in business structure or by internal implementation degradation. This provides an accurate decision basis for the performance optimization and / or resource governance of streaming media services, and thus helps to improve the operating efficiency and stability of streaming media services.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 A flowchart illustrating a resource consumption attribution method for streaming media services provided in an embodiment of this disclosure; Figure 2 A schematic flowchart of step S102 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 3 Another flowchart illustrating step S102 of the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 4 Another flowchart illustrating the resource consumption attribution method for streaming media services provided in this disclosure embodiment; Figure 5 A schematic flowchart of step S103 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 6 A schematic flowchart of S104 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 7 A schematic flowchart of S106 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 8 Another flowchart illustrating the resource consumption attribution method for streaming media services provided in this disclosure embodiment; Figure 9 A schematic flowchart of step S801 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure; Figure 10 A structural block diagram of a resource consumption attribution device for streaming media services provided in an embodiment of this disclosure; Figure 11 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0013] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0014] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related 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. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0015] Various modifications and variations can be made to this disclosure without departing from its spirit or scope, as will be apparent to those skilled in the art. Therefore, this disclosure is intended to cover modifications and variations falling within the scope of the corresponding claims (the claimed technical solutions) and their equivalents. It should be noted that the embodiments provided in this disclosure can be combined with each other without contradiction.

[0016] It should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of various types of information (such as user personal information, device information, log data, etc.) involved in the technical solution disclosed herein all comply with the provisions and requirements of relevant laws and regulations, and the relevant processing methods and scope are open and transparent and do not violate public order and good morals.

[0017] Before describing the technical solutions provided in this disclosure, in order to facilitate understanding of this disclosure, the problems existing in the related technologies will be specifically explained below.

[0018] With the rapid development of internet technology, streaming media services (such as live streaming, real-time audio and video, and media distribution) have been widely used in many scenarios such as online education, e-commerce live streaming, and social entertainment. In streaming media services, a service cluster typically consists of multiple edge nodes, machines, processes, and service instances, simultaneously handling various business operations such as client-side streaming, inter-node streaming, origin pull, push streaming, connection management, and background tasks.

[0019] Resource consumption is a crucial indicator of service quality during the operation of streaming media services. However, traditional resource monitoring methods typically only provide machine-level or process-level total resource metrics, such as total CPU utilization and total memory usage. When these overall metrics fluctuate, it's difficult to quickly determine the specific reasons for resource changes. For example, it's impossible to distinguish whether changes in resource consumption are due to changes in the business traffic structure (such as changes in the proportion of pull streaming types or origin request ratios) or due to deterioration in the service's internal code logic. Consequently, it's difficult to provide accurate data for performance optimization and resource management of streaming media services.

[0020] To address at least one of the aforementioned technical problems, embodiments of this disclosure provide a method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product for attributing resource consumption in streaming media services.

[0021] The resource consumption attribution method for streaming media services provided in this disclosure will be introduced first.

[0022] Figure 1 This is a flowchart illustrating a method for attributing resource consumption of a streaming media service as provided in an embodiment of this disclosure. Figure 1 As shown, the resource consumption attribution method for streaming media services provided in this embodiment may include the following steps S101 to S106.

[0023] S101: Use the execution unit that carries the business processing logic in the streaming media service as the execution context.

[0024] The streaming media service may include live streaming, real-time audio and video, or media distribution gateways, etc., and this disclosure does not limit this. The streaming media service may include multiple execution units carrying business processing logic, such as coroutines, threads, and / or event callbacks. Each execution unit can independently handle a segment of business processing logic, such as handling a pull request, handling a request to retrieve data from the origin server, or executing a background cleanup task. Business processing logic is a sequence of code instructions carried by the execution unit to implement a specific business function.

[0025] In S101, each execution unit that carries business processing logic in the streaming media service can be used as an execution context. The execution context can serve as the basic unit for resource consumption statistics and attribution.

[0026] S102: Bind at least one dimension of business label to each execution context.

[0027] In S102, one or more business tags of various dimensions can be bound to each execution context. These business tags characterize the business type or business object processed by the execution context. For example, business tags may include one or more of the following: processing logic type, business domain name, publishing point, processing subtype, node identifier, and service type. This allows the resource consumption data of the execution context to be associated with specific business semantics, providing a foundation for subsequent aggregation and attribution by business dimension.

[0028] S103: Obtain the resource consumption increment for each execution context in the target cycle.

[0029] The target period can be a preset time length, such as 1 minute or 5 minutes, or it can be dynamically determined based on the lifecycle of the execution context; this disclosure does not limit this. The resource consumption increment refers to the additional resource consumption of the execution context within the target period, such as the incremental time consumption. In S103, the resource consumption increment of each execution context within the target period can be obtained, i.e., the additional resource consumption of each execution context within the target period.

[0030] S104: Based on the business tags of the target dimension, aggregate the resource consumption increments of multiple execution contexts under the target dimension to obtain the total resource consumption increment of the target dimension in the target period.

[0031] The target dimension can be a single dimension or a combination of multiple dimensions; this disclosure does not limit this. Since the execution context is bound to at least one business tag, in S104, the resource consumption increments of multiple execution contexts under the target dimension can be aggregated based on the business tag of the target dimension. For example, the resource consumption increments of multiple execution contexts under the target dimension can be summed to obtain the total resource consumption increment of the target dimension in the target period. S105: Obtain the business load of the target dimension in the target period, and calculate the unit resource consumption index of the target dimension based on the total resource consumption increment and business load.

[0032] In S105, the service load of the target dimension within the target period can be obtained. The service load reflects the scale of service processing or the volume of service traffic for the target dimension during the target period. For example, in some examples, the service load may include one or more of the following: bandwidth, number of requests, number of connections, number of tasks, number of messages, number of frames, transcoding duration, and number of streams. Then, dividing the total resource consumption increment of the target dimension during the target period by the service load of the target dimension during the target period yields the unit resource consumption metric for the target dimension during the target period. The unit resource consumption metric eliminates the impact of changes in the target dimension's own service scale on the absolute value of resource consumption, helping to ensure longitudinal comparability of the same target dimension across different points in time.

[0033] S106: Based on the unit resource consumption index, determine the reasons for the changes in resource consumption.

[0034] In S106, the reasons for changes in resource consumption can be determined based on unit resource consumption indicators. For example, the proportion of unit resource consumption indicators for each target dimension in the total increase in resource consumption can be calculated. By analyzing changes in the proportion and unit resource consumption indicators, it is possible to distinguish whether changes in resource consumption are caused by changes in business structure (i.e., external factors) or by deterioration of internal processing logic (i.e., internal factors). This allows the changes in resource consumption to be attributed to specific business and processing logic dimensions, providing accurate decision-making basis for performance optimization and / or resource governance of streaming media services.

[0035] This embodiment of the disclosure uses the execution unit carrying business processing logic in the streaming media service as the execution context, and binds at least one business tag of the target dimension to each execution context. Based on the business tag of the target dimension, the resource consumption increment of multiple execution contexts is aggregated, and the unit resource consumption index is calculated in combination with the business load. Based on the unit resource consumption index, the cause of the change in resource consumption is determined. This realizes the attribution of resource consumption changes from the overall perspective to the business dimension and / or processing logic dimension. It helps to effectively distinguish whether the change in resource consumption is caused by changes in business structure or by internal implementation degradation. This provides an accurate decision basis for the performance optimization and / or resource governance of the streaming media service, and thus helps to improve the operating efficiency and stability of the streaming media service.

[0036] For ease of understanding, the resource consumption attribution method for streaming media services provided in this disclosure will be described in detail below with reference to some specific embodiments.

[0037] According to some embodiments of this disclosure, optionally, the execution unit may include any one or more of the following: coroutine, thread, thread pool task, request processing object, event callback, connection state machine, timer task, asynchronous task, participant model, fiber, and asynchronous result.

[0038] In this disclosure, the execution context refers to an execution unit that can carry a segment of business processing logic and whose resource consumption can be statistically analyzed during service operation. In streaming media service deployments, different services may use different types of execution units to implement business processing logic. For example, in a Simple Real-Time Streaming Server (SRS) service based on State Threads (st-threads), the execution unit or execution context can be a coroutine. In multi-threaded services, the execution unit or execution context can be a thread, a thread pool task, or a request processing object. In event-driven services, the execution unit or execution context can be an event callback, a connection state machine, a timer task, or an asynchronous task. In other services, the execution unit or execution context can also be an Actor, a Fiber, an asynchronous result (Future), a Go language coroutine, or a task, etc., and this application does not limit this.

[0039] The execution units defined in this disclosure can cover various types of services or concurrency models mentioned above. That is, regardless of the underlying concurrency model used by the streaming media service, resource consumption attribution monitoring can be performed using the method provided in this disclosure. This disclosure is applicable to streaming media services implemented with various different technology stacks, exhibiting good versatility and portability.

[0040] According to some embodiments of this disclosure, optionally, the business tag of at least one dimension may include any one or more of the following: processing logic type, business domain name, publishing point, processing subtype, node identifier, and service type.

[0041] During the execution context creation phase or when the business semantics are clearly defined, a set of business tags can be bound to the execution context. In some examples, business tags may include one or more of the following: processing logic type, business domain name, publishing point, processing subtype, node identifier, and service type.

[0042] The processing logic type can be used to identify the type of code or category of processing logic executed by the execution context, such as SrsHttpConn indicating handling HTTP connection requests, and SrsEdgeIngester indicating handling edge node pull requests. The business domain name can be used to identify the domain to which the business being processed by the execution context belongs, such as example.com. The publishing point can be used to identify the application or publishing point to which the business being processed by the execution context belongs, such as live or vod. The processing subtype is used to identify the specific business role or processing direction of the execution context, such as CLIENT indicating handling client requests, NODE2NODE indicating handling inter-node forwarding, and origin pull indicating handling pulls from the origin server. The node identifier can be used to identify the physical or logical node where the execution context resides, such as node01. The service type can be used to identify the service type to which the execution context belongs, such as srs2 or srs-cdn.

[0043] For example, taking SRS-type services as an example, the execution context can use business tags of at least one of the following dimensions: Processing logic type (class): Abstract classes or processing logic types in the code, such as SrsHttpConn (representing handling HTTP connection requests), SrsEdgeIngester (representing handling edge node pull requests), SrsTcpListener (representing handling TCP listening), and SrsServiceManager (representing service management).

[0044] Business domain name (domain): If the business domain name cannot be determined, it can be recorded as a placeholder value.

[0045] Release point (app): Business release point or application identifier.

[0046] Subtype handling: For example, CLIENT (indicates handling client requests), NODE2NODE (indicates handling inter-node forwarding), NODE (indicates node self-processing), HASH (indicates hash routing), BYTED_SUB (indicates byte stream sub-stream), BYTED_PATCH (indicates byte stream patching), full stream, sub-stream, origin-back type, or routing type.

[0047] Node identifier: A node or machine identifier.

[0048] Service type: such as srs2, srs-cdn, livertc or alfred, etc.

[0049] In multi-threaded or event-driven services, the above tags can be replaced with the following equivalent tags: handler: A code module used to identify the specific request being handled.

[0050] module: A module is used to identify the functional modules in a service.

[0051] route: The route is used to identify the route path or routing strategy for a request.

[0052] tenant: A tenant is used to identify the tenant or customer to whom the service belongs.

[0053] session_type: Session type, used to identify the business type of the session.

[0054] request_type: Request type, used to identify the business type of the request.

[0055] stream_type: Stream type, used to identify the type of media stream.

[0056] callback_type: Callback type, used to identify the type of event callback.

[0057] This embodiment of the disclosure binds the aforementioned business tags across multiple dimensions to the execution context, enabling the association between underlying resource consumption data and upper-level business semantics. This allows subsequent aggregation, normalization, and attribution analysis to be performed across multiple different business dimensions, thereby enabling the identification of specific business reasons for changes in resource consumption from different perspectives and improving the accuracy and flexibility of attribution analysis.

[0058] Figure 2 This is a schematic flowchart of step S102 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. Figure 2 As shown, according to some embodiments of this disclosure, optionally, S102: binding at least one dimension of business tags to each execution context may include the following steps S201 to S204.

[0059] S201: Extract business tags from request metadata when the execution context is created.

[0060] In S201, business tags can be extracted from the request metadata when the execution context is created. Request metadata refers to the metadata information of the business requests processed by the execution context. For example, request metadata may include the business domain name, publication point, flow identifier, and / or route type. By extracting business tags from the request metadata, partial dimensions of business information can be obtained when the execution context is created.

[0061] S202: For the extracted business tags, bind them to the execution context.

[0062] In S202, business tags extracted from the request metadata can be directly bound to the execution context. Thus, the execution context possesses some dimensions of business tags upon creation.

[0063] S203: For business tags of at least some dimensions that were not extracted from the request metadata, use default tags as placeholder tags.

[0064] In S203, for business tags of at least some dimensions that were not extracted from the request metadata, default tags can be used as placeholder tags. For example, when business tags of dimensions such as service type and node identifier are not extracted from the request metadata, default tags can be used as placeholder tags. In this way, even if some dimension information is temporarily unavailable, the execution context still has business tags of at least basic dimensions such as service type and node identifier, reducing the risk of statistical loss due to missing tags.

[0065] S204: During the execution context, after parsing out business tags for at least some dimensions, update the default tags to the parsed business tags.

[0066] In S204, during the execution context's runtime, once at least some dimensions of the business tags have been parsed, the default tags can be updated to the parsed business tags. For example, after the request type is parsed, the processing subtype in the default tag can be updated to the actual business role or processing direction. In this way, the business tags in the execution context can be gradually improved as business processing progresses.

[0067] Step S102 maps the runtime execution context to business dimensions. Compared to general performance profiling tools that only output function or thread hotspots, this step can directly output dimensions oriented towards business problem localization, such as resource consumption for a specific domain, a specific publishing point, a specific origin pull type, or a specific inter-node pull type, thereby providing attribution data with business semantics for performance optimization and resource governance.

[0068] Figure 3 Another flowchart illustrating step S102 of the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. For example... Figure 3 As shown, according to some embodiments of this disclosure, optionally, binding at least one dimension of business tags to each execution context may further include the following steps: S205: When the execution context processes multiple different business objects sequentially during its lifecycle, update the business tag of the execution context at the business object switching point so that the resource consumption increment before the update belongs to the previous business object, and the resource consumption increment after the update belongs to the next business object.

[0069] Here, the business object refers to the business entity or business request currently being processed by the execution context, such as a pull request, a request to return to the origin server, a request for forwarding between nodes, a push request, or a background cleanup task. The business object switching point is the moment when the execution context switches from one business object to another.

[0070] In S205, when an execution context processes multiple different business objects sequentially within its lifecycle, the business tag of the execution context can be updated at the business object switching point. For example, if a coroutine first processes a streaming request and then a request to retrieve data from the origin server, the business tag can be updated to "origin server" at the switching point when processing the origin server request. In this way, the incremental resource consumption before the update is attributed to the previous business object (e.g., the streaming request), and the incremental resource consumption after the update is attributed to the subsequent business object (e.g., the origin server request). This allows the resource consumption of an execution context serving multiple business objects to be accurately broken down and assigned to the corresponding business object, reducing resource consumption attribution errors caused by outdated tags and further improving the accuracy of attribution analysis.

[0071] Figure 4 Another flowchart illustrating the resource consumption attribution method for streaming media services provided in embodiments of this disclosure. Figure 4 As shown, according to some embodiments of this disclosure, optionally, the resource consumption attribution method for streaming media services may further include the following steps S401 and S402.

[0072] S401: When the execution context exits abnormally or the business tag is missing, the service type, processing logic type and node identifier already bound in the execution context will be used as the identity tag of the execution context.

[0073] In S401, when an execution context exits abnormally or its business tags are missing due to parsing failure, the service type, processing logic type, and node identifier already bound to the execution context can be used as the execution context's identity tags. For example, if an execution context crashes abnormally during processing, causing its business tags to fail to be fully bound, the service type, processing logic type, and node identifier already bound to the execution context can be extracted and combined into an identity tag.

[0074] S402: Outputs incremental logs of resource consumption containing identity tags.

[0075] In S402, incremental resource consumption logs that include identity tags can be output. For example, the identity tag and the incremental resource consumption of the execution context within the target period can be output to the logging system as incremental resource consumption logs for subsequent statistics and analysis.

[0076] Thus, when the execution context exits abnormally or the business tag is missing, the service type, processing logic type, and node identifier already bound in the execution context are used as the identity tags of the execution context. This ensures that even if the execution context exits abnormally or the business tag is missing, its resource consumption data can still be continuously counted and recorded. This effectively reduces the risk of statistical loss due to missing tags and improves the robustness and completeness of resource consumption attribution.

[0077] Figure 5 This is a schematic flowchart of step S103 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. Figure 5 As shown, according to some embodiments of this disclosure, optionally, S103: obtaining the resource consumption increment of each execution context in the target cycle may include the following steps S501 and S502.

[0078] S501: When the lifecycle of the execution context is less than the first preset threshold, the execution context from the last statistical point to the end time is taken as the target period, and the resource consumption increment of the execution context within the target period is obtained.

[0079] In S501, when the lifespan of an execution context is less than a first preset threshold, the execution context from the last statistical point to its end time can be used as the target period, and the resource consumption increment of the execution context within that target period can be obtained. For example, the last statistical point can be the creation time of the execution context, that is, the entire lifespan of the short-lifespan execution context can be used as the target period. Of course, the last statistical point can also be the end time of the previous statistical period; this disclosure does not limit this. The size of the first preset threshold can be flexibly adjusted according to actual conditions; this disclosure does not limit this. For example, the first preset threshold can be set to 1 minute. When the lifespan of an execution context is less than 1 minute, the execution context belongs to the short-lifespan type, and its entire lifespan can be used as a statistical period, outputting the total resource consumption increment at its end.

[0080] S502: When the lifecycle of the execution context is greater than or equal to the second preset threshold, the preset time length is taken as the target period, and the resource consumption increment of the execution context within the target period is obtained, wherein the preset time length is less than the lifecycle, and the second preset threshold is greater than or equal to the first preset threshold.

[0081] In S502, when the lifecycle of the execution context is greater than or equal to a second preset threshold, a preset time length can be used as the target period, and the resource consumption increment of the execution context within that target period can be obtained. The preset time length can be less than the lifecycle, and the second preset threshold can be greater than or equal to a first preset threshold. The size of the preset time length and the second preset threshold can be flexibly adjusted according to actual circumstances, and this disclosure does not impose any limitations on them.

[0082] For execution contexts with short lifecycles, the incremental time consumption from the last statistical point to the end time can be output when it ends. For execution contexts that exist for a long time after service startup or never exit, the incremental resource consumption from the last output time can be output according to a preset time length, such as the incremental time consumption. This can simultaneously cover short connection requests, long connection requests, persistent background tasks, and periodic maintenance tasks.

[0083] Thus, this embodiment can simultaneously cover short-lifecycle execution contexts (such as one-time requests) and long-lifecycle execution contexts (such as long connections and persistent background tasks), making incremental resource consumption collection applicable to execution units with various lifecycles, achieving full-scenario resource consumption statistics coverage, and solving the problem in related technologies that cannot statistically analyze the resource consumption of long connections and persistent tasks.

[0084] According to some embodiments of this disclosure, optionally, the statistical boundaries of the execution context may differ under different concurrency models. For example, for a coroutine model based on state threads (st-threads), the time consumed can be recorded at coroutine entry, exit, yielding, and periodic sampling. For a multi-threaded or thread pool model, the time consumed can be recorded before and after task start, task end, thread processing request entry, request exit, and blocking wait. For an event-driven model, the time consumed can be recorded at the start of event callbacks, callback end, state machine transitions, input / output callback triggers, and timer callback execution boundaries. For an asynchronous task model, the time consumed can be recorded at task creation, scheduling, waiting, completion, and cancellation. This disclosure does not limit this. Regardless of the underlying concurrency model, incremental time consumed can be collected at its corresponding statistical boundaries, and the resource consumption increment of the execution context within the target period can be finally accumulated.

[0085] According to some embodiments of this disclosure, the incremental resource consumption may optionally include incremental time consumption, which is the time that the execution context occupies the central processing unit within the target cycle.

[0086] Specifically, incremental resource consumption can include incremental time consumption, which is used to characterize the increase in resource consumption. During the operation of a streaming media service, the CPU time consumed by the execution context within a target period is the incremental time consumption. For example, if a coroutine actually executes code on the CPU for 200 milliseconds within a 1-minute target period, then these 200 milliseconds are the incremental time consumption of that coroutine within that target period. Exemplarily, incremental time consumption may exclude the time the execution context spends in non-running states such as waiting, blocking, or I / O, and only count the actual CPU time used.

[0087] Thus, by using incremental time consumption to characterize the incremental resource consumption, the actual consumption of CPU computing resources by the execution context can be accurately reflected, while reducing the bias in resource consumption assessment caused by waiting and blocking time, and further improving the accuracy and reliability of resource consumption attribution analysis.

[0088] According to some embodiments of this disclosure, optionally, S103: obtaining the resource consumption increment of each execution context in the target cycle may include the following steps: The incremental time consumption is obtained by using time statistics tools to obtain the time that the execution context occupies in the central processing unit within the target cycle.

[0089] The time statistics tools may include at least one of the following: thread CPU time counter, process CPU time counter, process resource usage statistics interface, scheduler, and framework instrumentation.

[0090] Specifically, the CPU time occupied by the execution context within the target period can be obtained using various time statistics tools, i.e., incremental time consumption. For example, the CPU time consumption of the current thread can be obtained through a thread CPU time counter (such as CLOCK_THREAD_CPU_TIME_ID). Alternatively, the CPU time consumption of the current process can be obtained through a process CPU time counter (such as CLOCK_PROCESS_CPU_TIME_ID) or a process resource usage statistics interface (such as getrusage). Alternatively, the CPU time consumption of the execution context can be obtained through the scheduling runtime recorded by the scheduler provided by the coroutine library, thread pool, or event-driven framework. Alternatively, the execution time can be directly obtained through the time recording points pre-embedded in the request processing framework, event callback framework, or task execution framework. The above-mentioned time statistics tools can be selected and used according to the actual scenario, and this disclosure does not limit them.

[0091] Thus, by providing a variety of time statistics tools, this embodiment can adapt to different service implementation environments and technology stacks. For example, scheduler statistics can be used in coroutine-based services, thread CPU time counters can be used in multi-threaded services, and framework-based data entry statistics can be used in event-driven services. It can be applied to a variety of different streaming media service architectures and has good versatility and adaptability.

[0092] Figure 6 This is a schematic flowchart of step S104 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. Figure 6 As shown, according to some embodiments of this disclosure, optionally, S104: Based on the business tags of the target dimension, the resource consumption increments of multiple execution contexts under the target dimension are aggregated to obtain the total resource consumption increment of the target dimension in the target period, which may include the following steps S601 and S602.

[0093] S601: Divide the execution contexts of business tags with target dimensions into the same aggregation group.

[0094] In S601, execution contexts with business tags that have a target dimension can be grouped into the same aggregation group. For example, assuming the target dimension is business domain name=example.com, then all execution contexts bound to the business domain name=example.com tag will be grouped into the same aggregation group.

[0095] It should be noted that the target dimension can include one dimension or a combination of multiple dimensions. For example, the target dimension can include at least one of the following: processing logic type; business domain name; business domain name + node identifier; business domain name + publishing point + node identifier; service type + processing logic type + processing subtype; service type + business domain name + publishing point + processing subtype; node identifier + service type + processing logic type; request type, origin return type, pull stream type, inter-node request type, and other processing subtypes.

[0096] S602: Sum the resource consumption increments of multiple execution contexts within the aggregation group to obtain the total resource consumption increment of the target dimension during the target period.

[0097] In S602, the resource consumption increments of multiple execution contexts within an aggregation group can be summed to obtain the total resource consumption increment of the target dimension during the target period. Taking the resource consumption increment as the incremental time consumption as an example, the incremental time consumption of multiple execution contexts within an aggregation group can be summed to obtain the total incremental time consumption of the target dimension during the target period.

[0098] In some embodiments, the number of instances of execution contexts within an aggregation group is summed or deduplicated to obtain the number of instances for the target dimension in the target period. This number of instances can be used to subsequently calculate unit instance resource consumption metrics, such as calculating the average resource consumption of each execution context instance, thereby further eliminating the impact of changes in the number of execution context instances on resource consumption analysis.

[0099] Thus, by grouping and aggregating execution contexts according to business tags of the target dimension, this embodiment achieves bottom-up data aggregation from the granularity of a single execution context to the business dimension, enabling resource consumption data to possess semantic information of the business dimension, and improving the observability and analyzability of resource consumption attribution.

[0100] According to some embodiments of this disclosure, optionally, S105: calculating the unit resource consumption index of the target dimension based on the total resource consumption increment and the service load may include the following steps: Calculate the quotient of the total resource consumption increment to the business load to obtain the unit resource consumption index for the target dimension.

[0101] In S105, the quotient of the total resource consumption increment of the target dimension in the target period and the business load can be calculated to obtain the unit resource consumption index of the target dimension in the target period. Taking the total resource consumption increment as the total incremental time as an example, the total incremental time of the target dimension in the target period can be divided by the business load of the target dimension in the target period to obtain the unit resource consumption index of the target dimension.

[0102] The service load can include any one or more of the following: bandwidth, number of requests, number of connections, number of tasks, number of messages, number of frames, transcoding time, and number of streams. For example, the unit resource consumption metric can include at least one of the following: The execution context time per unit bandwidth for a certain business domain name = the total resource consumption increment of that business domain name divided by the bandwidth of that business domain name; The execution context time per unit bandwidth for a business domain name + publishing point + node identifier dimension = the total resource consumption increment for that dimension divided by the bandwidth for that dimension; The unit request time for a certain processing subtype = the total resource consumption increment of that processing subtype divided by the number of requests for that processing subtype; The unit instance time for a certain processing logic type = the total resource consumption increment of that processing logic type divided by the number of instances of that processing logic type.

[0103] Thus, by dividing the total resource consumption increment by the service load, this embodiment calculates a unit resource consumption index that eliminates the impact of changes in service scale on the absolute value of resource consumption, making resource consumption comparable across different service dimensions and at different points in time for the same service dimension. Furthermore, by supporting multiple types of service loads, this embodiment is applicable to different service scenarios and different types of streaming media services, exhibiting good versatility and flexibility.

[0104] Figure 7 This is a schematic flowchart of step S106 in the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. Figure 7 As shown, according to some embodiments of this disclosure, optionally, S106: determining the cause of the change in resource consumption based on the unit resource consumption index may include the following steps S701 to S704.

[0105] S701: Calculate the proportion of the unit resource consumption index of the target dimension in the total incremental resource consumption.

[0106] In S701, the proportion of a target dimension's unit resource consumption index in the total resource consumption increment can be calculated. For example, for target dimension A, the proportion of its unit resource consumption index in the total resource consumption increment of all target dimensions can be calculated, thereby determining the proportion of that target dimension in the overall resource consumption.

[0107] S702: When the proportion increases but the unit resource consumption indicator of the target dimension does not increase, the reason is determined to be a change in business structure.

[0108] In S702, the changes in unit resource consumption indicators of a target dimension across different time windows (statistical periods) can be compared. When the proportion of a target dimension increases while its unit resource consumption indicator remains unchanged compared to the previous statistical period, the cause of the change in resource consumption is determined to be a change in business structure. For example, if the proportion of target dimension A increases by 10%, but its unit resource consumption indicator remains unchanged compared to the previous statistical period, it indicates that the increase in resource consumption is due to the expansion of the business scale of target dimension A, i.e., a change in business structure. In some examples, changes in business structure may include an increase in the proportion of inter-node streaming, a change in the proportion of P2P requests, an increase in the proportion of cold streams, or an increase in the proportion of origin pulls, etc., which are not limited in this disclosure.

[0109] S703: When the change in the percentage is within the preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be the deterioration of the internal processing logic.

[0110] In S703, when the change in the percentage is within a preset range and the unit resource consumption index of the target dimension increases, it can be determined that the cause of the change in resource consumption is internal processing logic degradation. For example, if the percentage of target dimension A remains stable, but its unit resource consumption index increases by 15%, it indicates that the increase in resource consumption is due to a decrease in the performance of the internal processing logic of target dimension A, i.e., internal processing logic degradation. In some examples, internal processing logic degradation may include increased code complexity, increased lock contention, increased log volume, increased exception retries, or slower algorithm implementation, etc., which are not limited in this disclosure.

[0111] S704: When the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within the preset range, the cause is determined to be a change in scale or sample.

[0112] In S704, when the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, it can be determined that the cause of the change in resource consumption is a change in scale or sample size. For example, if the number of nodes decreases by 10%, but the unit resource consumption index of each target dimension remains stable, it indicates that the change in resource consumption is due to a change in node scale, i.e., a change in scale or sample size. In some examples, such as changes in scale or sample size, changes in node online / offline status or changes in the number of machines may be included, and this disclosure does not limit this.

[0113] Thus, this embodiment achieves attribution analysis based on fine-grained unit resource consumption indicators, which can distinguish whether changes in resource consumption are caused by changes in business structure, deterioration of internal processing logic, or changes in scale or sample size. Specifically, by analyzing the percentage change, it can be determined whether the resource change is caused by changes in business structure (external factors). By analyzing the changes in unit resource consumption indicators, it can be determined whether the resource change is caused by deterioration of internal processing logic (internal factors). By analyzing the changes in the number of nodes or machines, it can eliminate the interference of scale or sample size changes on the attribution analysis. This multi-dimensional attribution analysis method can quickly locate the root cause of changes in resource consumption, reducing the misjudgment of external business fluctuations as internal performance problems, or the misjudgment of internal code deterioration as normal business growth. This provides an accurate decision-making basis for the performance optimization and resource governance of streaming media services, improving the efficiency and accuracy of performance optimization and resource governance.

[0114] Figure 8 This is another flowchart illustrating the resource consumption attribution method for streaming media services provided in embodiments of this disclosure. Figure 8 As shown, according to some embodiments of this disclosure, optionally, the resource consumption attribution method for streaming media services may further include the following steps: S801: Obtain global baseline resource metrics for the streaming media service. Global baseline resource metrics are used to reflect the overall resource efficiency of the streaming media service.

[0115] In S801, global baseline resource metrics for streaming media services can be obtained. These metrics reflect the overall resource efficiency of the streaming media service, such as CPU consumption per unit of bandwidth per process and CPU consumption per unit of request. Global baseline resource metrics eliminate the impact of service expansion, node online / offline status changes, and business scale variations on overall resource consumption, making the overall resource efficiency of the streaming media service comparable over time.

[0116] Accordingly, S106: Determining the cause of the change in resource consumption based on the unit resource consumption index may include the following steps: When the global baseline resource index changes, the cause of the change in resource consumption is determined by combining the global baseline resource index and the unit resource consumption index of the target dimension.

[0117] For example, when the global baseline resource index rises, drill-down analysis can be performed by combining the global baseline resource index and the unit resource consumption index of the target dimension to determine the specific dimension that caused the change in resource consumption.

[0118] Thus, based on global baseline resource indicators to trigger attribution analysis, this embodiment provides an attribution analysis path that starts from changes in overall resource efficiency and drills down to fine-grained target dimensions, making the attribution analysis of resource consumption changes more complete and improving the operability and accuracy of attribution analysis.

[0119] According to some embodiments of this disclosure, optionally, S106: combining global baseline resource indicators and target dimension unit resource consumption indicators to determine the cause of changes in resource consumption may include the following steps one to four.

[0120] Step 1: When the global baseline resource index increases, calculate the proportion of the unit resource consumption index of the target dimension in the total increase in resource consumption.

[0121] In step one, when the global baseline resource index increases, the proportion of the unit resource consumption index of the target dimension in the total increase in resource consumption can be calculated. For example, when the global baseline resource index increases by 10%, the proportion of each target dimension can be calculated to identify potential target dimensions that may lead to a decrease in overall resource efficiency.

[0122] Step 2: When the global baseline resource indicators and their proportions increase, but the unit resource consumption indicators of the target dimension do not increase, the reason is determined to be a change in business structure.

[0123] In step two, when the global baseline resource metric increases, the proportion of the target dimension increases, and the unit resource consumption metric of the target dimension does not increase compared to the previous statistical period (i.e., remains stable or decreases), it is determined that the cause of the change in resource consumption is a change in business structure. For example, if the global baseline resource metric increases by 10%, the proportion of target dimension A increases by 8%, but its unit resource consumption metric remains unchanged compared to the previous statistical period, it indicates that the overall decrease in resource efficiency is due to a change in business structure (such as the expansion of the business scale of target dimension A).

[0124] Step 3: When the change in the percentage is within the preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be the deterioration of the internal processing logic.

[0125] In step three, when the change in the proportion is within a preset range and the unit resource consumption index of the target dimension increases, it can be determined that the cause of the change in resource consumption is internal processing logic degradation. The specific judgment method for this step is the same as that in S703, and will not be repeated here for the sake of brevity.

[0126] Step 4: When the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within the preset range, determine the cause as a change in scale or sample.

[0127] In step four, when the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, it can be determined that the cause of the change in resource consumption is a change in scale or sample size. The specific judgment method for this step is the same as that in S704, and will not be repeated here for the sake of brevity.

[0128] Thus, when global baseline resource indicators rise, the proportion of each target dimension and the unit resource consumption indicator are further calculated. Based on the change in proportion, it is determined whether there are changes in business structure (external factors). Based on the change in unit resource consumption indicator, it is determined whether there is deterioration in internal processing logic (internal factors). Furthermore, the interference of scale or sample changes is eliminated by analyzing changes in the number of nodes or machines. This step-by-step drill-down attribution path from the overall to the fine-grained can quickly locate the specific target dimension and specific cause of the decline in overall resource efficiency, reducing blind investigation in a large amount of data and further improving the efficiency and accuracy of resource governance.

[0129] Figure 9 This is a flowchart illustrating step S801 of the resource consumption attribution method for streaming media services provided in this embodiment of the disclosure. Figure 9 As shown, according to some embodiments of this disclosure, optionally, S801: obtaining global baseline resource indicators may include the following steps S901 and S902.

[0130] S901: Obtain basic operational data and business load data of the streaming media service. The basic operational data includes at least one of the following: total CPU consumption of the service process, total memory consumption of the service process, and number of service processes. The business load data includes at least one of the following: service bandwidth, number of requests, and number of connections.

[0131] In S901, basic operational data and service load data of the streaming media service can be obtained. Basic operational data reflects the total resource consumption during the operation of the streaming media service, such as the total CPU consumption of the service processes, the total memory consumption of the service processes, and the number of service processes. Service load data reflects the scale of services carried by the streaming media service, such as service bandwidth, number of requests, and number of connections.

[0132] S902: Calculate global baseline resource indicators based on basic operational data and business load data. Global baseline resource indicators include at least one of the following: CPU consumption per process per unit bandwidth, memory consumption per process per unit bandwidth, CPU consumption per execution instance, and CPU consumption per request.

[0133] In S902, global baseline resource metrics can be calculated based on basic operational data and business load data. For example, the sample formula is as follows: CPU consumption per unit bandwidth per process = Total CPU consumption of service processes / Number of service processes / Service bandwidth; Unit bandwidth per process memory consumption = total memory consumption of service processes / number of service processes / service bandwidth; CPU consumption per execution instance = Total CPU consumption of service processes / Number of execution instances; CPU consumption per request = Total CPU consumption of service processes / Number of requests.

[0134] In this context, " / " represents division. These global benchmark resource metrics eliminate the impact of service expansion, node up / down, and changes in business scale on overall resource consumption, making the overall resource efficiency of streaming media services comparable over time.

[0135] In this way, by acquiring basic operational data and business load data, and calculating global benchmark resource indicators, comparable metrics reflecting the overall resource efficiency of streaming media services are provided, which helps to quickly determine whether the overall resource efficiency of streaming media services has changed.

[0136] According to some embodiments of this disclosure, the resource consumption attribution method for streaming media services may optionally include the following steps: The first global baseline resource metric before the release of the streaming service version is compared with the second global baseline resource metric after the release. If the increase of the second global baseline resource metric relative to the first global baseline resource metric exceeds a preset threshold, it is determined that the version release introduces a performance rollback.

[0137] Specifically, when a streaming service releases a version, a first global baseline resource metric before the release can be compared with a second global baseline resource metric after the release. For example, global baseline resource metrics (i.e., the first global baseline resource metric) are collected for a period of time before the release as baseline data, and global baseline resource metrics (i.e., the second global baseline resource metric) are collected for a period of time after the release as comparative data, and the magnitude of change between the two is calculated. If the increase of the second global baseline resource metric relative to the first global baseline resource metric exceeds a preset threshold (e.g., 10%), it is determined that the version release has introduced a performance regression.

[0138] In this way, by comparing global baseline resource metrics before and after the release, the impact of the release on service performance can be quantitatively assessed, reducing interference from factors such as service expansion, node up / down, and changes in business scale on performance evaluation, and providing an accurate basis for quality control and performance rollback detection of the release.

[0139] According to some embodiments of this disclosure, the resource consumption attribution method for streaming media services may optionally include the following steps: The system sorts multiple dimensions according to preset sorting indicators and outputs the sorting results. The preset sorting indicators include at least one of the following: incremental resource consumption, unit resource consumption index, percentage, year-on-year change rate, and month-on-month change rate. The sorting results can be used to indicate at least one dimension that may lead to changes in resources.

[0140] Specifically, after completing the attribution analysis, multiple dimensions can be ranked according to preset ranking indicators, and the ranking results can be output. For example, the target dimensions can be ranked from largest to smallest according to the increase in resource consumption, and the top five dimensions with the largest increase in resource consumption can be output. Alternatively, they can be ranked from largest to smallest according to the year-on-year change rate of unit resource consumption indicators, and the dimensions with the fastest increase in unit resource consumption indicators can be output. The ranking results can be used to indicate at least one dimension that is most likely to lead to resource changes.

[0141] In this way, by sorting multiple dimensions according to preset sorting indicators such as incremental resource consumption, unit resource consumption index, proportion, year-on-year change rate, and month-on-month change rate, and outputting the sorting results, the dimensions most likely to cause resource changes can be quickly located, reducing the time spent manually checking a large number of dimensions and further improving the efficiency and accuracy of resource governance.

[0142] According to some embodiments of this disclosure, the resource consumption attribution method for streaming media services may optionally include the following steps: When any of the following situations occur, the corresponding fault-tolerance strategy shall be adopted: When the business load of the target dimension is zero or missing within the target period, the unit resource consumption indicator will be marked as to be supplemented. When log recycling is delayed or duplicated, use time windows, log unique identifiers, or idempotent aggregation strategies to process the aggregated resource consumption increment in order to reduce duplicate statistics. When the overhead of incremental resource consumption collection exceeds a preset threshold, the collection frequency is reduced or the number of target dimensions is decreased.

[0143] In the actual operation of streaming media services, various abnormal situations may be encountered, such as zero or missing service load, delayed or duplicated logs, and excessive collection overhead. This embodiment provides corresponding fault-tolerance strategies to address these abnormal situations. Specifically, when the service load of a target dimension within the target period is zero or missing, to avoid division-by-zero errors, the unit resource consumption indicator can be marked as needing completion instead of being directly calculated. When log collection is delayed or duplicated, time windows, unique log identifiers, or idempotent aggregation strategies can be used to process the aggregated resource consumption increment, reducing errors caused by duplicate statistics. When the overhead of collecting incremental resource consumption exceeds a preset threshold, the collection frequency can be reduced or the number of target dimensions can be decreased to balance statistical accuracy and system performance.

[0144] Thus, through the aforementioned fault-tolerance strategies, this embodiment can maintain the availability and accuracy of statistical data under various abnormal conditions, while reducing the impact of the statistical mechanism itself on the performance of the streaming media service. For example, marking for padding avoids division by zero errors, using idempotent aggregation strategies avoids duplicate statistics, and reducing collection overhead by decreasing the frequency or dimensionality. These fault-tolerance strategies enable this embodiment to operate stably and continuously in large-scale, high-concurrency streaming media services, exhibiting good availability and robustness.

[0145] According to some embodiments of this disclosure, the resource consumption attribution method for streaming media services may optionally include the following steps: When the target process of the streaming service restarts, the statistical baselines of multiple execution contexts within the target process are reset.

[0146] Specifically, a streaming service may include one or more processes. The target process can be any number of processes. During the operation of the streaming service, the target process may restart due to a failure or maintenance. When the target process restarts, its original execution context and statistical baselines (such as cumulative elapsed time data, last statistical timestamp, etc.) may be lost. Therefore, after the target process restarts, the statistical baselines of all execution contexts within that target process can be reset, i.e., the cumulative elapsed time data can be cleared and the last statistical timestamp reset, so that statistics can resume.

[0147] In this way, by resetting the statistical baseline of the execution context within the target process, the accuracy and continuity of resource consumption statistics after the service process restarts are improved. This effectively solves the problem of statistical cycle disorder or data duplication caused by using the old baseline, and ensures that the data basis for attribution analysis is not affected by process restarts.

[0148] According to some embodiments of this disclosure, the resource consumption attribution method for streaming media services may optionally include the following steps: Global baseline resource metrics, target-dimensional unit resource consumption metrics, total resource consumption increments, and / or attribution results of resource consumption changes are stored in a time-series database, log repository, or monitoring platform. During storage, the following information can be recorded: sampling time, service type, node identifier, machine identifier, number of processes, business load, business tag, resource consumption increment, number of instances, and normalization result. The normalization result can include target-dimensional unit resource consumption metrics, such as CPU consumption per unit bandwidth per process or CPU consumption per unit request.

[0149] For example, after a service version release, the unit resource consumption index of the same business domain name, release point, and processing subtype combination before and after the release can be compared to see if it has increased, thereby determining whether the new version has introduced performance regression. After a scheduling strategy adjustment, the change in the proportion of streaming processing subtypes between nodes can be compared to see if it explains the fluctuation in overall CPU consumption. Through the above long-term storage mechanism, this embodiment can solve the problem of difficulty in historical comparison caused by the online / offline status of content delivery network nodes and dynamic changes in machine samples. Compared with the method of only retaining real-time monitoring charts, this embodiment can form traceable long-term performance governance data, supporting trend comparisons across versions, nodes, and time windows.

[0150] Thus, by persistently storing the aforementioned data over a long period, this embodiment supports comparisons of resource consumption trends across versions, nodes, services, and time windows, providing a traceable data foundation for version release evaluation, capacity planning, and cost management. For example, after a service version is released, by comparing global baseline resource metrics and fine-grained unit resource consumption metrics before and after the release, it can be quickly determined whether the new version has introduced performance rollback. This long-term traceable storage mechanism enables performance management of streaming media services to go beyond real-time monitoring, allowing for historical trend analysis and cross-version comparisons, thereby enhancing the depth and breadth of resource management.

[0151] Based on the same technical concept as the resource consumption attribution method for streaming media services provided in any of the above embodiments, this disclosure also provides a resource consumption attribution device for streaming media services.

[0152] Figure 10 A structural block diagram of a resource consumption attribution device for a streaming media service provided in an embodiment of this disclosure. Figure 10 As shown, the resource consumption attribution device 1000 for streaming media services provided in this embodiment may include the following modules: The identification module 1001 is used to identify the execution unit carrying business processing logic in the streaming media service as the execution context; Binding module 1002 is used to bind at least one dimension of business tags to each execution context; The acquisition module 1003 is used to acquire the resource consumption increment of each execution context in the target cycle; The aggregation module 1004 is used to aggregate the resource consumption increments of multiple execution contexts under the target dimension according to the business tags of the target dimension, so as to obtain the total resource consumption increment of the target dimension in the target period. The calculation module 1005 is used to obtain the business load of the target dimension in the target period, and calculate the unit resource consumption index of the target dimension based on the total resource consumption increment and the business load. Attribution module 1006 is used to determine the reasons for changes in resource consumption based on unit resource consumption indicators.

[0153] The specific working process of each of the above modules has been described above and will not be repeated here.

[0154] This embodiment of the disclosure uses the execution unit carrying business processing logic in the streaming media service as the execution context, and binds at least one business tag of the target dimension to each execution context. Based on the business tag of the target dimension, the resource consumption increment of multiple execution contexts is aggregated, and the unit resource consumption index is calculated in combination with the business load. Based on the unit resource consumption index, the cause of the change in resource consumption is determined. This realizes the attribution of resource consumption changes from the overall perspective to the business dimension and / or processing logic dimension. It helps to effectively distinguish whether the change in resource consumption is caused by changes in business structure or by internal implementation degradation. This provides an accurate decision basis for the performance optimization and / or resource governance of the streaming media service, and thus helps to improve the operating efficiency and stability of the streaming media service.

[0155] According to some embodiments of this disclosure, optionally, the execution unit includes any one or more of the following: coroutine, thread, thread pool task, request processing object, event callback, connection state machine, timer task, asynchronous task, participant model, fiber, and asynchronous result.

[0156] According to some embodiments of this disclosure, optionally, the business tag of at least one dimension includes any one or more of the following: processing logic type, business domain name, publishing point, processing subtype, node identifier, and service type.

[0157] According to some embodiments of this disclosure, optionally, the binding module 1002 may be used to extract business tags from request metadata when the execution context is created; bind the extracted business tags to the execution context; use default tags as placeholder tags for business tags of at least some dimensions that are not extracted from the request metadata; and update the default tags to the parsed business tags after parsing the business tags of at least some dimensions during the execution context operation.

[0158] According to some embodiments of this disclosure, optionally, the binding module 1002 can also be used to update the business label of the execution context at the business object switching point when the execution context processes multiple different business objects sequentially during its lifecycle, so that the resource consumption increment before the update belongs to the previous business object, and the resource consumption increment after the update belongs to the next business object.

[0159] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in the embodiments of this disclosure may further include a recording module, used to use the service type, processing logic type and node identifier bound in the execution context as the identity label of the execution context when the execution context exits abnormally or the service label is missing; and output a resource consumption incremental log containing the identity label.

[0160] According to some embodiments of this disclosure, optionally, the acquisition module 1003 can be specifically used to: when the lifecycle of the execution context is less than a first preset threshold, take the execution context from the last statistical point to the end time as the target period, and acquire the resource consumption increment of the execution context within the target period; when the lifecycle of the execution context is greater than or equal to a second preset threshold, take a preset time length as the target period, and acquire the resource consumption increment of the execution context within the target period, wherein the preset time length is less than the lifecycle, and the second preset threshold is greater than or equal to the first preset threshold.

[0161] According to some embodiments of this disclosure, optionally, the resource consumption increment includes incremental time, which is the time the execution context occupies the central processing unit within the target cycle.

[0162] According to some embodiments of this disclosure, optionally, the acquisition module 1003 can be used to obtain the time occupied by the execution context in the central processing unit within the target period through a time statistics tool to obtain the incremental time consumption; wherein, the time statistics tool includes at least one of the following: thread CPU time counter, process CPU time counter, process resource usage statistics interface, scheduler, and framework instrumentation.

[0163] According to some embodiments of this disclosure, optionally, the aggregation module 1004 can be used to divide the execution contexts with business tags of the target dimension into the same aggregation group; and sum the resource consumption increments of multiple execution contexts within the aggregation group to obtain the total resource consumption increment of the target dimension in the target period.

[0164] According to some embodiments of this disclosure, optionally, the service load includes any one or more of the following: bandwidth, number of requests, number of connections, number of tasks, number of messages, number of frames, transcoding duration, and number of streams. Specifically, the calculation module 1005 can be used to calculate the quotient of the total resource consumption increment and the service load to obtain the unit resource consumption index for the target dimension.

[0165] According to some embodiments of this disclosure, optionally, the attribution module 1006 can be used to calculate the proportion of the unit resource consumption index of the target dimension in the total resource consumption increment; when the proportion increases but the unit resource consumption index of the target dimension does not increase, the cause is determined to be a change in business structure; when the change in the proportion is within a preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be a deterioration in internal processing logic; when the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, the cause is determined to be a change in scale or sample.

[0166] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in these embodiments may further include a data acquisition module for acquiring global baseline resource indicators for the streaming media service. These global baseline resource indicators reflect the overall resource efficiency of the streaming media service. Specifically, the attribution module 1006 may be used to determine the cause of the change in resource consumption when the global baseline resource indicators change, by combining the global baseline resource indicators with the unit resource consumption indicators of the target dimension.

[0167] According to some embodiments of this disclosure, optionally, the attribution module 1006 can be specifically used to calculate the proportion of the unit resource consumption index of the target dimension in the total resource consumption increment when the global baseline resource index increases; when the global baseline resource index increases, the proportion increases, but the unit resource consumption index of the target dimension does not increase, the cause is determined to be a change in business structure; when the change in the proportion is within a preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be a degradation of internal processing logic; when the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, the cause is determined to be a change in scale or sample.

[0168] According to some embodiments of this disclosure, optionally, the acquisition module can be used to acquire basic operating data and service load data of the streaming media service. The basic operating data includes at least one of the following: total CPU consumption of service processes, total memory consumption of service processes, and number of service processes. The service load data includes at least one of the following: service bandwidth, number of requests, and number of connections. Based on the basic operating data and service load data, a global baseline resource index is calculated. The global baseline resource index includes at least one of the following: CPU consumption per process per unit bandwidth, memory consumption per process per unit bandwidth, CPU consumption per execution instance, and CPU consumption per request.

[0169] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in this disclosure may further include a comparison analysis module, used to compare a first global benchmark resource index before the release of a streaming media service version with a second global benchmark resource index after the release of the version. If the increase of the second global benchmark resource index relative to the first global benchmark resource index exceeds a preset threshold, it is determined that the version release introduces a performance regression.

[0170] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in the embodiments of this disclosure may further include a sorting module, which is used to sort multiple dimensions according to preset sorting indicators and output sorting results; wherein, the preset sorting indicators include at least one of resource consumption increment, unit resource consumption indicator, percentage, year-on-year change rate, and month-on-month change rate, and the sorting results are used to indicate at least one dimension that may lead to resource changes.

[0171] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in this disclosure may further include a fault-tolerance module, used to adopt a corresponding fault-tolerance strategy when any of the following situations occur: when the service load of the target dimension within the target period is zero or missing, the unit resource consumption index is marked as to be supplemented; when log collection is delayed or repeated, the aggregated resource consumption increment is processed using a time window, log unique identifier or idempotent aggregation strategy to reduce duplicate statistics; when the overhead of collecting resource consumption increment exceeds a preset threshold, the collection frequency is reduced or the number of target dimensions is reduced.

[0172] Optionally, according to some embodiments of this disclosure, the resource consumption attribution device 1000 for streaming media services provided in the embodiments of this disclosure may further include a reset module, used to reset the statistical baseline of multiple execution contexts within the target process when the target process of the streaming media service is restarted.

[0173] It should be noted that the resource consumption attribution device for streaming media services provided in this disclosure has the same or corresponding technical features as the resource consumption attribution method for streaming media services provided in any of the above embodiments, and produces the same technical effects. For the sake of brevity, further details are omitted here.

[0174] According to the resource consumption attribution method for streaming media services provided in the embodiments of this disclosure, this disclosure also provides an electronic device, a non-transitory computer-readable storage medium storing computer instructions, and a computer program product.

[0175] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0176] like Figure 11 As shown, the electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded into a random access memory (RAM) 1103 from a storage unit 1108. The RAM 1103 may also store various programs and data required for the operation of the device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0177] Multiple components in device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of monitors, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0178] The computing unit 1101 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as the resource consumption attribution method for streaming media services. For example, in some embodiments, the resource consumption attribution method for streaming media services may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the resource consumption attribution method for streaming media services described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform a resource consumption attribution method for a streaming media service by any other suitable means (e.g., by means of firmware).

[0179] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0180] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0181] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0182] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0183] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0184] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0185] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0186] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for attributing resource consumption in a streaming media service, comprising: Use the execution unit that carries the business processing logic in the streaming media service as the execution context; Bind at least one dimension of business label to each execution context; Get the resource consumption increment for each execution context in the target period; Based on the business tags of the target dimension, the resource consumption increments of multiple execution contexts under the target dimension are aggregated to obtain the total resource consumption increment of the target dimension in the target period. Obtain the service load of the target dimension in the target period, and calculate the unit resource consumption index of the target dimension based on the total resource consumption increment and the service load. Based on the unit resource consumption index, determine the reasons for the changes in resource consumption.

2. The method according to claim 1, wherein, The execution unit includes any one or more of the following: coroutine, thread, thread pool task, request processing object, event callback, connection state machine, timer task, asynchronous task, participant model, fiber, and asynchronous result.

3. The method according to claim 1, wherein, The business tags of at least one dimension include any one or more of the following: processing logic type, business domain name, publishing point, processing subtype, node identifier, and service type.

4. The method according to claim 1, wherein, Bind at least one business label of each execution context, including: When the execution context is created, the business tags are extracted from the request metadata; For the extracted business tags, bind them to the execution context; For business tags of at least some dimensions that were not extracted from the request metadata, use default tags as placeholder tags; During the execution context, after parsing out business tags for at least some dimensions, the default tag is updated to the parsed business tag.

5. The method according to claim 4, wherein, Bind at least one dimension of business label to each execution context, and also include: When an execution context processes multiple different business objects sequentially during its lifecycle, the business tag of the execution context is updated at the business object switching point, so that the resource consumption increment before the update belongs to the previous business object, and the resource consumption increment after the update belongs to the next business object.

6. The method according to claim 4, wherein, The method further includes: When the execution context exits abnormally or the business tag is missing, the service type, processing logic type and node identifier already bound in the execution context will be used as the identity tag of the execution context. Output an incremental log of resource consumption containing the identity tag.

7. The method according to claim 1, wherein, Obtain the incremental resource consumption for each execution context in the target lifecycle, including: When the lifecycle of the execution context is less than a first preset threshold, the execution context from the last statistical point to the end time is taken as the target period, and the resource consumption increment of the execution context within the target period is obtained. When the lifecycle of the execution context is greater than or equal to the second preset threshold, the preset time length is taken as the target period, and the resource consumption increment of the execution context within the target period is obtained, wherein the preset time length is less than the lifecycle, and the second preset threshold is greater than or equal to the first preset threshold.

8. The method according to claim 1, wherein, The incremental resource consumption includes incremental time consumption, which is the time that the execution context occupies the central processing unit within the target cycle.

9. The method according to claim 8, wherein, Obtain the incremental resource consumption for each execution context in the target lifecycle, including: The incremental time consumption is obtained by using a time statistics tool to determine the time the execution context occupies the central processing unit within the target cycle. The time statistics tool includes at least one of the following: thread CPU time counter, process CPU time counter, process resource usage statistics interface, scheduler, and framework instrumentation.

10. The method according to claim 1, wherein, Based on the business tags of the target dimension, the resource consumption increments of multiple execution contexts under the target dimension are aggregated to obtain the total resource consumption increment of the target dimension in the target period, including: The execution contexts with business tags of the target dimension are divided into the same aggregation group; The resource consumption increments of multiple execution contexts within the aggregation group are summed to obtain the total resource consumption increment of the target dimension in the target period.

11. The method according to claim 1, wherein, The service load includes any one or more of the following: bandwidth, number of requests, number of connections, number of tasks, number of messages, number of frames, transcoding duration, and number of streams; Based on the total resource consumption increment and the business load, calculate the unit resource consumption index for the target dimension, including: Calculate the quotient of the total resource consumption increment and the business load to obtain the unit resource consumption index of the target dimension.

12. The method according to claim 1, wherein, Based on the aforementioned unit resource consumption index, determine the reasons for the changes in resource consumption, including: Calculate the proportion of the unit resource consumption index of the target dimension in the total increase in resource consumption; When the aforementioned proportion increases but the unit resource consumption indicator of the target dimension does not increase, the reason is determined to be a change in business structure. When the change in the percentage is within a preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be internal processing logic degradation. When the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, the cause is determined to be a change in scale or sample size.

13. The method according to claim 1, wherein, The method further includes: obtaining global baseline resource metrics for the streaming media service, wherein the global baseline resource metrics are used to reflect the overall resource efficiency of the streaming media service; Based on the aforementioned unit resource consumption index, determine the reasons for the changes in resource consumption, including: When the global baseline resource index changes, the cause of the change in resource consumption is determined by combining the global baseline resource index and the unit resource consumption index of the target dimension.

14. The method according to claim 13, wherein, By combining the global baseline resource metric and the unit resource consumption metric of the target dimension, the reasons for changes in resource consumption are determined, including: When the global baseline resource index increases, the proportion of the unit resource consumption index of the target dimension in the total resource consumption increment is calculated. When the global baseline resource index increases, the percentage increases, and the unit resource consumption index of the target dimension does not increase, the reason is determined to be a change in business structure. When the change in the percentage is within a preset range and the unit resource consumption index of the target dimension increases, the cause is determined to be internal processing logic degradation. When the number of nodes or machines changes and the change in the unit resource consumption index of the target dimension is within a preset range, the cause is determined to be a change in scale or sample size.

15. The method according to claim 13, wherein, Obtain global baseline resource metrics, including: Obtain basic operational data and service load data of the streaming media service. The basic operational data includes at least one of the following: total CPU consumption of the service process, total memory consumption of the service process, and number of service processes. The service load data includes at least one of the following: service bandwidth, number of requests, and number of connections. Based on the basic operational data and the business load data, the global benchmark resource indicators are calculated. The global benchmark resource indicators include at least one of the following: CPU consumption per process per unit bandwidth, memory consumption per process per unit bandwidth, CPU consumption per execution instance, and CPU consumption per request.

16. The method according to claim 1, wherein, The method further includes: The first global baseline resource metric before the release of the streaming service version is compared with the second global baseline resource metric after the release. If the increase of the second global baseline resource metric relative to the first global baseline resource metric exceeds a preset threshold, it is determined that the version release introduces a performance rollback.

17. The method according to claim 1, wherein, The method further includes: The system sorts multiple dimensions according to preset sorting indicators and outputs the sorting results. The preset sorting indicators include at least one of the following: incremental resource consumption, unit resource consumption index, percentage, year-on-year change rate, and month-on-month change rate. The sorting results are used to indicate at least one dimension that may lead to changes in resources.

18. The method according to claim 1, wherein, The method further includes: When any of the following situations occur, the corresponding fault-tolerance strategy shall be adopted: When the business load of the target dimension is zero or missing within the target period, the unit resource consumption indicator is marked as to be supplemented. When log recycling is delayed or duplicated, use time windows, log unique identifiers, or idempotent aggregation strategies to process the aggregated resource consumption increment in order to reduce duplicate statistics. When the overhead of incremental resource consumption collection exceeds a preset threshold, the collection frequency is reduced or the number of target dimensions is decreased.

19. The method according to claim 1, wherein, The method further includes: When the target process of the streaming media service restarts, the statistical baselines of multiple execution contexts within the target process are reset.

20. A resource consumption attribution device for a streaming media service, comprising: The identification module is used to identify the execution unit that carries the business processing logic in the streaming media service as the execution context; The binding module is used to bind at least one dimension of business tags to each execution context; The acquisition module is used to acquire the resource consumption increment of each execution context in the target cycle; The aggregation module is used to aggregate the resource consumption increments of multiple execution contexts under the target dimension according to the business tags of the target dimension, so as to obtain the total resource consumption increment of the target dimension in the target period. The calculation module is used to obtain the service load of the target dimension in the target period, and calculate the unit resource consumption index of the target dimension based on the total resource consumption increment and the service load. The attribution module is used to determine the reasons for changes in resource consumption based on the unit resource consumption index.

21. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-19.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-19.

23. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-19.