A micro-service partitioning method based on logical independence and performance comprehensive evaluation

By constructing a management cost evaluation model and using a metaheuristic search algorithm, the problem of balancing logical independence and performance in existing microservice partitioning methods is solved, achieving optimal performance partitioning within the range of logical independence and improving the overall performance of the application.

CN116107832BActive Publication Date: 2026-06-12TONGJI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2022-11-28
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Most existing microservice partitioning methods only pursue logical independence while ignoring performance, resulting in the performance of the migrated application being affected, and failing to comprehensively consider all factors affecting performance.

Method used

By collecting relevant data from monolithic applications, we construct a management cost assessment model, abstract the workflow structure, and use metaheuristic search JADE algorithms to obtain the optimal microservice partitioning scheme, taking into account both logical independence and performance.

Benefits of technology

It achieves optimal microservice partitioning within the scope of logical independence, accurately assesses the combined impact of application topology, business processing, data transmission, and request queuing, and improves the overall performance of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107832B_ABST
    Figure CN116107832B_ABST
Patent Text Reader

Abstract

The application discloses a micro-service division method based on logical independence and performance comprehensive evaluation, which comprises the following steps: collecting relevant data of monolithic application; analyzing relevant features of management cost, constructing an effective management cost evaluation model, and training the model; abstracting a workflow structure from the execution track of the monolithic application, and calculating workflow-related parameters based on monitoring data and management time evaluator; determining a micro-service division problem P based on relevant indexes, and obtaining an optimal scheme based on a solution algorithm of meta-heuristic search JADE. The application can comprehensively consider logical independence and performance to obtain a micro-service extraction scheme which is optimal in performance within a certain range of logical independence; when considering performance, the application can depict the complex relationship between relevant factors and management cost, the complex relationship between management cost and business processing time, and accurately evaluate the overall performance which is comprehensively influenced by application topology structure, business processing, data transmission and request queuing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a microservice partitioning method based on logical independence and comprehensive performance evaluation. Background Technology

[0002] Monolithic architectures are increasingly struggling to handle increasingly complex applications, while microservice architectures, with their flexibility in development and operations and logical independence, are becoming a new choice for many companies and developers. Migrating existing monolithic applications to microservice architectures, rather than building them from scratch, is considered a simple way to use microservice architectures. To ensure that the migrated microservice applications can leverage their advantages, we need to rationally partition the monolithic application, that is, to propose a reasonable and effective microservice partitioning method. Based on the Single Responsibility Principle in microservice design, most existing microservice partitioning methods only pursue high logical independence of the partitioning results and rarely pay attention to whether the partitioning results have good performance. Research shows that inappropriate microservice partitioning schemes can lead to performance degradation after migration, and the importance of performance to applications is self-evident, so we should also consider the performance of the results when partitioning. A few studies consider the performance of the partitioning results, but they only consider a small number of factors affecting performance, such as network overhead, rather than comprehensively considering all factors affecting performance. Summary of the Invention

[0003] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0004] In view of the problems existing in the microservice partitioning methods based on logical independence and comprehensive performance evaluation, this invention is proposed.

[0005] Therefore, the purpose of this invention is to provide a microservice partitioning method based on logical independence and comprehensive performance evaluation.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] Collect relevant data for monolithic applications, including relevant function parameter data and runtime environment data;

[0008] Analyze the relevant characteristics of management costs, construct an effective management cost assessment model, and train it.

[0009] The workflow structure is abstracted from the execution trajectory of the monolithic application, and workflow-related parameters are calculated based on monitoring data and a management time estimator.

[0010] Based on relevant indicators, the microservice partitioning problem P is determined, and the optimal solution is obtained by metaheuristically searching the JADE solution algorithm.

[0011] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the relevant function parameter data includes:

[0012] The relevant functions are the seven-tuple of functions included in the singleton application, represented as follows:

[0013] f k =(opr k ,par k ret k fbc k fstod k ,fltod k fltold k )

[0014] The seven-tuple includes information related to logical independence and information related to performance;

[0015] The logical independence-related information includes the function name opr. k Parameter par k and return value ret k ;

[0016] The performance-related information includes the CPU requirement (fbc) per unit request of business logic that characterizes the business processing features. k The short-term object data growth rate fstod characterizes the system management features. k Long-term object data growth rate fltod k and the amount of long-lived object data fltold k ;

[0017] The operating environment data includes network transmission bandwidth and network transmission latency.

[0018] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the management cost evaluation model is as follows:

[0019] mtps i =f ml (mstod i mltod i mltold i MTC i YMS, TMS)

[0020] Among them, f mlFor data-driven machine learning regression models, MTPS i The average system management time per second, and the management cost that is used as the evaluation indicator, are affected by three factors;

[0021] The primary influencing factor is the per-second short-term object data increment (mstod). i The amount of garbage generated in the young generation, as denoted by YMS (Young Generation Memory Space Size);

[0022] The second influencing factor is the per-second long-term object data increment (mltod). i Long-term object live data volume (mltold) i The amount of garbage in the old generation as depicted by TMS, along with the size of the old generation memory space;

[0023] The third influencing factor is the user-defined CPU allocation per second (mtc). i The amount of CPU resources available is determined.

[0024] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, wherein: the young generation memory space size YMS and the old generation memory space size TMS in the management cost evaluation model are application-independent constants, and mtc i The allocation amount specified by the user, and the short-term object data increment per second (mstod). i 1 / second long-term object data increment mltod i Long-term object live data volume (mltold) i From all those assigned to MS i The size of the short-term and long-term object data of the function is determined by the following formula:

[0025]

[0026]

[0027]

[0028] Among them, fstod k ,fltod k and fltold k Each microservice is assigned to MS when continuously processing requests. i The function's per-second short-term object data increment, per-second long-term object data increment, and long-term object liveness data volume, mf i For microservices MS i The number of functions, ltold base The amount of function-independent long-lived object live data required to run each microservice;

[0029] Microservice applications are defined as a set MSE = {MS i}, where MS i =(MC) i MI i ) represents any microservice. For the microservice MS i The collection of all classes in the set. For the microservice MS i A collection of interface classes.

[0030] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the workflow is an abstract representation of a series of functions in a monolithic application and the relationships between them, which is defined as a directed acyclic graph:

[0031] G q =(V q E q )

[0032] Where q represents each request, and the point set is... The set of functions in the classes that a microservice application needs to run to process this request, edge set This defines the data transfer relationships between functions when a microservice application processes this request. Representation function To function The amount of data transmitted;

[0033] When a set of requests arrives, their respective response times can be calculated based on the performance calculation model using the workflows corresponding to them.

[0034] The formula for the microservice application performance calculation model is as follows:

[0035]

[0036] Where ART is the average response time of the entire microservice application, m is the total number of requests, SIMULA is the simulation algorithm, and {G q} represents the set of all request workflows containing the structure and time required for each part, {m q} represents the set of request volumes for each request;

[0037] Application performance is reflected by the combined response time of each request. For request q, the performance calculation model is based on workflow G. q The information reflects the response time, which is affected by business processing, data transmission, request queuing, and system management.

[0038] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the response time of each request is related to the CPU processing time, which is obtained by calculating the ratio of the total CPU demand to the CPU available per second.

[0039] The total CPU demand is obtained by monitoring the function-related information of each node, and the CPU availability per second is obtained by subtracting the CPU unavailability per second caused by management operations from the CPU allocation per second specified by the user in the microservice where the function is located.

[0040] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, wherein: for microservices assigned to MS i function f in class k The CPU availability per second is shown in the following formula:

[0041] Mac i =mtc i ·(1-mtps i )

[0042] Among them, Mac i For the microservice MS i CPU availability per second, MTC i For the microservice MS i CPU allocation per second, mtps i For the microservice MS i Average system management time per second;

[0043] Each node represents a microservice MS that has been assigned to it. i function f in class k The CPU processing time is calculated using the following formula:

[0044]

[0045] Among them, ct k The function f represented by the node k CPU processing time, FBC k For function f k Total CPU usage during the business logic of processing requests, mac i For microservices MS i CPU availability per second.

[0046] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the microservice partitioning problem P is determined based on relevant indicators, including:

[0047] The relevant metrics include Average Response Time (ART) and Logical Independence (LIG).

[0048] In the microservice partitioning problem P, the application to be partitioned is divided into classes as the smallest granularity, and an effective and appropriate partitioning result MSE is given.

[0049] The microservice partitioning problem P is as follows:

[0050] P: min ART

[0051] stLIG≤p

[0052] Wherein, ART is the performance index of the partitioning result MSE, representing the average response time of all requests. The lower the ART, the better the performance. LIG is the logical independence index of the partitioning result. The lower the LIG, the higher the logical independence. p is a user-specified parameter that limits the logical independence index and determines the range of logical independence of feasible solutions.

[0053] As a preferred embodiment of the microservice partitioning method based on logical independence and comprehensive performance evaluation described in this invention, the optimal solution is obtained using a metaheuristic search algorithm for JADE, including:

[0054] Using the aforementioned ART as the fitness function, individuals with smaller fitness functions are considered more superior.

[0055] Define an individual x as having dimension n C A vector, wherein each dimension value x is a vector. i Let be a real number in the range [0, N), and each individual represents a partitioning result, where the i-th class will be assigned to the i-th class. In each microservice, during the partitioning process, the population is iterated multiple times according to the design of the JADE algorithm. Each time, mutation and crossover operations are performed sequentially, and the relevant parameters are adaptively adjusted during the iteration process.

[0056] A computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.

[0057] The beneficial effects of this invention are as follows: This invention can comprehensively consider logical independence and performance to obtain a microservice extraction scheme with optimal performance within a certain range of logical independence; when considering performance, this invention can characterize the complex relationship between relevant factors and management costs, the complex relationship between management costs and business processing time, and accurately evaluate the overall performance affected by the application topology, business processing, data transmission, and request queuing. Attached Figure Description

[0058] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0059] Figure 1 This is a schematic diagram illustrating the microservice partitioning method based on logical independence and comprehensive performance evaluation according to the present invention.

[0060] Figure 2 This is a flowchart illustrating the microservice partitioning method based on logical independence and comprehensive performance evaluation of the present invention.

[0061] Figure 3 This is an experimental comparison diagram between the present invention and the traditional method. Detailed Implementation

[0062] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0063] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0064] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0065] Secondly, the present invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of the present invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not according to the usual scale. Furthermore, the schematic diagrams are merely examples and should not limit the scope of protection of the present invention. In addition, actual fabrication should include three-dimensional spatial dimensions of length, width, and depth.

[0066] Example 1

[0067] Reference Figure 1 and Figure 2 A microservice partitioning method based on logical independence and comprehensive performance evaluation includes,

[0068] Reference Figure 1As shown, the application is a monolithic application developed according to the object-oriented paradigm, consisting of a series of objects created from classes. Each class contains a series of functions, and the relevant information of these functions determines the application's logical independence and performance. The partitioned microservice application consists of a series of microservices containing classes. The workflow structure can be abstracted from the execution trajectory of the application service requests, and the application's performance can be evaluated through the workflow.

[0069] Applications are composed of classes of functions, and classes are composed of applications. In object-oriented programming, a class is a blueprint for creating objects, describing the characteristics and functions of the created objects. In object-oriented applications, classes are used as the basic unit from the initial design. Based on this consideration, this method uses classes as the smallest unit for microservice partitioning, without further subdividing the functions within each class. Simultaneously, based on function-related information, the logical independence and performance of the application can be evaluated. Therefore, it is necessary to characterize not only the structural relationship between classes and functions, but also the function information of each class and the relationships between functions; for example... Figure 1 The proposed case shows that the monolithic application consists of 5 classes, which contain a total of 22 functions, and there are data transfer relationships between the functions.

[0070] Workflow represents the functions in a class that an application needs to run to process each request, and the data transfer relationships between them, such as... Figure 1 As shown in the proposed case, the workflows for request 1 and request q consist of 9 functions from 4 classes and their associated data transmissions, and 10 functions from 3 classes and their associated data transmissions, respectively.

[0071] The function contained in a singleton application is defined as a seven-tuple, as shown in the following formula:

[0072] f k =(opr k ,par k ret k fbc k fstod k ,fltod k fltold k )

[0073] The seven-tuple includes logical independence-related information and performance-related information; the logical independence-related information includes the function name opr. k Parameter par k and return value ret k Performance-related information includes the CPU requirement (fbc) per unit of business logic that characterizes the business processing features. k The short-term object data growth rate fstod characterizes the system management features. k Long-term object data growth rate fltodk and the amount of long-lived object data fltold k .

[0074] A class consisting of functions is defined as a set c. j ={f j,k}, where f j,k Let $k$ represent the $j$-th function of the $j$-th class. A monotonous application consisting of a class and its contained functions is defined as a triple $Mo = (C, F, E)$, where $C = {c$, $f$, $E$, $f ... j} represents the collection of all classes contained in the application; F = {f k} represents the set of all functions contained in the application; It is the set of data transmission relationships between functions, that is, any two functions and Data transfer volume between A set of.

[0075] After a monolithic application is divided into microservices, all classes are divided into multiple groups, which then form microservices. These microservices that can cooperate with each other constitute a microservice application. A microservice granularity partitioning scheme for a monolithic application is called a microservice partitioning scheme, and microservice applications will ultimately be created based on the microservice partitioning scheme.

[0076] A microservice application is defined as a set MSE = {MS i}

[0077] Among them, MS i =(MC) i MI i ) represents any microservice, and For microservices MS i The collection of all classes in the set. For microservices MS i A collection of interface classes; an interface class refers to the collection of all classes that are called by other microservices. and All of these are classes in the application to be divided, i.e.

[0078] S1: Collect relevant data for monolithic applications, including relevant function parameter data and runtime environment data. It should be noted that:

[0079] To obtain relevant function parameter data, based on historical running data or manually set test data, a scenario of the application handling multiple users and multiple requests is simulated. The application is deployed as a whole, and the running path and related running information during request processing are monitored using tools based on execution trajectory technology (such as Kieker). Each class is deployed separately and monitored separately. Information related to the system's resource utilization is monitored using tools based on monitoring technology (such as Prometheus). The information includes the function and class information in the application.

[0080] In addition, it is necessary to monitor the operating environment data, mainly including network transmission bandwidth and network transmission latency. This information can be used to more accurately evaluate the performance of applications running in this environment.

[0081] The relevant function parameter data includes,

[0082] The relevant functions are the seven-tuple of functions included in the singleton application, represented as follows:

[0083] f k =(opr k ,par k ret k fbc k fstod k ,fltod k fltold k )

[0084] The seven-tuple includes information related to logical independence and performance-related information;

[0085] Logical independence related information includes the function name opr k Parameter par k and return value ret k ;

[0086] Performance-related information includes the CPU requirement (fbc) per unit of business logic that characterizes the business processing features. k The short-term object data growth rate fstod characterizes the system management features. k Long-term object data growth rate fltod k and the amount of long-lived object data fltold k .

[0087] S3: Analyze the relevant characteristics of management costs, construct an effective management cost assessment model, and train it. It should be noted that:

[0088] In the evaluation management cost model, the young generation memory space size YMS and the old generation memory space size TMS are application-independent constants. iThe allocation amount specified by the user, and the short-term object data increment per second (mstod). i 1 / second long-term object data increment mltod i Long-term object live data volume (mltold) i From all those assigned to MS i The size of the short-term and long-term object data of the function is determined by the following formula:

[0089]

[0090]

[0091]

[0092] Among them, fstod k ,fltod k and fltold k These represent the increment of short-lived object data per second, the increment of long-lived object data per second, and the amount of long-lived object live data for each function in a microservice during continuous request processing. i For microservices MS i The number of functions, ltold base The amount of function-independent long-lived object live data required to run each microservice, such as the amount of long-lived object live data used by the microservice infrastructure.

[0093] Microservice applications are defined as a set MSE = {MS i}, where MS i =(MC) i MI i ) represents any microservice. For microservices MS i The collection of all classes in the set. For microservices MS i A collection of interface classes.

[0094] mstod i and mltod i mltold provides increments per second for short-lived and long-lived objects in microservices. i The amount of live data for long-term objects in microservices is used; based on data characteristics and regression model features, multiple machine learning regression models are selected for training, and then the model with the lowest evaluation error is chosen.

[0095] S4: Abstracts the workflow structure from the execution trajectory of a monolithic application and calculates workflow-related parameters based on monitoring data and a management time estimator. It should be noted that:

[0096] Workflow construction involves abstracting the workflow structure from the execution trajectory of a monolithic application and calculating workflow-related parameters based on monitoring data and a management time estimator.

[0097] For each request q, the workflow is an abstract representation of the functions in a series of classes that a monolithic application runs to process that request, along with the relationships between them. It is defined as a directed acyclic graph G. q =(V q E q ), where the point set The set of functions in the classes that a microservice application needs to run to process this request, edge set This defines the data transfer relationships between functions when a microservice application processes this request. Representation function To function The amount of data transmitted.

[0098] When a group of requests arrives, we calculate their respective response times based on their corresponding workflows and the performance calculation model. The formula for the microservice application performance calculation model is as follows:

[0099]

[0100] Where ART is the average response time of the entire microservice application, m is the total number of requests, SIMULA is the simulation algorithm, and {G q} represents the set of all request workflows containing the structure and time required for each part, {m q} represents the set of request volumes for each request;

[0101] Application performance is reflected by the combined response time of each request. For request q, the performance calculation model is based on workflow G. q The information reflects the response time, which is affected by business processing, data transmission, request queuing, and system management.

[0102] To calculate the response time for each request, three aspects need to be considered:

[0103] First perspective: When unaffected by other factors, the time used entirely for request processing; by calculating the CPU processing time required to execute the functions represented by each node for business processing, calculating the network transmission time required to execute the data transmission represented by each edge, and combining the topology of the workflow, the completion time of the last node can be calculated and thus reflect the response time of the request.

[0104] The second perspective: response time affected by request queuing; due to multiple requests competing for limited resources, queuing will occur and affect response time.

[0105] By simulating queuing and ensuring that each microservice can only process a limited number of requests at a time, the queuing time required for each node in the workflow to be executed can be obtained.

[0106] Third perspective: Response time affected by system management; In addition to the factors mentioned above, the CPU may become unavailable when the system performs management operations, which will also affect the overall response time.

[0107] This impact is reflected in the CPU processing time of each node in the workflow. When calculating CPU processing time, the impact of system management is also taken into account. The performance calculation model first calculates the workflow-related data for each request, and then uses the average response time of all requests as the evaluation index to obtain the overall system performance.

[0108] The CPU processing time for each node is obtained by calculating the ratio of total CPU demand to available CPU per second. Total CPU demand is obtained by monitoring the relevant information of the function represented by each node. Since users allocate resources in units of microservices, and functions in a microservice share resources, available CPU per second is obtained by subtracting the CPU unavailability per second caused by management operations from the user-specified CPU allocation per second in the microservice where the function resides.

[0109] Specifically, for those assigned to microservices MS i function f in class k The calculation method for CPU availability per second is as follows:

[0110] Mac i =mtc i ·(1-mtps i )

[0111] Among them, Mac i For microservices MS i CPU availability per second, MTC i For microservices MS i CPU allocation per second, mtps i For microservices MS i The average system management time per second.

[0112] MTC i Depending on the specific allocation method specified by the user, such as allocating CPUs according to the demand of microservices, or allocating a fixed and identical amount of CPUs without considering the differences in demand among microservices; mtps i Calculated by the management time estimator.

[0113] Each node represents a microservice MS that has been assigned to it. i function f in class kThe CPU processing time is calculated as follows:

[0114]

[0115] Among them, ct k The function f represented by the node k CPU processing time, FBC k For function f k Total CPU usage during the business logic of processing requests, mac i For microservices MS i CPU availability per second.

[0116] The network transmission time for each side is calculated as follows: it is obtained by adding the transmission delay to the ratio of the total network resource demand represented by the total amount of data transmitted to the available network resources per second represented by bandwidth. The formula is as follows:

[0117]

[0118] in, For transmission time, For the amount of data transmitted, BW t D represents the network bandwidth of the operating environment, i.e., the amount of data that can be transmitted per unit time. t Network transmission latency in the operating environment.

[0119] The total amount of data transmitted is obtained by monitoring the relevant information of the transmission process between the functions represented by each node. The bandwidth and transmission latency are determined by the operating environment. If the transmission time within a microservice is negligible, then the transmission time between microservices is related to the network parameters of the operating environment.

[0120] To calculate the queuing time before each node executes, a simulation method called SIMULA is proposed. Since each microservice has a parallelism limit, when the number of requests processed by a microservice reaches the parallelism limit, the remaining requests need to queue up. Because the queuing time is quite complex, it will be calculated through simulation.

[0121] S5: Based on relevant metrics, determine the microservice partitioning problem P, and obtain the optimal solution using a metaheuristic search algorithm for JADE. It should be noted that:

[0122] The logical independence calculation model is shown below:

[0123]

[0124] Where LIG is the application-wide logic independence index, and CHD is... t CHM t IFNt The three indicators are: Δchd, Δchm, and Δifn, representing the expected target values ​​and the differences between the expected values ​​and the results of this method. CHD, CHM, and IFN are three widely accepted indicators. LIG comprehensively measures the logical independence of the partitioning results. CHD measures domain-level cohesion, i.e., the average function name text similarity among functions within a microservice. A higher CHD indicates higher cohesion and corresponding higher logical independence. The calculation method is shown in the formula below:

[0125]

[0126]

[0127]

[0128] Where N is the total number of microservices, {opr} k and {opr} m For microservices MS i The collection of all classes MC i Any two classes c in k and c m The set of function names of each function, f term The function is a term extraction function, which extracts relevant term keywords from the set of function names {opr}.

[0129] CHM measures message-level cohesion, which is the similarity of average parameters and return values ​​among functions within a microservice. A higher CHM indicates higher cohesion and corresponding logical independence. The calculation method is shown in the formula below:

[0130]

[0131]

[0132]

[0133] Where N, k, and m have the same meanings as in the CHD index calculation formula, {par} k and {par} m For microservices MS i The collection of all classes MC i Any two classes c in k and c m The set of parameters for each function, {ret} k and {ret} m This is the corresponding set of return values.

[0134] IFN measures the coupling at the interface level, that is, the average number of classes accessed by other microservices per microservice. A lower IFN indicates lower coupling and higher logical independence. The calculation method is shown in the formula below:

[0135]

[0136] ifn i =|MI i |

[0137] Where N has the same meaning as described above, |MI i | indicates microservices MS i The number of interface classes.

[0138] The logical independence metric involved, LIG, is as described above, CHD. t CHM t IFN t The expected target value for each indicator will be determined manually or by measuring the results of the division according to existing methods, since the expected target value will be different for different divisions.

[0139] Based on the above indicators, a microservice partitioning problem P is proposed that comprehensively considers performance and logical independence. In the microservice partitioning problem P, the application to be partitioned is divided into classes as the smallest granularity, and an effective and appropriate partitioning result MSE is given.

[0140] The obtained partition result MSE has better performance indicators under certain constraints of logical independence. The specific problem is defined as shown in the formula below.

[0141] P: min ART

[0142] stLIG≤p

[0143] Among them, ART is the performance index of the partitioning result, which represents the average response time of all requests. The lower the ART, the better the performance. The specific calculation method is as shown above. LIG is the logical independence index of the partitioning result. The lower the LIG, the higher the logical independence. The specific calculation method is as shown above.

[0144] p is a user-specified parameter that limits the logical independence index, determining the range of logical independence for feasible solutions. For the microservice partitioning problem P, a solution algorithm based on metaheuristic search JADE is designed to find a partitioning result that meets the requirements.

[0145] The algorithm's search process aims to optimize the fitness function, using ART as the fitness function mentioned earlier. Individuals with a smaller fitness function are considered better. Individual x is defined as an n-dimensional... CA vector, where each dimension x is a value. i It is a real number in the range [0, N).

[0146] Ideally, using real number data types instead of integer data types is beneficial for smooth individual iteration during the search process.

[0147] Each individual represents a partitioning result, where the i-th class will be assigned to the i-th class. In each microservice, during the partitioning process, the population will be iterated multiple times according to the design of the JADE algorithm, with mutation and crossover operations performed sequentially each time, and the relevant parameters will be adaptively adjusted during the iteration process.

[0148] Example 2

[0149] This embodiment is the second embodiment of the present invention. Unlike the first embodiment, this embodiment provides a verification test of a microservice partitioning method based on logical independence and comprehensive performance evaluation, and verifies and explains the technical effects used in this method.

[0150] Traditional technical methods include MEM, FoSCI, DE-neural, and MCSR. However, most traditional methods only pursue logical independence or even overemphasize it, resulting in partitioning results that often do not have good performance.

[0151] To verify that our method can achieve a microservice partitioning scheme with suitable logical independence and higher performance compared to traditional methods.

[0152] In this embodiment, the traditional MEM method, FoSCI method, DE-neural method, MCSR method, and the proposed MECE method will be used to measure and compare the logical independence and average application response time of different microservice partitioning schemes.

[0153] Test environment: The open-source project JPetstore-6 and related publicly available execution trajectory data are used as test samples. Different methods are used to obtain microservice partitioning schemes, which are then run on a real Kubernetes cluster to simulate concurrent user requests and obtain test result data.

[0154] Using this method, automated testing equipment is activated, and the Hey stress testing tool is used to simulate and test this method. Data is obtained based on the experimental results. Logical Independence (LIG) is calculated for each microservice partitioning scheme; the results are as follows. Figure 3 As shown. A positive LIG value indicates that the logical independence is not as good as the expected target value, and the larger the value, the worse the logical independence; a negative LIG value indicates that the logical independence is worse than the expected target value, and the smaller the value, the better the logical independence.

[0155] from Figure 3 As can be seen from the left subgraph, the logical independence of the partitioning result of the MECE method proposed in this paper is better than most existing methods, and the value is negative, indicating that the logical independence is better than the expected target value.

[0156] Each method was tested with 10 sets of data, and the performance of each set of data was calculated and compared using ART; the results are as follows. Figure 3 As shown in the image, a smaller ART value indicates a shorter application response time and higher performance.

[0157] from Figure 3 As can be seen from the right subplot, this method has the highest performance among the five methods, outperforming the MEM method, FoSCI method, DE-neural method, and MCSR method by 42.71%, 13.04%, 17.61%, and 29.01%, respectively.

[0158] The MECE method described in this invention was compared with the traditional MEM method, FoSCI method, DE-neural method, and MCSR method to measure and compare the logical independence and average application response time of different microservice partitioning schemes. According to the results, the logical independence of this method is better than expected and better than most traditional methods. Among the five methods, this method has the highest performance, exceeding the results of the MEM method, FoSCI method, DE-neural method, and MCSR method by 42.71%, 13.04%, 17.61%, and 29.01%, respectively. This indicates that the results of this method demonstrate better logical independence and the best performance.

[0159] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A microservice partitioning method based on logical independence and comprehensive performance evaluation, characterized in that: include, Collect relevant data for monolithic applications, including relevant function parameter data and runtime environment data; Analyze the relevant characteristics of management costs, construct an effective management cost assessment model, and train it. The workflow structure is abstracted from the execution trajectory of the monolithic application, and workflow-related parameters are calculated based on monitoring data and a management time estimator. Based on relevant metrics, the microservice partitioning problem is determined. P And based on the metaheuristic search JADE solution algorithm, the optimal solution is obtained; The relevant function parameter data includes, The relevant functions are the seven-tuple of functions included in the singleton application, represented as follows: ; The seven-tuple includes information related to logical independence and information related to performance; The logical independence-related information includes function names. ,parameter and return value ; The performance-related information includes the CPU requirement per unit request of business logic that characterizes the business processing features. The short-term object data growth rate that characterizes the system management features Long-term object data growth rate and the amount of long-lived object data ; The operating environment data includes network transmission bandwidth and network transmission latency; The management cost assessment model is shown in the following formula: ; in, For data-driven machine learning regression models, The average system management time per second, and the management cost that is used as the evaluation indicator, are affected by three factors; The primary influencing factor is the per-second increment of short-term object data. and younger generation memory space size YMS The amount of waste generated by the younger generation; The second influencing factor is the per-second increment of long-term object data. Long-term object liveness data volume and the size of the old generation memory space TMS The amount of waste depicted by the elderly generation; The third influencing factor is the CPU allocation per second set by the user. The amount of CPU resources available is determined; Based on relevant metrics, the microservice partitioning problem is determined. P include, The relevant metrics include Average Response Time (ART) and Logical Independence (LIG). In the microservice partitioning problem P, the application to be partitioned is divided into classes as the smallest granularity, and an effective and appropriate partitioning result MSE is given.

2. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 1, characterized in that: The size of the young generation memory space in the management cost assessment model is evaluated. YMS and the size of the old generation memory space TMS For constants that are unrelated to the application, The allocation amount specified by the user, and the short-term object data increment per second. Per second long-term object data increment Long-term object liveness data volume From all that were divided into The size of the short-term and long-term object data of the function is determined by the following formula: ; ; ; in, For microservices The number of functions, The amount of function-independent long-lived object live data required to run each microservice; Microservice applications are defined as a collection. ,in Represents any microservice, For the microservice The collection of all classes in the set. For the microservice A collection of interface classes.

3. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 1, characterized in that: The workflow is an abstract representation of a series of functions in a monolithic application that run to process requests, and the relationships between those functions; it is defined as a directed acyclic graph. ; Where q represents each request, and the point set is... The set of functions in the classes that a microservice application needs to run to process this request, edge set This defines the data transfer relationships between functions when a microservice application processes this request. Representation function To function The amount of data transmitted; When a group of requests arrives, their respective response times can be calculated based on the performance calculation model using the workflows corresponding to them. The formula for the microservice application performance calculation model is as follows: ; in, ART This refers to the average response time of the entire microservice application. m Total number of requests SIMULA For simulation algorithms, This is a collection of all request workflows that include the structure and the time required for each part. This is the set of request volumes for each request; Application performance is reflected by the combined response time of each request. q The performance calculation model is based on the workflow. The information reflects the response time, which is affected by business processing, data transmission, request queuing, and system management.

4. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 3, characterized in that: The response time for each request is related to the CPU processing time, which is obtained by calculating the ratio of the total CPU demand to the CPU available per second. The total CPU demand is obtained by monitoring the function-related information of each node, and the CPU availability per second is obtained by subtracting the CPU unavailability per second caused by management operations from the CPU allocation per second specified by the user in the microservice where the function is located.

5. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 4, characterized in that: For those assigned to microservices Functions in the class The CPU availability per second is shown in the following formula: ; in, For the microservice CPU availability per second For the microservice CPU allocation per second For the microservice Average system management time per second; Each node represents a microservice that has been allocated to it. Functions in the class The CPU processing time is calculated using the following formula: ; in, The function represented by the node CPU processing time For function Total CPU requirements during the business logic of processing requests. For microservices CPU availability per second.

6. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 1, characterized in that: Microservice partitioning problem P The details are as follows: ; Wherein, ART is the performance index of the partitioning result MSE, representing the average response time of all requests. The lower the ART, the better the performance. LIG is the logical independence index of the partitioning result. The lower the LIG, the higher the logical independence. p is a user-specified parameter that limits the logical independence index and determines the range of logical independence of feasible solutions.

7. The microservice partitioning method based on logical independence and comprehensive performance evaluation as described in claim 1, characterized in that: The solution algorithm for JADE based on metaheuristic search obtains the optimal solution, including: Using the aforementioned ART as the fitness function, individuals with smaller fitness functions are considered more superior. Define individual x For dimension A vector, where each dimension of the vector is a value. Let N be a real number in the range [0, N), where each individual represents a partitioning result, and the i-th i The class will be divided into the first... In each microservice, during the partitioning process, the population is iterated multiple times according to the design of the JADE algorithm, with mutation and crossover operations performed sequentially each time, and the relevant parameters are adaptively adjusted during the iteration process.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The When a computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.