CN112433755A - Micro-service architecture identification method based on multiple types of features and multiple measurement indexes - Google Patents
Micro-service architecture identification method based on multiple types of features and multiple measurement indexes Download PDFInfo
- Publication number
- CN112433755A CN112433755A CN202011288078.XA CN202011288078A CN112433755A CN 112433755 A CN112433755 A CN 112433755A CN 202011288078 A CN202011288078 A CN 202011288078A CN 112433755 A CN112433755 A CN 112433755A
- Authority
- CN
- China
- Prior art keywords
- service
- component
- sub
- micro
- probability value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000005259 measurement Methods 0.000 title claims abstract description 71
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000004364 calculation method Methods 0.000 claims abstract description 46
- 238000004458 analytical method Methods 0.000 claims abstract description 13
- 230000003068 static effect Effects 0.000 claims abstract description 11
- 230000008569 process Effects 0.000 claims description 16
- 238000007781 pre-processing Methods 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000013461 design Methods 0.000 abstract description 3
- 239000000306 component Substances 0.000 description 104
- 238000013459 approach Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000011160 research Methods 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000002596 correlated effect Effects 0.000 description 2
- 230000000875 corresponding effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000002068 genetic effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/74—Reverse engineering; Extracting design information from source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a micro-service architecture identification method based on multi-class characteristics and multiple measurement indexes, which is characterized in that a decision model for micro-service architecture identification is constructed aiming at the characteristics of a micro-service architecture relative to other software architectures, micro-service architecture characteristic measurement index information in a target software project is obtained through a static analysis technology, and finally, the probability of using the micro-service architecture by an input project is calculated by utilizing the decision model. Compared with the existing architecture identification method, the method expands the characteristics of the micro-service architecture, designs a calculation function according with the characteristics of each measurement index, has higher identification accuracy and contains richer contents in the identification result.
Description
Technical Field
The invention belongs to the field of framework pattern recognition in software engineering reverse engineering, and particularly relates to a micro-service framework recognition method based on multiple types of features and multiple measurement indexes.
Background
A software system with a certain scale may have a complex evolution process, and a problem that system architecture information cannot be updated in time or documents are missing may occur in the evolution process of the system, so that the real architecture information of the software system has a deviation, and further, a huge burden is brought to later maintenance. Therefore, in the field of reverse engineering of software engineering, it is an important task to identify the architecture of a software system so as to acquire the real architecture information of the system as much as possible.
In the research of the architecture identification technology, besides that the traditional software clustering technology clusters entities in a software system into components with certain abstract granularity based on the principle of high-cohesion low-coupling in software development to obtain a system structure view and help development and maintenance personnel of a target system to understand the state of the system architecture, the technologies such as genetic algorithm, pattern matching, concept analysis and the like are gradually used in architecture identification. However, like software clustering, these architecture identification techniques are more directed to general scenes, and do not consider the characteristics of specific architectures, and the results obtained by these methods are likely to lose much information related to actual architectures, so that the identified results are greatly different from the actual results, and therefore, it is necessary to design a targeted architecture identification method for different software architectures.
At present, the most common software architecture comprises a layered architecture, an event-driven architecture, a micro-service architecture and the like, and a recognition method aiming at the layered architecture has been proposed by the academic world in recent years, and the recognition effect is greatly improved; research data for event-driven architecture recognition is much less, and related scholars propose an event-driven program architecture mode recognition method based on an ontology in 2019, so that a new thought is provided for related research to a certain extent; however, as the micro service architecture which is applied more widely in the years, no relevant targeted research results appear yet.
The fire and heat of the micro-service architecture are irrelevant to the architectural characteristics, the traditional single application is broken away, the single application program is advocated to be divided into a group of small-sized services, each service is built around specific services, specific components are used for completing specific functions and can be independently deployed in a production environment, and the services are communicated by adopting a lightweight communication mechanism, are coordinated and matched with each other and provide final value for users. Based on the characteristics, the micro-service architecture embodies the characteristics of controllable complexity, flexible technology selection, high fault tolerance rate, strong expandability and the like.
Therefore, in the identification of the micro-service architecture, in addition to applying the existing architecture identification and architecture recovery technology, the characteristics of the architecture itself should be combined, so that the identification effect is more consistent with the real situation.
Disclosure of Invention
The invention aims to provide a method for identifying the total probability and the non-conformity reason of the input item using the micro-service architecture, which are identified by calculation through measurement index information and a decision model based on a constructed decision model for identifying the micro-service architecture and the acquired measurement index information conforming to the typical characteristics of the micro-service architecture in the input item.
In order to achieve the purpose, the technical scheme of the invention is as follows: a micro-service architecture identification method based on multi-class features and multiple measurement indexes comprises the following steps:
step 1) constructing a decision model P for micro-service architecture recognition according to the characteristics of the micro-service architectureaThe probability P is used for calculating the probability P of the target software project using the micro service architecture, wherein a is a measurement index in the decision model;
step 2) inputting a source code of a target software project, preprocessing the target software project to obtain a sub service entity b with the granularity possibly being a single sub service entityiSet of (B) { B ═ B1,b2,…,bn};
Step 3) based on the entity set B obtained in step 2), respectively aiming at each entity B in BiPerforming static analysis to detect whether a component related to a measurement index in the decision model is used or not, and storing related information into micro-service information and a component library L;
step 4) acquiring sub-service quantity information x related to each measurement index in the decision model based on the micro-service information established in the step 3) and the component library L;
and 5) calculating by using a probability value calculation function and a decision model function corresponding to each index based on the measurement index related sub-service quantity information x acquired in the step 4) to obtain a probability value P of the micro-service architecture used by the target software project.
Further, the specific content of the decision model constructed in step 1) is as follows:
(1) the characteristics of the micro service architecture are summarized and concluded, and the characteristics are divided into three categories: scale characteristics, component characteristics and topology characteristics, selecting representative and universal characteristics as measurement indexes for micro-service architecture identification, and constructing a measurement index set A ═ a1,a2,a3,a4In which a is1Measure an index for the number of sub-services in a scale feature, a2And a3Measure indexes of service registration and discovery component and load balancing component in component characteristics, a4Measure an index for a gateway component in the topological feature;
(2) according to each metric aiIs characterized by defining a probability value calculation function f for each measurement indexi(x) The calculation function calculates the addition probability value P of the target software project to the micro service architecture decision model according to the related quantity information x of the measurement indexes in the target software projecti. The method comprises the following specific steps:
a) the probability value calculation function of the sub-service quantity metric index is as follows:
where x is the number of sub-services obtained from the micro-service information and component library, P1=f1(x) The addition probability value of the sub-service quantity measurement index in the decision model is calculated according to the sub-service quantity;
b) the probability value calculation function for the service registration and discovery component metrics is:
wherein x is the number of sub-services containing service registration and discovery components obtained from the micro-service information and component library, P2=f2(x) The addition probability value of the service registration and discovery component measurement index in the decision model is calculated according to the number of the sub-services comprising the service registration and discovery component;
c) the probability value calculation function of the load balancing component measurement index is as follows:
wherein x is the number of sub-services containing load balancing components obtained from the micro-service information and component library, P3=f3(x) The addition probability value of the load balancing component measurement index in the decision model is calculated according to the number of the sub-services comprising the load balancing component;
d) the probability value calculation function of the gateway component metric index is:
f4(x)=IA(x)
where x is the number of sub-services containing gateway components obtained from the micro-service information and component library,
P4=f4(x) The addition probability value of the gateway component measurement index in the decision model is calculated according to the number of the sub services containing the gateway component;
(3) and according to the importance of each measurement index, giving specific weight to the addition probability value of each measurement index in the final decision model to obtain a final decision model function. Setting weights of the addition probability values of the four measurement indexes of the number of the sub-services, the service registration and discovery component, the load balancing component and the gateway component in a final decision model function as w1、w2、w3And w4Denotes w1=0.3,w2=0.5,w3=0.1,w40.1. The final decision model function is:
P=w1*P1+w2*P2+w3*P3+w4*P4;
where P is the probability value for the input target software project to use the microservice architecture.
Further, the specific process of preprocessing the target software project in step 2) to obtain the set of sub-service entities with granularity possibly being a single sub-service entity is as follows:
traversing all folder directories in the input item, wherein the upper folder directory of the src folder may contain a single sub-service, saving the upper folder directory path of the src folder to the entity b storing the directory path of the upper folder, which may be a single sub-serviceiSet of (B) { B ═ B1,b2,…,bnIn (c) }.
Further, the specific process of performing static analysis on each entity in step 3) to detect whether the entity uses a component related to a metric index in the decision model and storing the related information into the microservice information and component library is as follows:
(1) respectively detecting the entities B in the set B acquired in the step 2)iWhether a pom.xml file or a build.gram file is contained therein;
(2) if entity biThe entity contains a pom.xml file, which indicates that the entity uses a maven construction tool to manage the dependence, so that third party dependence introduced by the dependences node is obtained by analyzing the pom.xml file, and whether the entity uses a service registration and discovery component, a load balancing component and a gateway component can be known according to the third party dependence;
(3) if entity biThe third party dependency is acquired by analyzing the build.gradle file so as to know whether the entity uses the service registration and discovery component, the load balancing component and the gateway component;
(4) to entity biThe name of the entity, the path of the folder directory where the entity is located, and the acquired component information used by the entity are stored in the micro-service information and the component library L.
Further, the specific process of obtaining the sub-service quantity information related to each measurement index in the decision model in step 4) is as follows:
(1) counting the number x of entities containing at least one type of component from the microservice information established in step 3) and the component library L1The value is the number of sub-services;
(2) counting the number x of entities containing service registration and discovery components from the micro-service information established in step 3) and the component library L2The value is the number of sub-services comprising the service registration and discovery component;
(3) counting the number x of entities containing load balancing components from the micro service information established in step 3) and the component library L3The value is the number of sub-services comprising the load balancing component;
(4) counting the number x of entities containing gateway components from the microservice information and component library L established in step 3)4This value is the number of sub-services that comprise the gateway component.
Further, the specific process of calculating according to the probability value calculation function and the decision model function in the step 5) to obtain the probability value P of the target software project using the microservice architecture is as follows:
(1) the sub-service quantity value x obtained by the statistics in the step 4) is used1Probability value calculation function f substituted into sub-service quantity measurement index1(x) Obtaining the addition probability value P of the sub-service quantity measurement index in the decision model1;
(2) The sub-service quantity value x containing the service registration and discovery component statistically obtained in the step 4)2Probability value calculation function f substituting into service registration and discovery component metrics2(x) Obtaining the addition probability value P of the service registration and discovery component measurement index in the decision model2;
(3) The sub-service quantity value x containing the load balancing component statistically obtained in the step 4)3Probability value calculation function f substituting load balancing component measurement index3(x) Obtaining the addition probability value P of the load balancing component measurement index in the decision model3;
(4) The inclusion gateway group obtained by statistics in the step 4) is addedSub-service quantity value x of a piece4Probability value calculation function f substituted into gateway component metric index4(x) Obtaining the addition probability value P of the gateway component measurement index in the decision model4;
(5) Substituting the addition probability value obtained by the four steps into the final decision model function
P=w1*P1+w2*P2+w3*P3+w4*P4
Wherein w1=0.3,w2=0.5,w3=0.1,w4And (3) calculating a probability value P of the target software item using the microservice architecture, wherein the probability value P is 0.1.
Has the advantages that: the method constructs a decision model for framework recognition based on the characteristics of the micro-service framework, and calculates by combining the model with the measurement index information related to the micro-service framework in the target software project acquired by static analysis to obtain the total probability for judging the micro-service framework used by the target software project. Compared with the prior art, the method of the invention mainly has the following advantages:
(1) the characteristics of the micro-service architecture are expanded, the recognition effect is good, and the recognition accuracy is high. The micro-service architecture identification method based on the multi-class characteristics and the plurality of measurement indexes deeply considers the characteristics of the micro-service architecture, purposefully selects the measurement indexes which are universal but can effectively embody the characteristics of the micro-service architecture, designs the calculation function which can represent the characteristics of each measurement index to calculate the addition probability value of each measurement index to a micro-service architecture decision model, and distributes the weighted value of each index in the final architecture identification probability calculation function according to the importance of each index. Therefore, compared with the existing framework identification method, the identification accuracy is higher.
(2) The recognition result contains richer content. The micro-service architecture identification method based on the multi-class characteristics and the multiple measurement indexes extracts the components used by the service entity and embodying the micro-service architecture characteristics in the identification process, and compared with the identification result of the existing architecture identification method, the micro-service architecture identification method based on the multi-class characteristics and the multiple measurement indexes contains richer contents and can better restore the micro-service characteristics in the target software project.
(3) The micro-service architecture identification method provided by the invention is fully automatic. The method takes a target software project as input, other steps are automatically completed, and the recognized micro-service architecture probability value and the component information used by each sub-service are automatically given after recognition is completed.
Drawings
FIG. 1 is a flow chart of the present invention.
Fig. 2 is a data flow diagram of the present invention showing the relationship between the functional blocks and data information involved in the present invention.
Fig. 3 is a functional model diagram of a sub-service quantity metric probability value calculation function.
FIG. 4 is a functional model diagram of a service registration and discovery component metric probability value calculation function.
FIG. 5 is a functional model diagram of a load balancing component metric probability value calculation function.
Detailed Description
For the understanding and comprehension of the present invention, the following detailed description is provided with reference to the accompanying drawings, wherein:
fig. 1 shows a flow chart of the present invention, wherein the framework identification process mainly includes four steps of preprocessing, static analysis, index information acquisition, and probability calculation, and the probability calculation needs to use the decision model that we have constructed.
According to our aforementioned steps, the following steps are carried out in sequence:
in the first step, a decision model is constructed.
(1) The calculation function of the probability value of the sub-service quantity measurement index is defined as follows:
the micro-service project is different from a common single java project, the single java project only has one src source code directory, the micro-service is different, the cooperative work of a plurality of sub-services is an important characteristic of the micro-service project, and the sub-services are reflected in a target software project and may exist in the project and comprise a plurality of src folder sub-services. The calculation function for the probability value of the sub-service quantity measurement index of the comprehensive analysis has the following characteristics: when the sub-service quantity is small, the function value approaches to 0; secondly, when the number of the sub-services is larger and more, the function value approaches to 1, and when the number of the sub-services reaches a certain value, the probability addition caused by the index tends to be smooth, namely the change of the function value tends to be smooth. Therefore, we define the sub-service quantity metric probability value calculation function as
The functional model is shown in fig. 3.
(2) Service registration and discovery component metric probability value calculation function definition:
the entity with the service registration and discovery component is regarded as a real sub-service and marked, the entity is a core member in the micro-service architecture, if more marked sub-services are detected, the identification of the micro-service architecture is more beneficial, so that the quantity of the marked sub-services and the final probability value are positively correlated, but the influence of the quantity of the marked sub-services on the final probability value cannot be a pure linear relation, and when the quantity of the marked sub-services reaches a certain value, the probability addition corresponding to the index is close to the peak value and tends to be stable. The analysis-by-synthesis service registration and discovery component metric probability value calculation function should have the following characteristics: the number of the sub-services with the service registration and discovery component is 0, and the function value is 0; and secondly, a certain sub-service has a service registration and discovery component, the function value approaches to 1, the more the number of the sub-services is, the more the function value approaches to 1, but the more the probability addition in the future tends to be gentle, namely, the function value tends to be gentle. Therefore, we define the service registration and discovery component metric probability value calculation function as
The functional model is shown in fig. 4.
(3) The load balancing component measurement index probability value calculation function is defined as follows:
load balancing is also a common component in microservice projects. Usually, one service in the micro-service can support many servers by one cluster, so load balancing is necessary, which is also an embodiment of high availability of micro-service items. Although other non-microservice projects may also have load balancing, the deployment scale is far less than that of microservice projects, namely whether one project uses microservice architecture is highly correlated with the scale of load balancing, and the function characteristic is similar to the calculation function of the probability value of the measurement index of the service registration and discovery component, so that the calculation function of the probability value of the measurement index of the load balancing component is defined as
The functional model is shown in fig. 5.
(4) The gateway component metric probability value calculation function is defined as follows:
the gateway component is a more common component in micro-service projects and may not be necessary, but if a gateway component is used, it is advantageous for the identification of the micro-service architecture. Different from the above indexes, the existence of the gateway component is generally a relation of existence or nonexistence for the micro service architecture, namely existence or nonexistence, so that an indication function is adopted to correspond to the relation, and a gateway component measurement index probability value calculation function is defined as
f4(x)=IA(x)
That is, when the number of sub-services having a gateway component is 0, the function value is 0; otherwise the function value is 1.
In the aspect of weight distribution of each metric index, because the service registration and discovery component is a core component in the micro-service project, if each sub-project needs to provide own service externally or request other services, the service registration and discovery component is needed, so that in the process of identifying the micro-service architecture, the detection of the service registration and discovery component is crucial, and a larger weight of 0.5 is given to identify the index; in order to weaken the probability identification of the load balancing component and the gateway component on micro service items without the two types of components, smaller weight 0.1 is respectively given to identify the two types of indexes; the remaining weight of 0.3 is then given to the sub-service quantity metric.
And step two, pretreatment.
The main work of preprocessing is to perform src folder detection on the input target software project and to regard the upper folder of the detected src folder directory as an entity that may serve a single child and store it into an entity collection.
And thirdly, performing static analysis.
The main work of the static analysis is to process each entity B in the entity set B obtained by preprocessingiAnd respectively detecting the components related to the measurement indexes. In the detection process, the construction tools used by the entity are judged according to the type of the configuration files, then the configuration files are analyzed in different modes according to different construction tools so as to obtain the dependency package information of each component, whether the related components are used or not is judged according to the dependency package information, and the judgment result and the entity information are stored into the micro-service information and the component library L.
And fourthly, acquiring index information.
The main work of index information acquisition is to count sub-service quantity information related to the quantitative indexes in the decision model from micro-service information and a component library.
And fifthly, calculating the probability.
The main work of the probability calculation is to calculate the probability of the target software project using the micro-service architecture according to the number information of the related sub-services of each index obtained by the index information and the frame model.
Example (b):
for convenience of description, we take the identification process of a ruoyi-group open source item as an example. The ruoyi-cloud project is an open source micro-service project realized based on a SpringCloud framework, and integrates eureka, gateway, feign and other core micro-service components.
This is done in turn according to the steps we have mentioned before (since the decision model is built independently of the specific target software project, we do not put this part of the steps into the example):
the first step, pretreatment.
After preprocessing the ruoyi-group project, we will get an entity set B, which contains 15 possible sub-service entities BiAnd the entity set B { [ ruoyi-common-auth, ruoyi-common-core, ruoyi-common-log, ruoyi-common-redis, ruoyi-common-swagger, ruoyi-config, ruoyi-eureka, ruoyi-gateway, ruoyi-activiti, ruoyi-auth, ruoyi-dfs, ruoyi-gen, ruoyi-system, ruoyi-system-api, ruoyi-monitor }.
And secondly, performing static analysis.
Performing static analysis on the entity set B obtained after preprocessing to obtain micro-service information of a ruoyi-group project and a component library L, wherein the recorded entities using the service registration and discovery component Eureka comprise ruoyi-config, ruoyi-Eureka, ruoyi-gateway, ruoyi-activiti, ruoyi-auth, ruoyi-dfs, ruoyi-gen, ruoyi-system and ruoyi-monitor; entities using the load balancing component Feign are ruoyi-auth, ruoyi-dfs and ruoyi-system; the entity using the Gateway component Zuuul has ruoyi-auth, and the entity using the Gateway component Spring Cloud Gateway has ruoyi-Gateway.
And thirdly, acquiring index information.
Performing statistics on the sub-service number related to the metric index based on the micro-service information and the component library L, wherein 9 entities in the ruoyi-group project have at least one type of component, which is ruoyi-config, ruoyi-eureka, ruoyi-gateway, ruoyi-activiti, ruoyi-auth, ruoyi-dfs, ruoyi-gen, ruoyi-system, ruoyi-monitor, so that the sub-service number x is x19; there are 9 sub-services with service registration and discovery component, so the number x of sub-services containing service registration and discovery component29; there are 3 sub-services with load balancing components, so the number x of sub-services containing load balancing components 33; there are 2 sub-services with gateway components, instituteTo include the number x of sub-services of the gateway component4=2。
And fourthly, probability calculation.
In conjunction with the information obtained above, the probability P ═ w that the ruoyi-group item uses the microservice architecture1*P1+w2*P2+w3*P3+w4*P4=w1*f1(x1)+w2*f2(x2)+w3*f3(x3)+w4*f4(x4)≈0.9406=94.06%。
It should be noted that the above-mentioned embodiments are only preferred embodiments of the present invention, and it will be apparent to those skilled in the art that various modifications and equivalents can be made without departing from the principle of the present invention, and it is intended that all the technical solutions of the present invention which are modified and equivalent by the claims are covered by the present invention.
Claims (6)
1. A micro-service architecture identification method based on multi-class features and a plurality of measurement indexes is characterized by comprising the following steps:
step 1) constructing a decision model P for micro-service architecture recognition according to the characteristics of the micro-service architectureaThe probability P is used for calculating the probability P of the target software project using the micro service architecture, wherein a is a measurement index in the decision model;
step 2) inputting a source code of a target software project, preprocessing the target software project to obtain a sub service entity b with the granularity possibly being a single sub service entityiSet of (B) { B ═ B1,b2,…,bn};
Step 3) based on the entity set B obtained in step 2), respectively aiming at each entity B in BiPerforming static analysis to detect whether a component related to a measurement index in the decision model is used or not, and storing related information into micro-service information and a component library L;
step 4) acquiring sub-service quantity information x related to each measurement index in the decision model based on the micro-service information established in the step 3) and the component library L;
and 5) calculating by using a probability value calculation function and a decision model function corresponding to each index based on the measurement index related sub-service quantity information x acquired in the step 4) to obtain a probability value P of the micro-service architecture used by the target software project.
2. The method of claim 1, wherein the method further comprises: the construction of the decision model in the step 1) is specifically as follows:
(1) the characteristics of the micro service architecture are summarized and concluded, and the characteristics are divided into three categories: scale characteristics, component characteristics and topology characteristics, selecting representative and universal characteristics as measurement indexes for micro-service architecture identification, and constructing a measurement index set A ═ a1,a2,a3,a4In which a is1Measure an index for the number of sub-services in a scale feature, a2And a3Measure indexes of service registration and discovery component and load balancing component in component characteristics, a4Measure an index for a gateway component in the topological feature;
(2) according to each metric aiIs characterized by defining a probability value calculation function f for each measurement indexi(x) The calculation function calculates the addition probability value P of the target software project to the micro service architecture decision model according to the related quantity information x of the measurement indexes in the target software projectiThe method comprises the following steps:
a) the probability value calculation function of the sub-service quantity metric index is as follows:
where x is the number of sub-services obtained from the micro-service information and component library, P1=f1(x) The addition probability value of the sub-service quantity measurement index in the decision model is calculated according to the sub-service quantity;
b) the probability value calculation function for the service registration and discovery component metrics is:
wherein x is the number of sub-services containing service registration and discovery components obtained from the micro-service information and component library, P2=f2(x) The addition probability value of the service registration and discovery component measurement index in the decision model is calculated according to the number of the sub-services comprising the service registration and discovery component;
c) the probability value calculation function of the load balancing component measurement index is as follows:
wherein x is the number of sub-services containing load balancing components obtained from the micro-service information and component library, P3=f3(x) The addition probability value of the load balancing component measurement index in the decision model is calculated according to the number of the sub-services comprising the load balancing component;
d) the probability value calculation function of the gateway component metric index is:
f4(x)=IA(x)
wherein x is the number of sub-services containing gateway components obtained from the micro-service information and component library, P4=f4(x) The addition probability value of the gateway component measurement index in the decision model is calculated according to the number of the sub services containing the gateway component;
(3) giving specific weight to the addition probability value of each measurement index in a final decision model according to the importance of each measurement index to obtain a final decision model function, and setting the weight occupied by the addition probability values of the four measurement indexes, namely the number of the sub-services, the service registration and discovery component, the load balancing component and the gateway component in the final decision model function by w1、w2、w3And w4Denotes w1=0.3,w2=0.5,w3=0.1,w4The final decision model function is 0.1:
P=w1*P1+w2*P2+w3*P3+w4*P4
where P is the probability value for the input target software project to use the microservice architecture.
3. The method of claim 1, wherein the method further comprises: the specific process of preprocessing the target software project in the step 2) to obtain the set with the granularity possibly being a single sub-service entity is as follows:
traversing all folder directories in the input item, wherein the upper folder directory of the src folder may contain a single sub-service, saving the upper folder directory path of the src folder to the entity b storing the directory path of the upper folder, which may be a single sub-serviceiSet of (B) { B ═ B1,b2,…,bnIn (c) }.
4. The method of claim 1, wherein the method further comprises: the specific process of performing static analysis on each entity in the step 3) to detect whether the entity uses a component related to a measurement index in the decision model and storing the related information into the microservice information and the component library is as follows:
(1) respectively detecting the entities B in the set B acquired in the step 2)iWhether a pom.xml file or a build.gram file is contained therein;
(2) if entity biThe entity contains a pom.xml file, which indicates that the entity uses a maven construction tool to manage the dependence, so that third party dependence introduced by the dependences node is obtained by analyzing the pom.xml file, and whether the entity uses a service registration and discovery component, a load balancing component and a gateway component can be known according to the third party dependence;
(3) if entity biContains build.gradle file, which indicates the fileThe entity manages the dependency by using a gradle construction tool, so that the third party dependency is acquired by analyzing the build.
(4) To entity biThe name of the entity, the path of the folder directory where the entity is located, and the acquired component information used by the entity are stored in the micro-service information and the component library L.
5. The method of claim 1, wherein the method further comprises: the specific process of obtaining the sub-service quantity information related to each measurement index in the decision model in the step 4) is as follows:
(1) counting the number x of entities containing at least one type of component from the microservice information established in step 3) and the component library L1The value is the number of sub-services;
(2) counting the number x of entities containing service registration and discovery components from the micro-service information established in step 3) and the component library L2The value is the number of sub-services comprising the service registration and discovery component;
(3) counting the number x of entities containing load balancing components from the micro service information established in step 3) and the component library L3The value is the number of sub-services comprising the load balancing component;
(4) counting the number x of entities containing gateway components from the microservice information and component library L established in step 3)4This value is the number of sub-services that comprise the gateway component.
6. The method of claim 1, wherein the method further comprises: the specific process of calculating the probability value P of the micro service architecture used by the target software project according to the probability value calculation function and the decision model function in the step 5) is as follows:
(1) the sub-service quantity value x obtained by the statistics in the step 4) is used1Probability value calculation substituting into sub-service quantity measurement indexesFunction f1(x) Obtaining the addition probability value P of the sub-service quantity measurement index in the decision model1;
(2) The sub-service quantity value x containing the service registration and discovery component statistically obtained in the step 4)2Probability value calculation function f substituting into service registration and discovery component metrics2(x) Obtaining the addition probability value P of the service registration and discovery component measurement index in the decision model2;
(3) The sub-service quantity value x containing the load balancing component statistically obtained in the step 4)3Probability value calculation function f substituting load balancing component measurement index3(x) Obtaining the addition probability value P of the load balancing component measurement index in the decision model3;
(4) The sub-service quantity value x containing the gateway component statistically obtained in the step 4)4Probability value calculation function f substituted into gateway component metric index4(x) Obtaining the addition probability value P of the gateway component measurement index in the decision model4;
(5) Substituting the addition probability value obtained by the four steps into the final decision model function
P=w1*P1+w2*P2+w3*P3+w4*P4
Wherein w1=0.3,w2=0.5,w3=0.1,w4And (3) calculating a probability value P of the target software item using the microservice architecture, wherein the probability value P is 0.1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011288078.XA CN112433755A (en) | 2020-11-17 | 2020-11-17 | Micro-service architecture identification method based on multiple types of features and multiple measurement indexes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011288078.XA CN112433755A (en) | 2020-11-17 | 2020-11-17 | Micro-service architecture identification method based on multiple types of features and multiple measurement indexes |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112433755A true CN112433755A (en) | 2021-03-02 |
Family
ID=74701182
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011288078.XA Pending CN112433755A (en) | 2020-11-17 | 2020-11-17 | Micro-service architecture identification method based on multiple types of features and multiple measurement indexes |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112433755A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114780060A (en) * | 2022-03-27 | 2022-07-22 | 昆明理工大学 | Micro-service granularity identification method based on user story |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109597610A (en) * | 2018-12-10 | 2019-04-09 | 南京华苏科技有限公司 | A kind of application structure modularization construction method based on micro services framework |
CN109948710A (en) * | 2019-03-21 | 2019-06-28 | 杭州电子科技大学 | Micro services recognition methods based on API similarity |
CN110149396A (en) * | 2019-05-20 | 2019-08-20 | 华南理工大学 | A kind of platform of internet of things construction method based on micro services framework |
US20190356555A1 (en) * | 2018-05-17 | 2019-11-21 | Microsoft Technology Licensing, Llc | Machine learning microservice architecture design tools and methods |
CN111460137A (en) * | 2020-05-20 | 2020-07-28 | 南京大学 | Micro-service focus identification method, device and medium based on topic model |
-
2020
- 2020-11-17 CN CN202011288078.XA patent/CN112433755A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190356555A1 (en) * | 2018-05-17 | 2019-11-21 | Microsoft Technology Licensing, Llc | Machine learning microservice architecture design tools and methods |
CN109597610A (en) * | 2018-12-10 | 2019-04-09 | 南京华苏科技有限公司 | A kind of application structure modularization construction method based on micro services framework |
CN109948710A (en) * | 2019-03-21 | 2019-06-28 | 杭州电子科技大学 | Micro services recognition methods based on API similarity |
CN110149396A (en) * | 2019-05-20 | 2019-08-20 | 华南理工大学 | A kind of platform of internet of things construction method based on micro services framework |
CN111460137A (en) * | 2020-05-20 | 2020-07-28 | 南京大学 | Micro-service focus identification method, device and medium based on topic model |
Non-Patent Citations (2)
Title |
---|
洪华军 等: "一种基于微服务架构的业务系统设计与实现", 计算机与数字工程, no. 01, 20 January 2018 (2018-01-20) * |
郑骞 等: "面向企业业财一体化的微服务架构云构建方法研究", 中国总会计师, no. 05, 15 May 2020 (2020-05-15) * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114780060A (en) * | 2022-03-27 | 2022-07-22 | 昆明理工大学 | Micro-service granularity identification method based on user story |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110162414A (en) | The method and device of artificial intelligence service is realized based on micro services framework | |
CN106095942B (en) | Strong variable extracting method and device | |
CN103761254B (en) | Method for matching and recommending service themes in various fields | |
CN109447364A (en) | Power customer based on label complains prediction technique | |
CN110503531A (en) | The dynamic social activity scene recommended method of timing perception | |
CN104636751A (en) | Crowd abnormity detection and positioning system and method based on time recurrent neural network | |
CN110221965A (en) | Test cases technology, test method, device, equipment and system | |
US20170109636A1 (en) | Crowd-Based Model for Identifying Executions of a Business Process | |
JP2000011005A (en) | Data analyzing method and its device and computer- readable recording medium recorded with data analytical program | |
CN106599230A (en) | Method and system for evaluating distributed data mining model | |
CN109784015A (en) | A kind of authentication identifying method and device | |
CN103886030A (en) | Cost-sensitive decision-making tree based physical information fusion system data classification method | |
CN109408574A (en) | Complaint confirmation of responsibility system based on Text Mining Technology | |
CN108268886A (en) | For identifying the method and system of plug-in operation | |
Huang et al. | The mahalanobis taguchi system—adaptive resonance theory neural network algorithm for dynamic product designs | |
CN112433755A (en) | Micro-service architecture identification method based on multiple types of features and multiple measurement indexes | |
CN104965846A (en) | Virtual human establishing method on MapReduce platform | |
CN114780862B (en) | User interest vector extraction method, extraction model and computer system | |
CN116629338A (en) | Model data processing method, related device, equipment and storage medium | |
CN107122849B (en) | Spark R-based product detection total completion time minimization method | |
CN109872225A (en) | Divide single method and device | |
CN109981337A (en) | The multi-source data alignment schemes of data-oriented opening and shares | |
CN108280176A (en) | Data mining optimization method based on MapReduce | |
CN108256083A (en) | Content recommendation method based on deep learning | |
CN108256086A (en) | Data characteristics statistical analysis technique |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |