Server resource allocation method, device, electronic device and storage medium

The method addresses the inflexibility and inaccuracy of existing server resource allocation by determining dimensional information for service nodes within request call chains, allowing for precise and flexible resource distribution based on call link relationships.

CN114996002BActive Publication Date: 2024-12-10BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210571336.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2024-12-10
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

Existing server resource allocation methods are inflexible and lack accuracy, failing to meet the diverse needs of Internet platform business modules and resource budgeting requirements due to reliance on container-based allocation.

Method used

A method that determines dimensional information for each service node in a request call chain, constructing a tree structure to accurately allocate server resources based on the call link relationship, and distributing resources according to the proportion of request call chains, enabling detailed and flexible resource allocation.

Benefits of technology

Enables efficient and accurate server resource allocation by considering the detailed dimensions of service nodes, facilitating better resource budgeting and data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996002B_ABST
    Figure CN114996002B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a server resource allocation method, device, electronic device and storage medium, the method comprising: obtaining dimension information of at least one request call chain of a service system, wherein each request call chain includes multiple service nodes, the dimension information of each request call chain includes dimension information of at least one service node among the multiple service nodes, the dimension information of each service node in the at least one service node includes an attribute value of the service node under a target dimension, and the attribute value is used to indicate a resource allocation object corresponding to the corresponding service node in multiple resource allocation objects; for each request call chain in the at least one request call chain, determining the dimension information of each service node included in the request call chain based on the dimension information of the request call chain; and performing server resource allocation on multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes included in each request call chain in the at least one request call chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to a server resource allocation method, device, electronic device and storage medium. Background Art

[0002] Internet-related technologies require a large number of server development program services. Therefore, for resource allocation and data analysis, it is particularly important to allocate server resources reasonably. Nowadays, servers are generally deployed through containers. In related technologies, server resources are generally allocated based on containers. However, the current Internet platform business modules are diverse, and the capabilities provided by the services deployed by server containers can be applied to a variety of business scenarios. The allocation method in related technologies is not flexible enough, and the allocation accuracy is low, which cannot meet the needs of resource budget and related data analysis. Summary of the invention

[0003] The present disclosure provides a server resource allocation method, device, electronic device and storage medium to at least solve the above-mentioned problems in the related technology, or not solve any of the above-mentioned problems. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a server resource allocation method is provided, comprising: obtaining dimension information of at least one request call chain of a service system, wherein each request call chain includes multiple service nodes, the dimension information of each request call chain includes dimension information of at least one service node among the multiple service nodes, the dimension information of each service node among the at least one service node includes an attribute value of the service node under a target dimension, the attribute value is used to indicate a resource allocation object corresponding to the corresponding service node among multiple resource allocation objects, and the multiple resource allocation objects are resource allocation objects corresponding to the target dimension; for each request call chain in the at least one request call chain, determining the dimension information of each service node included in the request call chain based on the dimension information of the request call chain; and performing server resource allocation on the multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes included in each request call chain in the at least one request call chain.

[0005] Optionally, for each request call chain in the at least one request call chain, determining the dimension information of each service node included in the request call chain based on the dimension information of the request call chain, including: for each request call chain, building a call link relationship of all service nodes included in the request call chain; according to the call link relationship, transmitting the dimension information of at least one service node among the multiple service nodes of the request call chain, and determining the dimension information of each service node included in the request call chain.

[0006] Optionally, the call link relationship is a tree structure, and each service node represents a node in the tree structure; the dimension information of at least one service node among the multiple service nodes of the request call chain is transmitted in accordance with the call link relationship, including: along the direction from the root node to the leaf node of the tree structure, the dimension information of the at least one service node is transmitted.

[0007] Optionally, the dimensional information of the at least one service node is transmitted along the direction from the root node to the leaf node of the tree structure, including: when no dimensional information exists on the root node, assigning preset dimensional information to the root node; for each leaf node, when no dimensional information exists on the leaf node, using the dimensional information of the parent node corresponding to the leaf node as the dimensional information of the leaf node.

[0008] Optionally, the performing server resource allocation for the multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes contained in each request call chain in the at least one request call chain includes: dividing all service nodes contained in the at least one request call chain into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide the service capability deployed by a server; determining the node set corresponding to the target server, and performing resource allocation for the target server for the multiple resource allocation objects corresponding to the target dimension according to the dimension information of all service nodes contained in the node set corresponding to the target server.

[0009] Optionally, the node set corresponding to the target server is determined, and according to the dimension information of all service nodes contained in the node set corresponding to the target server, resource allocation to the target server is performed on the multiple resource allocation objects corresponding to the target dimension, including: determining the number of request call chains corresponding to each resource allocation object under the target dimension according to the dimension information of all service nodes contained in the node set corresponding to the target server and the request call chain in which each service node is located; determining the proportion of resources of the target server that each resource allocation object bears based on the proportion of the number of request call chains corresponding to each resource allocation object; and allocating the resources of the target server to the corresponding resource allocation objects according to the proportion.

[0010] Optionally, before determining the node set corresponding to the target server, it also includes: generating a database list based on the dimension information of all service nodes contained in each request call chain in the at least one request call chain, wherein the database list includes at least: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension.

[0011] Optionally, the method of determining the number of request call chains corresponding to each resource allocation object under the target dimension based on the dimension information of all service nodes included in the node set corresponding to the target server and the request call chain in which each service node is located includes: in the database list, for all service nodes included in the node set corresponding to the target server, searching for the number of request call chains corresponding to each resource allocation object under the target dimension.

[0012] According to a second aspect of an embodiment of the present disclosure, a server resource allocation device is provided, comprising: an acquisition unit, configured to: acquire dimension information of at least one request call chain of a service system, wherein each request call chain includes multiple service nodes, the dimension information of each request call chain includes dimension information of at least one service node among the multiple service nodes, the dimension information of each service node among the at least one service node includes an attribute value of the service node under a target dimension, the attribute value is used to indicate a resource allocation object corresponding to the corresponding service node among multiple resource allocation objects, and the multiple resource allocation objects are resource allocation objects corresponding to the target dimension; a determination unit, configured to: for each request call chain in the at least one request call chain, determine the dimension information of each service node contained in the request call chain based on the dimension information of the request call chain; an allocation unit, configured to: perform server resource allocation on the multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes contained in each request call chain in the at least one request call chain.

[0013] Optionally, the determination unit is configured to: for each request call chain, construct a call link relationship of all service nodes contained in the request call chain; according to the call link relationship, transmit the dimension information of at least one service node among the multiple service nodes of the request call chain to determine the dimension information of each service node contained in the request call chain.

[0014] Optionally, the call link relationship is a tree structure, and each service node represents a node in the tree structure; the determination unit is configured to: transmit the dimension information of the at least one service node along the direction from the root node to the leaf node of the tree structure.

[0015] Optionally, the determination unit is configured to: if no dimension information exists for the root node, assign preset dimension information to the root node; for each leaf node, if no dimension information exists for the leaf node, use the dimension information of the parent node corresponding to the leaf node as the dimension information of the leaf node.

[0016] Optionally, the allocation unit is configured to: divide all service nodes included in the at least one request call chain into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide the service capabilities deployed by a server; determine the node set corresponding to the target server, and perform resource allocation on the target server for the multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes included in the node set corresponding to the target server.

[0017] Optionally, the allocation unit is configured to: determine the number of request call chains corresponding to each resource allocation object under the target dimension based on the dimensional information of all service nodes contained in the node set corresponding to the target server and the request call chain in which each service node is located; determine the proportion of resources of the target server that each resource allocation object bears based on the ratio of the number of request call chains corresponding to each resource allocation object; and allocate the resources of the target server to the corresponding resource allocation objects according to the proportion.

[0018] Optionally, it also includes a generation unit, which is configured to generate a database list based on the dimension information of all service nodes contained in each request call chain in the at least one request call chain, wherein the database list at least includes: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension.

[0019] Optionally, the allocation unit is configured to: in the database list, for all service nodes included in the node set corresponding to the target server, search for the number of request call chains corresponding to each resource allocation object under the target dimension.

[0020] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, prompt the at least one processor to execute the server resource allocation method according to the present disclosure.

[0021] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided. When the instructions are executed by at least one processor, the at least one processor is prompted to execute the server resource allocation method according to the present disclosure.

[0022] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising computer instructions, which, when executed by at least one processor, implement the server resource allocation method according to the present disclosure.

[0023] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0024] According to the server resource allocation method, device, electronic device and storage medium disclosed in the present invention, server resource allocation can be performed on multiple resource allocation objects under the target dimension by determining the dimensional information of all service nodes contained in each request call chain. Compared with the prior art of dividing server resources with containers as the smallest unit, server resources can be reasonably and efficiently allocated from a more detailed perspective.

[0025] In addition, according to the server resource allocation method, device, electronic device and storage medium disclosed in the present invention, by customizing the target dimension, such as defining the target dimension as a business dimension, the server resource allocation details of the customized target dimension can be flexibly and conveniently obtained, which is helpful for resource budgeting and data analysis.

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0028] Figure 1 The figure is a flow chart of a method for allocating server resources according to an exemplary embodiment.

[0029] Figure 2 The diagram is a schematic diagram showing a resource allocation object of a target server according to an exemplary embodiment.

[0030] Figure 3 It is a schematic diagram showing the ratio of the number of request call chains corresponding to resource allocation object A and resource allocation object B respectively according to an exemplary embodiment.

[0031] Figure 4 The figure is an overall flow chart of a method for allocating server resources according to an exemplary embodiment.

[0032] Figure 5 The figure is an overall flow chart of offline data analysis according to an exemplary embodiment.

[0033] Figure 6 The invention is a block diagram showing a device for allocating server resources according to an exemplary embodiment.

[0034] Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. DETAILED DESCRIPTION

[0035] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0037] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0038] Internet-related technologies require a large number of server development program services. Therefore, for resource allocation and data analysis, it is particularly important to allocate server resources reasonably. Nowadays, servers are generally deployed through containers. In related technologies, containers are generally used as the basis to calculate and allocate server resources in combination with their usage time, and server resources are divided into containers as the smallest unit. However, the current Internet platform business modules are diverse, and the capabilities provided by the services deployed by server containers can be applied to a variety of business scenarios. According to the allocation method in the related technology, server resources cannot be allocated to various business scenarios. At the same time, the request volume of different business scenarios changes over time, which makes the methods in the related technology not flexible enough and the allocation accuracy is low, which cannot meet the needs of resource budgeting and related data analysis.

[0039] In order to solve the problems existing in the above-mentioned related technologies, the present disclosure proposes a server resource allocation method, device, electronic device and storage medium, which can perform server resource allocation on multiple resource allocation objects under the target dimension by determining the dimensional information of all service nodes contained in each request call chain. Compared with the prior art of dividing server resources with containers as the smallest unit, server resources can be reasonably and efficiently allocated from a more detailed perspective.

[0040] Next, we will refer to Figures 1 to 7 The server resource allocation method, device, electronic device and storage medium according to the present disclosure are described in detail.

[0041] Figure 1 FIG. 1 is a flow chart showing a method for allocating server resources according to an exemplary embodiment. Figure 1 In step 101, dimension information of at least one request call chain of the service system may be obtained. Each request call chain includes multiple service nodes, and the dimension information of each request call chain includes dimension information of at least one service node among the multiple service nodes. The dimension information of each service node among the at least one service node includes an attribute value of the service node under a target dimension, and the attribute value is used to indicate a resource allocation object corresponding to the corresponding service node among multiple resource allocation objects, and the multiple resource allocation objects are resource allocation objects corresponding to the target dimension.

[0042] According to an exemplary embodiment of the present disclosure, the service system may be a distributed link tracing system (OpenTracing), that is, the dimension information of the request call chain in the exemplary embodiment of the present disclosure may be obtained based on the OpenTracing standard. The service system is an online service system, that is, the dimension information of the request call chain in the exemplary embodiment of the present disclosure is information obtained online.

[0043] Furthermore, in OpenTracing, a request call chain (Trace) can represent the tracing of a complete call chain of a request. The Trace may include multiple logical running units (Spans). Span is the service node in the exemplary embodiment of the present disclosure. Multiple Spans can present the logical causal relationship of the Trace call by nesting or sequential arrangement. The Trace can be a directed acyclic graph (DAG) of multiple Spans, and the Span can be a program with processing capabilities with a start time and execution duration.

[0044] Furthermore, each service node may include its own configuration information, and the configuration information may include, but is not limited to, the number of the parent service node of the service node (ParentSpanId), the number of the service node (SpanId), the identification data of the service node (SpanTags) and the request call chain number (TraceId) where the service node is located. The identification data may include the above-mentioned dimension information, and the dimension information may exist in the identification data in the form of a key-value pair. For an exemplary embodiment of the present disclosure, the key may correspond to the target dimension, and the value may correspond to the attribute value. For example, the target dimension may be a business dimension, and the corresponding attribute value may include business 1, business 2, etc. It should be noted that the identification data may also include other dimension information, and other dimension information may also exist in the identification data in the form of a key-value pair. It should also be noted that the resource allocation object may be a unit with the ability to assume server resources.

[0045] According to an exemplary embodiment of the present disclosure, the information related to a request call chain described above can be stored in the information set (trace message) of the request call chain. All trace messages of the service system can be sent to the data warehouse tool (offline storage Hive) through Kafka. All trace messages stored in Hive are discrete big data (in units of service nodes). The exemplary embodiment of the present disclosure needs to aggregate the configuration information of each service node according to TraceId based on all tracemessages stored in Hive, and aggregate the service nodes of the same request call chain together. In this way, in step 101, the dimension information of at least one request call chain can be obtained based on the aggregated configuration information.

[0046] Based on the above description, a request call chain may have service nodes that do not carry dimension information. The exemplary embodiment of the present disclosure needs to combine the dimension information of each service node in each request call chain to perform subsequent server resource allocation. Therefore, it is necessary to determine the dimension information of all service nodes contained in each request call chain based on the service nodes that carry dimension information. Below, this process is described in detail through step 102.

[0047] In step 102, for each request call chain in at least one request call chain, dimension information of each service node included in the request call chain may be determined based on the dimension information of the request call chain.

[0048] As can be seen from the above description, each request call chain may include multiple service nodes, and the multiple service nodes present the call logic causal relationship of the request call chain through nesting or sequential arrangement. The exemplary embodiment of the present disclosure may pass the dimension information of the service node called previously to the service node called later based on the logical relationship between the multiple service nodes of each request call chain, and the logical relationship between the multiple service nodes may be reflected by the ParentSpanId in the configuration information. Based on this idea, the exemplary embodiment of the present disclosure may first construct a call link relationship of all service nodes contained in the request call chain for each request call chain; then, according to the call link relationship, the dimension information of at least one service node among the multiple service nodes of the request call chain may be passed to determine the dimension information of each service node contained in the request call chain. In this way, the service node that originally does not carry dimension information inherits the dimension information of its logically upstream parent service node, which can make the dimension information of each service node finally determined more accurate.

[0049] According to an exemplary embodiment of the present disclosure, the call link relationship of all service nodes included in each request call chain can be presented as a tree structure, then each service node can represent a node in the tree structure, and the parent service node of each service node is the parent node of the node represented by the service node. Then the dimensional information can be transmitted by traversing the tree structure, specifically: the dimensional information of at least one service node is transmitted along the direction from the root node to the leaf node of the tree structure. It should be noted that the traversal method can be a depth-first search algorithm (Depth-First-Search, DFS). By traversing the tree structure, the transmission of dimensional information can be realized simply and conveniently.

[0050] According to the nature of the tree structure, the tree structure includes a root node and a leaf node. When the node has dimension information, the dimension information can be directly retained. If the node does not have dimension information, the dimension information needs to be transferred. The following is a detailed description of the transfer process in combination with the root node and the leaf node: when the root node does not have dimension information, the root node is assigned preset dimension information; for each leaf node, when the leaf node does not have dimension information, the dimension information of the parent node corresponding to the leaf node is used as the dimension information of the leaf node. In this way, the specific dimension information transfer process of the root node and the leaf node can be limited in combination with the nature of the tree structure, so that the determined dimension information is more accurate. It should be noted that for each node, the determination of the dimension information can be flexibly adjusted based on different situations, for example, retaining its own dimension information, retaining the transferred dimension information, and resetting the dimension information.

[0051] According to an exemplary embodiment of the present disclosure, dimension information is transmitted by a method of traversing a tree structure, which can be intuitively understood by coloring the nodes: first, the root node is colored, and then, for each leaf node, if dimension information exists and the existing dimension information is the same as the dimension information of its parent node, or if there is no dimension information, it is colored the same color as its parent node; if the existing dimension information is different from the dimension information of its parent node, it is colored a different color from its parent node.

[0052] After determining the dimension information of all service nodes included in each request call chain, in step 103, server resource allocation can be performed on multiple resource allocation objects corresponding to the target dimension based on the dimension information of all service nodes included in each request call chain in at least one request call chain.

[0053] It can be seen from the above embodiments that the attribute value in the dimension information of the service node can indicate the resource allocation object corresponding to the corresponding service node in multiple resource allocation objects, and the resource allocation object needs to allocate the resources of the server. The exemplary embodiment of the present disclosure can cluster the service nodes according to the service type (the clustering method includes but is not limited to clustering by the CPU model, model or machine name corresponding to the service node). Then, all the service nodes contained in at least one request call chain are divided into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide the service capabilities deployed by a server. Next, the node set corresponding to the target server can be determined, and the resource allocation of the target server can be performed on the multiple resource allocation objects corresponding to the target dimension according to the dimension information of all service nodes contained in the node set corresponding to the target server. In this way, the service nodes can be aggregated into a server with an entity, which is convenient for subsequent resource allocation based on the dimension information of the service nodes.

[0054] According to an exemplary embodiment of the present disclosure, resource allocation to a target server is performed for multiple resource allocation objects under a target dimension. First, the number of request call chains corresponding to each resource allocation object under the target dimension can be determined based on the dimension information of all service nodes contained in the node set corresponding to the target server and the request call chain in which each service node is located. Then, based on the ratio of the number of request call chains corresponding to each resource allocation object, the proportion of resources assumed by each resource allocation object for the target server can be determined. Finally, the resources of the target server can be allocated to the corresponding resource allocation objects according to the assumed ratio. According to an embodiment, the final resource allocation can be performed based on the ratio of the number of request call chains, so that the resource allocation is more reasonable.

[0055] For example, Figure 2 is a schematic diagram of a resource allocation object of a target server according to an exemplary embodiment, referring to Figure 2 , the service deployed on the target server is service C. Service C participates in both the request call chain based on service A on the left and the request call chain based on service B on the right. Both sides may correspond to different resource allocation objects (such as resource allocation object A and resource allocation object B). Therefore, the resources of the target server need to be allocated to resource allocation object A and resource allocation object B. Then, firstly, according to the dimension information of all service nodes contained in the node set corresponding to the target server and the request call chain where each service node is located, the number of request call chains (trace count) corresponding to resource allocation object A and resource allocation object B within the preset time range (t, t+1) can be determined. Figure 3is a schematic diagram showing the ratio of the number of request call chains corresponding to resource allocation object A and resource allocation object B respectively according to an exemplary embodiment, with reference to Figure 3 The ratio of the two can be obtained by calculating the ratio of the area within (t, t+1). Based on the ratio of the two, the proportion of each resource allocation object to the target server's resources is determined (for example, the ratio of the two is used as the proportion of resource allocation object A and resource allocation object B to the target server's resources). Finally, the resources of the target server can be allocated to resource allocation object A and resource allocation object B according to the proportion.

[0056] According to an exemplary embodiment of the present disclosure, the overall resource allocation result of the service system may be obtained by combining the number of target servers and the resource allocation results of all other servers.

[0057] Based on the above embodiment, the number of request call chains corresponding to each resource allocation object under the target dimension can be determined based on the search statement of the database. Therefore, it is necessary to first build the storage data of the database, and then search based on the storage data. Specifically, before determining the node set corresponding to the target server, a database list can be generated based on the dimension information of all service nodes contained in each request call chain in at least one request call chain, wherein the database list includes at least: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension. It should be noted that the database list can be stored in Hive. In the embodiment, the dimension information is placed in the database through columnar storage, which can achieve better compatibility.

[0058] After generating the database list, the exemplary embodiment of the present disclosure can search the database list for the number of request call chains corresponding to each resource allocation object under the target dimension for all service nodes included in the node set corresponding to the target server. According to this embodiment, the process of determining the number of request call chains corresponding to each resource allocation object under the target dimension can be simply and quickly implemented by searching the database list.

[0059] Figure 4 is an overall flow chart of a server resource allocation method according to an exemplary embodiment. Figure 4 , an overall description is given of the server resource allocation method in the exemplary embodiment of the present disclosure. Figure 4 The overall process of the server resource allocation method shown includes three parts, namely online data acquisition, offline data analysis and resource allocation.

[0060] For the online data acquisition part, all trace messages in the service system can be obtained. The logic between the data in all trace messages can be reflected as follows: multiple request call chains, for each request call chain, the call relationship between services is presented (such as Figure 4 ), each service can be provided by at least one service node, and at least one service node can call each other through the calling relationship to provide the corresponding service. Each service node may have dimension information (or may not), and each service may correspond to a server.

[0061] For the offline data analysis part, first, all trace messages of the service system can be sent to the data warehouse tool (offline storage Hive) through Kafka, and then for each request call chain, the call link relationship of all service nodes contained in it can be built. Finally, according to the call link relationship, the dimension information of multiple service nodes in the request call chain can be transmitted to determine the dimension information of each service node contained in the request call chain.

[0062] Figure 5 This is an overall flow chart of offline data analysis according to an exemplary embodiment. Figure 5 , further elaborating on the offline data analysis part. Figure 5 , which can be divided into five steps from top to bottom, and the exemplary embodiment of the present disclosure can implement these five steps by executing the UDF method through Hive. First, the first step is to obtain all trace messages through Kafka. Figure 5 The above shows a request call chain corresponding to TraceId xxx.abc, which includes service nodes A, B and C. The configuration information of each service node includes the parent node number (ParentSpanId of the parent service node), node number (SpanId of the service node), dimension information (the target dimension is dimension 1) and other dimension information (dimension 2 and dimension 3, etc.). It should be noted that although the figure shows the logical relationship between service nodes, in fact, all trace messages obtained through Kafka are discrete data to be aggregated. Then, the second step is to aggregate the configuration information of each service node according to TraceId, and aggregate the service nodes of the same request call chain together. Next, the third step is to build the call chain relationship of all service nodes contained in each request call chain. Figure 5The above shows that corresponding to the request call chain with TraceId xxx.abc, the call chain relationship of service node A, service node B and service node C is constructed. In addition, the fourth step is to transmit the dimension information of at least one service node among the multiple service nodes of the corresponding request call chain according to the call chain relationship, and determine the dimension information of each service node included in the request call chain. Figure 5 The above shows that the dimension information of service node A is passed to service node B (for service node B, add business 1) corresponding to the request call chain with TraceId xxx.abc. Finally, the fifth step is to generate a database list based on the dimension information of all service nodes contained in each request call chain in at least one request call chain and store it in Hive, where the database list includes: the request call chain in which each service node is located, the node set to which each service node belongs, the attribute value of each service node under the target dimension, and the attribute value of each service node under other dimensions.

[0063] For the resource allocation part, you can set a timed search of the database list to determine the number of request call chains corresponding to each resource allocation object; determine the proportion of resources that each resource allocation object bears for the target server based on the proportion of the number of request call chains corresponding to each resource allocation object; allocate the resources of the target server to the corresponding resource allocation object according to the proportion, and visualize the resource allocation results.

[0064] Figure 6 is a block diagram of a server resource allocation device according to an exemplary embodiment. Figure 6 The server resource allocation device 600 includes an acquisition unit 601, a determination unit 602 and an allocation unit 603.

[0065] The acquisition unit 601 can acquire the dimensional information of at least one request call chain of the service system, wherein each request call chain includes multiple service nodes, the dimensional information of each request call chain includes the dimensional information of at least one service node among the multiple service nodes, and the dimensional information of each service node in the at least one service node includes the attribute value of the service node under the target dimension, and the attribute value is used to indicate the resource allocation object corresponding to the corresponding service node in the multiple resource allocation objects, and the multiple resource allocation objects are the resource allocation objects corresponding to the target dimension.

[0066] According to an exemplary embodiment of the present disclosure, the service system may be a distributed link tracing system (OpenTracing), that is, the dimension information of the request call chain in the exemplary embodiment of the present disclosure may be obtained based on the OpenTracing standard. The service system is an online service system, that is, the dimension information of the request call chain in the exemplary embodiment of the present disclosure is information obtained online by the acquisition unit 601.

[0067] Furthermore, in OpenTracing, a request call chain (Trace) can represent the tracing of a complete call chain of a request. The Trace may include multiple logical running units (Spans). Span is the service node in the exemplary embodiment of the present disclosure. Multiple Spans can present the logical causal relationship of the Trace call by nesting or sequential arrangement. The Trace can be a directed acyclic graph (DAG) of multiple Spans, and the Span can be a program with processing capabilities with a start time and execution duration.

[0068] Furthermore, each service node may include its own configuration information, and the configuration information may include, but is not limited to, the number of the parent service node of the service node (ParentSpanId), the number of the service node (SpanId), the identification data of the service node (SpanTags) and the request call chain number (TraceId) where the service node is located. The identification data may include the above-mentioned dimension information, and the dimension information may exist in the identification data in the form of a key-value pair. For an exemplary embodiment of the present disclosure, the key may correspond to the target dimension, and the value may correspond to the attribute value. For example, the target dimension may be a business dimension, and the corresponding attribute value may include business 1, business 2, etc. It should be noted that the identification data may also include other dimension information, and other dimension information may also exist in the identification data in the form of a key-value pair. It should also be noted that the resource allocation object may be a unit with the ability to assume server resources.

[0069] According to an exemplary embodiment of the present disclosure, the information related to a request call chain described above can be stored in the information set (trace message) of the request call chain. All trace messages of the service system can be sent to the data warehouse tool (offline storage Hive) through Kafka. All trace messages stored in Hive are discrete big data (in units of service nodes). The exemplary embodiment of the present disclosure needs to aggregate the configuration information of each service node according to TraceId based on all tracemessages stored in Hive, and aggregate the service nodes of the same request call chain together. In this way, the acquisition unit 601 can obtain the dimension information of at least one request call chain based on the aggregated configuration information.

[0070] Based on the above description, a request call chain may have service nodes that do not carry dimension information. The exemplary embodiment of the present disclosure needs to combine the dimension information of each service node in each request call chain to perform subsequent server resource allocation. Therefore, it is necessary to determine the dimension information of all service nodes contained in each request call chain based on the service nodes that carry dimension information. This is described in detail below through determination unit 602.

[0071] The determining unit 602 may determine, for each request call chain in at least one request call chain, dimension information of each service node included in the request call chain based on the dimension information of the request call chain.

[0072] As can be seen from the above description, each request call chain may include multiple service nodes, and the multiple service nodes present the call logic causal relationship of the request call chain through nesting or sequential arrangement. The exemplary embodiment of the present disclosure can pass the dimension information of the service node called previously to the service node called later based on the logical relationship between the multiple service nodes of each request call chain, and the logical relationship between the multiple service nodes can be reflected by the ParentSpanId in the configuration information. Based on this idea, the determination unit 602 can first construct the call link relationship of all service nodes contained in the request call chain for each request call chain; then, according to the call link relationship, the dimension information of at least one service node among the multiple service nodes of the request call chain can be passed to determine the dimension information of each service node contained in the request call chain. In this way, the service node that originally does not carry dimension information inherits the dimension information of its logical upstream parent service node, which can make the dimension information of each service node finally determined more accurate.

[0073] According to an exemplary embodiment of the present disclosure, the call link relationship of all service nodes included in each request call chain can be presented as a tree structure, then each service node can represent a node in the tree structure, and the parent service node of each service node is the parent node of the node represented by the service node. Then the dimensional information can be transmitted by traversing the tree structure, specifically, the determination unit 602 can be configured to: transmit the dimensional information of at least one service node along the direction from the root node to the leaf node of the tree structure. It should be noted that the traversal method can be a depth-first search algorithm (Depth-First-Search, DFS). The determination unit 602 can simply and conveniently implement the transmission of dimensional information by traversing the tree structure.

[0074] According to the nature of the tree structure, the tree structure includes a root node and a leaf node. When the node has dimension information, the determination unit 602 can directly retain the dimension information. In the case where the node does not have dimension information, the determination unit 602 needs to transfer the dimension information. The following is a detailed description of the dimension information transfer process of the determination unit 602 in combination with the root node and the leaf node: when the root node does not have dimension information, the root node is assigned preset dimension information; for each leaf node, when the leaf node does not have dimension information, the dimension information of the parent node corresponding to the leaf node is used as the dimension information of the leaf node. In this way, the determination unit 602 can limit the specific dimension information transfer process of the root node and the leaf node in combination with the nature of the tree structure, so that the determined dimension information is more accurate. It should be noted that for each node, the determination of the dimension information can be flexibly adjusted based on different situations, for example, retaining its own dimension information, retaining the transmitted dimension information, and resetting the dimension information.

[0075] According to an exemplary embodiment of the present disclosure, the determination unit 602 transmits dimension information by traversing the tree structure, which can be intuitively understood by coloring the nodes: first, the root node is colored, and then, for each leaf node, if dimension information exists and the existing dimension information is the same as the dimension information of its parent node, or if there is no dimension information, it is colored the same color as its parent node; if the existing dimension information is different from the dimension information of its parent node, it is colored a different color from its parent node.

[0076] The allocation unit 603 may perform server resource allocation on multiple resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in each request call chain in at least one request call chain.

[0077] As can be seen from the above embodiments, the attribute value in the dimension information of the service node can indicate the resource allocation object corresponding to the corresponding service node in multiple resource allocation objects, and the resource allocation object needs to allocate the resources of the server. The exemplary embodiment of the present disclosure can cluster the service nodes according to the service type (the clustering method includes but is not limited to clustering by the CPU model, model or machine name corresponding to the service node). Then specifically, the allocation unit 603 divides all service nodes contained in at least one request call chain into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide the service capabilities deployed by a server. Next, the node set corresponding to the target server can be determined, and the resource allocation of the target server can be performed on the multiple resource allocation objects corresponding to the target dimension according to the dimension information of all service nodes contained in the node set corresponding to the target server. In this way, the allocation unit 603 can aggregate the service nodes into a server with an entity, which is convenient for subsequent resource allocation based on the dimension information of the service nodes.

[0078] According to an exemplary embodiment of the present disclosure, the allocation unit 603 may first determine the number of request call chains corresponding to each resource allocation object under the target dimension based on the dimension information of all service nodes contained in the node set corresponding to the target server and the request call chain in which each service node is located. The allocation unit 603 may then determine the proportion of resources of the target server that each resource allocation object bears based on the proportion of the number of request call chains corresponding to each resource allocation object. Finally, the resources of the target server may be allocated to the corresponding resource allocation objects according to the proportion. According to an embodiment, the allocation unit 603 may perform the final resource allocation based on the proportion of the number of request call chains, so that the resource allocation is more reasonable.

[0079] Based on the above embodiment, the number of request call chains corresponding to each resource allocation object under the target dimension can be determined based on the search statement of the database. Therefore, it is necessary to first build the storage data of the database, and then search based on the storage data. Specifically, the server resource allocation device 600 may also include a generation unit. The generation unit may generate a database list based on the dimension information of all service nodes contained in each request call chain in at least one request call chain before determining the node set corresponding to the target server, wherein the database list includes at least: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension. It should be noted that the database list can be stored in Hive. In the embodiment, the generation unit places the dimension information into the database through columnar storage, which can obtain better compatibility.

[0080] After the generation unit is executed, the allocation unit 603 can search the database list for the number of request call chains corresponding to each resource allocation object under the target dimension for all service nodes included in the node set corresponding to the target server. According to this embodiment, the allocation unit 603 can simply and quickly implement the process of determining the number of request call chains corresponding to each resource allocation object under the target dimension by searching the database list.

[0081] Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment.

[0082] Reference Figure 7 The electronic device 700 includes at least one memory 701 and at least one processor 702, wherein the at least one memory 701 stores a set of computer executable instructions, and when the computer executable instruction set is executed by the at least one processor 702, the server resource allocation method according to the present disclosure is executed.

[0083] As an example, the electronic device 700 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instruction set. Here, the electronic device 700 is not necessarily a single electronic device, but may also be any device or circuit capable of executing the above instruction (or instruction set) individually or in combination. The electronic device 700 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0084] In the electronic device 700, the processor 702 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0085] The processor 702 may execute instructions or codes stored in the memory 701, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.

[0086] The memory 701 may be integrated with the processor 702, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 701 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 701 and the processor 702 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 702 can read files stored in the memory.

[0087] In addition, the electronic device 700 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 700 may be connected to each other via a bus and / or a network.

[0088] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to execute the server resource allocation method according to the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0089] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by a processor of a computer device to implement the server resource allocation method according to the present disclosure.

[0090] According to the server resource allocation method, device, electronic device and storage medium disclosed in the present invention, server resource allocation can be performed on multiple resource allocation objects under the target dimension by determining the dimensional information of all service nodes contained in each request call chain. Compared with the prior art of dividing server resources with containers as the smallest unit, server resources can be reasonably and efficiently allocated from a more detailed perspective.

[0091] In addition, according to the server resource allocation method, device, electronic device and storage medium disclosed in the present invention, by customizing the target dimension, such as defining the target dimension as a business dimension, the server resource allocation details of the customized target dimension can be flexibly and conveniently obtained, which is helpful for resource budgeting and data analysis.

[0092] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0093] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A server resource allocation method, characterized in that: include: Obtaining dimension information of at least one request call chain of a service system, wherein each request call chain includes multiple service nodes, the dimension information of each request call chain includes dimension information of at least one service node among the multiple service nodes, the dimension information of each service node among the at least one service node includes an attribute value of the service node under a target dimension, the attribute value being used to indicate a resource allocation object corresponding to the corresponding service node among multiple resource allocation objects, the multiple resource allocation objects being resource allocation objects corresponding to the target dimension; For each request call chain in the at least one request call chain, determining dimension information of each service node included in the request call chain based on the dimension information of the request call chain; Performing server resource allocation on the multiple resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in each request call chain in the at least one request call chain; The performing server resource allocation on the multiple resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in each request call chain in the at least one request call chain includes: Dividing all service nodes included in the at least one request call chain into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide a service capability deployed by a server; A node set corresponding to a target server is determined, and resource allocation is performed on the target server for the multiple resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in the node set corresponding to the target server.

2. The distribution method according to claim 1, wherein: The determining, for each request call chain in the at least one request call chain, dimension information of each service node included in the request call chain based on the dimension information of the request call chain includes: For each request call chain, construct a call link relationship of all service nodes included in the request call chain; According to the call link relationship, dimension information of at least one service node among the multiple service nodes of the request call chain is transmitted to determine the dimension information of each service node included in the request call chain.

3. The distribution method according to claim 2, wherein: The call link relationship is a tree structure, and each service node represents a node in the tree structure; The transmitting, according to the call link relationship, dimension information of at least one service node among the plurality of service nodes in the request call chain includes: The dimension information of the at least one service node is transmitted along the direction from the root node to the leaf nodes of the tree structure.

4. The distribution method according to claim 3, wherein: The transmitting the dimension information of the at least one service node along the direction from the root node to the leaf node of the tree structure includes: In the case that the root node does not have dimension information, assigning preset dimension information to the root node; For each leaf node, if there is no dimension information for the leaf node, the dimension information of the parent node corresponding to the leaf node is used as the dimension information of the leaf node.

5. The distribution method according to claim 1, wherein: The determining a node set corresponding to the target server, and performing resource allocation on the target server for the multiple resource allocation objects corresponding to the target dimension according to dimension information of all service nodes included in the node set corresponding to the target server, includes: Determine the number of request call chains corresponding to each resource allocation object under the target dimension based on dimension information of all service nodes included in the node set corresponding to the target server and the request call chain in which each service node is located; Determining a proportion of resources of the target server assumed by each resource allocation object based on a proportion of the number of request call chains corresponding to each resource allocation object; According to the commitment ratio, the resources of the target server are allocated to the corresponding resource allocation objects.

6. The distribution method according to claim 5, wherein: Before determining the node set corresponding to the target server, it also includes: Generate a database list based on dimension information of all service nodes included in each request call chain in the at least one request call chain, The database list includes at least: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension.

7. The distribution method according to claim 6, wherein: Determining the number of request call chains corresponding to each resource allocation object under the target dimension based on the dimension information of all service nodes included in the node set corresponding to the target server and the request call chain in which each service node is located includes: In the database list, for all service nodes included in the node set corresponding to the target server, the number of request call chains corresponding to each resource allocation object under the target dimension is searched.

8. A server resource allocation device, characterized in that: include: an acquiring unit configured to: acquire dimension information of at least one request call chain of a service system, wherein each request call chain includes a plurality of service nodes, the dimension information of each request call chain includes dimension information of at least one service node among the plurality of service nodes, the dimension information of each service node among the at least one service node includes an attribute value of the service node under a target dimension, the attribute value being used to indicate a resource allocation object corresponding to the corresponding service node among a plurality of resource allocation objects, the plurality of resource allocation objects being resource allocation objects corresponding to the target dimension; The determining unit is configured to: determine, for each request call chain in the at least one request call chain, dimension information of each service node included in the request call chain based on the dimension information of the request call chain; an allocating unit configured to: perform server resource allocation on the plurality of resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in each request call chain in the at least one request call chain; The allocation unit is configured as follows: Dividing all service nodes included in the at least one request call chain into at least one node set, wherein each node set includes at least one service node, and all service nodes in the same node set are used to provide a service capability deployed by a server; A node set corresponding to a target server is determined, and resource allocation is performed on the target server for the multiple resource allocation objects corresponding to the target dimension based on dimension information of all service nodes included in the node set corresponding to the target server.

9. The dispensing device according to claim 8, characterized in that Determine if the unit is configured to: For each request call chain, construct a call link relationship of all service nodes included in the request call chain; According to the call link relationship, dimension information of at least one service node among the multiple service nodes of the request call chain is transmitted to determine the dimension information of each service node included in the request call chain.

10. The dispensing device according to claim 9, characterized in that The call link relationship is a tree structure, and each service node represents a node in the tree structure; Determine if the unit is configured to: The dimension information of the at least one service node is transmitted along the direction from the root node to the leaf nodes of the tree structure.

11. The dispensing device according to claim 10, wherein Determine if the unit is configured to: In the case that the root node does not have dimension information, assigning preset dimension information to the root node; For each leaf node, if there is no dimension information for the leaf node, the dimension information of the parent node corresponding to the leaf node is used as the dimension information of the leaf node.

12. The dispensing device according to claim 8, wherein Allocation units are configured as: Determine the number of request call chains corresponding to each resource allocation object under the target dimension based on dimension information of all service nodes included in the node set corresponding to the target server and the request call chain in which each service node is located; Determining a proportion of resources of the target server assumed by each resource allocation object based on a proportion of the number of request call chains corresponding to each resource allocation object; According to the commitment ratio, the resources of the target server are allocated to the corresponding resource allocation objects.

13. The dispensing device according to claim 12, wherein It also includes a generation unit, which is configured to: Generate a database list based on dimension information of all service nodes included in each request call chain in the at least one request call chain, The database list includes at least: the request call chain in which each service node is located, the node set to which each service node belongs, and the attribute value of each service node under the target dimension.

14. The dispensing device according to claim 13, wherein Allocation units are configured as: In the database list, for all service nodes included in the node set corresponding to the target server, the number of request call chains corresponding to each resource allocation object under the target dimension is searched.

15. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer-executable instructions, When the computer-executable instructions are executed by the at least one processor, the computer-executable instructions cause the at least one processor to execute the server resource allocation method according to any one of claims 1 to 7.

16. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one processor, the at least one processor is prompted to perform the server resource allocation method according to any one of claims 1 to 7.

17. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the server resource allocation method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Micro-service request response method and device, equipment and storage medium

    CN113419852A

  • Call chain monitoring system and method

    CN113688012A