Determination Method, Device, Electronic Device and Medium for Nodes to be Optimized
By analyzing the computing link of microservices and identifying the nodes to be optimized, the problem of long microservice computing time affecting user experience is solved, and the stability and performance of microservices are improved.
Patent Information
- Application Number
- CN202211612932.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-12-15
AI Technical Summary
The longer the computing time of microservices will affect the user experience, resulting in users' belief that microservices are unstable and it is difficult for the existing technology to effectively analyze and optimize problem nodes in the computing link.
By determining the candidate computing link in the microservice, determining the target computing link based on the link calculation time, analyzing the target nodes in the target computing link and their dependencies and occurrence information, a core computing link is generated, thereby identifying the nodes to be optimized.
It realizes accurate analysis and optimization of the computing time of microservices, quickly locates nodes to be optimized, improves user experience, and ensures the stability of microservices.
Smart Images

Figure CN116016686B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, specifically to technologies such as microservices, computing links, node optimization, and cloud computing, and particularly to a method, apparatus, electronic device, and medium for determining a node to be optimized. Background Art
[0002] The computing duration of microservices is an important factor affecting the user experience. For microservices with a relatively long computing duration, users will consider the microservices unstable and have a poor product experience, which may lead users to actively abandon using such microservices.
[0003] Therefore, it is necessary to analyze the computing links of microservices in order to locate and optimize problem nodes. Summary of the Invention
[0004] The present disclosure provides a method, apparatus, electronic device, and medium for determining a node to be optimized in a microservice.
[0005] According to one aspect of the present disclosure, there is provided a method for determining a node to be optimized, including:
[0006] Determining at least one candidate computing link included in a microservice, and determining a target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links;
[0007] Determining target nodes included in the target computing link, and determining the number information of the occurrences of the target nodes in the target computing link, as well as the node dependency relationships between the target nodes;
[0008] Generating a core computing link according to the target nodes, the node dependency relationships, and the number information, and determining a node to be optimized from the core computing link.
[0009] According to another aspect of the present disclosure, there is provided a device for determining a node to be optimized, including:
[0010] A computing link determination module, configured to determine at least one candidate computing link included in a microservice, and determine a target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links;
[0011] An information determination module, configured to determine target nodes included in the target computing link, and determine the number information of the occurrences of the target nodes in the target computing link, as well as the node dependency relationships between the target nodes;
[0012] The node to be optimized determination module is configured to generate a core calculation link according to the target node, the node dependency relationship, and the frequency information, and determine the node to be optimized from the core calculation link.
[0013] According to another aspect of the present disclosure, there is provided an electronic device, including:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of any one of the present disclosures.
[0017] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method of any one of the present disclosures.
[0018] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program, and the computer program executes the method of any one of the present disclosures when being executed by a processor.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. Brief Description of the Drawings
[0020] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0021] Figure 1A is a flowchart of some methods for determining nodes to be optimized disclosed in the embodiments of the present disclosure;
[0022] Figure 1B is a schematic diagram of some methods for determining candidate calculation links disclosed in the embodiments of the present disclosure;
[0023] Figure 1C is a schematic diagram of some target calculation link reports disclosed in the embodiments of the present disclosure;
[0024] Figure 2A is a flowchart of some other methods for determining nodes to be optimized disclosed in the embodiments of the present disclosure;
[0025] Figure 2B is a schematic diagram of some two-level Map structures disclosed in the embodiments of the present disclosure;
[0026] Figure 3AIt is a flowchart of some methods for determining nodes to be optimized according to an embodiment of the present disclosure;
[0027] Figure 3B It is a schematic diagram of the generation of some classified calculation links according to an embodiment of the present disclosure;
[0028] Figure 3C It is a schematic diagram of the overall process for determining nodes to be optimized according to an embodiment of the present disclosure;
[0029] Figure 4 It is a schematic structural diagram of a device for determining nodes to be optimized according to an embodiment of the present disclosure;
[0030] Figure 5 It is a block diagram of an electronic device for implementing the method for determining nodes to be optimized according to an embodiment of the present disclosure. Specific embodiments
[0031] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0032] The computing duration of microservices is an important factor affecting the user experience. For microservices with a long computing duration, users will consider the microservices unstable and have a poor product experience, resulting in users actively abandoning the use of such microservices. Therefore, it is necessary to analyze the computing links of microservices to locate and optimize problem nodes.
[0033] However, usually, a microservice system contains multiple microservices, and there are numerous internal code logics in each microservice. Therefore, it is particularly important to analyze the core computing links between multiple microservices in order to locate and optimize problem nodes based on the core computing links.
[0034] Figure 1A It is a flowchart of some methods for determining nodes to be optimized according to an embodiment of the present disclosure. This embodiment can be applied to the situation of determining nodes to be optimized in microservices. The method of this embodiment can be executed by a device for determining nodes to be optimized disclosed in an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can be integrated into any electronic device with computing capabilities.
[0035] As Figure 1A shown, the method for determining nodes to be optimized disclosed in this embodiment may include:
[0036] S101. Determine the candidate computing links included in at least one microservice, and determine the target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links.
[0037] Among them, a microservice represents a cloud-native architecture approach, where a single application consists of many loosely coupled and independently deployable smaller components or services. For example, an e-commerce system needs to provide services such as order services, user functions, product services, and payment services. If these services are implemented using a monolithic architecture, the coupling degree will be quite high and the development difficulty will also be great. If microservices are used for development and each service is developed as a monolithic application, then each service such as the order service, user function, product service, and payment service becomes a microservice.
[0038] A microservice includes at least one candidate computing link, and each candidate computing link is composed of at least one node. A node represents a computing node, also known as a functional point or operator, which is used to perform preset data processing operations. After the current node finishes performing the data processing operation, it transmits the obtained data processing result to the adjacent node in the candidate computing link until the last node in the candidate computing link finishes performing the data processing operation. For example, microservice 1 includes two candidate computing links, "A-C-D" and "A-B-D". Among them, "A, B, C, and D" all represent nodes, that is, the process of data processing by microservice 1 can be completed through the candidate computing link "A-C-D" or through the candidate computing link "A-B-D".
[0039] The link computing duration represents the duration required for all nodes in the candidate computing link to complete the data processing operation. In other words, the link computing duration is the sum of the node computing durations of each node in the candidate computing link. The node computing duration represents the duration required for a node to complete the data processing operation. For example, the link computing duration of the candidate computing link "A-C-D" can be expressed as Time(A) + Time(C) + Time(D), where Time(A) represents the duration required for node A to complete the data processing operation, Time(B) represents the duration required for node B to complete the data processing operation, and Time(C) represents the duration required for node C to complete the data processing operation.
[0040] In one implementation, the microservice system determines the data types of the output data required by each microservice. Further, the microservice system also determines at least one node allocated to each microservice, as well as the data types of the dependent data of each node and the data types of the output data of each node. Then, according to the data types of the output data required by each microservice, the data types of the dependent data of each node, and the data types of the output data of each node, the candidate computing links included in each microservice are derived in reverse order.
[0041] Figure 1B Schematic diagrams of determining candidate computing links disclosed according to embodiments of the present disclosure. As Figure 1B shown, assume that the data type of the output data required by a certain microservice is "d5", and the nodes allocated by the microservice system for this microservice include Node A, Node B, Node C, and Node D. Among them, the data types of the output data of Node A are "d1" and "d2"; the data type of the data relied on by Node B is "d2", and the data type of the output data is "d4"; the data type of the data relied on by Node C is "d1", and the data type of the output data is "d3"; the data type of the data relied on by Node D is "d3" or "d4", and the data type of the output data is "d5". Since the data type of the output data required by this microservice is "d5", Node D is selected as the last node. And since the data type of the data relied on by Node D is "d3" or "d4", Node C and Node D are respectively selected as the adjacent nodes of Node D. The data type of the data relied on by Node C is "d1", and the data type of the data relied on by Node B is "d2", so Node A is selected as the adjacent node of Node C and Node D, thereby obtaining the candidate computing link "A-C-D" and the candidate computing link "A-B-D" included in this microservice.
[0042] After determining at least one candidate computing link included in any microservice, according to the node computing durations of the nodes in each candidate computing link, determine the link computing duration of each candidate computing link, and then according to the sorting result of the link computing durations, determine the target computing link corresponding to this microservice from the candidate computing links. Optionally, the candidate computing link with the longest link computing duration is used as the target computing link. It can be understood that the link computing duration of the target computing link is the longest, so it is likely to cause the microservice to take too long, so it is a candidate computing link that needs to be focused on.
[0043] Exemplarily, continue to use Figure 1B as an example for explanation. Assume that the duration for Node A to output "d1" is T1, the duration for Node A to output "d2" is T2; the duration for Node C to output "d3" is T3; the duration for Node B to output "d4" is T4; the duration for Node D to output "d5" is T5. Then the link computing duration of the candidate computing link "A-C-D" is "T1 + T3 + T5", and the link computing duration of the candidate computing link "A-B-D" is "T2 + T4 + T5". If T1 + T3 + T5 > T2 + T4 + T5, then the candidate computing link "A-C-D" is used as the target computing link of this microservice. If T1 + T3 + T5 < T2 + T4 + T5, then the candidate computing link "A-B-D" is used as the target computing link of this microservice.
[0044] By determining the candidate computing links included in at least one microservice and determining the target computing link corresponding to the microservice from the candidate computing links according to the link computing duration, the effect of determining the target computing link that needs to be focused on in each microservice according to the link computing duration is achieved, laying a data foundation for generating the core computing link between microservices based on the target computing link subsequently.
[0045] S102. Determine the target nodes included in the target computing link, and determine the number information of the target nodes appearing in the target computing link, as well as the node dependency relationship between the target nodes.
[0046] Among them, the number information includes but is not limited to the total number of times the target node appears in the target computing link, and / or the number of child nodes when the target node appears as a child node in the target computing link, etc. The node dependency relationship reflects the execution sequence between the target nodes, which can be determined according to the positions of the target nodes in the target computing link.
[0047] In one implementation, the SDK (Software Development Kit) in each microservice obtains the target computing link corresponding to each microservice and generates a link analysis request according to the target computing link. The microservice system first temporarily stores the link analysis requests generated by each SDK in the service memory space (buffer), and after waiting for a certain period of time, such as 5 minutes, etc., batches the link analysis requests and reports them to the data aggregator in the microservice system. Optionally, when reporting the link analysis request to the data aggregator, the link analysis request can be reported to the corresponding data aggregator according to the request key of the link analysis request. Among them, the request key can be obtained by performing a hash calculation on the string composed of the microservice identifier and the request identifier.
[0048] Figure 1C is a schematic diagram of reporting some target computing links disclosed according to the embodiments of the present disclosure. As Figure 1C shown, the target computing link 1, target computing link 2, target computing link 3, and target computing link 4 are temporarily stored in the service memory space of the microservice system. After waiting for a certain period of time, the microservice system batches and reports the target computing link 1, target computing link 2, target computing link 3, and target computing link 4 to the data aggregator of the microservice system.
[0049] The data aggregator includes a first-level data aggregator and a second-level data aggregator. The first-level data aggregator receives batch-reported link analysis requests, and obtains the microservice identifier, request identifier, microservice product identifier, and microservice category identifier corresponding to each link analysis request, and then filters the link analysis request according to the microservice identifier, request identifier, microservice product identifier, and microservice business identifier. Among them, the microservice product identifier indicates the identifier of the product to which the microservice belongs, such as electronic map software, short video software, social software, and online shopping software, etc. The microservice business identifier indicates the identifier of the specific business involved in the microservice in the product to which it belongs, such as the taxi-hailing business or the designated driver business in the electronic map software, etc.
[0050] Optionally, filtering the link analysis request according to the microservice identifier, the request identifier, the microservice product identifier, and the microservice business identifier includes at least one of the following execution methods:
[0051] A. Perform specific sampling on link analysis requests according to the microservice identifier, that is, filter the link analysis requests with specific microservice identifiers.
[0052] B. Randomly sample the link analysis requests according to the request identifier, that is, filter a random number of link analysis requests.
[0053] C. Perform specific sampling on link analysis requests according to the microservice product identifier and the microservice business identifier, that is, filter the link analysis requests with specific microservice product identifiers and microservice business identifiers.
[0054] The first-level data aggregator determines the request timestamps of the filtered link analysis requests, and aggregates the link analysis requests that belong to the same request timestamp range, for example, taking 10 seconds as a request timestamp range. And, after a preset time after the aggregation is completed, for example, 30 seconds after the aggregation is completed, the aggregated link analysis requests are sent to the second-level data aggregator. In other words, if before the preset time, the first-level data aggregator receives a link analysis request that belongs to the request timestamp range, the link analysis request will also be aggregated; if after the preset time, the first-level data aggregator receives a link analysis request that belongs to the request timestamp range, the link analysis request will be directly discarded.
[0055] The secondary data aggregator obtains the link analysis request sent by the primary data aggregator, and parses the link analysis request to obtain the target computing link contained therein, and then determines the target nodes included in the target computing link. For example, assuming that the target computing link includes "ABDF" and "ACEF", the target nodes include node A, node B, node C, node D, node E, and node F.
[0056] Further, the secondary data aggregator determines the node dependency relationship between target nodes according to the positions of the target nodes in their respective target computing links. Moreover, the total number of times the target nodes appear in the target computing links, and / or the number of times the sub-nodes appear as child nodes, is / are counted.
[0057] Exemplarily, assume that the target computing links include "A - B - D - F" and "A - C - E - F". Among them, the total number of times node A appears in the target computing links is "2", and the number of times it appears as a child node is "0"; the total number of times node B appears in the target computing links is "1", and the number of times it appears as a child node is "1"; the total number of times node C appears in the target computing links is "1", and the number of times it appears as a child node is "1"; the total number of times node D appears in the target computing links is "1", and the number of times it appears as a child node is "1"; the total number of times node E appears in the target computing links is "1", and the number of times it appears as a child node is "1"; the total number of times node F appears in the target computing links is "2", and the number of times it appears as a child node is "2".
[0058] By determining the target nodes included in the target computing links, and determining the occurrence frequency information of the target nodes in the target computing links, as well as the node dependency relationship between the target nodes, the effect of statistical analysis on the target nodes is achieved, laying a data foundation for generating the core computing links between microservices based on the frequency information and dependency relationship subsequently.
[0059] S103. Generate the core computing links between microservices according to the target nodes, the node dependency relationship, and the frequency information, and determine the nodes to be optimized from the core computing links.
[0060] Among them, there is at least one computing link between microservices for realizing the collaborative work among multiple microservices. The core computing link between microservices is generated based on the target nodes in the target computing links, and the target computing link is the candidate computing link with the longest link computing duration among each microservice. Therefore, the core computing link is the computing link between microservices that is most likely to cause the collaborative work among microservices to take too long and needs to be focused on.
[0061] In one embodiment, the secondary data aggregator first takes the target node serving as the parent node as the target parent node and the target node serving as the child node as the target child node according to the node dependency relationship. It can be understood that the same target node can serve only as the target parent node, or only as the target child node, or both as the target parent node and the target child node. For example, assuming that the target computing link includes "A - B - C", then node A is the parent node of node B, and node A is the target parent node; node B is the child node of node A, and node B is the target child node, while node B is also the parent node of node C, so node B is also the target parent node; node C is the child node of node C, and node C is the target child node.
[0062] Further, the secondary data aggregator first filters the target parent nodes according to the frequency information to determine the core head node, and then filters the target child nodes according to the frequency information to determine the core child nodes. The core child nodes are matched in the target parent nodes. If there is no matching target parent node, the core computing link is directly generated based on the core head node and the core child nodes; if there is a matching target parent node, the target parent node is used as the new core head node, and then the target child nodes are filtered according to the frequency information to determine the new core child nodes, and then the new core child nodes are matched in the target parent nodes again. Repeat the above operations until no new core head node is generated. Finally, the core computing link is generated based on the core head node, the core child nodes, and all the generated new core child nodes.
[0063] Statistical information on the number of times each core node appears in the target computing link and the node computing duration in the target computing link, and then filtering each core node according to the number of times information and / or node computing duration that appears in the target computing link. Finally, the nodes to be optimized are determined according to the filtering results.
[0064] The present disclosure determines the candidate computing links included in at least one microservice, determines the target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links, determines the target nodes included in the target computing link, determines the number of times information that the target nodes appear in the target computing link, and the node dependency relationship between the target nodes. The core computing link between microservices is generated according to the target nodes, the node dependency relationship, and the number of times information, and the nodes to be optimized are determined from the core computing link, achieving the effect of determining the nodes to be optimized in the microservice. Thus, when the computing duration of the microservice increases, the nodes to be optimized can be quickly located, and then the computing duration of the microservice can be assisted in optimization to ensure the user experience of using the microservice.
[0065] Figure 2AIt is a flowchart of a method for determining other nodes to be optimized disclosed in an embodiment of the present disclosure, which is further optimized and extended based on the above technical solution and can be combined with each of the above optional embodiments.
[0066] As Figure 2A shown, the method for determining nodes to be optimized disclosed in this embodiment may include:
[0067] S201. Determine candidate computing links included in at least one microservice, and determine the target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links.
[0068] S202. Determine target nodes included in the target computing link, and determine the number information of the occurrences of the target nodes in the target computing link, as well as the node dependency relationship between the target nodes.
[0069] S203. Determine target parent nodes and target child nodes from the target nodes according to the node dependency relationship.
[0070] In one implementation, a two-level Map structure is constructed according to the node dependency relationship, where the first-level Map structure stores the target parent nodes, and the second-level Map structure stores the target child nodes.
[0071] Figure 2B It is a schematic diagram of some two-level Map structures disclosed in an embodiment of the present disclosure. As Figure 2B shown, assuming that the target computing link includes "A - B - D - F" and "A - C - E - F", the first-level Map structure includes the target parent nodes: node A, node B, node C, node D, and node E; the second-level Map structure includes the target child nodes: node B, node C, node D, node E, and node F.
[0072] S204. Determine the first number information corresponding to the target parent nodes and the second number information corresponding to the target child nodes from the number information.
[0073] Among them, the first number information includes the first total number of occurrences of the target parent nodes in the target computing link and the number of child nodes when the target parent nodes appear as child nodes in the target computing link; the second number information includes the second total number of occurrences of the target child nodes in the target computing link.
[0074] Continuing with Figure 2BFor example, an explanation is given. In the target parent node, the first total count of node A is "2", and the child node count is "0"; the first total count of node B is "1", and the child node count is "1"; the first total count of node C is "1", and the child node count is "0"; the first total count of node D is "1", and the child node count is "0"; the first total count of node E is "1", and the child node count is "0"; in the target child node, the second total count of node B is "1"; the second total count of node C is "1"; the second total count of node D is "1"; the second total count of node E is "1"; the second total count of node F is "2".
[0075] By setting the first count information to include the first total count of the target parent node that appears in the target calculation link and the child node count of the target parent node that appears as a child node in the target calculation link; and the second count information to include the second total count of the target child node that appears in the target calculation link, the effect of separately counting the count information for the target parent node and the target child node is achieved, facilitating subsequent node screening using the respective count information of the target parent node and the target child node, and improving the accuracy and reliability of node screening.
[0076] S205. Generate a core calculation link according to the target parent node, the target child node, the first count information, and the second count information.
[0077] In one implementation, node screening is performed on the target parent node according to the first count information to determine a core head node, and node screening is performed on the target child node according to the second count information to determine core child nodes, and then a core calculation link is generated according to the core head node and the core child nodes.
[0078] By determining the target parent node and the target child node from the target nodes according to the node dependency relationship, determining the first count information corresponding to the target parent node and the second count information corresponding to the target child node from the count information, and generating a core calculation link according to the target parent node, the target child node, the first count information, and the second count information, a data foundation is laid for subsequent screening of nodes to be optimized from the core calculation link between microservices.
[0079] Optionally, S205 includes the following steps A, B, and C:
[0080] A. Determine a core head node from the target parent node according to the first total count and the child node count.
[0081] Among them, the core head node represents the first node in the core calculation link between microservices.
[0082] In one embodiment, according to the sorting result of the first total number corresponding to each target parent node and the sorting result of the number of child nodes corresponding to each target parent node, a core head node is determined from each target parent node.
[0083] Optionally, step A includes:
[0084] Taking the target parent node with zero number of child nodes and the largest first total number as the core head node.
[0085] Exemplarily, assume that there are three target parent nodes: node A, node B, and node C. Among them, the first total number corresponding to node A is 2 and the number of child nodes is 0; the first total number corresponding to node B is 3 and the number of child nodes is 1; the first total number corresponding to node C is 4 and the number of child nodes is 0. Then node C is taken as the core head node.
[0086] Since the target parent node with zero number of child nodes and the largest first total number has the highest probability of being the head node in the core calculation link, by taking the target parent node with zero number of child nodes and the largest first total number as the core head node, the accuracy of the core head node can be guaranteed to the greatest extent, thereby indirectly guaranteeing the accuracy of the generation of the core calculation link and the accuracy of the determination of the node to be optimized.
[0087] B. Determine the core child nodes from the target child nodes according to the core head node, the node dependency relationship, and the second total number.
[0088] In one embodiment, according to the core head node and the node dependency relationship, the auxiliary child nodes corresponding to the core head node are determined from the target child nodes, and then the core child nodes corresponding to the core head node are determined from the auxiliary child nodes according to the second total number.
[0089] Optionally, step B includes:
[0090] Determine the auxiliary child nodes corresponding to the core head node from the target child nodes according to the node dependency relationship; take the auxiliary child node with the largest second total number as the core child node.
[0091] Exemplarily, assume that node A is the core head node, and the target child nodes that have a dependency relationship with node A are node B, node C, and node D. Then node B, node C, and node D are taken as the auxiliary child nodes. Assume that the second total number corresponding to node B is 5, the second total number corresponding to node C is 3, and the second total number corresponding to node C is 4. Then node B is taken as the core child node corresponding to node A.
[0092] By determining, according to the node dependency relationship, the auxiliary child node corresponding to the core head node from the target child nodes, and taking the auxiliary child node with the second highest total number as the core child node. Since the probability of the auxiliary child node with the second highest total number being the core child node is the highest, the accuracy of the core child node can be guaranteed to the greatest extent, thereby indirectly ensuring the accuracy of the generation of the core calculation link and the accuracy of the determination of the node to be optimized.
[0093] C. Match the core child node in the target parent nodes to determine the first matching result, and generate a core calculation link according to the core head node, the core child node, and the first matching result.
[0094] In one implementation, match the core child node in the target parent nodes to determine whether any target parent node matches the core child node, and generate a core calculation link according to the obtained first matching result, the core head node, and the core child node.
[0095] By determining the core head node from the target parent nodes according to the first total number and the child node number, determining the core child node from the target child nodes according to the core head node, the node dependency relationship, and the second total number, matching the core child node in the target parent nodes to determine the first matching result, and generating a core calculation link according to the core head node, the core child node, and the first matching result. Since the core calculation link will be generated according to the matching result of the core child node in the target parent nodes, the integrity and accuracy of the core child nodes included in the core calculation link are ensured, and the omission of core child nodes is avoided.
[0096] Optionally, step C includes:
[0097] In the case where any target parent node does not match the core child node, generate a core calculation link according to the core head node and the core child node.
[0098] Among them, if any target parent node does not match the core child node, it means that the core child node is not a parent node, that is, there is no subsequent child node of the core child node in the target calculation link. Then, a core calculation link is formed according to the core head node and the core child node.
[0099] By generating a core calculation link according to the core head node and the core child node in the case where any target parent node does not match the core child node, the integrity and accuracy of the core child nodes included in the core calculation link are ensured, and the omission of core child nodes is avoided.
[0100] Optionally, step C further includes the following steps C1, C2, and C3
[0101] C1. In the case where any target parent node matches the core child node, take this target parent node as the new core head node.
[0102] Exemplarily, assume that the core child node is node B, and the target parent node also includes node B, then node B is used as the new core head node.
[0103] C2. Determine new core child nodes from the target child nodes according to the new core head node, node dependency relationship, and the second total number.
[0104] In one implementation, according to the node dependency relationship, determine new auxiliary child nodes corresponding to the new core head node from the target child nodes, and use the new auxiliary child node with the most second total number as the new core child node.
[0105] C3. Match the new core child nodes in the target parent node to determine the second matching result, and generate a core calculation link according to the core head node, core child nodes, new core child nodes, and the second matching result.
[0106] In one implementation, match the new core child nodes in the target parent node to determine whether any target parent node matches the new core child nodes, and generate a core calculation link according to the obtained second matching result, as well as the core head node, core child nodes, and new core child nodes.
[0107] Optionally, in the case where no target parent node matches the new core child nodes, generate a core calculation link according to the core head node, core child nodes, and new core child nodes.
[0108] Optionally, in the case where any target parent node matches the new core child nodes, use this target parent node as the new core head node again, and determine new core child nodes from the target child nodes according to the newly determined new core head node, node dependency relationship, and the second total number. Match the newly determined new core child nodes in the target parent node, and repeat the above process until no target parent node matches the currently determined new core child nodes, so as to generate a core calculation link according to the core head node, core child nodes, and all new core child nodes.
[0109] By using the target parent node as the new core head node in the case where any target parent node matches the core child nodes, determining new core child nodes from the target child nodes according to the new core head node, node dependency relationship, and the second total number, matching the new core child nodes in the target parent node to determine the second matching result, and generating a core calculation link according to the core head node, core child nodes, new core child nodes, and the second matching result, the effect of circularly determining the core child nodes in the core calculation link is achieved, ensuring the integrity and accuracy of the core child nodes included in the core calculation link and avoiding omission of core child nodes.
[0110] Exemplarily, the following explains how to determine the process of the core computing link by way of example.
[0111] Assume that the target parent nodes determined from each target computing link include: Node A, Node B, Node C, Node D, and Node E, and the target child nodes include: Node B, Node C, Node D, Node E, and Node F.
[0112] Assume that in the target parent nodes, the number of child nodes corresponding to Node A is zero, and the first total number is the largest, then Node A is taken as the core head node. Assume that in the target child nodes, Node B, Node C, and Node D have a dependency relationship with Node A, then Node B, Node C, and Node D are taken as the auxiliary child nodes corresponding to Node A. Assume that the second total number of Node B is more than that of Node C and Node D, then Node B is taken as the core child node.
[0113] Match Node B in the target parent nodes, and it can be determined that Node B is also included in the target parent nodes, then Node B is taken as the new core head node. Assume that in the target child nodes, Node D and Node E have a dependency relationship with Node B, then Node D and Node E are taken as the new auxiliary child nodes corresponding to Node B. Assume that the second total number of Node D is more than that of Node E, then Node D is taken as the new core child node.
[0114] Match Node D in the target parent nodes, and it can be determined that Node D is also included in the target parent nodes, then Node D is taken as the new core head node again. Assume that in the target child nodes, Node E and Node F have a dependency relationship with Node D, then Node E and Node F are taken as the new auxiliary child nodes corresponding to Node D again. Assume that the second total number of Node F is more than that of Node D, then Node F is taken as the new core child node again.
[0115] Match Node F in the target parent nodes, and it can be determined that Node F is not included in the target parent nodes, then the core computing link "A - B - D - F" is generated.
[0116] S206. Determine the nodes to be optimized from the core computing link.
[0117] Figure 3A It is a flowchart of some methods for determining the nodes to be optimized disclosed in the embodiments of the present disclosure, which is a further optimization and extension of "determining the nodes to be optimized from the core computing link" in the embodiments of the present disclosure, and can be combined with the above various alternative embodiments.
[0118] As Figure 3A shown, the method for determining the nodes to be optimized disclosed in this embodiment may include:
[0119] S301. Determine the core nodes included in the core computing link, and determine the total third occurrence times of the core nodes in the target computing link.
[0120] Among them, the core nodes refer to each node included in the core computing link.
[0121] S302. Use the target computing link including the core nodes as the auxiliary computing link, and determine the node computing duration of the core nodes in the auxiliary computing link.
[0122] Exemplarily, assume that the core nodes include node A, node B, node C, and node D. Among them, the target computing link 1 includes node A, node B, and node C, and the target computing link 2 includes node C and node D. Then determine the node computing duration of node A, node B, and node C in the target computing link 1, and determine the node computing duration of node C and node D in the target computing link 2.
[0123] S303. Determine the nodes to be optimized from the core nodes according to the total third occurrence times and the node computing duration.
[0124] In one implementation, obtain the total occurrence times threshold and the computing duration threshold, compare the total third occurrence times of each core node with the total occurrence times threshold, and compare the node computing duration of each core node with the computing duration threshold. Take the core nodes whose total third occurrence times are greater than the total occurrence times threshold, and / or the node computing duration is greater than the computing duration threshold as the nodes to be optimized.
[0125] Since the total third occurrence times and the node computing duration are the representations of the contribution degree and influence of the core nodes in the core computing link, the nodes to be optimized screened based on the total third occurrence times and the node computing duration can ensure the accuracy and reliability of the screening of the nodes to be optimized, and achieve the effect of accurately positioning the problem nodes.
[0126] Optionally, S303 includes:
[0127] S3031. Determine the first screening parameter according to the ratio between the total third occurrence times and the number of links of the target computing link.
[0128] Among them, the number of links of the target computing link represents the total number of target computing links.
[0129] Exemplarily, assume that the total third occurrence times of the core node A in the target computing link is 5, and the number of links of the target computing link is 10. Then the first screening parameter corresponding to the core node A is 5 / 10.
[0130] S3032. Determine the second screening parameter according to the ratio between the node computing duration and the link computing duration of the auxiliary computing link.
[0131] Among them, the link calculation duration of the auxiliary calculation link represents the duration required for all nodes in the auxiliary calculation link to complete the data processing operation.
[0132] In one implementation, according to the node calculation duration of the core node in each auxiliary calculation link and the link calculation duration of each auxiliary calculation link, a ratio mean value is calculated, and a second screening parameter is determined according to the calculation result of the ratio mean value.
[0133] Exemplarily, assume that the auxiliary calculation links to which the core node A belongs are the target calculation link 1 and the target calculation link 2. Assume that the link calculation duration of the target calculation link 1 is 100 ms, and the link calculation duration of the target calculation link 2 is 150 ms. The node calculation duration of the core node A in the target calculation link 1 is 10 ms, and the node calculation duration in the target calculation link 2 is 30 ms. Then the second screening parameter corresponding to the core node A is (10 / 100 + 30 / 150) / 2.
[0134] S3033. Determine a third screening parameter according to the product between the first screening parameter and the second screening parameter.
[0135] In one implementation, the product between the first screening parameter and the second screening parameter of any core node is used as the third screening parameter corresponding to the core node.
[0136] S3034. Screen out the nodes to be optimized from the core nodes according to the target screening parameter; wherein, the target screening parameter is at least one of the first screening parameter, the second screening parameter, and the third screening parameter.
[0137] In one implementation, a first threshold, a second threshold, and a third threshold are obtained. The first screening parameter corresponding to each core node is compared with the first threshold, the second screening parameter is compared with the second threshold, and the third screening parameter is compared with the third threshold. If the first screening parameter corresponding to any core node is greater than the first threshold, the second screening parameter is greater than the second threshold, and / or the third screening parameter is greater than the third threshold, then the core node is used as the node to be optimized.
[0138] By determining the first screening parameter according to the ratio between the third total number and the number of links of the target calculation link, determining the second screening parameter according to the ratio between the node calculation duration and the link calculation duration of the auxiliary calculation link, determining the third screening parameter according to the product between the first screening parameter and the second screening parameter, and screening out the nodes to be optimized from the core nodes according to the target screening parameter; wherein, the target screening parameter is at least one of the first screening parameter, the second screening parameter, and the third screening parameter, the effect of screening out the nodes to be optimized from multiple parameter dimensions is achieved, and the accuracy of determining the nodes to be optimized is ensured.
[0139] Optionally, in addition to the above first screening parameter, second screening parameter, and third screening parameter, a fourth screening parameter may also be included, where the fourth screening parameter is the percentile value of the node calculation duration of each core node in the node calculation durations of all core nodes, such as the eightieth percentile, ninetieth percentile, or ninety-ninth percentile, etc.
[0140] Optionally, after determining the node to be optimized from the core nodes, it further includes:
[0141] Store the target calculation link, core calculation link, and the node to be optimized in a database, such as storing them in a MySQL database.
[0142] Among them, the stored information may also include the microservice product identifier, microservice business identifier, name of the affiliated computer room, etc. of each target calculation link.
[0143] Optionally, after determining the node to be optimized from the core nodes, it further includes:
[0144] Display the target calculation link, core calculation link, and the node to be optimized on the front-end page within a specific time period (such as at the hour level or minute level, etc.).
[0145] Among them, the display method may be in the form of a table, icon, or flame graph, etc. Specifically, it can also be distinguished and displayed according to different affiliated computer rooms, and the node calculation duration of each node can be displayed in detail, etc.
[0146] The embodiments of the present disclosure also disclose another method for determining the node to be optimized, which can be executed after determining the target calculation link corresponding to the microservice from the candidate calculation links, and includes:
[0147] 1) Use the target node with the node type of the internal microservice node as the first target node, and use the target node with the node type of the external microservice node as the second target node.
[0148] Among them, the internal microservice node refers to the node that performs calculations within the microservice system, and the external microservice node refers to the node used for distributed link requests outside the microservice system.
[0149] In one implementation, traverse and obtain the node types of the target nodes in each target calculation link, and use the target nodes with the node type of the internal microservice node in each target calculation link as the first target nodes, and use the target nodes with the node type of the external microservice node as the second target nodes.
[0150] 2) Merge the first target nodes to generate a target merged node, and generate a classification calculation link based on the target merged node and the second target nodes.
[0151] In one implementation, the first target nodes in any target computing link are merged to generate a target merged node, and the target merged node is placed at the head node position in the target computing link, and the remaining second target nodes in the target computing link keep their relative positions unchanged, so as to convert the target computing link into a classification computing link.
[0152] Figure 3B It is a schematic diagram of the generation of some classification computing links disclosed according to the embodiments of the present disclosure. As Figure 3B shown, assume that the form of any target computing link is A - B - C - D - E, where the node types of the target nodes A, C, and E are microservice internal nodes, and the node types of the target nodes B and D are microservice external nodes.
[0153] Then, the target nodes A, C, and E are merged to generate a target merged node, and the target merged node is placed at the head node position in the target computing link, and the remaining target nodes B and D keep their relative positions unchanged, so as to convert the target computing link into a classification computing link.
[0154] 3) Determine the classification nodes included in the classification computing link, and determine the occurrence frequency information of the classification nodes in the classification computing link, as well as the node dependency relationship between the classification nodes.
[0155] Among them, the classification nodes refer to the nodes included in the classification computing link.
[0156] 4) Generate a core computing link between microservices according to the classification nodes, the node dependency relationship between the classification nodes, and the occurrence frequency information of the classification nodes in the classification computing link, and determine the nodes to be optimized from the core computing link.
[0157] In one implementation, according to the node dependency relationship, determine the target parent node and the target child node from the classification nodes, determine the first occurrence frequency information corresponding to the target parent node and the second occurrence frequency information corresponding to the target child node from the frequency information, and generate a core computing link according to the target parent node, the target child node, the first occurrence frequency information, and the second occurrence frequency information.
[0158] Determine the core nodes included in the core computing link, and determine the third total occurrence times of the core nodes in the target computing link. Take the target computing link including the core nodes as an auxiliary computing link, and determine the node computing duration of the core nodes in the auxiliary computing link. According to the third total occurrence times and the node computing duration, determine the nodes to be optimized from the core nodes.
[0159] The specific implementation manners of steps 3) and 4) can refer to the relevant content descriptions in the embodiments of the present disclosure, and will not be elaborated here.
[0160] Since the target nodes with the node type of internal microservice nodes are merged, it is convenient to analyze the type of the nodes to be optimized finally obtained, whether they are internal microservice nodes or external microservice nodes, which helps to quickly locate whether the problem nodes belong to the inside or outside of the microservice system and improves the overall efficiency of the microservice optimization process.
[0161] Figure 3C It is a schematic diagram of the overall process determined according to some nodes to be optimized disclosed in the embodiments of the present disclosure. As Figure 3C shown, it includes four parts: data collection, data aggregation, data storage, and data display. Among them, the data collection part further includes determining the target calculation link, data temporary storage, and data reporting; the data aggregation part further includes primary data aggregation and secondary data aggregation. Among them, the specific implementation manners of each part can refer to the relevant descriptions in the embodiments of the present disclosure and will not be elaborated here.
[0162] Figure 4 It is a schematic diagram of the structure of a determining device for some nodes to be optimized disclosed in the embodiments of the present disclosure, which can be applicable to the situation of determining the nodes to be optimized in a microservice. The device in this embodiment can be implemented by software and / or hardware and can be integrated on any electronic device with computing capabilities.
[0163] As Figure 4 shown, the determining device 40 for the nodes to be optimized disclosed in this embodiment may include a calculation link determining module 41, an information determining module 42, and a node to be optimized determining module 43, where:
[0164] The calculation link determining module 41 is configured to determine at least one candidate calculation link included in a microservice and determine the target calculation link corresponding to the microservice from the candidate calculation links according to the link calculation duration of the candidate calculation links;
[0165] The information determining module 42 is configured to determine the target nodes included in the target calculation link, determine the occurrence times information of the target nodes in the target calculation link, and the node dependency relationship between the target nodes;
[0166] The node to be optimized determining module 43 is configured to generate a core calculation link between microservices according to the target nodes, the node dependency relationship, and the times information, and determine the nodes to be optimized from the core calculation link.
[0167] Optionally, the node to be optimized determining module 43 is specifically configured to:
[0168] Determine the target parent nodes and target child nodes from the target nodes according to the node dependency relationship;
[0169] Determine the first frequency information corresponding to the target parent node and the second frequency information corresponding to the target child node from the frequency information;
[0170] Generate a core calculation link according to the target parent node, the target child node, the first frequency information, and the second frequency information.
[0171] Optionally, the first frequency information includes the first total frequency of the target parent node appearing in the target calculation link and the child node frequency of the target parent node appearing as a child node in the target calculation link; the second frequency information includes the second total frequency of the target child node appearing in the target calculation link.
[0172] Optionally, the node to be optimized determination module 43 is specifically further configured to:
[0173] Determine a core head node from the target parent nodes according to the first total frequency and the child node frequency;
[0174] Determine a core child node from the target child nodes according to the core head node, the node dependency relationship, and the second total frequency;
[0175] Match the core child node in the target parent node to determine a first matching result, and generate a core calculation link according to the core head node, the core child node, and the first matching result.
[0176] Optionally, the node to be optimized determination module 43 is specifically further configured to:
[0177] Use the target parent node with zero child node frequency and the most first total frequency as the core head node.
[0178] Optionally, the node to be optimized determination module 43 is specifically further configured to:
[0179] Determine the auxiliary child nodes corresponding to the core head node from the target child nodes according to the node dependency relationship;
[0180] Use the auxiliary child node with the most second total frequency as the core child node.
[0181] Optionally, the node to be optimized determination module 43 is specifically further configured to:
[0182] In the case where any target parent node does not match the core child node, generate a core calculation link according to the core head node and the core child node.
[0183] Optionally, the node to be optimized determination module 43 is specifically further configured to:
[0184] In the case where any target parent node matches the core child node, use the target parent node as the new core head node;
[0185] Determine new core child nodes from the target child nodes according to the new core head node, node dependencies, and the second total count;
[0186] Match the new core child nodes in the target parent node to determine the second matching result, and generate a core calculation link according to the core head node, core child nodes, new core child nodes, and the second matching result.
[0187] Optionally, the node to be optimized determination module 43 is further specifically configured to:
[0188] Determine the core nodes included in the core calculation link, and determine the third total count of the core nodes appearing in the target calculation link;
[0189] Use the target calculation link including the core nodes as an auxiliary calculation link, and determine the node calculation duration of the core nodes in the auxiliary calculation link;
[0190] Determine the nodes to be optimized from the core nodes according to the third total count and the node calculation duration.
[0191] Optionally, the node to be optimized determination module 43 is further specifically configured to:
[0192] Determine the first screening parameter according to the ratio between the third total count and the number of links of the target calculation link;
[0193] Determine the second screening parameter according to the ratio between the node calculation duration and the link calculation duration of the auxiliary calculation link;
[0194] Determine the third screening parameter according to the product of the first screening parameter and the second screening parameter;
[0195] Screen and obtain the nodes to be optimized from the core nodes according to the target screening parameter; wherein, the target screening parameter is at least one of the first screening parameter, the second screening parameter, and the third screening parameter.
[0196] Optionally, the device further includes a node classification module, which is specifically configured to:
[0197] Use the target nodes with the node type of microservice internal nodes as the first target nodes, and use the target nodes with the node type of microservice external nodes as the second target nodes;
[0198] Merge the first target nodes to generate target merged nodes, and generate a classification calculation link according to the target merged nodes and the second target nodes;
[0199] Determine the classification nodes included in the classification calculation link, and determine the occurrence information of the classification nodes in the classification calculation link, as well as the node dependencies between the classification nodes;
[0200] Generate a core computing link between microservices based on classification nodes, the node dependencies between classification nodes, and the information on the number of times classification nodes appear in the classification calculation link, and determine the nodes to be optimized from the core computing link.
[0201] The determining device 40 for the nodes to be optimized disclosed in the embodiments of the present disclosure can execute the method for determining the nodes to be optimized disclosed in the embodiments of the present disclosure, and has functional modules and beneficial effects corresponding to the execution of the method. The content not described in detail in this embodiment can be referred to the description in the method embodiments of the present disclosure.
[0202] In the technical solution of the present disclosure, the acquisition, storage, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0203] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0204] Figure 5 The schematic block diagram of an example electronic device 500 that can be used to implement the 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 can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0205] As Figure 5 shown, the device 500 includes a computing unit 501, which can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 502 or the computer program loaded from the storage unit 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0206] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as a keyboard, mouse, etc.; output unit 507, such as various types of displays, speakers, etc.; storage unit 508, such as a disk, optical disc, etc.; and communication unit 509, such as a network card, modem, wireless communication transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0207] Computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of computing unit 501 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated 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. Computing unit 501 executes the various methods and processes described above, such as the method for determining nodes to be optimized. For example, in some embodiments, the method for determining nodes to be optimized can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the method for determining nodes to be optimized described above can be executed. Alternatively, in other embodiments, computing unit 501 can be configured to execute the method for determining nodes to be optimized by any other suitable means (e.g., by means of firmware).
[0208] 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 can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0209] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0210] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection 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 include, 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 a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0211] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, voice input, or tactile input).
[0212] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0213] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, can also be a server of a distributed system, or a server incorporating a blockchain.
[0214] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this is not limited herein.
[0215] The above specific embodiments do not constitute a limitation on the protection scope 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 shall be included within the protection scope of this disclosure.
Claims
1. A method for determining a node to be optimized, comprising: Determine the candidate computing links included in at least one microservice, and determine the target computing link corresponding to the microservice from the candidate computing links according to the link computing duration of the candidate computing links; Determine the target nodes included in the target computing link, and determine the occurrence frequency information of the target nodes in the target computing link, as well as the node dependency relationship between the target nodes; Generate the core computing link between the microservices according to the target nodes, the node dependency relationship, and the frequency information, and determine the nodes to be optimized from the core computing link; Among them, the generating the core computing link between the microservices according to the target nodes, the node dependency relationship, and the frequency information includes: Determine the target parent node and the target child node from the target nodes according to the node dependency relationship; Determine the first frequency information corresponding to the target parent node and the second frequency information corresponding to the target child node from the frequency information; Generate the core computing link according to the target parent node, the target child node, the first frequency information, and the second frequency information.
2. The method according to claim 1, wherein, The first frequency information includes the first total frequency of the target parent node appearing in the target computing link and the child node frequency of the target parent node appearing as a child node in the target computing link; The second frequency information includes the second total frequency of the target child node appearing in the target computing link.
3. The method according to claim 2, wherein, The generating the core computing link according to the target parent node, the target child node, the first frequency information, and the second frequency information includes: Determine the core head node from the target parent nodes according to the first total frequency and the child node frequency; Determine the core child node from the target child nodes according to the core head node, the node dependency relationship, and the second total frequency; Match the core child node in the target parent node to determine the first matching result, and generate the core computing link according to the core head node, the core child node, and the first matching result.
4. The method according to claim 3, wherein, The determining the core head node from the target parent nodes according to the first total frequency and the child node frequency includes: Take the target parent node with zero child node frequency and the most first total frequency as the core head node.
5. The method according to claim 3, wherein, The determining the core child node from the target child nodes according to the core head node, the node dependency relationship, and the second total frequency includes: Determine the auxiliary child node corresponding to the core head node from the target child nodes according to the node dependency relationship; Take the auxiliary child node with the most second total frequency as the core child node.
6. The method according to claim 3, wherein, The generating the core computing link according to the core head node, the core child node, and the first matching result includes: In the case where any of the target parent nodes does not match the core child node, generate the core computing link according to the core head node and the core child node.
7. The method according to claim 3, wherein, Generating a core calculation link according to the core head node, the core child node, and the first matching result includes: When any of the target parent nodes matches the core child node, using the target parent node as a new core head node; Determining a new core child node from the target child nodes according to the new core head node, the node dependency relationship, and the second total number; Matching the new core child node in the target parent node to determine a second matching result, and generating the core calculation link according to the core head node, the core child node, the new core child node, and the second matching result.
8. The method according to claim 1, wherein, Determining a node to be optimized from the core calculation link includes: Determining the core nodes included in the core calculation link and determining the third total number of times the core nodes appear in the target calculation link; Using the target calculation link including the core nodes as an auxiliary calculation link and determining the node calculation duration of the core nodes in the auxiliary calculation link; Determining the node to be optimized from the core nodes according to the third total number and the node calculation duration.
9. The method according to claim 8, wherein, Determining the node to be optimized from the core nodes according to the third total number and the node calculation duration includes: Determining a first screening parameter according to the ratio between the third total number and the number of links in the target calculation link; Determining a second screening parameter according to the ratio between the node calculation duration and the link calculation duration of the auxiliary calculation link; Determining a third screening parameter according to the product of the first screening parameter and the second screening parameter; Screening the node to be optimized from the core nodes according to a target screening parameter; where the target screening parameter is at least one of the first screening parameter, the second screening parameter, and the third screening parameter.
10. After determining the target computing link corresponding to the microservice from the candidate computing links according to the method described in claim 1, the method further includes: Taking the target node with the node type of the internal node of the microservice as the first target node, and taking the target node with the node type of the external node of the microservice as the second target node; Merging the first target nodes to generate a target merged node, and generating a classification calculation link according to the target merged node and the second target node; Determining the classification nodes included in the classification calculation link, and determining the number information of the times the classification nodes appear in the classification calculation link, and the node dependency relationship between the classification nodes; Generating the core calculation link between the microservices according to the classification nodes, the node dependency relationship between the classification nodes, and the number information of the times the classification nodes appear in the classification calculation link, and determining the node to be optimized from the core calculation link.
11. An apparatus for determining a node to be optimized, comprising: A calculation link determination module, configured to determine candidate calculation links included in at least one microservice, and determine the target calculation link corresponding to the microservice from the candidate calculation links according to the link calculation duration of the candidate calculation links; An information determination module, configured to determine target nodes included in the target computing link, and determine the number information of the occurrences of the target nodes in the target computing link, as well as the node dependency relationships between the target nodes; An optimization node determination module, configured to generate a core computing link between the microservices according to the target nodes, the node dependency relationships, and the number information, and determine optimization nodes from the core computing link; Wherein, the optimization node determination module is specifically configured to: Determine a target parent node and a target child node from the target nodes according to the node dependency relationships; Determine first number information corresponding to the target parent node and second number information corresponding to the target child node from the number information; Generate the core computing link according to the target parent node, the target child node, the first number information, and the second number information.
12. According to the apparatus described in claim 11, wherein The first number information includes the first total number of occurrences of the target parent node in the target computing link, and the number of child nodes when the target parent node appears as a child node in the target computing link; The second number information includes the second total number of occurrences of the target child node in the target computing link.
13. According to the apparatus described in claim 12, wherein The optimization node determination module is specifically further configured to: Determine a core head node from the target parent nodes according to the first total number and the number of child nodes; Determine a core child node from the target child nodes according to the core head node, the node dependency relationships, and the second total number; Match the core child node among the target parent nodes to determine a first matching result, and generate the core computing link according to the core head node, the core child node, and the first matching result.
14. According to the apparatus described in claim 13, wherein The optimization node determination module is specifically further configured to: Use the target parent node with zero number of child nodes and the most first total number as the core head node.
15. According to the apparatus described in claim 13, wherein The optimization node determination module is specifically further configured to: Determine an auxiliary child node corresponding to the core head node from the target child nodes according to the node dependency relationships; Use the auxiliary child node with the most second total number as the core child node.
16. According to the apparatus described in claim 13, wherein The optimization node determination module is specifically further configured to: In the case where any of the target parent nodes does not match the core child node, generate the core computing link according to the core head node and the core child node.
17. According to the apparatus described in claim 13, wherein The optimization node determination module is specifically further configured to: In the case where any of the target parent nodes matches the core child node, use this target parent node as a new core head node; Determine a new core child node from the target child nodes according to the new core head node, the node dependency relationships, and the second total number; Match the new core child node among the target parent nodes to determine a second matching result, and generate the core computing link according to the core head node, the core child node, the new core child node, and the second matching result.
18. According to the apparatus described in claim 11, wherein The optimization node determination module is specifically further configured to: Determine the core nodes included in the core computing link, and determine the third total number of times the core nodes appear in the target computing link; Use the target computing link including the core nodes as the auxiliary computing link, and determine the node computing duration of the core nodes in the auxiliary computing link; Determine the nodes to be optimized from the core nodes according to the third total number and the node computing duration; 19. The apparatus according to claim 18, wherein, The module for determining the nodes to be optimized is specifically further configured to: Determine a first screening parameter according to the ratio between the third total number and the number of links of the target computing link; Determine a second screening parameter according to the ratio between the node computing duration and the link computing duration of the auxiliary computing link; Determine a third screening parameter according to the product between the first screening parameter and the second screening parameter; Screen the nodes to be optimized from the core nodes according to the target screening parameter; wherein, the target screening parameter is at least one of the first screening parameter, the second screening parameter, and the third screening parameter.
20. The apparatus according to claim 11, further comprising a node classification module, specifically configured to: Take the target node with the node type of the internal node of the microservice as the first target node, and take the target node with the node type of the external node of the microservice as the second target node; Merge the first target nodes to generate a target merged node, and generate a classification computing link according to the target merged node and the second target node; Determine the classification nodes included in the classification computing link, and determine the occurrence information of the classification nodes in the classification computing link, as well as the node dependency relationship between the classification nodes; Generate the core computing link between the microservices according to the classification nodes, the node dependency relationship between the classification nodes, and the occurrence information of the classification nodes in the classification computing link, and determine the nodes to be optimized from the core computing link.
21. An electronic device, 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
23. A computer program product, comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.
Citation Information
Patent Citations
Method and equipment for determining key node
CN106506188A