A software architecture optimization method and device

By building a dynamic call relationship network during the runtime of distributed architecture and generating reference information for architecture optimization, the problem of low optimization efficiency and relying on personal experience in software architecture optimization is solved, and efficient and objective software architecture optimization is achieved.

CN114840187BActive Publication Date: 2025-05-16THOUGHTWORKS SOFTWARE TECH (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210563513.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-05-16
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

In the optimization of software architecture, the existing technology has problems such as low optimization efficiency, slow speed and strong dependence on personal subjective experience.

Method used

By obtaining the call chain tracking data of the runtime of distributed architecture, a dynamic call relationship network of service components is built at runtime, and reference information for architecture optimization is generated, and the software architecture is optimized based on this.

Benefits of technology

It realizes high efficiency, fast speed, more objective and reliable software architecture optimization, and reduces dependence on individual subjective experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840187B_ABST
    Figure CN114840187B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for optimizing software architecture. Starting from the entire process from software architecture development to operation, the call chain tracing data of the distributed architecture during operation is obtained, and the dynamic call relationship network of the service component during operation is constructed based on the call chain tracing data. The dynamic call relationship network of the component is used as the basis for software architecture optimization and generated as reference information, and the software architecture is optimized with the reference information. The method will not be affected by non-technical factors such as personnel changes and experience, making the governance of the architecture more objective and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a software architecture optimization method and device. Background Art

[0002] With the continuous development of Internet technology, the traditional monolithic application architecture model can no longer meet the explosive growth of network access traffic. The distributed microservice architecture with higher throughput solves the problems of low throughput and large single applications in the monolithic application architecture.

[0003] In order to ensure that the software system can maintain continuous and stable operation and update capabilities as the complexity of the software architecture continues to increase, there is an urgent need for optimization methods that can adjust the software architecture more quickly and objectively. Summary of the invention

[0004] In order to solve the problems of low optimization efficiency, slow speed and strong reliance on personal subjective experience in the prior art, the present invention provides a software architecture optimization method and device, which has the characteristics of high optimization efficiency, more objective and reliable, etc.

[0005] A software architecture optimization method provided according to a specific embodiment of the present invention includes:

[0006] Get call chain tracing data when the distributed architecture is running;

[0007] Constructing a dynamic call relationship network of the service component at runtime based on the call chain tracking data;

[0008] Generate reference information for architecture optimization, the reference information is the basis for software architecture optimization, and the reference information at least includes: the dynamic call relationship network.

[0009] Furthermore, the constructing of a dynamic call relationship network of the service component at runtime based on the call chain tracking data includes:

[0010] Determine the type of trace tag in the call chain trace data;

[0011] Determine the caller and the callee of the call relationship based on the type of the tracking tag;

[0012] The caller and the callee are taken as nodes, the tracking tags are taken as association relationships, and the identifiers of the corresponding call chain tracking data are taken as attributes of the association relationships to form a call relationship graph.

[0013] Furthermore, the constructing of a dynamic call relationship network of the service component at runtime based on the call chain tracking data further includes:

[0014] Aggregate the call chains involved in implementing the microservice function. If the identifiers of the tracking data of two call chains are different, but they both have the same microservice participating nodes and the calling order of the participating nodes is the same, then merge the two call chains into one path.

[0015] Furthermore, the aggregating of the call chains involved in implementing the microservice function includes:

[0016] A call relationship element is extracted from each call in the call chain, and a call sequence model is constructed based on the call relationship element. The call relationship element includes a call sequence number, a caller, and a callee.

[0017] Furthermore, the reference information also includes: a team division of labor structure, and the construction process of the team division of labor structure includes:

[0018] Build the first bipartite network based on the code commit records of the code repository;

[0019] The first bipartite network is single-mode mapped toward the developer direction to obtain a team division of labor structure that represents the collaborative relationship between the developers.

[0020] Furthermore, the reference information also includes: a service linkage modification relationship network, and the construction process of the service linkage modification relationship network includes:

[0021] The first bipartite network is single-mode mapped toward the code base to obtain a service linkage modification relationship network representing the modification relationship between services.

[0022] Furthermore, the reference information also includes: a communication structure, and the construction process of the communication structure includes:

[0023] Building a second bipartite network between the developers and the communication mode corresponding to the communication information based on the communication information between the developers;

[0024] The second bipartite network is single-mode mapped toward the developer to obtain a communication structure for characterizing the closeness of communication between the developers.

[0025] Furthermore, the first bipartite network is single-mode mapped toward the developer direction to obtain a team division structure representing the collaborative relationship between the developers, including:

[0026] If the first bipartite network is a connected graph, single-mode mapping is performed on the obtained connected graph in the direction of the developer to obtain a single-mode mapping graph of the connected graph;

[0027] If the first bipartite network is a non-connected graph, all subgraphs of the non-connected graph are obtained, and a single-mode mapping in the developer direction is performed on each subgraph;

[0028] Merging the single-mode mapping graphs generated by the non-connected subgraphs to obtain the single-mode mapping graph of the non-connected graph;

[0029] The single-mode mapping graph of the connected graph and the single-mode mapping graph of the non-connected graph are clustered based on a preset community discovery algorithm to obtain the team division of labor structure.

[0030] Furthermore, the single-mode mapping of the second bipartite network toward the developer to obtain a communication structure for characterizing the closeness of communication between the developers includes:

[0031] If the second bipartite network is a connected graph, the connected graph is single-mode mapped in the direction of the developer to obtain the communication structure;

[0032] If the second bipartite network is a non-connected graph, a single-mode mapping is performed on a subgraph of the non-connected graph in a direction of developers;

[0033] The unimodal mapping graphs of the subgraphs of the non-connected graph are merged, and the merged unimodal mapping graphs are clustered based on a preset community discovery algorithm to obtain the communication structure.

[0034] A software architecture optimization device provided according to a specific embodiment of the present invention includes:

[0035] The data acquisition module is used to obtain the call chain tracing data when the distributed architecture is running;

[0036] A dynamic call relationship network module, used to construct a dynamic call relationship network of the service component at runtime based on the call chain tracking data; and

[0037] The reference information generation module is used to generate reference information for architecture optimization, wherein the reference information is the basis for software architecture optimization, and the reference information at least includes: the dynamic call relationship network.

[0038] The software architecture optimization method provided by the present invention starts from the entire process from software architecture development to operation, obtains the call chain tracing data of the distributed architecture during operation, and constructs the dynamic call relationship network of the service component during operation based on the call chain tracing data. The dynamic call relationship network of the component is used as the basis for software architecture optimization and generated as reference information, and the software architecture is optimized with the reference information. The method will not be affected by non-technical factors such as personnel changes and experience, making the governance of the architecture more objective and reliable. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 is a flowchart of a software architecture optimization method provided according to an exemplary embodiment;

[0041] Figure 2 is a flow chart for constructing a dynamic call relationship network diagram according to an exemplary embodiment;

[0042] Figure 3 is a flowchart for constructing a team division of labor structure according to an exemplary embodiment;

[0043] Figure 4 is a flow chart for constructing a communication structure between target code submitters provided according to an exemplary embodiment;

[0044] Figure 5 It is a structural diagram of a software architecture optimization device provided according to an exemplary embodiment. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Reference Figure 1 As shown, an embodiment of the present invention provides a software architecture optimization method, which may include the following steps:

[0047] 101. Obtain call chain tracing data when the distributed architecture is running.

[0048] The dynamic call relationship network diagram of the software architecture is a distributed component relationship diagram formed from the logs and call chain tracing data of the software system during runtime. For distributed architecture, the running data is the distributed call chain tracing data, among which the output of the Jaeger tool is the most common, and its data format complies with the OpenTracing protocol.

[0049] 102. Build a dynamic call relationship network of service components at runtime based on call chain tracking data.

[0050] According to the information recorded in each span (tracing tag) of the call chain tracing data, the tag type can be determined, such as DB query, HTTP call, asynchronous call, RPC call, etc. Then, according to different tag types, the caller and the callee of the call relationship are determined. Finally, the caller and the callee are used as nodes, the corresponding tags as associations, and the corresponding traceid (tracing identifier) ​​as attributes on the relationship, mapped into a dynamic call relationship network diagram.

[0051] 103. Generate reference information for architecture optimization. The reference information is the basis for software architecture optimization. The reference information at least includes: a dynamic call relationship network.

[0052] With the reference information obtained as a reference, the architectural characteristics of the software architecture represented by the characteristics of the graph structure can be used to manage the software architecture more objectively and scientifically. Starting from the entire process of software architecture from development to operation, the call chain tracing data of the distributed architecture runtime is obtained, and the dynamic call relationship network of the service component at runtime is constructed based on the call chain tracing data. The dynamic call relationship network of the component is used as the basis for software architecture optimization and generated as reference information, and the software architecture is optimized based on the reference information. This method will not be affected by non-technical factors such as personnel changes and experience, making the governance of the architecture more objective and reliable.

[0053] The software architecture optimization method provided by the present invention solves the problems of traditional architecture's strong reliance on personal ability and lack of unified architectural design principles and methods by performing graph theory modeling, analysis and visualization on the code structure and the data generated during the research and development process. It also makes a more objective and scientific judgment on the excellent indicators of the architecture, and makes the optimization of the software architecture more reasonable and accurate.

[0054] As a feasible implementation method of the above embodiment, refer to Figure 2 As shown, constructing a dynamic call relationship network diagram of a service component at runtime based on the call chain tracking data of each service component in the log information may include the following steps:

[0055] 201. Determine the type of the tracing tag in the call chain tracing data.

[0056] 202. Determine a caller and a callee of a call relationship based on the type of the tracking tag.

[0057] 203. The caller and the callee are taken as nodes, the tracking tags are taken as association relationships, and the identifiers of the corresponding call chain tracking data are taken as attributes of the association relationships to form a call relationship graph.

[0058] Specifically, the dynamic call relationship network diagram of the software architecture is a distributed component relationship diagram formed from the logs and call chain tracing data of the software system during runtime. For distributed architecture, the running data is the distributed call chain tracing data, among which the output of the jaeger tool is the most common, and its data format conforms to the opentracing protocol. First, according to the information recorded in each span (tracing tag) of the call chain tracing data, the type of tag is determined, such as DB query, HTTP call, asynchronous call, RPC call, etc. Then, according to different tag types, the caller and the callee of the call relationship are determined. Finally, the caller and the callee are used as nodes, the corresponding tags as associations, and the corresponding traceid (tracing identifier) ​​as attributes on the relationship, and mapped into a dynamic call relationship network diagram.

[0059] The properties of the nodes in the network diagram are supplemented based on the relevant information of the tag, such as the core fields, number of instances, and instance IP in the log. The references between the call relationships are constructed through the reference information carried on each tag. For example, if SpanB carries the reference information of ChildOf: SpanA, the relationship of SpanB.upStream: SpanA is constructed, and the topological structure is mapped into the topological structure of the association relationship.

[0060] The call relationships between nodes are aggregated to obtain the call chain. For any two requests with different tracking identifiers, if they have exactly the same microservice participating nodes and exactly the same call sequence between microservices, the two call relationships are considered to belong to the same call chain.

[0061] Specifically, for each call in the system, only the core call sequence number, caller, and callee are retained to build a call sequence model. The call sequence model can be described as:

[0062] <Calling order>: (caller), (callee);

[0063] Create a model pool to store all the calling sequence models. The model pool is a hash key-value dictionary. The model string is the key and the model specific information is the value. The string is used for matching search. If the corresponding model does not exist in the model pool, a new model key-value pair is added to the model pool, otherwise the model is merged.

[0064] If the call sequence models constructed by any two call links are exactly the same, they are considered to belong to the same call aggregation and are merged in sequence: merge the call links, increase the number of calls of the call links as weights, and add the tracking identifier of the original data as a reference. Until all the calls are processed. Then, the starting point is the caller and the end point is the callee. The thickness of the connecting line between the caller and the callee represents the number of calls (the thicker the line, the more calls), and the connection is made to obtain a dynamic call relationship network diagram. Then the architecture can be optimized based on the indicators of the diagram, where:

[0065] Degree: The most important parameter describing a node in a network. The higher the node degree, the more important its position in the architecture. For service nodes of different degrees, combined with other local indicators, all distributed services appearing in the network are graded, and different operation and maintenance strategies and architecture governance plans are formulated. The degree of the service can also be reduced by reasonably splitting the nodes, thereby eliminating architecture bottlenecks.

[0066] Degree distribution: Degree distribution can be used to define the characteristics of a network. Degree distribution characterizes the connectivity, reuse and complexity of nodes in the network, and can also be used to measure the uneven structure of the system.

[0067] Modularity: Evaluates the degree of structure of the clustering algorithm.

[0068] Number of edges: A summary of the number of edges in the graph network.

[0069] Average path length: The effective size of a graph network. It is used to evaluate the design and optimization of system message transmission, the evaluation and control of inter-object communication costs, and the improvement of system responsiveness. For networks with very long average path lengths, it means that the call depth is too deep in the distributed architecture. Too long links may lead to long response times, and each node on the link may become a factor affecting the stability of the architecture. The network structure can be adjusted with the goal of reducing the path length.

[0070] Centrality: reflects the relative importance of each node in the network.

[0071] Betweenness: The importance of being "passed". Betweenness can analyze the impact of any component and the relationship between components on the entire system when they are deleted or fail, provide a quantitative basis for judging the single-point bottleneck of the system, and guide improvement. For a network with extremely large differences in node load distribution, the bottleneck that restricts its stability is the maximum betweenness of the node.

[0072] For service nodes with large betweenness, the betweenness values ​​of core nodes can be reduced by splitting services and transferring responsibilities, thus achieving global optimization.

[0073] Clustering coefficient: How "tight" the network is. It reflects the cohesion of different components in the system and the tendency of the system to be organized in layers (hierarchy).

[0074] Degree correlation: In actual graph networks, the degree of a node is correlated with the degree of its adjacent nodes. This is used to determine whether the network structure is homogeneous or heterogeneous.

[0075] Connectivity: It is used to evaluate the connectivity of a network. The greater the connectivity, the better the connectivity.

[0076] The above indicators can be used to accurately measure the dynamic structural performance of the software architecture, divide business boundaries, and perform structural comparison of multiple graphs for subsequent architecture governance.

[0077] In some specific embodiments of the present invention, the reference information further includes: a team division of labor structure, and the process of constructing the team division of labor structure may include:

[0078] Build the first bipartite network based on the code commit records of the code repository. Then

[0079] The first bipartite network is single-mode mapped toward the developer direction to obtain a team division of labor structure that represents the collaborative relationship between developers.

[0080] The reference information also includes: service linkage modification relationship network, and the construction process of the service linkage modification relationship network includes:

[0081] The first bipartite network is single-mode mapped toward the code base to obtain a service linkage modification relationship network representing the modification relationship between services.

[0082] Reference Figure 3 As shown, the process of performing single-mode mapping of the first bipartite network toward the developer direction to obtain a team division structure representing the collaborative relationship between the developers may include the following steps:

[0083] 301. If the first bipartite network is a connected graph, single-mode mapping is performed on the obtained connected graph in the direction of the developer to obtain a single-mode mapping graph of the connected graph.

[0084] 302. If the first bipartite network is a non-connected graph, all subgraphs of the non-connected graph are obtained, and single-mode mapping in the developer direction is performed on each subgraph.

[0085] 303. Merge the single-mode mapping graphs generated by the non-connected subgraphs to obtain a single-mode mapping graph of the non-connected graph.

[0086] 304. Based on a preset community discovery algorithm, the single-mode mapping graph of the connected graph and the single-mode mapping graph of the non-connected graph are clustered to obtain a team division of labor structure.

[0087] Specifically, after obtaining the code submission record csv file, split the data according to the configured iteration cycle, prepare an array for each iteration for storage, process the data within the end cycle of the code submission date less than the configuration, calculate the position of the data in the iteration, and then extract the submission destination code base information and developer name information, create nodes representing developers and code base nodes in the corresponding positions of the array, and the submission relationship between the two nodes. Perform binary network judgment and connected graph judgment on the graph array, obtain all subgraphs of the non-connected graph, traverse all subgraphs, and perform single-mode mapping on each subgraph. Merge the single-mode mapping graphs generated by non-connected subgraphs. Finally, merge all single-mode mapping graphs in the graph array, and apply the Louvain algorithm to form clustering results for developers and code bases respectively. Calculate the degree, average degree, and cumulative degree distribution of the two graphs of developers and code bases.

[0088] The graph formed in the direction of the projected developer is an undirected graph. The relationship between the nodes representing the developers has no directional meaning, so the entire graph is an undirected graph. The modularity-based community discovery algorithm in graph theory is used for this undirected graph. The advantage of this algorithm is that it can realize the division of communities of different granularities in a large-scale network in a short time without specifying the number of communities. Returns the maximum modularity value within the computing power range. The modularity value range is between [-0.5, 1]. The modularity value is between 0.3-0.7, which means that the team structure has good cohesion and clear division of labor.

[0089] Based on the undirected graph of the developer relationship, the basic eigenvalues ​​of the graph can be calculated. The main focus is on degree and degree distribution. The larger the degree of a developer, the more important the position of the person in the team is. Important mainly means two possibilities. The first is that the person is responsible for the core content and is the most capable person in the team. The second is that the work content of the person is scattered and unfocused, and most of the tasks are miscellaneous. In this case, it usually occurs together with the low modularity value of the community discovery algorithm. It can be used to help team managers redefine the team structure and adjust the division of labor.

[0090] Reference information may also include: communication structure. The process of building the communication structure includes:

[0091] Based on the communication information between developers, a second bipartite network is constructed between the communication methods corresponding to the communication information and the developers.

[0092] The second bipartite network is single-mode mapped toward the developer direction to obtain a communication structure that is used to characterize the degree of communication between developers.

[0093] Reference Figure 4As shown, in some specific embodiments of the present invention, the second bipartite network is single-mode mapped toward the developer direction to obtain a communication structure for characterizing the closeness of communication between developers, which may include the following steps:

[0094] 401. If the second bipartite network is a connected graph, single-mode mapping is performed on the developers to obtain a communication structure.

[0095] 402. If the second bipartite network is a non-connected graph, single-mode mapping is performed on the developers in the subgraph of the non-connected graph.

[0096] 403. The single-mode mapping graphs of the subgraphs of the non-connected graph are merged, and the merged single-mode mapping graphs are clustered based on a preset community discovery algorithm to obtain a communication structure.

[0097] Specifically, taking the meeting attended by developers as an example, the number of records in the csv data containing the meeting information is extracted, and the current meeting topic, date and participants are extracted from it. The participants are used as an array, and nodes are created with the meeting topic and date as the name. The array of participants is traversed to create participant nodes, and the relationship between nodes is determined according to the meeting topic. If the obtained graph is a bipartite network graph and a connected graph, all subgraphs of the non-connected graph are obtained, and all subgraphs are traversed to perform single-mode mapping of the participants on each subgraph. The non-connected subgraphs are merged to generate a single-mode mapping graph, and the Louvain algorithm is applied for clustering to obtain the division of the communication structure.

[0098] The architectural characteristics of the software architecture represented by the characteristics of the four graph structures can make the software architecture more objective and scientific. In the specific implementation, according to Conway's law and Conway's inverse law, if there are inconsistencies in the team structure, communication structure and boundaries of the software dynamic architecture of the software system, more invalid communication and information transmission errors will occur. Therefore, the software can be optimized by the similarity of the four topological structures. Referring to the basic theory of graph isomorphism, the number of nodes in the four topological structures, the degree of node entry and exit, etc. can be compared to make judgments based on the size of the similarity. For example, by judging whether the number of clustered topological structures is consistent; whether the clustering of team structure and the clustering of communication structure, and whether the clustering of team structure and the clustering of communication structure contain the same nodes representing the submitter; the clustering of team structure and the clustering of software architecture, and whether there is a corresponding relationship between the clustering of team structure and the clustering of software architecture. For example, the team structure is divided into three clusters A, B, and C, and the static architecture of the software architecture is also divided into three clusters D, E, and F. If the code base that A is responsible for happens to appear in D, then the authority and responsibility relationship is satisfied. When the three clusters correspond to each other, the structural similarity is high, which means that the software architecture is more reasonable.

[0099] Based on the same design idea Figure 5 As shown, an embodiment of the present invention further provides a software architecture optimization device, which can execute each step of the software architecture optimization method described in the above embodiment, and the device may include:

[0100] The data acquisition module 501 is used to acquire the call chain tracing data when the distributed architecture is running;

[0101] A dynamic call relationship network module 502, used to construct a dynamic call relationship network of the service component at runtime based on the call chain tracking data; and

[0102] The reference information generation module 503 is used to generate reference information for architecture optimization. The reference information is the basis for software architecture optimization. The reference information at least includes: the dynamic call relationship network.

[0103] When the software architecture optimization device is running, it has the same beneficial effects as the above-mentioned software optimization method. Its specific implementation method can refer to the software optimization method described in the above embodiment, and the present invention will not repeat it here.

[0104] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, each step of the software architecture optimization method described in the above embodiment is implemented.

[0105] For the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0106] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0107] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted according to actual needs, and the technical features recorded in the embodiments may be replaced or combined.

[0108] The modules and sub-modules in the devices and terminals of the various embodiments of the present invention may be combined, divided, or deleted according to actual needs.

[0109] In the several embodiments provided by the present invention, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, such as multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0110] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0111] In addition, each functional module or submodule in each embodiment of the present invention may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0113] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0115] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A software architecture optimization method, characterized in that: include: Get call chain tracing data when the distributed architecture is running; Constructing a dynamic call relationship network of the service component at runtime based on the call chain tracking data; Generate reference information for architecture optimization, the reference information is the basis for software architecture optimization, and the software architecture is optimized based on the reference information. The reference information at least includes: the dynamic call relationship network and the team division structure. The construction process of the team division structure includes: Build the first bipartite network based on the code commit records of the code repository; The first bipartite network is single-mode mapped toward the developer direction to obtain a team division of labor structure that represents the collaborative relationship between the developers.

2. The method according to claim 1, characterized in that The step of constructing a dynamic call relationship network of the service component at runtime based on the call chain tracking data includes: Determine the type of trace tag in the call chain trace data; Determine the caller and the callee of the call relationship based on the type of the tracking tag; The caller and the callee are taken as nodes, the tracking tags are taken as association relationships, and the identifiers of the corresponding call chain tracking data are taken as attributes of the association relationships to form a call relationship graph.

3. The method according to claim 2, characterized in that The step of constructing a dynamic call relationship network of the service component at runtime based on the call chain tracking data further includes: Aggregate the call chains involved in implementing the microservice function. If the identifiers of the tracking data of two call chains are different, but they both have the same microservice participating nodes and the calling order of the participating nodes is the same, then merge the two call chains into one path.

4. The method according to claim 3, characterized in that The aggregating of the call chains involved in implementing the microservice functions includes: A call relationship element is extracted from each call in the call chain, and a call sequence model is constructed based on the call relationship element. The call relationship element includes a call sequence number, a caller, and a callee.

5. The method according to claim 1, characterized in that The reference information also includes: a service linkage modification relationship network, and the construction process of the service linkage modification relationship network includes: The first bipartite network is single-mode mapped toward the code base to obtain a service linkage modification relationship network representing the modification relationship between services.

6. The method according to claim 1, characterized in that The reference information also includes: a communication structure, and the construction process of the communication structure includes: Building a second bipartite network between the developers and the communication mode corresponding to the communication information based on the communication information between the developers; The second bipartite network is single-mode mapped toward the developer to obtain a communication structure for characterizing the closeness of communication between the developers.

7. The method according to claim 1, characterized in that The single-mode mapping of the first bipartite network to the developer direction to obtain a team division structure representing the collaborative relationship between the developers includes: If the first bipartite network is a connected graph, single-mode mapping is performed on the obtained connected graph in the direction of the developer to obtain a single-mode mapping graph of the connected graph; If the first bipartite network is a non-connected graph, all subgraphs of the non-connected graph are obtained, and a single-mode mapping in the developer direction is performed on each subgraph; Merging the single-mode mapping graphs generated by the non-connected subgraphs to obtain the single-mode mapping graph of the non-connected graph; The single-mode mapping graph of the connected graph and the single-mode mapping graph of the non-connected graph are clustered based on a preset community discovery algorithm to obtain the team division of labor structure.

8. The method according to claim 6, characterized in that The single-mode mapping of the second bipartite network toward the developer to obtain a communication structure for characterizing the closeness of communication between the developers includes: If the second bipartite network is a connected graph, the connected graph is single-mode mapped in the direction of the developer to obtain the communication structure; If the second bipartite network is a non-connected graph, a single-mode mapping is performed on a subgraph of the non-connected graph in a direction of the developer; The unimodal mapping graphs of the subgraphs of the non-connected graph are merged, and the merged unimodal mapping graphs are clustered based on a preset community discovery algorithm to obtain the communication structure.

9. A software architecture optimization device, characterized in that: include: The data acquisition module is used to obtain the call chain tracing data when the distributed architecture is running; A dynamic call relationship network module, used to construct a dynamic call relationship network of the service component at runtime based on the call chain tracking data; as well as A reference information generation module is used to generate reference information for architecture optimization. The reference information is the basis for software architecture optimization. The software architecture is optimized based on the reference information. The reference information at least includes: the dynamic call relationship network and the team division structure. The construction process of the team division structure includes: Build the first bipartite network based on the code commit records of the code repository; The first bipartite network is single-mode mapped toward the developer direction to obtain a team division of labor structure that represents the collaborative relationship between the developers.

Citation Information

Patent Citations

  • Micro-service link monitoring and tracking method and system

    CN114172949A