Multi-dimensional micro-service splitting method and system for power grid business

By building a multi-attribute graph of the power grid business system and using a multi-channel graph neural network to process it, the problem of unreasonable microservice splitting granularity in the existing technology is solved, and microservice splitting with higher accuracy and flexibility is achieved, improving the performance and maintainability of the system.

CN120234566AActive Publication Date: 2025-07-01STATE GRID ANHUI ELECTRIC POWER CO LTD +2

Patent Information

Application Number
CN202510703847.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-01
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

The prior art is unreasonable when microservices are split in power grid business systems, resulting in some microservices being unable to withstand loads during high traffic periods, with performance bottlenecks and excessive coupling, which increases the complexity of the system and maintenance difficulty.

Method used

The multi-dimensional microservice splitting method is adopted to extract static information, dynamic information and business information from the single-dimensional program of the power grid business, build a multi-attribute graph of business, function and pressure, and use a multi-channel graph neural network for processing to achieve high-precision splitting of microservices.

Benefits of technology

It improves the accuracy and rationality of microservice splitting, reduces manual errors, enhances the flexibility and scalability of the system, and avoids the problems of performance bottlenecks and high coupling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234566A_ABST
    Figure CN120234566A_ABST
Patent Text Reader

Abstract

The invention provides a power grid business-oriented multi-dimensional micro-service splitting method and system, and relates to the technical field of power grid information. From the perspective of multi-dimensional data, three dimensions of business, function and pressure are introduced, and each business module in a power grid business monomer program is comprehensively analyzed. According to the invention, the multi-channel graph neural network is designed to process the multi-attribute graph so as to realize splitting; wherein a trainable weight is introduced into the graph convolution coding part to improve the graph convolution feature extraction quality, a mode of combining a gating mechanism and cross-channel residual connection is used in the feature fusion part to obtain high-quality comprehensive feature representation, and a trainable weight is introduced into the node clustering part to improve the clustering effect. Compared with a traditional method which only depends on function analysis, the method has the advantages that the internal relation and potential dependence between the modules can be identified more accurately, the splitting precision and rationality are improved, and errors caused by artificial experience are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid information technology, and more specifically, to: 1. A multi-dimensional microservice splitting method for power grid services; 2. A multi-dimensional microservice splitting system for power grid services. Background Art

[0002] In today's rapidly developing digital age, the business scale of power grid enterprises continues to expand, and the types of business are becoming increasingly complex. This puts higher requirements on the efficient and stable operation of the power grid system, while traditional monolithic application systems are difficult to adapt to this change, and they have the following disadvantages: 1. The maintenance work of traditional monolithic application systems has become increasingly complex. With the continuous addition of business functions, the code volume has increased sharply, the internal structure of the system has become intricate, and the coupling degree between different modules is extremely high. This makes it that when developers perform system maintenance, a slight modification may trigger a series of unpredictable problems, greatly increasing the maintenance cost and maintenance risk. For example, when upgrading a certain functional module, due to its close dependencies with multiple other modules, it may be necessary to conduct comprehensive testing and adjustment on the entire system. This not only consumes a large amount of time and manpower, but may also cause the system to be unstable during maintenance, affecting the normal conduct of business.

[0003] 2. The upgrade of monolithic application systems is also very slow. Due to the limitations of its overall architecture, when introducing new functions or technologies, large-scale changes need to be made to the entire system. This process involves multiple links such as in-depth modification of existing code, re-testing, and compatibility debugging with other modules. Each link requires a large amount of time and effort, resulting in the elongation of the online cycle of new functions and being unable to meet the needs of business development in a timely manner. In the face of increasingly fierce market competition, this slow upgrade speed makes power grid enterprises appear powerless in dealing with new business challenges and customer needs, and may miss some development opportunities.

[0004] 3. The performance bottleneck problem has gradually emerged. With the explosive growth of business data volume and the continuous increase in the number of concurrent user accesses, traditional monolithic application systems are stretched when dealing with large-scale data and high-concurrency requests. The response speed of the system gradually slows down, and even situations such as freezing and crashing occur, seriously affecting the user experience and the normal operation of business. For example, during the peak electricity consumption period, when a large number of users simultaneously perform operations such as electricity bill query and payment, the system may experience long response delays, resulting in users being unable to obtain the required information in a timely manner, bringing great inconvenience to users and also affecting the service image of power grid enterprises.

[0005] Due to its advantages such as high availability, easy scalability, and flexible deployment, the microservices architecture has become the mainstream direction for migrating business applications to the cloud. The microservices architecture splits a large monolithic application into multiple small, independent services, each of which can be developed, deployed, and maintained independently, greatly enhancing the flexibility and scalability of the system. However, in actual power grid business systems, microservices transformation still faces many challenges.

[0006] For example, the Chinese invention patent with the patent number 202210559572.8 discloses a method and system for splitting a monolithic program based on multi-channel attention graph neural network clustering. The solution is as follows: When the Java program runs, call graph analysis to obtain multi-attribute information between classes, construct a multi-attribute graph structure, and design a graph convolutional neural network model based on multiple channels to perform feature embedding representation learning on the multi-attribute graph; then, with the goal of optimizing the embedding representation, use the attention mechanism to fuse the embedding representations of the multi-channel convolutional network to form a new feature embedding representation; then, through joint training with clustering information, finally use spectral clustering for clustering to obtain the microservices splitting result. However, through testing, it is found that when applying this patent for splitting, the granularity division is still unreasonable - specifically manifested as: 1. Some microservices cannot withstand the load during high-traffic periods and experience performance bottlenecks; 2. Some microservices have too high a coupling degree, increasing the complexity and maintenance difficulty of the system. Summary of the Invention

[0007] Based on this, it is necessary to provide a multi-dimensional microservices splitting method and system for power grid business to address the unreasonable problem of the existing patent granularity division.

[0008] The present invention is implemented by the following technical solutions: In the first aspect, the present invention discloses a multi-dimensional microservices splitting method for power grid business, including: S1, extract static information, dynamic information, and business information from the power grid business monolithic program to form an initial feature matrix X ; Construct a business channel adjacency matrix based on the power grid business monolithic program A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A 3, and combine with X to form a multi-attribute graph G ; G ={( A 1, X )、( A 2, X )、( A 3, X )}.

[0009] S2, takeG Input it into a multi-channel graph neural network for processing.

[0010] Among them, the multi-channel graph neural network includes: a graph convolutional encoding part, a feature fusion part, a node clustering part, and a graph convolutional decoding part.

[0011] The graph convolutional encoding part is used to: combine three graph convolutional encoders with trainable weights w ij and respectively perform encoding processing on ( A 1, X )、( A 2, X )、( A 3, X ) to correspondingly obtain three feature embedding representations Z 1~ Z 3.

[0012] The feature fusion part is used to: based on the gating mechanism and cross-channel residual connection method, fuse Z 1, Z 2, Z 3 into a comprehensive feature representation .

[0013] The node clustering part is used to: combine w ij to perform spectral clustering on to obtain a clustering result and construct a clustering loss L clus .

[0014] The graph convolutional decoding part is used to: respectively perform decoding processing on Z 1, Z 2, Z 3 through three graph convolutional decoders to correspondingly obtain three reconstructed feature matrices , and then reconstruct three reconstructed channel adjacency matrices , and construct a reconstruction loss L sa .

[0015] S3, based on L clus , L sa construct a total loss function Loss , and perform backpropagation to adjust the parameters of the multi-channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

[0016] This multi-dimensional microservice splitting method for grid services implements the method or process according to the embodiments of the present disclosure.

[0017] In a second aspect, the present invention discloses a multi-dimensional microservice splitting system for grid services, which uses the multi-dimensional microservice splitting method for grid services disclosed in the first aspect.

[0018] The multi-dimensional microservice splitting system for grid services includes: a multi-attribute graph construction module, a neural network processing module, and a neural network iteration module.

[0019] The multi-attribute graph construction module is used to: extract static information, dynamic information, and service information from the grid service monolithic program to form an initial feature matrix X , and construct a service channel adjacency matrix based on the grid service monolithic program A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A 3, and combine with X to form a multi-attribute graph G .

[0020] The neural network processing module is used to: input G into a multi-channel graph neural network for processing.

[0021] The neural network iteration module is used to: based on L clus , L sa construct a total loss function Loss , and perform backpropagation to adjust the parameters of the multi-channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

[0022] This multi-dimensional microservice splitting system for grid services implements the method or process according to the embodiments of the present disclosure.

[0023] In a third aspect, the present invention discloses a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the multi-dimensional microservice splitting method for grid services disclosed in the first aspect.

[0024] Compared with the prior art, the present invention has the following beneficial effects: 1. Starting from the perspective of multi-dimensional data, the present invention introduces three dimensions of service, function, and pressure, and comprehensively analyzes each service module in the grid service monolithic program. Compared with the traditional method that only relies on functional analysis, the present invention can more accurately identify the internal connections and potential dependencies between modules, improve the splitting accuracy and rationality, and avoid errors caused by human experience.

[0025] 2. On the one hand, the present invention constructs an initial feature matrix representing all modules of the grid service monomer program based on static information, dynamic information, and service information. On the other hand, three adjacency matrices are correspondingly constructed from three dimensions of service, function, and pressure, thereby forming a multi-attribute graph that more comprehensively represents the relationships of all modules, providing richer and more comprehensive information for microservice splitting.

[0026] 3. The present invention designs a multi-channel graph neural network to process the multi-attribute graph for splitting; among them, the graph convolution encoding part introduces trainable weights during encoding w ij , which can improve the quality of graph convolution feature extraction; the feature fusion part, on the one hand, dynamically adjusts the contribution ratio of each modality feature in the node fusion representation through a gating mechanism to highlight key information and suppress irrelevant noise, and on the other hand, through cross-channel residual connections, retains the fine-grained information of each modality's original features, enhances the integrity and stability of the fusion features, thereby fully fusing multi-dimensional key information, while improving the expression ability and discriminant performance of node feature representations, avoiding the problems of feature information loss and insufficient adaptability existing in traditional single weighted fusion methods; the node clustering part also introduces trainable weights during clustering w ij , which can dynamically adjust the actual similarity between node pairs to optimize the clustering effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0028] Figure 1 It is a flowchart of a multi-dimensional microservice splitting method for grid services provided in Embodiment 1 of the present invention; Figure 2 It is a structural diagram of a multi-channel graph neural network provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0030] It should be noted that when a component is referred to as "installed on" another component, it can be directly on the other component or there can also be an intermediate component. When a component is considered to be "set on" another component, it can be directly set on the other component or there may be an intermediate component at the same time. When a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there may be an intermediate component at the same time.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this invention belongs. The terms used in the specification of this invention herein are for the purpose of describing specific embodiments only and are not intended to limit the invention. The term "or / and" used herein includes any and all combinations of one or more of the related listed items.

[0032] First of all, it should be noted that through the analysis of the existing patent (patent number: 202210559572.8), it is found that only the functional dimension is considered in the extraction process. However, in fact, the business traffic pressure has an important impact in the power grid business system: the electricity consumption demands vary greatly in different time periods and the business traffic fluctuates significantly. The component coupling degree is also very important in the power grid business system - it reflects the dependency relationship between microservices. Therefore, it can be concluded that the existing patent ignores these factors and lacks a multi-dimensional comprehensive evaluation such as the functional dimension, business traffic pressure, and component coupling degree, resulting in unreasonable microservice granularity division.

[0033] Based on this conclusion, the present invention considers starting from the perspective of multi-dimensional data, introducing three dimensions of business, function, and pressure, and comprehensively analyzing each business module in the power grid business monolithic program.

[0034] Embodiment 1 Reference Figure 1 , shows the flowchart of the multi-dimensional microservice splitting method for power grid business provided in this Embodiment 1. For the convenience of subsequent description, it is assumed that the power grid business monolithic program includes N modules (which can also be regarded as N classes or N nodes).

[0035] As Figure 1 stated, the method includes the following steps: S1, extract static information, dynamic information, and business information from the power grid business monolithic program to form an initial feature matrix X ; Based on the power grid business monolithic program, construct a business channel adjacency matrix A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A3, and combine with X to form a multi-attribute graph G .

[0036] For S1, mainly two aspects of work are carried out - one is to construct an initial feature matrix X and the other is to construct 3 adjacency matrices A from 1 to A 3, and finally construct G .

[0037] 101. For X , its composition method includes: For each module in the grid service monomer program, extract and construct its static information feature vector, dynamic information feature vector, and business information feature vector; Stack the static information feature vectors, dynamic information feature vectors, and business information feature vectors of the N modules in the grid service monomer program by rows to obtain X .

[0038] Specifically: ① The static information feature vector characterizes the static information of the grid service monomer program, and its data source can be: extracting various names, definitions, inheritance structures, implemented interfaces, method lists, comments, etc. from the code, and at the same time counting quantitative indicators such as the number of code lines, cyclomatic complexity, and interface call times.

[0039] Generally, the static information feature vector adopts a five-dimensional design, and its representation is: ; In the formula, represents the static information feature vector of the i th class; LOC i represents the number of code lines of the i th class; FUNC i represents the number of methods defined in the i th class; VAR i represents the number of variables defined in the i th class; DEP i represents the number of dependencies of the i th class on other classes; INHERIT i represents the number of comment lines of the i th class.

[0040] ② The dynamic information feature vector represents the dynamic information of the grid service monomer program, and its data source can be: recording the load characteristics of each module according to the runtime data collection information (such as response duration, concurrent call count, etc.).

[0041] Generally, the dynamic information feature vector adopts a four-dimensional design, and it is expressed as: ; In the formula, represents the dynamic information feature vector of the i th class; QPS i represents the average call count per unit time of the i th class; CALL_OUT i represents the number of calls initiated outward by the i th class; CALL_IN i represents the number of times the i th class is called by other classes; represents whether the i th class is a business entry class.

[0042] ③ The business information feature vector represents the business information of the grid service monomer program, and its data source can be: extracting business keywords from unstructured information such as interface description documents and annotation texts, and encoding the text (methods such as TF-IDF and Word2Vec can be used) into vector form.

[0043] The dimension of the business information feature vector is uncertain and depends on the specific class situation. Specifically, the business information feature vector of the i th class can be expressed as .

[0044] In addition, it should be noted that when constructing the above feature vectors, the collected relevant data can be cleaned, standardized, and the numerical data can be normalized. When necessary, the principal component analysis (PCA) method can be used to reduce the dimension of the data to reduce noise and redundancy, so as to provide high-quality data basis for subsequent steps.

[0045] Then there is: ; N represents the total number of modules in the grid service monomer program, d represents the feature dimension.

[0046] 102. For A 1 to A 3, they respectively reflect the impacts of the three major dimensions of business, function, and pressure on the grid service application.

[0047] ① AThe data source of 1 can be the call chain logs during dynamic runtime, or it can come from business process documents or statistical analysis reports.

[0048] If two modules appear together multiple times in the same business scenario, such as participating in the same call chain or the execution of the same business use case, then they have a high coupling degree in the "business" dimension.

[0049] Therefore, A The expression of 1 can be written as: ; In the formula, A 1( i , j ) represents A the value of the i -th row and j -th column of 1; freq ij represents i the j -th module and the T biz -th module appear together in the same link

[0050] ② A The data source of 2 can rely on static code analysis or the extraction results of the abstract syntax tree (AST), or it can also integrate information such as code-level dependencies, interface calls, and inheritance relationships.

[0051] If there is a direct or indirect functional relationship between two modules (such as function calls, inheritance relationships, interface references), then they have a high coupling degree in the "function" dimension.

[0052] Therefore, A The expression of 2 can be written as: ; In the formula, A 2( i , j ) represents A the value of the i -th row and j -th column of 2; coupleFreq ij represents i the j -th module and the T func -th module have the number of functional relationships;

[0053] ③ A The data source of 3 can be from the runtime monitoring platform or historical load logs, such as the concurrent request volume, response duration, CPU / memory usage, etc.

[0054] If two modules exhibit strong operational correlations (such as synchronous peaks and coupled resource occupancy) in a high-concurrency or high-load environment, they can be considered to have a high coupling degree in the "stress" dimension.

[0055] Therefore, A The expression of 3 can be written as: ; In the formula, A 3( i , j ) represents A The value of the i th row and j th column of 3; sim ij represents the similarity between the i th module and the j th module; T press represents the stress correlation threshold.

[0056] It should be noted that T biz , T func , T press can be taken according to empirical values or adjusted according to subsequent clustering results to achieve good effects.

[0057] 103. Based on X , A 1 to A 3, the G constructed can be expressed as: G ={( A 1, X ), ([[]] A 2, X ), ([[]] A 3, X )}.

[0058] That is to say, G consists of three parts - the three parts have the same feature matrix and different adjacency matrices.

[0059] S2, input G into the multi-channel graph neural network for processing.

[0060] Since G contains information in three dimensions (i.e., equivalent to three modalities), there is no difference in importance among them, and the network design of existing patents cannot be followed. Therefore, in this case, a new design of the network structure and principle has been carried out to obtain the multi-channel graph neural network used in this case.​​

[0061] See Figure 2 , the multi-channel graph neural network includes: a graph convolutional encoding part, a feature fusion part, a node clustering part, and a graph convolutional decoding part.

[0062] 201. The graph convolutional encoding part is used to: combine three graph convolutional encoders with trainable weights w ij to respectively perform encoding processing on ( A 1, X ), ( A 2, X ), ( A 3, X ) to correspondingly obtain three feature embedding representations Z 1~ Z 3.

[0063] As Figure 2 shown, for the three modalities of G , the three graph convolutional encoders perform encoding processing one by one. The three convolutional encoders are all L layers.

[0064] It should be noted that the graph convolutional encoding part introduces a learnable edge weight mechanism in the convolutional operation - on the basis of the original adjacency matrix A 1~ A 3, a trainable weight i , j ) is assigned to each edge ([[]]. Therefore, the output of the w ij . Thus, the output of the m th graph convolutional encoder at the l +1 layer is: ; In the formula, m ∈[1,2,3]; A m ( i , j ) is the value of the A m th row and the i th column of j ; represents A m in the i th neighbor node set of the th node; m represents the weight matrix of the l th layer of the th graph convolutional encoder; m represents the output of the l th layer of the σ(.) represents a non-linear activation function (usually Relu activation function).

[0065] It should be noted that ; .

[0066] 202. The feature fusion part is used to: based on the gating mechanism and cross-channel residual connection, Z 1, Z 2, Z 3 are fused into a comprehensive feature representation .

[0067] Although there is no difference in importance among the three modalities, their contribution degrees in different node features are different. In order to fully reflect the contribution degree, the feature fusion part introduces a combination of the gating mechanism and cross-channel residual connection.

[0068] As Figure 2 shown, the feature fusion part includes: 3 gated neural networks, 3 product layers, and 2 residual connection layers.

[0069] Among them, the m th gated neural network is used to Z m first perform a linear transformation through a linear layer and then be processed by a Sigmoid activation function to obtain the m th gating weight g m ; m ∈[1, 2, 3]; The m th product layer is used to multiply g m , Z m ; The first residual connection layer is used to add the outputs of the 3 product layers; The second residual connection layer is used to add the output of the first residual connection layer, Z 1, Z 2, Z 3 to obtain .

[0070] The above process can be expressed by the formula as: ; ; ; In the formula, Sigmoid (.) represents the Sigmoid activation function; W gRepresents the weight matrix of the linear layer; b g Represents the bias term of the linear layer.

[0071] For the feature fusion part, it calculates the gating weights to control the information flux of each modality feature during the fusion process, and performs preliminary node adjustment and fusion through the gating mechanism. It can suppress irrelevant modality noise information, highlight key information features, improve the expression ability and discrimination performance of the fused features, and then introduces residual connections to stack the original feature embeddings of each modality to avoid information loss and enhance the feature expression ability after fusion.

[0072] 203. The node clustering part is used to: Combine w ij Perform Spectral clustering to obtain the clustering result and construct the clustering loss L clus .

[0073] It should be noted that when the node clustering part performs spectral clustering on It will combine w ij to optimize the clustering effect.

[0074] Specifically, the method by which the node clustering part combines w ij to perform spectral clustering on includes: S201. Construct the affine matrix S .

[0075] Among them, ; S ij Represents S The value of the i th row and j th column of ; Ω represents the scale parameter; Represents i The j th node and

[0076] In this way, by w ij To dynamically adjust the actual similarity between node pairs to provide the most accurate clustering basis.

[0077] S202. Based on S Perform spectral clustering to obtain K clustering clusters and use them as the clustering result.

[0078] Specifically, S202 includes: First, perform SPerform normalization processing and calculate the Laplacian matrix, then solve its eigenvectors, and then use the K-means clustering algorithm or other clustering algorithms to cluster the eigenvectors to obtain K clustering clusters, and use them as the clustering results.

[0079] After obtaining the clustering results, a L clus can be constructed, and its expression is: ; In the formula, represents the Manhattan distance between the th node and the i th node in j ; C ( i ) represents the set of nodes in the same clustering cluster as the th node in i .

[0080] 204. The graph convolutional decoding unit is used to: respectively decode Z 1, Z 2, Z 3 through 3 graph convolutional decoders to correspondingly obtain 3 reconstructed feature matrices , and then reconstruct 3 reconstructed channel adjacency matrices , and construct a reconstruction loss L sa .

[0081] Similar to the graph convolutional encoding unit, for the three modalities of G , 3 graph convolutional decoders perform decoding processing one by one.

[0082] As shown in Figure 2 , the graph convolutional decoding unit includes: 3 graph convolutional decoders and 3 reconstruction layers.

[0083] If the 3 deconvolution encoders are all L layers, then the output of the m th layer of the l th graph convolutional decoder is: ; In the formula, m ∈[1,2,3]; represents the A m after normalization; represents the weight matrix of the m th layer of the l -1 layer of the th graph convolutional decoder; m th graph convolutional decoderl Output of the -1 layer; σ (.) represents a non - linear activation function.

[0084] It should be noted that ; .

[0085] The m th reconstruction layer is used to reconstruct through a non - linear activation function into . Therefore, The expression of can be written as: .

[0086] In addition, after obtaining , , can be constructed L sa , and its expression is: ; In the formula, λ represents the hyperparameter for balancing L sa ; represents the Frobenius norm.

[0087] S3, based on L clus , L sa construct the total loss function Loss , and perform backpropagation to adjust the parameters of the multi - channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

[0088] It should be noted that Loss The expression of is: ; In the formula, γ represents the hyperparameter for controlling the L clus contribution.

[0089] Thus, the microservice splitting result of the power grid business monolithic program is obtained.

[0090] Embodiment 2 This Embodiment 2 provides a multi - dimensional microservice splitting system for power grid business, which uses the multi - dimensional microservice splitting method for power grid business provided in Embodiment 1.

[0091] The multi - dimensional microservice splitting system for power grid business includes: a multi - attribute graph construction module, a neural network processing module, and a neural network iteration module.

[0092] The multi-attribute graph construction module is used to: extract static information, dynamic information, and service information from the grid service monomer program to form an initial feature matrix X , and construct a service channel adjacency matrix based on the grid service monomer program A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A 3, and combine with X to form a multi-attribute graph G .

[0093] The neural network processing module is used to: input G into a multi-channel graph neural network for processing.

[0094] The neural network iteration module is used to: based on L clus , L sa construct a total loss function Loss , and perform backpropagation to adjust the parameters of the multi-channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

[0095] Since this system uses the multi-dimensional microservice splitting method for grid services in Embodiment 1, it also has the same effect, which will not be repeated here.

[0096] Embodiment 3 This Embodiment 3 discloses a computer device, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps of the multi-dimensional microservice splitting method for grid services disclosed in Embodiment 1.

[0097] Among them, the computer device can be: a mobile terminal, a fixed terminal. The former is, for example: a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Portable Application Description), a PMP (Portable Media Player), a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), etc.; the latter is, for example: a digital TV, a desktop computer, etc.

[0098] This Embodiment 3 also discloses a readable storage medium. Computer program instructions are stored in the readable storage medium, and when the computer program instructions are read and run by a processor, they execute the steps of the multi-dimensional microservice splitting method for grid services disclosed in Embodiment 1.

[0099] Among them, the readable storage medium may include, but is not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0100] Embodiment 3 also discloses a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the multi-dimensional microservice splitting method for grid services disclosed in Embodiment 1.

[0101] It should be noted that the computer program for executing the above can be written in one or more programming languages or a combination thereof. Among them, the programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The above computer program can be executed entirely on the user's computer, partially on the user's computer, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN). The above-described embodiments only represent several implementation manners of the present invention, and their descriptions are relatively specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent should be subject to the appended claims.

Claims

1. A multi-dimensional microservice splitting method for grid services, characterized in that, It includes: S1, Extract static information, dynamic information, and service information from the grid service single program to form an initial feature matrix X ; Construct a service channel adjacency matrix based on the grid service single program A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A 3. And combine with X to form a multi-attribute graph G ; G ={( A 1, X )、( A 2, X )、( A 3, X )}; S2, input G into a multi-channel graph neural network for processing; Among them, the multi-channel graph neural network includes: A graph convolutional encoding unit, which is used to: combine trainable weights through three graph convolutional encoders w ij respectively perform encoding processing on ( A 1, X )、( A 2, X )、( A 3, X ) to correspondingly obtain three feature embedding representations Z 1~ Z 3; A feature fusion unit, which is configured to: based on a gating mechanism and cross-channel residual connection, fuse Z 1, Z 2, Z 3 into a comprehensive feature representation ; A node clustering unit, which is used for: combining w ij performing spectral clustering to obtain a clustering result and construct a clustering loss L clus ; and The graph convolution decoding unit is used to: respectively decode Z 1, Z 2, Z 3 through three graph convolution decoders to correspondingly obtain three reconstructed feature matrices , and then reconstruct three reconstructed channel adjacency matrices , and construct a reconstruction loss L sa ; Z 1、 Z 2、 Z 3 through three graph convolution decoders to correspondingly obtain three reconstructed feature matrices and then reconstruct three reconstructed channel adjacency matrices and construct a reconstruction loss L sa ; S3, based on L clus , L sa construct the total loss function Loss , and perform backpropagation to adjust the parameters of the multi-channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

2. The multi-dimensional microservice splitting method for grid-oriented services according to claim 1, wherein X The composition method includes: For each module in the power grid service monomer program, extract and construct its static information feature vector, dynamic information feature vector, and service information feature vector; Stack the static information feature vectors, dynamic information feature vectors, and service information feature vectors of N modules in the grid service single program by rows to obtain X ; Among them, ; N represents the total number of modules in the grid service single program; d represents the feature dimension.

3. The multi-dimensional microservice splitting method for grid services according to claim 1, wherein A The expression for 1 is: ; Wherein, A 1( i , j ) represents A the value of the i th row and j th column of 1; freq ij represents the number of times that the i th module and the j th module appear in the same link simultaneously; T biz represents the service correlation threshold; A The expression of 2 is: ; In the formula, A 2( i , j ) represents A the value of the i th row and j th column of 2; coupleFreq ij represents the i th module, j the number of functional relationships existing in the T func th module; represents the functional coupling threshold; A The expression for 3 is: ; In the formula, A 3( i , j ) represents A the value of the i th row and j th column of 3; sim ij represents the similarity between the i th module and the j th module; T press represents the pressure correlation threshold.

4. The multi-dimensional microservice splitting method for grid services according to claim 1, characterized in that In the graph convolutional encoding section, all three graph convolutional encoders are L layers; Among them, the output of the m +1-th layer of the l th graph convolutional encoder is: ; wherein, m ∈ [1, 2, 3]; A m ( i , j ) is the value of the A m th row and the i th column; j column value; represents the A m th neighbor node set of the i th node; represents the weight matrix of the m th layer of the l th graph convolutional encoder; represents the output of the m th layer of the l th graph convolutional encoder; σ (.) represents a non - linear activation function; wherein, ; .

5. The multi-dimensional microservice splitting method for grid services according to claim 1, wherein The feature fusion part includes: 3 gated neural networks, 3 product layers, and 2 residual connection layers; The m gated neural network is used to Z m perform a linear transformation through a linear layer first, and then be processed by a Sigmoid activation function to obtain the m gating weight g m ; m ∈[1, 2, 3]; The m first product layer is used to multiply g m and Z m together; The first residual connection layer is used to add the outputs of the 3 product layers; The second residual connection layer is used to add the output of the first residual connection layer, Z 1, Z 2, Z 3 to obtain .

6. The multi-dimensional microservice splitting method for grid services according to claim 1, wherein Node clustering unit combination w ij For The method for performing spectral clustering includes: S201, construct an affine matrix S ; where ; S ij represents S the value of the i -th row and j -th column; Ω represents the scale parameter; represents the Euclidean distance between the i -th node and j -th node in S202, based on S perform spectral clustering to obtain K clustering clusters and use them as the clustering result.

7. The multi-dimensional microservice splitting method for grid services according to claim 1, characterized in that The graph convolutional decoding part includes: 3 graph convolutional decoders and 3 reconstruction layers; All 3 graph convolutional decoders are L layers; Among them, the m output of the l layer of the th graph convolutional decoder is: ; Wherein, m ∈ [1, 2, 3]; represents the normalized A m ; represents the m th weight matrix of the l -1 layer of the th graph convolutional decoder; m represents the output of the l -1 layer of the σ th graph convolutional decoder; ; ; The m reconstruction layer is used to reconstruct into ; .

8. The multi-dimensional microservice splitting method for grid services according to claim 1, characterized in that L clus , L sa , Loss The expression of ; In the formula, γ represents the hyperparameter that controls L clus the contribution; λ represents the hyperparameter that balances L sa ...; represents the Frobenius norm; represents the i th j node and the C ( i ) represents the set of nodes in the same cluster as the th i node in 9. A multi-dimensional microservice splitting system for grid services, characterized in that, It uses the multi-dimensional microservice splitting method for power grid services described in any one of claims 1-8; The multi-dimensional microservice splitting system for power grid services includes: A multi-attribute graph construction module, which is used to: extract static information, dynamic information, and service information from the grid service monomer program to form an initial feature matrix X , construct a service channel adjacency matrix based on the grid service monomer program A 1. Functional channel adjacency matrix A 2. Pressure channel adjacency matrix A 3, and combine with X to form a multi-attribute graph G ; A neural network processing module, which is used to: input G into a multi-channel graph neural network for processing; and A neural network iteration module, which is used for: based on L clus , L sa construct a total loss function Loss , and perform backpropagation to adjust the parameters of the multi-channel graph neural network until the network converges, and use the clustering result obtained at this time as the microservice splitting result.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the multi-dimensional microservice splitting method for power grid services described in any one of claims 1-8.

Citation Information

Patent Citations

  • A Single-Unit Program Decomposition Method and System for Multi-Channel Attention Graph Neural Network Clustering

    CN114647465B

  • Dynamic perception rescheduling method for large-scale micro-service application and application

    CN114518948A

  • Single program splitting method and system for multi-channel attention map neural network clustering

    CN114647465A

  • Micro-service splitting method based on system characteristics

    CN115794039A

  • Micro-service splitting method based on depth map reconstruction

    CN116974523A

Cited By

  • Micro-service division method and electronic equipment

    CN120892799A

  • Micro-service partitioning method and electronic device

    CN120892799B