Micro-service identification method and device based on service information

CN117556272BActive Publication Date: 2026-10-27ANHUI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311693898.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2026-10-27
Estimated Expiration
2043-12-08

AI Technical Summary

Technical Problem

[0005]基于此,有必要针对目前基于源代码的微服务识别方法得到的微服务候选呈现单一性的问题,提供基于业务信息的微服务识别方法、装置

Benefits of technology

[0021]本发明在基于动态执行轨迹、静态调用关系构建出关联矩阵的基础上,又引入了其他四个原始属性矩阵,分别从动态执行轨迹、提交哈希值、提交作者、类名相似度的角度挖掘并丰富关系种类,增强了节点关系的多元化,从而避免微服务候选呈现单一性的问题。经过实验,本发明在耦合性、内聚性有着良好表现,性能指标总体优于其他方法,在业务逻辑方面也更加满足领域专家的期望。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117556272B_ABST
    Figure CN117556272B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of microservice identification, and more particularly to a microservice identification method and device based on business information.The present application analyzes a monolithic system: an association matrix is constructed according to a dynamic execution track and a static call relationship;an original attribute matrix one is constructed according to the dynamic execution track;an original attribute matrix two is constructed based on a commit hash value in commit information;an original attribute matrix three is constructed based on a commit author in the commit information;an original attribute matrix four is constructed based on a class name similarity;and the five matrices are combined and processed by a CoGCN model to obtain clustering results, thereby determining a microservice identification result.The present application supplements matrices based on business information, enriches the relationship types, and thus has good performance in coupling and cohesion, and also better meets the expectations of domain experts in terms of business logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microservice identification technology, and specifically to a method for identifying and migrating software architectures. More specifically, it relates to a microservice identification method and apparatus based on business information. The invention is applicable to software architecture in software engineering, enabling the migration of traditional monolithic software architectures to microservice architectures, making the entire migration process highly automated and requiring minimal human intervention. Background Technology

[0002] Traditional monolithic architectures couple all functions and modules of a system into a single application. While this approach offers advantages such as ease of project management, simple deployment, and stable operation, these advantages diminish as business needs evolve and the system grows larger. Instead, the pain of software maintenance and iterative updates sets in.

[0003] Microservices are gaining popularity due to their advantages over monolithic systems, such as loose coupling, low cohesion, small size, and autonomy. Furthermore, they offer a natural advantage in cloud deployments, allowing for the dynamic and rational allocation of resources needed by multiple components. Therefore, more practitioners are choosing to refactor monolithic applications into one or more microservices. Each microservice comprises a set of components that point to specific functionalities of the original monolith. Thus, the entire software system can be represented by a graph, where each component can be considered a node, and the dependencies between components can be seen as edges between nodes. In recent years, a method utilizing graph neural networks has emerged to facilitate the migration from monoliths to microservices.

[0004] However, during the migration process, the developer's migration decisions will play a decisive role in the quality of the resulting microservices. However, due to differences in research fields, some developers rely heavily on the source code of monolithic systems as an important basis for migration, resulting in migration results that are monotonous and do not perform well in terms of business functionality. Summary of the Invention

[0005] Therefore, it is necessary to address the problem that current microservice identification methods based on source code exhibit a lack of diversity in the microservice candidates obtained, and to provide a microservice identification method and device based on business information.

[0006] This invention is achieved using the following technical solution:

[0007] In a first aspect, the present invention discloses a microservice identification method based on business information, comprising the following steps:

[0008] S1. Obtain the original dynamic execution trajectory and original static call relationship of the monolithic system; filter the original dynamic execution trajectory to obtain the processed dynamic execution trajectory, and simplify the original static call relationship to obtain the processed static call relationship; construct the association matrix based on the processed dynamic execution trajectory and processed static call relationship; where the association matrix is ​​an n*n matrix, and n is the total number of all classes in the monolithic system;

[0009] S2, based on the processed dynamic execution trajectory, constructs the original attribute matrix one;

[0010] The process involves three steps: 1) Obtaining the commit information of the monolithic system; 2) Constructing the original attribute matrix based on the commit hash value; and 3) Constructing the original attribute matrix based on the commit author.

[0011] Obtain the source code of the monolithic system and construct the original attribute matrix based on class name similarity.

[0012] Among them, the original attribute matrix 1, the original attribute matrix 2, the original attribute matrix 3, and the original attribute matrix 4 are also n*n matrices;

[0013] S3, normalize the original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, and original attribute matrix 4, and then merge them into a composite matrix; where the composite matrix is ​​an n*4n matrix;

[0014] S4. Input the correlation matrix and composite matrix into the trained CoGCN model for processing to obtain the clustering results and determine the microservice identification results.

[0015] This microservice identification method based on business information implements the method or process according to embodiments of this disclosure.

[0016] Secondly, the present invention discloses a microservice identification device based on business information, which uses the microservice identification method based on business information from the first aspect.

[0017] The microservice identification device includes: a dynamic execution trajectory generation module, a static call relationship generation module, an association matrix construction module, an attribute matrix one construction module, an attribute matrix two construction module, an attribute matrix three construction module, an attribute matrix four construction module, a matrix processing module, and an identification module.

[0018] The dynamic execution trajectory generation module obtains the original dynamic execution trajectory of the monolithic system and filters it to obtain a processed dynamic execution trajectory. The static call relationship generation module obtains the original static call relationships of the monolithic system and simplifies them to obtain a processed static call relationship. The association matrix construction module constructs an association matrix based on the processed dynamic execution trajectory and the processed static call relationships. The attribute matrix one construction module constructs the original attribute matrix one based on the processed dynamic execution trajectory. The attribute matrix two construction module obtains the commit information of the monolithic system and constructs the original attribute matrix two based on the commit hash value. The attribute matrix three construction module obtains the commit information of the monolithic system and constructs the original attribute matrix three based on the commit author. The attribute matrix four construction module obtains the source code of the monolithic system and constructs the original attribute matrix four based on class name similarity. The matrix processing module normalizes the original attribute matrices one, two, three, and four before merging them into a composite matrix. The recognition module has a built-in trained CoGCN model, which is used to process the input correlation matrix and composite matrix to obtain clustering results and determine the microservice recognition results.

[0019] The microservice identification device based on business information implements the method or process according to embodiments of this disclosure.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] This invention, building upon the association matrix constructed based on dynamic execution trajectories and static call relationships, introduces four additional original attribute matrices. These matrices mine and enrich the types of relationships from the perspectives of dynamic execution trajectories, submission hash values, submission authors, and class name similarity, thereby enhancing the diversity of node relationships and avoiding the problem of monotonous microservice candidates. Experiments have shown that this invention exhibits good performance in terms of coupling and cohesion, with overall performance indicators superior to other methods, and it better meets the expectations of domain experts in terms of business logic. Attached Figure Description

[0022] Figure 1 This is a flowchart of the microservice identification method based on business information in Embodiment 1 of the present invention;

[0023] Figure 2 for Figure 1 Example chart of submission information obtained from [the source];

[0024] Figure 3 This is a comparison chart of the performance indicators of several methods in Embodiment 2 of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] It should be noted that when a component is said to be "installed on" another component, it can be directly on the other component or it may be in a component that is centered on it. When a component is said to be "set on" another component, it can be directly set on the other component or it may also be in a component that is centered on it. When a component is said to be "fixed to" another component, it can be directly fixed to the other component or it may also be in a component that is centered on it.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.

[0028] Example 1

[0029] Please see Figure 1 , Figure 1 This is a flowchart of the microservice identification method based on business information in this invention. Embodiment 1 discloses a microservice identification method based on business information, which is used to identify and migrate software architecture.

[0030] The microservice identification method based on business information includes the following steps:

[0031] S1. Obtain the original dynamic execution trajectory and original static call relationship of the monolithic system; filter the original dynamic execution trajectory to obtain the processed dynamic execution trajectory, and simplify the original static call relationship to obtain the processed static call relationship; construct the association matrix based on the processed dynamic execution trajectory and processed static call relationship; where the association matrix is ​​an n*n matrix, and n is the total number of all classes in the monolithic system.

[0032] This step aims to obtain the correlation matrix, and the specific operation is the same as S1 and S2 of Chinese invention patent CN 115730069 A. To avoid repetition, this embodiment 1 omits the process of obtaining the processed dynamic execution trajectory and the processed static call relationship, and only describes how to obtain the correlation matrix:

[0033] Count the number of co-occurrences N1 for each pair of classes under the processed static call relationship, and count the number of co-occurrences N2 for each pair of classes under the processed dynamic execution trajectory;

[0034] By superimposing the co-occurrence counts N1 and N2, the correlation between all classes in the single system is obtained and an correlation matrix is ​​formed.

[0035] The correlation matrix is ​​represented as:

[0036] Where 1 < k1 < k2 < n.

[0037] and The values ​​are the same, both representing the total occurrence count of the k1-th and k2-th classes. It should be noted that this matrix is ​​based on w... 11 … …、 …、w nn It is a symmetric matrix of the symmetric line.

[0038] Among these, the total number of occurrences between two different classes is what we need to focus on. Therefore, here, w 11 … …、 …、w nn Set the value to a fixed value, usually 0, to represent that it has no practical meaning and avoid affecting subsequent calculations.

[0039] S2, based on the processed dynamic execution trajectory, constructs the original attribute matrix one;

[0040] The process involves three steps: 1) Obtaining the commit information of the monolithic system; 2) Constructing the original attribute matrix based on the commit hash value; and 3) Constructing the original attribute matrix based on the commit author.

[0041] Obtain the source code of the monolithic system and construct the original attribute matrix based on class name similarity.

[0042] Among them, the original attribute matrix 1, the original attribute matrix 2, the original attribute matrix 3, and the original attribute matrix 4 are also n*n matrices.

[0043] This step involves introducing several attribute matrices to supplement the association matrix, thereby improving the recognition effect during subsequent clustering processing.

[0044] ① For the original attribute matrix one, since the dynamic call frequency is more indicative of the strength of the relationship between the two classes, the direct call frequency of the two classes is selected from the processed dynamic execution trajectory to characterize the strength of the relationship between the two classes, and thus the original attribute matrix one is constructed.

[0045] Specifically, the co-occurrence count N² of each class pair under the processed dynamic execution trajectory is counted to construct the original attribute matrix one:

[0046] The original attribute matrix is ​​represented as follows:

[0047] Where, 1 < k1 < k2 < n;

[0048] and The same matrix represents the co-occurrence count of the k1-th and k2-th classes under the processed dynamic execution trajectory; it should be noted that this matrix is ​​based on a 11 … …、 …、a nn It is a symmetric matrix of the symmetric line.

[0049] Among these, the total number of occurrences between two different classes is what we need to be concerned with. Therefore, here, a 11 … … …、a nn Set the value to a fixed value, usually 0, to represent that it has no practical meaning and avoid affecting subsequent calculations.

[0050] ② For the original attribute matrix II and the original attribute matrix III, it is because the inventor found that the construction of monolithic systems currently uses git commits more often, so each git commit message is generally highly correlated, and the build categories under the same commit author are also generally highly correlated.

[0051] Therefore, the Git language is used to obtain the branch structure of the project to which the monolithic system belongs, and then the commit information for each step is obtained from different branch structures. For example... Figure 2 As shown, each commit has a unique commit hash; each commit also contains information about which classes the commit author worked on in that commit—classes that can be identified as belonging to the same commit author.

[0052] Specifically,

[0053] For the original attribute matrix two:

[0054] Count the number of times each pair of classes co-occurs under the same commit hash value, N3, and construct the original attribute matrix II;

[0055] The second original attribute matrix is:

[0056] Where, 1 < k1 < k2 < n;

[0057] and The same matrix represents the co-occurrence count of the k1-th class and the k2-th class under the same commit hash value; it should be noted that this matrix is ​​based on b 11 … … …、b nn It is a symmetric matrix of the symmetric line.

[0058] Among these, the number of co-occurrences between two different classes is what we need to be concerned with. Therefore, here, b 11 … … …、b nn Set the value to a fixed value, usually 0, to represent that it has no practical meaning and avoid affecting subsequent calculations.

[0059] For the original attribute matrix three:

[0060] Count the number of co-occurrences N3 of each pair of classes under the same submitting author, and construct the original attribute matrix 3;

[0061] The original attribute matrix three is as follows:

[0062] Where n is the total number of all classes in the singleton system, 1 < k1 < k2 < n;

[0063] and The values ​​are the same, both representing the co-occurrence count of the k1-th class and the k2-th class under the same submitting author; it should be noted that this matrix is ​​based on c 11 … … …、c nn It is a symmetric matrix of the symmetric line.

[0064] Among these, the number of co-occurrences between two different classes is what we need to be concerned with. Therefore, here, c 11 … … …、c nn Set the value to a fixed value, usually 0, to represent that it has no practical meaning and avoid affecting subsequent calculations.

[0065] ③ Regarding the original attribute matrix four, it is because the inventor discovered that if the class names of classes that handle different businesses are highly similar, then there is a certain correlation between the classes, especially for classes named using different words composed of the same root words or meanings. Therefore, it is feasible to use class name similarity to split the monolithic system.

[0066] Specifically, the class name similarity is calculated for each pair of classes to construct the original attribute matrix. For any pair of classes [M, N] consisting of two classes M and N, the proportion of common characters in the class names of M and N is calculated and used as the class name similarity of [M, N]. This can be expressed by the formula: Class name similarity represents the similarity of class names in the range [M, N]; M∩N represents the common characters in the class names of M and N; M∪N represents all characters in the class names of M and N.

[0067] The original attribute matrix four is as follows:

[0068] Where, 1 < k1 < k2 < n;

[0069] and The values ​​are the same, both representing the class name similarity between the k1-th class and the k2-th class; it should be noted that this matrix is ​​based on d 11 … … …、d nn It is a symmetric matrix of the symmetric line.

[0070] Among these, the similarity of class names between two different classes is what we need to be concerned with. Therefore, here, d 11 … … …、d nn Set the value to a fixed value, usually 0, to represent that it has no practical meaning and avoid affecting subsequent calculations.

[0071] S3, normalize the original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, and original attribute matrix 4, and then merge them into a composite matrix; where the composite matrix is ​​an n*4n matrix.

[0072] This step normalizes the four attribute matrices mentioned above to balance their influence on the subsequent recognition process and prevent any single attribute from dominating the results.

[0073] Specifically,

[0074] First, for any element X in the original attribute matrix 1, original attribute matrix 2, attribute matrix 3, and original attribute matrix 4, obtain the maximum value X of its row. max The minimum value X in the row min ;

[0075] Calculate the normalized value of element X

[0076] Construct normalized attribute matrix 1, normalized attribute matrix 2, normalized attribute matrix 3, and normalized attribute matrix 4 according to the position of X′; wherein normalized attribute matrix 1, normalized attribute matrix 2, normalized attribute matrix 3, and normalized attribute matrix 4 are n*n matrices.

[0077] Then, obtain normalized attribute matrix one, normalized attribute matrix two, normalized attribute matrix three, and normalized attribute matrix four;

[0078] The normalized attribute matrix I, normalized attribute matrix II, normalized attribute matrix III, and normalized attribute matrix IV are merged, keeping the number of rows in the matrix to n and expanding the number of columns in the matrix to 4n, to obtain a composite matrix;

[0079] The composite matrix is: [ABCD];

[0080] Where A represents normalized attribute matrix one; B represents normalized attribute matrix two; C represents normalized attribute matrix three; and D represents normalized attribute matrix four.

[0081] S4. Input the correlation matrix and composite matrix into the trained CoGCN model for processing to obtain the clustering results and determine the microservice identification results.

[0082] The CoGCN model is a multi-view semi-supervised learning model. For its specific structure, please refer to the paper "Graph Neural Network to Dilute Outliers for Refactoring Monolith Application, AAAI Conference on Artificial Intelligence, 2021 / 02 / 07".

[0083] The CoGCN model used in Example 1 remains unchanged in terms of loss function, but spectral clustering is used instead. This is because, after experimental verification, the inventors found that spectral clustering has better performance than traditional K-means clustering when processing high-dimensional data. Furthermore, since the input composite matrix contains attribute matrices belonging to the sparse matrix, using spectral clustering to process sparse data is more targeted and effective, and it can prevent the occurrence of massive matrix results due to the sparse matrix.

[0084] Specifically, the association matrix and composite matrix are input into the trained CoGCN model for processing to obtain clustering results—N clusters of elements; then, the characteristics of elements in each cluster are identified to determine the service name of the microservice. This step can be done manually by simple identification and naming, or it can be done by a program for matching and classification.

[0085] In summary, in order to address the issue that existing technologies rely on source code to obtain relatively singular microservice identification results, this embodiment, while adjusting the clustering method, also introduces several attribute matrices to achieve diversification: enriching the types of node relationships, adding edges defined based on business relationships, and mining other relationships in the source code, thereby making the obtained microservice candidates closer to the ideal microservice decomposition results.

[0086] Example 2

[0087] A specific example is provided based on the method in Example 1:

[0088] This embodiment 2 uses the Jpetstore monolithic system as the application object of the method in embodiment 1.

[0089] ① The Kieker tool is used to perform dynamic operation analysis on the monolithic system to obtain the original dynamic execution trajectory; then the original dynamic execution trajectory is filtered to obtain the processed dynamic execution trajectory; then the original attribute matrix is ​​calculated based on the processed dynamic execution trajectory.

[0090] ② The Java-call-Graph tool is used to process the Jpetstore source code to obtain the original static call relationship; then the original static call relationship is simplified to obtain the processed static call relationship; then the association matrix is ​​calculated based on the processed dynamic execution trajectory and the processed static call relationship.

[0091] ③ Obtain the project to which the Jpetstore monolithic system belongs, and analyze the branch structure of the project using the Git language: Jpetstore is divided into 4 branches. Then, read each branch to obtain the commit information for each time, and then perform statistics by commit hash value and commit author respectively; then, based on the statistical results, calculate the original attribute matrices two and three.

[0092] ⑤ Extract the class names of all classes in the Jpetstore source code, calculate the class name similarity of each pair of classes, and then construct the original attribute matrix four.

[0093] ⑥ The original attribute matrices 1, 2, 3, and 4 are first normalized and then merged into a composite matrix. This composite matrix, along with the association matrix, is then input into the trained CoGCN model to output the clustering results (i.e., microservice candidates) and determine the microservice identification results. It should be noted that the clustering method used in this CoGCN model is spectral clustering, with the number of clusters k being 3.

[0094] This embodiment 2 also introduces other models—1. the CoGCN model using K-means clustering; 2. the M2M model; 3. the FoSIC model; and 4. the MEM model—to identify microservices in the Jpetstore monolithic system. See the performance indicator comparison results below. Figure 3 The performance metrics include: SM (Structural Modularity), ICP (Inter-Partition Call percentage), IFN (Interface Number), and NED (Non-Extreme Distribution).

[0095] A higher SM value indicates better microservice modularity; a lower ICP value indicates better microservice identification; a lower IFN value is better; and a lower NED value is better.

[0096] It should be noted that the method in Example 1 corresponds to Figure 3 The second line in the middle.

[0097] For the CoGCN model using K-means clustering, two methods are provided: The first is to input the composite matrix and correlation matrix into the CoGCN model using K-means clustering for microservice identification (corresponding to...). Figure 3 The second method is to directly use the CoGCN model with K-means clustering to identify microservices in the Jpetstore monolithic system (corresponding to...). Figure 3 (Third line in the middle).

[0098] For the M2M model, FoSIC model, and MEM model, all three directly perform microservice identification on the Jpetstore monolithic system (corresponding to...). Figure 3 (The fourth, fifth, and sixth lines of the middle text).

[0099] like Figure 3 As shown, although the method of Example 1 has a slight disadvantage in NED, it improves in SM, ICP and IFN, and the advantages of ICP and IFN are significant. It can be considered that the method of Example 1 is superior to other methods in general.

[0100] Example 3

[0101] This embodiment discloses a microservice identification device based on business information, which uses the microservice identification method based on business information in Embodiment 1.

[0102] The microservice identification device includes: a dynamic execution trajectory generation module, a static call relationship generation module, an association matrix construction module, an attribute matrix one construction module, an attribute matrix two construction module, an attribute matrix three construction module, an attribute matrix four construction module, a matrix processing module, and an identification module.

[0103] The dynamic execution trajectory generation module obtains the original dynamic execution trajectory of the monolithic system and filters it to obtain a processed dynamic execution trajectory. The static call relationship generation module obtains the original static call relationships of the monolithic system and simplifies them to obtain a processed static call relationship. The association matrix construction module constructs an association matrix based on the processed dynamic execution trajectory and the processed static call relationships. The attribute matrix one construction module constructs the original attribute matrix one based on the processed dynamic execution trajectory. The attribute matrix two construction module obtains the commit information of the monolithic system and constructs the original attribute matrix two based on the commit hash value. The attribute matrix three construction module obtains the commit information of the monolithic system and constructs the original attribute matrix three based on the commit author. The attribute matrix four construction module obtains the source code of the monolithic system and constructs the original attribute matrix four based on class name similarity. The matrix processing module normalizes the original attribute matrices one, two, three, and four before merging them into a composite matrix. The recognition module has a built-in trained CoGCN model, which is used to process the input correlation matrix and composite matrix to obtain clustering results and determine the microservice recognition results.

[0104] For the specific recognition principle, please refer to Example 1, which will not be repeated here.

[0105] This embodiment also discloses a readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the above-described microservice identification method based on business information is performed.

[0106] When applying the method of Example 1, it can be applied in the form of software, such as by designing it as a program that can run independently on a computer-readable storage medium. The computer-readable storage medium can be a USB flash drive, designed as a USB security token, and the program can be designed to start the entire method through an external trigger.

[0107] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0108] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A microservice identification method based on business information, comprising the following steps: S1, obtain the original dynamic execution trajectory and original static call relationship of the monolithic system; The original dynamic execution trajectory is filtered to obtain the processed dynamic execution trajectory, and the original static call relationship is simplified to obtain the processed static call relationship. Based on the processed dynamic execution trajectory and the processed static call relationship, an association matrix is ​​constructed; where the association matrix is... n * n matrix, n This represents the total number of classes in the monolithic system. The microservice identification method is characterized by further comprising the following steps: S2, based on the processed dynamic execution trajectory, constructs the original attribute matrix one; The process involves three steps: 1) Obtaining the commit information of the monolithic system; 2) Constructing the original attribute matrix based on the commit hash value; and 3) Constructing the original attribute matrix based on the commit author. Obtain the source code of the monolithic system and construct the original attribute matrix based on class name similarity. Among them, the original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, and original attribute matrix 4 are also... n * n matrix; The original attribute matrix is ​​represented as follows: ; Where, 1 < k 1 < k 2< n ; and The same, both representing the first k 1 class and the first k The number of times two classes co-occur in the processed dynamic execution trajectory; a 11 … … … a nn Set to a fixed value; The second original attribute matrix is: ; Where, 1 < k 1 < k 2< n ; and The same, both representing the first k 1 class and the first k The number of times two classes co-occur under the same commit hash value; b 11 … … … b nn Set to a fixed value; The original attribute matrix three is as follows: in, n The total number of classes in a single-player system, 1 < k 1 < k 2< n ; and The same, both representing the first k 1 class and the first k The number of times two classes co-occur under the same commit author; c 11 … … … c nn Set to a fixed value; The original attribute matrix four is as follows: ; Where, 1 < k 1 < k 2< n ; and The same, both representing the first k 1 class and the first k Similarity between the class names of two classes; d 11 … … … d nn Set to a fixed value; S3, normalize the original attribute matrices 1, 2, 3, and 4, then merge them into a composite matrix; where the composite matrix is... n *4 n matrix; S4. Input the correlation matrix and composite matrix into the trained CoGCN model for processing, obtain the clustering results, and determine the microservice identification results.

2. The microservice identification method based on business information according to claim 1, characterized in that, In S1, the methods for constructing the correlation matrix include: Count the number of co-occurrences N1 for each pair of classes under the processed static call relationship, and count the number of co-occurrences N2 for each pair of classes under the processed dynamic execution trajectory; By superimposing the co-occurrence counts N1 and N2, the correlation between all classes in the single system is obtained and an correlation matrix is ​​formed. The correlation matrix is ​​represented as follows: ; Where, 1 < k 1 < k 2< n ; and The same, both representing the first k 1 class and the first k The total number of occurrences for both classes; w 11 … … … w nn Set to a fixed value.

3. The microservice identification method based on business information according to claim 1, characterized in that, In S3, the methods for normalizing the original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, and original attribute matrix 4 include: For any element in original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, or original attribute matrix 4 X Get the maximum value of its row. X max The minimum value of the row X min ; Calculate elements X Normalized value ; Will according to X The corresponding normalized attribute matrix is ​​constructed as follows: Normalized Attribute Matrix 1, Normalized Attribute Matrix 2, Normalized Attribute Matrix 3, and Normalized Attribute Matrix 4; among them, Normalized Attribute Matrix 1, Normalized Attribute Matrix 2, Normalized Attribute Matrix 3, and Normalized Attribute Matrix 4 are... n * n matrix.

4. The microservice identification method based on business information according to claim 1, characterized in that, In S3, the methods for constructing composite matrices include: Obtain normalized attribute matrix 1, normalized attribute matrix 2, normalized attribute matrix 3, and normalized attribute matrix 4; The normalized attribute matrix I, normalized attribute matrix II, normalized attribute matrix III, and normalized attribute matrix IV are merged, keeping the number of rows in the matrix to n and expanding the number of columns in the matrix to 4n, to obtain a composite matrix; The composite matrix is: ; Where A represents normalized attribute matrix one; B represents normalized attribute matrix two; C represents normalized attribute matrix three; and D represents normalized attribute matrix four.

5. The microservice identification method based on business information according to claim 1, characterized in that, The CoGCN model uses spectral clustering for clustering.

6. A microservice identification device based on business information, characterized in that, It uses the microservice identification method based on business information as described in any one of claims 1-5; the microservice identification device includes: The dynamic execution trajectory generation module is used to obtain the original dynamic execution trajectory of the single system and filter the original dynamic execution trajectory to obtain the processed dynamic execution trajectory. The static call relationship generation module is used to obtain the original static call relationship of the monolithic system and simplify the original static call relationship to obtain the processed static call relationship. The association matrix construction module is used to construct an association matrix based on the processed dynamic execution trajectory and the processed static call relationship; The attribute matrix construction module is used to construct the original attribute matrix based on the processed dynamic execution trajectory. The attribute matrix II construction module is used to obtain the submission information of the monolithic system and construct the original attribute matrix II based on the submission hash value. The attribute matrix 3 construction module is used to obtain the submission information of the monolithic system and construct the original attribute matrix 3 based on the submission author; The attribute matrix four construction module is used to obtain the source code of the monolithic system and construct the original attribute matrix four based on class name similarity. The matrix processing module is used to normalize the original attribute matrix 1, original attribute matrix 2, original attribute matrix 3, and original attribute matrix 4 before merging them into a composite matrix. as well as The identification module has a built-in trained CoGCN model, which processes the input correlation matrix and composite matrix to obtain clustering results and determine the microservice identification results.

Citation Information

Patent Citations

  • Micro-service identification method based on dynamic and static calling relation and reflecting service capability

    CN115730069A