Industrial production Internet of Things business micro-service extraction method, medium and system

By collecting and analyzing industrial production data, building node contribution optimization model and spectral clustering algorithm, and automatically identifying and optimizing business microservices, the problem of inaccurate microservice division in the existing technology is solved, and high cohesion and low coupling microservice extraction and data synchronization are achieved.

CN120234498AActive Publication Date: 2025-07-01BEIJING NANCAL RUIYUAN DIGITAL TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510304844.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-01
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

The prior art is difficult to automatically identify and extract highly cohesive and low coupling business microservices from industrial production data, resulting in inaccurate microservice division.

Method used

By collecting industrial production data, establishing a business relationship chart, calculating node participation and influence degree, building an optimization equation set of node contribution degree, using spectral clustering algorithm to identify tight connection subgraphs, and optimizing microservices based on microservice independence scores to determine the data synchronization mechanism.

Benefits of technology

It realizes the automatic extraction of high-cohesion and low-coupling business microservices from industrial production data, ensures the cohesion and independence of microservices, improves the timeliness and consistency of data synchronization, and improves the reliability and stability of microservice architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234498A_ABST
    Figure CN120234498A_ABST
Patent Text Reader

Abstract

The invention provides an industrial production Internet of Things business micro-service extraction method, medium and system, and belongs to the technical field of electric digital data processing. Establishing an industrial production business relation graph; calculating a node participation degree value and an inter-node influence degree value; constructing and solving a node contribution degree optimization equation set to obtain a node contribution degree matrix, wherein the node contribution degree optimization equation set comprises a target equation used for maximizing the sum of node contribution degrees, a constraint equation used for limiting a value range, a balance equation used for balancing contribution degree distribution and a convergence equation used for judging optimization convergence; obtaining an initial business micro-service by using the node contribution degree matrix and adopting a spectral clustering algorithm; calculating a micro-service cohesion contribution degree and a micro-service coupling contribution degree to obtain a micro-service independence score; optimizing the initial business micro-service according to the micro-service independence score; and determining a data synchronization mechanism of the optimized business micro-service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric digital data processing. Specifically, it relates to a method, medium and system for extracting microservices of industrial production Internet of Things services. Background Art

[0002] Currently, with the booming development of industrial Internet of Things technology, the industrial production process has been continuously automated and intelligentized. Various production equipment, process control systems, and production management systems have been connected to the Internet of Things platform, generating a large amount of rich production business data such as operation data, process parameters, quality indicators, and scheduling instructions. How to make full use of these production data to improve the operation efficiency of the factory and the product quality has become a key problem to be solved urgently.

[0003] In response to this demand, the industry has proposed industrial application solutions based on the microservices architecture. The microservices architecture splits complex industrial application systems into independent service units with high cohesion and low coupling, giving full play to the advantages of modularity, flexibility, and scalability. However, how to automatically identify and extract appropriate business microservices from a large amount of industrial production data remains a major challenge.

[0004] Some existing microservice extraction methods are mainly based on code analysis or domain model analysis, which require a large amount of manual participation and accumulation of domain knowledge. This method is suitable for the microservice transformation of software systems, but for complex fields such as industrial production, the data relationships are intricate and it is difficult to apply directly. In addition, some microservice extraction methods based on data flow analysis, although they can mine microservice boundaries from data relationships, lack a comprehensive consideration of the importance and influence of data, and it is difficult to ensure the cohesion and independence of microservices. That is to say, in the prior art, there is a problem that the division of business microservices is not accurate enough due to the difficulty of fully mining the relationships and influences between data.

[0005] Therefore, there is an urgent need for an automated microservice extraction method based on industrial production data, which can fully mine the relationships and influences between data, identify business microservices with high cohesion and low coupling, and provide strong support for the microservice transformation of industrial Internet of Things applications. Summary of the Invention

[0006] In view of this, the present invention provides a method, medium and system for extracting microservices of industrial production Internet of Things services, which can solve the problem in the prior art that the division of business microservices is not accurate enough due to the difficulty of fully mining the relationships and influences between data.

[0007] The present invention is implemented as follows: A method for extracting industrial production Internet of Things service microservices provided by the first aspect of the present invention includes: collecting industrial production service data; establishing an industrial production service relationship graph; calculating the node participation value and the node - to - node influence value; constructing and solving a node contribution optimization equation set to obtain a node contribution matrix, where the node contribution optimization equation set includes an objective equation for maximizing the total node contribution, a constraint equation for limiting the value range, a balance equation for balancing the contribution distribution, and a convergence equation for judging the optimization convergence; using the node contribution matrix to obtain initial service microservices by means of spectral clustering algorithm; calculating the microservice cohesion contribution and the microservice coupling contribution to obtain a microservice independence score; optimizing the initial service microservices according to the microservice independence score; and determining the data synchronization mechanism of the optimized service microservices.

[0008] Among them, the industrial production service data includes production equipment operation data, production process parameter data, production quality inspection data, production scheduling instruction data, and production environment monitoring data.

[0009] Among them, the nodes in the industrial production service relationship graph represent the industrial production service data. The node participation value is obtained according to the number of times the node is called by other nodes, and the node - to - node influence value is obtained according to the number of times the node calls other nodes.

[0010] Among them, the node contribution optimization equation set includes a node contribution objective equation, a node contribution constraint equation, a node contribution balance equation, and a node contribution convergence equation.

[0011] Among them, the node contribution objective equation is used to maximize the total node contribution. The input of the node contribution objective equation includes the node participation value and the node - to - node influence value, and the output of the node contribution objective equation is the node contribution matrix. The node contribution constraint equation is used to limit the value range of the node contribution matrix. The input of the node contribution constraint equation includes a preset maximum influence threshold and a preset minimum influence threshold, and the output of the node contribution constraint equation is a node contribution constraint interval.

[0012] Among them, the node contribution balance equation is used to balance the distribution of the node contribution matrix. The input of the node contribution balance equation includes the node participation value and the node - to - node influence value, and the output of the node contribution balance equation is a node contribution balance coefficient. The node contribution convergence equation is used to judge the optimization convergence state of the node contribution matrix. The input of the node contribution convergence equation includes the iterative difference of the node contribution matrix and a preset convergence threshold, and the output of the node contribution convergence equation is an optimization convergence state.

[0013] Among them, the cohesion contribution degree of the microservice is the sum of the node contribution degrees within the initial business microservice, and the coupling contribution degree of the microservice is the sum of the node contribution degrees between the initial business microservice and other initial business microservices.

[0014] Among them, the data synchronization mechanism includes data synchronization priority, data synchronization timing, and data consistency rules.

[0015] The second aspect of the present invention provides a computer-readable storage medium, in which program instructions are stored. When the program instructions run on a computer, they are used to execute the above-mentioned method for extracting industrial production Internet of Things business microservices.

[0016] The third aspect of the present invention provides an industrial production Internet of Things business microservice extraction system, which includes the above-mentioned computer-readable storage medium. The system can be any one of a computer, a server, and a single-chip microcomputer. The computer-readable storage medium is set inside the system, and a microprocessor for executing the program instructions stored in the computer-readable storage medium is set inside the system.

[0017] Compared with the prior art, the present invention provides a method, medium, and system for extracting industrial production Internet of Things business microservices. The present invention proposes a method for extracting industrial production Internet of Things business microservices, which can automatically identify and extract highly cohesive and low-coupling business microservices from industrial production data. Compared with the prior art, this method has the following advantages:

[0018] 1. Comprehensively mining data relationships and impacts. The method of the present invention not only considers the direct call relationships between nodes, but also analyzes the indirect influence relationships. By constructing node participation degree and node influence degree indicators, the mutual influences between data are comprehensively characterized. This lays a foundation for accurately identifying business microservices subsequently.

[0019] 2. Extracting microservices by means of mathematical optimization. The method of the present invention proposes a multi-constraint node contribution degree optimization model. Using indicators such as node participation degree and node influence degree, the contribution degree weights of each node are determined through mathematical optimization. This method objectively quantifies the importance of nodes and avoids the influence of subjective experience on the division of microservices.

[0020] 3. Identifying tightly connected subgraphs based on the spectral clustering algorithm. The method of the present invention uses the optimized node contribution degree information and adopts the spectral clustering algorithm to identify the tightly connected subgraphs in the business relationship graph, and these subgraphs are the initial business microservices. This method can automatically discover the microservice boundaries without relying on manual experience.

[0021] 4. Further improve the quality of microservices through cohesion-coupling optimization. The method of the present invention not only identifies the initial microservices, but also further evaluates the cohesion contribution degree and coupling contribution degree of each microservice, and optimizes and reorganizes the microservices according to the microservice independence score. This ensures that the final microservices have strong cohesion and independence.

[0022] 5. Determine the data synchronization mechanism between microservices. The method of the present invention finally determines the priority, timing, and consistency rules for data synchronization for the optimized microservices according to the node contribution degree information. This ensures the timely synchronization and consistency of critical data between microservices and improves the reliability of the microservice architecture.

[0023] In summary, the method for extracting industrial production IoT service microservices proposed by the present invention makes full use of the internal relationships and impacts of industrial production data. Through technical means such as mathematical optimization, spectral clustering, and cohesion-coupling evaluation, it automatically extracts highly cohesive and low-coupling service microservices from massive data, and determines the data synchronization mechanism between microservices, solving the problem in the prior art that the extraction of service microservices is inaccurate due to the difficulty of fully mining the relationships and impacts between data. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a flowchart of the method of the present invention.

[0025] Figure 2 is the industrial production data acquisition architecture diagram in Embodiment 2.

[0026] Figure 3 is the service node call relationship diagram in Embodiment 2.

[0027] Figure 4 is the participation degree analysis diagram of each node in Embodiment 2.

[0028] Figure 5 is the eigenvalue distribution diagram of the node contribution degree matrix in Embodiment 2.

[0029] Figure 6 is the comparative analysis diagram of the microservices before and after optimization in Embodiment 2, including (A) the performance diagram before optimization and (B) the performance diagram after optimization. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0031] As Figure 1 shown, it is a flowchart of a method for extracting industrial production IoT service microservices provided in the first aspect of the present invention. This method includes the following steps:

[0032] S01. Collect industrial production business data, where the industrial production business data includes production equipment operation data, production process parameter data, production quality inspection data, production scheduling instruction data, and production environment monitoring data;

[0033] S02. Establish an industrial production business relationship diagram, where the nodes in the industrial production business relationship diagram represent the industrial production business data;

[0034] S03. Calculate the data call frequencies in the industrial production business relationship diagram to obtain node participation values and node - to - node influence values. The node participation value is obtained based on the number of times the node is called by other nodes, and the node - to - node influence value is obtained based on the number of times the node calls other nodes;

[0035] S04. Construct a node contribution optimization equation set, where the node contribution optimization equation set includes a node contribution target equation, a node contribution constraint equation, a node contribution balance equation, and a node contribution convergence equation;

[0036] S05. Solve the node contribution optimization equation set to obtain a node contribution matrix;

[0037] S06. Use the node contribution matrix and adopt a spectral clustering algorithm to identify the tightly - connected sub - graphs in the industrial production business relationship diagram to obtain initial business microservices;

[0038] S07. Calculate the microservice cohesion contribution degree and microservice coupling contribution degree of the initial business microservices. The microservice cohesion contribution degree is the sum of the node contribution degrees within the initial business microservice, and the microservice coupling contribution degree is the sum of the node contribution degrees between the initial business microservice and other initial business microservices;

[0039] S08. Calculate the microservice independence score according to the microservice cohesion contribution degree divided by the microservice coupling contribution degree;

[0040] S09. Re - allocate the nodes in the initial business microservices with microservice independence scores lower than a preset independence threshold to other initial business microservices with microservice independence scores higher than the preset independence threshold to obtain optimized business microservices;

[0041] S10. Determine the data synchronization mechanism of the optimized business microservices based on the node contribution matrix. The data synchronization mechanism includes data synchronization priorities, data synchronization timings, and data consistency rules.

[0042] The node contribution optimization equation set includes:

[0043] The node contribution degree objective equation is used to maximize the total node contribution degree. The inputs of the node contribution degree objective equation include the node participation value and the node - to - node influence degree value, and the output of the node contribution degree objective equation is the node contribution degree matrix;

[0044] The node contribution degree constraint equation is used to limit the value range of the node contribution degree matrix. The inputs of the node contribution degree constraint equation include a preset maximum influence degree threshold and a preset minimum influence degree threshold, and the output of the node contribution degree constraint equation is the node contribution degree constraint interval;

[0045] The node contribution degree balance equation is used to balance the distribution of the node contribution degree matrix. The inputs of the node contribution degree balance equation include the node participation value and the node - to - node influence degree value, and the output of the node contribution degree balance equation is the node contribution degree balance coefficient;

[0046] The node contribution degree convergence equation is used to judge the optimization convergence state of the node contribution degree matrix. The inputs of the node contribution degree convergence equation include the iterative difference of the node contribution degree matrix and a preset convergence threshold, and the output of the node contribution degree convergence equation is the optimization convergence state.

[0047] The following is a detailed description of the specific implementation of the above steps.

[0048] Step S01, collect industrial production business data. The purpose of this step is to collect various types of data related to the industrial production process. Specifically, it includes:

[0049] 1) Production equipment operation data: That is, the operation parameters of various industrial equipment, such as rotation speed, temperature, pressure, etc. These data reflect the operation status of the equipment.

[0050] 2) Production process parameter data: Refers to the process parameters of each production process, such as ingredient ratio, reaction time, roasting temperature, etc. These parameters determine the specific execution method of the production process.

[0051] 3) Production quality inspection data: Refers to the data obtained by inspecting various indicators of the production products, such as size, weight, strength, etc. These data reflect the quality status of the products.

[0052] 4) Production scheduling instruction data: Refers to various scheduling instructions issued by production management personnel, such as production task allocation, production progress adjustment, etc. These data describe the control and coordination of the production process.

[0053] 5) Production environment monitoring data: Includes environmental parameters such as workshop temperature and humidity, lighting, and noise. These data reflect the environmental conditions at the production site.

[0054] In summary, the industrial production business data collected in this step lay the foundation for subsequent data analysis and microservice extraction.

[0055] Step S02: Establish an industrial production business relationship graph. The purpose of this step is to construct a graph model that reflects the relationships between various production business data. The specific approach is as follows:

[0056] 1) Consider each type of production data as a node, and the connections between the nodes represent the call or influence relationships between the data.

[0057] 2) Based on the data collection situation, establish an adjacency matrix A between the nodes, where a ij = 1 indicates that node i directly calls the data of node j.

[0058] 3) By analyzing the call relationships between the nodes, a data call frequency matrix F can be obtained, where f ij represents the number of times node i calls node j.

[0059] In short, by establishing an industrial production business relationship graph, the originally scattered data is transformed into an organic network structure, providing an intuitive data model for subsequent microservice extraction.

[0060] Step S03: Calculate the node participation value and the node - to - node influence value. The purpose of this step is to analyze the importance of each node in the entire business relationship network. The specific approach is as follows:

[0061] 1) The node participation value P i reflects the frequency with which node i is called by other nodes. The calculation formula is: where α1 is the indirect influence attenuation coefficient, and its value range is 0.1 0。3 ; δ 为距离衰减系数,取值范围为0.2 0.5; d ki is the shortest path distance from node k to node i.

[0062] 2) The node - to - node influence matrix I describes the mutual influence relationships between the nodes. The calculation formula is: where α2 is the second - order influence weight coefficient, and its value range is 0.2 - 0.4.

[0063] By calculating the node participation value and the node - to - node influence, the importance and criticality of the data in the entire production system can be revealed, providing a basis for subsequent microservice division.

[0064] Step S04: Construct an optimization equation system for node contribution. The purpose of this step is to establish a mathematical model for optimizing the contribution weight of each node. The optimization equation system includes the following four parts:

[0065] 1) Objective equation: The objective is to maximize the sum of node contribution degrees, while considering deviation constraints, normalization constraints, and entropy constraints.

[0066] 2) Constraint equation system: T min ≤ D ij ≤ T max ; |D ij - D ji |≤ ∈1. Constrains the value range of node contribution degrees and symmetry.

[0067] 3) Balance equation: Used to balance the distribution of node contribution degrees.

[0068] 4) Convergence equation: ΔD ≤ ∈2. Used to determine whether the optimization process converges.

[0069] By establishing such a multi-constraint optimization problem, a node contribution degree matrix D reflecting the relative importance of each node can be obtained, providing a basis for subsequent microservice partitioning.

[0070] Step S05, solve the node contribution degree optimization equation system. The purpose of this step is to use a numerical optimization algorithm to solve the node contribution degree optimization equation system constructed in step S04 to obtain the final node contribution degree matrix D. The specific approach is as follows:

[0071] 1) First, according to the business relationship adjacency matrix A and the data call frequency matrix F, calculate the node participation value P i and the node influence degree matrix I.

[0072] 2) Substitute these parameters into the objective function f obj , constraint function, balance function, and convergence function defined in step S04.

[0073] 3) Use a numerical optimization algorithm, such as the gradient descent method, Newton's method, etc., and repeatedly iterate to solve until the convergence condition is met.

[0074] 4) Finally, obtain the stable node contribution degree matrix D.

[0075] This step is the key to the entire microservice extraction process because the node contribution degree matrix D directly determines the subsequent microservice partitioning effect.

[0076] Step S06, use the spectral clustering algorithm to identify tightly connected subgraphs. The purpose of this step is to use the node contribution degree matrix D and use the spectral clustering algorithm to divide the business relationship graph into several tightly connected subgraphs, that is, the initial business microservices. The specific approach is as follows:

[0077] 1) First, calculate the normalized Laplacian matrix where I is the identity matrix and D is the degree matrix.

[0078] 2) Perform eigenvalue decomposition on L to obtain the eigenmatrix composed of eigenvectors.

[0079] 3) Take the first k eigenvectors of the eigenmatrix as input and use the k-means algorithm to cluster the nodes.

[0080] 4) Each clustering cluster corresponds to an initial business microservice.

[0081] The spectral clustering algorithm can utilize the node contribution information to accurately identify the tightly connected subgraphs in the business relationship graph, laying a foundation for subsequent microservice partitioning.

[0082] Step S07, calculate the microservice cohesion contribution and microservice coupling contribution. The purpose of this step is to evaluate the internal cohesion of the initial business microservices and the coupling between microservices, providing a basis for subsequent optimization. The specific approach is as follows:

[0083] 1) For each initial business microservice i, calculate its cohesion contribution where S i represents the set of nodes within the microservice.

[0084] 2) Calculate the coupling contribution between microservice i and other microservices j

[0085] 3) Combine the cohesion contribution and coupling contribution to form the microservice partitioning evaluation matrix M.

[0086] By calculating the cohesion contribution and coupling contribution of microservices, the internal cohesion of microservices and the coupling between microservices can be quantitatively evaluated, providing a basis for subsequent microservice optimization.

[0087] Step S08, calculate the microservice independence score. The purpose of this step is to calculate the independence score of each initial microservice based on the cohesion contribution and coupling contribution, providing a basis for subsequent microservice optimization. The specific approach is as follows:

[0088] 1) For each initial microservice i, calculate its independence score

[0089] 2) The higher the independence score, the more independent the microservice, the stronger the internal coupling degree, and the weaker the coupling degree with other microservices.

[0090] By calculating the microservice independence score, it is possible to identify which microservices have strong internal cohesion but high coupling with other microservices and need further optimization.

[0091] Step S09, optimize microservice partitioning. The purpose of this step is to adjust and optimize the initial microservices based on the microservice independence score to finally obtain the optimized business microservices. The specific approach is as follows:

[0092] 1) Set a pre-determined independence threshold, such as 0.8.

[0093] 2) For the initial microservices with independence scores lower than the threshold, reassign the nodes to other microservices with independence scores higher than the threshold.

[0094] 3) Recalculate the cohesion contribution degree and coupling contribution degree of each microservice until the independence scores of all microservices are higher than the threshold.

[0095] 4) Finally, obtain the optimized business microservices.

[0096] Through this step, the cohesion and independence of microservices can be further improved, the coupling degree between microservices can be reduced, and the design requirements of the microservice architecture can be met.

[0097] Step S10, determine the data synchronization mechanism for microservices. The purpose of this step is to determine the data synchronization mechanism between each optimized business microservice based on the node contribution degree matrix D, including data synchronization priority, data synchronization timing, and data consistency rules. The specific approach is as follows:

[0098] 1) For the data synchronization between each pair of microservices i and j, according to the values of D ij and D ji in the node contribution degree matrix D, determine the data synchronization priority. The larger the contribution degree value, the higher the data synchronization priority.

[0099] 2) Determine the data synchronization timing sequence according to the influence relationship between nodes. That is, which data needs to be synchronized first and which data can be synchronized in parallel.

[0100] 3) According to the symmetry or asymmetry of the node contribution degree, formulate corresponding data consistency rules. If D ij ≈D ji , then strong consistency is adopted; if D ij ≠D ji , then eventual consistency is adopted.

[0101] By determining the data synchronization mechanism between microservices, it is possible to ensure the timely synchronization and consistency of critical data, and improve the reliability and stability of the microservice architecture.

[0102] The following is a detailed description of the calculation process involved in the present invention.

[0103] 1. Adjacency matrix representation of the industrial production business relationship diagram:

[0104]

[0105] In the formula, A is the business relationship adjacency matrix; n is the total number of industrial production business data nodes; a ij represents the direct call relationship from node i to node j, taking 1 when there is a call relationship and 0 otherwise.

[0106] 2. Data call frequency matrix representation:

[0107]

[0108] In the formula, F is the data call frequency matrix; f ij represents the number of times node i calls node j.

[0109] 3. Calculation of node participation value:

[0110]

[0111] In the formula, P i is the participation value of node i; α1 is the indirect influence attenuation coefficient, and its value range is 0.1 0.3 ; δ 为距离衰减系数,取值范围为0.2 0.5; d ki is the shortest path distance from node k to node i.

[0112] 4. Calculation of the influence degree matrix between nodes:

[0113]

[0114] Each element is calculated as follows:

[0115]

[0116] In the formula, i ij is the influence degree value of node i on node j; α2 is the second-order influence weight coefficient, and its value range is 0.2 - 0.4.

[0117] 5. Node contribution degree optimization equation system:

[0118] 5.1 Objective equation:

[0119]

[0120] In the formula, D n×nis the node contribution matrix to be optimized; λ1, λ2, and λ3 are weight coefficients used to balance the deviation constraint, normalization constraint, and entropy constraint respectively, and their value ranges are all from 0.1 to 1.0.

[0121] 5.2 Constraint equations:

[0122] T min ≤D ij ≤T max ;

[0123]

[0124] |D ij -D ji |≤∈1;

[0125] In the formula, T min is the minimum influence degree threshold, with a value of 0.01; T max is the maximum influence degree threshold, with a value of 0.9; ∈1 is the asymmetry constraint threshold, with a value of 0.1.

[0126] 5.3 Balance equation:

[0127]

[0128] In the formula, B ij is the node contribution degree balance coefficient; β1, β2 are balance attenuation coefficients, and their value ranges are all from 0.1 to 1.0.

[0129] 5.4 Convergence equation:

[0130]

[0131] ΔD≤∈2;

[0132] In the formula, ΔD is the iteration difference metric; t is the number of iterations; γ is the maximum difference weight coefficient, with a value of 0.3; ∈2 is the convergence threshold, with a value of 0.001.

[0133] 6. Calculation of the spectral clustering feature matrix:

[0134]

[0135] In the formula, L is the normalized Laplacian matrix; I is the identity matrix; D is the degree matrix, and the diagonal elements are the sum of the node contributions.

[0136] 7. Calculation of the microservice partition evaluation matrix:

[0137]

[0138] In the formula, k is the number of microservices; Cohesion iand Coupling ij They are the cohesion contribution degree and the coupling contribution degree respectively.

[0139] In the field of industrial production Internet of Things, the extraction and determination of business microservices have always been a key technical problem. In the prior art, several common microservice partitioning methods are mainly adopted: one is the manual partitioning method based on the business domain. This method mainly relies on the experience and cognition of domain experts, and divides the service boundary by analyzing the similarity and relevance of business functions. Although this method is intuitive and easy to understand, due to the lack of an objective quantitative evaluation standard, it is often difficult to cope with complex and changeable industrial production scenarios, and there may be significant differences in the partitioning results of different experts. The second is the analysis method based on the static call relationship. This method constructs a call graph by analyzing the dependency relationship between each module of the system, and then uses the graph segmentation algorithm for service partitioning. Although this type of method has a certain degree of objectivity, it only considers the static structural characteristics of the system and ignores the dynamic interaction characteristics during the actual operation process, resulting in the partitioning result may deviate from the actual business scenario. The third is the dynamic analysis method based on the system operation log. By collecting and analyzing the log data during the system operation, the interaction frequency and pattern between modules are statistically analyzed, and a weighted relationship graph is constructed and then the clustering algorithm is applied for service identification. Although this method introduces dynamic operation characteristics, it fails to fully utilize the specific attributes and constraint conditions in the industrial production field. The fourth is the service identification method based on deep learning. By using a neural network model to learn the interaction pattern of the system, the correlation relationship between modules is predicted. Although this type of method has strong pattern recognition ability, it requires a large amount of training data support, and the interpretability of the model is poor, making it difficult to provide intuitive decision-making basis for domain experts.

[0140] In contrast, the present invention proposes an industrial production Internet of Things business microservice extraction method based on node contribution degree optimization, which has significant technical innovation and application advantages. First, the present invention establishes a comprehensive data collection and modeling system, systematically collects multi-dimensional information such as production equipment operation data, process parameter data, quality inspection data, production scheduling instruction data, and production environment monitoring data, and constructs a complete industrial production business relationship graph. This all-round data collection strategy provides a solid data foundation for subsequent microservice partitioning, ensuring the accuracy and integrity of the partitioning result. Second, the present invention innovatively proposes a quantitative evaluation method for node importance. By introducing the calculation of node participation value and node influence value, it not only considers the direct call relationship between nodes, but also considers the indirect influence and distance attenuation effect by introducing an attenuation coefficient. Especially, an exponential decay term is introduced in the calculation of node participation, which more accurately describes the transfer influence characteristics between nodes, making the evaluation of node importance more in line with the actual business scenario.

[0141] The most distinctive innovation of the present invention lies in the construction of a complete set of equations for optimizing node contribution degrees. This innovative design has multiple advantages: Firstly, in terms of the objective equation, multiple optimization objectives such as maximizing the total node contribution, minimizing the deviation from the influence degree, normalization constraint, and entropy constraint are comprehensively considered. By introducing weight coefficients, a dynamic balance among the objectives is achieved. Secondly, in terms of the constraint equations, strict value ranges for contribution degrees, normalization requirements, and symmetry constraints are set, ensuring the rationality and feasibility of the optimization results. Thirdly, in terms of the balance equation, by introducing an exponential decay term to adaptively adjust the contribution degree differences among nodes, the emergence of local polarization phenomena is effectively avoided. Finally, in terms of the convergence equation, both the average difference and the maximum difference dimensions are considered, providing a reliable termination condition for the optimization process and ensuring the stable convergence of the algorithm.

[0142] In terms of the actual application effects, the present invention demonstrates significant advantages: First, it significantly improves the accuracy of service partitioning. Through quantitative contribution degree calculations, the service boundaries are more clearly and reasonably partitioned, effectively reducing the coupling degree among services. Second, it greatly enhances the maintainability of the system. The service partitioning based on contribution degrees makes the responsibilities of each microservice clearer, significantly reducing the system maintenance cost. Third, it obviously improves the system performance. Through an optimized data synchronization mechanism, unnecessary data interactions among services are reduced, improving the overall operation efficiency of the system. Fourth, it greatly enhances the scalability of the system. The service partitioning based on contribution degrees provides a good architectural foundation for the horizontal expansion and vertical upgrade of the system. These advantages have been fully verified in the actual industrial production environment, providing a reliable theoretical basis and practical guidance for the architecture design of industrial Internet.

[0143] Generally speaking, the specific implementation manner of the present invention realizes the precise partitioning of industrial production Internet of Things business microservices through rigorous mathematical modeling and optimization methods, overcoming problems in the prior art such as inaccurate manual experience partitioning, lack of dynamic characteristics in static analysis, and ignoring domain characteristics in log analysis. In particular, by introducing a complete set of equations for optimizing node contribution degrees, the quantitative optimization and dynamic adjustment of the microservice partitioning process are achieved, providing an innovative solution for the architecture design and optimization of industrial production Internet of Things systems. This method based on mathematical optimization not only improves the scientificity and accuracy of service partitioning but also provides a new technical path for the evolution and upgrade of industrial Internet architecture.

[0144] The second aspect of the present invention provides a computer-readable storage medium, in which program instructions are stored. When the program instructions run on a computer, they are used to execute the above-mentioned method for extracting industrial production Internet of Things business microservices.

[0145] The third aspect of the present invention provides an industrial production Internet of Things service microservice extraction system, which includes the above-mentioned computer-readable storage medium. The system can be any one of a computer, a server, and a single-chip microcomputer. The computer-readable storage medium is set inside the system, and a microprocessor for executing program instructions stored in the computer-readable storage medium is set inside the system.

[0146] Specifically, the principle of the present invention is as follows: The core idea of the industrial production Internet of Things service microservice extraction method proposed by the present invention is to utilize the internal relationships and influences of industrial production data, and determine the contribution degree weights of each data node through mathematical optimization, and then use the spectral clustering algorithm to automatically identify business microservices with high cohesion and low coupling. The specific principle is as follows:

[0147] First, the method of the present invention collects rich industrial production data, including equipment operation data, process parameter data, quality inspection data, scheduling instruction data, environmental monitoring data, etc. These data reflect all aspects of the entire production process.

[0148] Secondly, the method of the present invention establishes an industrial production business relationship graph, abstracts various production data as nodes in the graph, and the connections between the nodes represent the call or influence relationships between the data. By analyzing the call frequencies between the nodes, the node participation value and the node influence value can be obtained. The node participation value reflects the frequency of a node being called by other nodes, and the node influence value reflects the influence degree of a node on other nodes. These two indicators provide a basis for subsequent microservice identification.

[0149] Next, the method of the present invention constructs a node contribution degree optimization equation system, including an objective function, constraint conditions, a balance function, and a convergence condition. The objective function aims to maximize the total node contribution degree, while considering the deviation constraint, normalization constraint, and entropy constraint of the node contribution degree. By solving this multi-constraint optimization problem, a node contribution degree matrix reflecting the relative importance of each node can be obtained.

[0150] After having the node contribution degree matrix, the method of the present invention uses the spectral clustering algorithm to identify tightly connected subgraphs from the business relationship graph, and these subgraphs correspond to the initial business microservices. The spectral clustering algorithm can utilize the node contribution degree information to accurately discover the community structure in the graph, providing technical support for the automatic identification of microservice boundaries.

[0151] To further optimize the microservice division, the method of the present invention calculates the cohesion contribution degree and coupling contribution degree of each initial microservice, and reorganizes and adjusts the microservices according to the microservice independence score. The higher the cohesion contribution degree and the lower the coupling contribution degree of a microservice, the stronger its independence and the more in line with the design requirements of the microservice architecture. Through this optimization step, it is ensured that the final microservices have high cohesion and low coupling.

[0152] Finally, the method of the present invention uses the node contribution matrix to determine the priority, timing, and consistency rules for data synchronization for the optimized microservices. This ensures the timely synchronization and consistency of critical data between microservices, enhancing the reliability and stability of the microservice architecture.

[0153] A specific Embodiment 1 of the present invention is provided below, and the specific implementation of each step in this Embodiment 1 is described in detail as follows.

[0154] Step S01, collect industrial production business data. The purpose of this step is to collect various types of data related to the industrial production process, laying a foundation for subsequent analysis and microservice extraction.

[0155] The specific implementation is as follows: First, the system collects the operating data of production equipment, including operating parameters such as the rotation speed, temperature, and pressure of various industrial equipment. These data reflect the operating status of the equipment. Second, collect production process parameter data, including process parameters such as the batching ratio, reaction time, and roasting temperature of each production process. These parameters determine the specific execution method of the production process. Third, collect production quality inspection data, including the inspection results of various indicators such as the size, weight, and strength of the produced products. These data reflect the quality status of the products. In addition, collect production scheduling instruction data, including various scheduling instructions issued by production management personnel, such as production task allocation and production progress adjustment. These data describe the control and coordination of the production process. Finally, collect production environment monitoring data, including environmental parameters such as the temperature, humidity, lighting, and noise in the workshop. These data reflect the environmental conditions at the production site.

[0156] Through the collection and accumulation of these data, a foundation is laid for subsequent industrial production business modeling and microservice extraction.

[0157] Step S02, establish an industrial production business relationship graph. The purpose of this step is to construct a graph model that reflects the relationships between various production business data, providing an intuitive data structure for subsequent analysis and microservice extraction.

[0158] The specific implementation is as follows: First, regard each type of production data as a node, and the connection lines between the nodes represent the call or influence relationships between the data. According to the data collection situation, an adjacency matrix A between the nodes can be established, where a ij = 1 indicates that node i directly calls the data of node j.

[0159] By analyzing the call relationships between the nodes, a data call frequency matrix F can be further obtained, where f ij represents the number of times node i calls node j.

[0160] In this way, a graph model reflecting the business relationships of industrial production is established, where nodes represent various production data, and the connection lines and their weights represent the call and influence relationships between the data. This lays the foundation for subsequent microservice extraction.

[0161] Step S03: Calculate the node participation value and the node influence value. The purpose of this step is to analyze the importance of each node in the entire business relationship network and provide a basis for subsequent microservice partitioning.

[0162] The specific implementation method is as follows:

[0163] First, calculate the node participation value P i , to reflect the frequency of node i being called by other nodes. The calculation formula is:

[0164]

[0165] Among them, α1 is the indirect influence attenuation coefficient, and its value range is 0.1 - 0.3; δ is the distance attenuation coefficient, and its value range is 0.2 - 0.5; d ki is the shortest path distance from node k to node i.

[0166] Secondly, calculate the node influence matrix I to describe the mutual influence relationship between each node. The calculation formula is:

[0167]

[0168] Among them, α2 is the second-order influence weight coefficient, and its value range is 0.2 - 0.4.

[0169] By calculating the node participation value and the node influence, the importance and criticality of data in the entire production system can be revealed, providing a basis for subsequent microservice partitioning.

[0170] Step S04: Construct an optimization equation system for node contribution. The purpose of this step is to establish a mathematical model for optimizing the contribution weights of each node and provide a basis for microservice extraction.

[0171] The optimization equation system includes the following four parts:

[0172] 1. Objective equation:

[0173]

[0174] The purpose of this objective equation is to maximize the total node contribution, while considering deviation constraints, normalization constraints, and entropy constraints. Among them, λ1, λ2, λ3 are weight coefficients, and their value ranges are all 0.1 - 1.0.

[0175] 2. Constraint equation system:

[0176] T min ≤D ij ≤T max ; |D ij -D ji |≤∈1

[0177] This constraint condition limits the value range of the node contribution degree D ij and requires the node contribution degree to satisfy normalization and symmetry in both row and column directions. Among them, T min = 0.01 is the minimum influence degree threshold, T max = 0.9 is the maximum influence degree threshold, and ∈1 = 0.1 is the asymmetry constraint threshold.

[0178] 3. Balance equation:

[0179]

[0180] This balance equation aims to balance the distribution of the node contribution degree. Among them, β1 and β2 are balance attenuation coefficients, and their value ranges are both 0.1 to 1.0.

[0181] 4. Convergence equation:

[0182]

[0183] This convergence equation is used to judge whether the optimization process converges. Among them, γ = 0.3 is the maximum difference weight coefficient, and ∈2 = 0.001 is the convergence threshold.

[0184] By establishing such a multi-constraint optimization problem, a node contribution degree matrix D reflecting the relative importance of each node can be obtained, providing a basis for subsequent microservice partitioning.

[0185] Step S05, solve the node contribution degree optimization equation system. The purpose of this step is to use a numerical optimization algorithm to solve the node contribution degree optimization equation system constructed in step S04 to obtain the final node contribution degree matrix D.

[0186] The specific implementation method is as follows: First, according to the business relationship adjacency matrix A and the data call frequency matrix F, calculate the node participation value P i and the node influence degree matrix I. Then, substitute these parameters into the objective function f obj , constraint function, balance function and convergence function defined in step S04. Next, use a numerical optimization algorithm, such as the gradient descent method, Newton method, etc., to repeatedly iterate and solve until the convergence condition is satisfied. Finally, a stable node contribution degree matrix D is obtained.

[0187] This step is crucial for the entire microservice extraction process because the node contribution matrix D directly determines the subsequent microservice partitioning effect.

[0188] Step S06: Use the spectral clustering algorithm to identify tightly connected subgraphs. The purpose of this step is to use the node contribution matrix D and apply the spectral clustering algorithm to divide the business relationship graph into several tightly connected subgraphs, namely the initial business microservices.

[0189] The specific implementation is as follows: First, calculate the normalized Laplacian matrix where I is the identity matrix and D is the degree matrix. Then, perform eigenvalue decomposition on L to obtain the eigenmatrix composed of eigenvectors. Next, use the first k eigenvectors of the eigenmatrix as input and apply the k-means algorithm to cluster the nodes. Each clustering cluster corresponds to an initial business microservice.

[0190] The spectral clustering algorithm can utilize the node contribution information to accurately identify the tightly connected subgraphs in the business relationship graph, laying a foundation for the subsequent microservice partitioning.

[0191] Step S07: Calculate the microservice cohesion contribution and microservice coupling contribution. The purpose of this step is to evaluate the internal cohesion of the initial business microservices and the coupling between microservices, providing a basis for subsequent optimization.

[0192] The specific implementation is as follows: For each initial business microservice i, calculate its cohesion contribution where S i represents the set of nodes within this microservice. At the same time, calculate the coupling contribution between microservice i and other microservices j Form the microservice partitioning evaluation matrix M with the cohesion contribution and coupling contribution.

[0193] By calculating the cohesion contribution and coupling contribution of microservices, the internal cohesion of microservices and the coupling between microservices can be quantitatively evaluated, providing a basis for subsequent microservice optimization.

[0194] Step S08: Calculate the microservice independence score. The purpose of this step is to calculate the independence score of each initial microservice based on the cohesion contribution and coupling contribution, providing a basis for subsequent microservice optimization.

[0195] The specific implementation is as follows: For each initial microservice i, calculate its independence score The higher the independence score, the more independent the microservice, the stronger the internal coupling, and the weaker the coupling with other microservices.

[0196] By calculating the microservice independence score, it is possible to identify which microservices have strong internal cohesion but high coupling with other microservices and need further optimization.

[0197] Step S09, optimize the microservice partitioning. The purpose of this step is to adjust and optimize the initial microservices according to the microservice independence score, and finally obtain the optimized business microservices.

[0198] The specific implementation is as follows: First, set an independence threshold, such as 0.8. For the initial microservices with independence scores lower than the threshold, reallocate the nodes in them to other microservices with independence scores higher than the threshold. Then recalculate the cohesion contribution degree and coupling contribution degree of each microservice until the independence scores of all microservices are higher than the threshold. Finally, the optimized business microservices are obtained.

[0199] Through this step, the cohesion and independence of microservices can be further improved, the coupling degree between microservices can be reduced, and the design requirements of the microservice architecture can be met.

[0200] Step S10, determine the data synchronization mechanism of microservices. The purpose of this step is to determine the data synchronization mechanism between each optimized business microservice according to the node contribution matrix D, including data synchronization priority, data synchronization timing, and data consistency rules.

[0201] The specific implementation is as follows: For the data synchronization between each pair of microservices i and j, according to the values of D ij and D ji in the node contribution matrix D, determine the data synchronization priority. The larger the contribution value, the higher the data synchronization priority. Then, according to the influence relationship between nodes, determine the timing order of data synchronization, that is, which data needs to be synchronized first and which data can be synchronized in parallel. Finally, according to the symmetry or asymmetry of the node contribution degree, formulate corresponding data consistency rules. If D ij ≈D ji , then strong consistency is adopted; if D ij ≠D ji , then eventual consistency is adopted.

[0202] By determining the data synchronization mechanism between microservices, the timely synchronization and consistency of key data can be ensured, and the reliability and stability of the microservice architecture can be improved.

[0203] In order to better understand and implement the present invention, the following provides Example 2 of a specific application scenario of the present invention: A certain industrial park brings together many large-scale mechanical equipment manufacturing companies, and their products cover the fields of engineering machinery, CNC machine tools, intelligent instruments, etc. With the continuous application of industrial Internet technology, the factory has achieved comprehensive interconnection of production equipment, process control systems, and production management systems. These systems generate a large amount of production operation data, process parameter data, quality inspection data, production scheduling data, and environmental monitoring data every day. How to tap the intrinsic value of these data and improve the factory's operating efficiency and product quality has become a major problem in park management.

[0204] To this end, the park management decided to adopt the industrial production Internet of Things business microservice extraction method proposed in this invention to uniformly analyze and integrate the production data of various enterprises in the park, in order to achieve optimization and coordination of the production process. The following is the specific implementation of this method in a typical mechanical equipment manufacturing enterprise.

[0205] The first step is data collection. The company's production workshop has a total of 10 production lines, involving three major categories of products, namely engineering machinery, CNC machine tools and intelligent instruments. Each production line is equipped with a PLC control system, SCADA monitoring system and MES production management system. These systems generate a large amount of production operation data, process parameter data, quality inspection data, production scheduling data and environmental monitoring data every day. In response to these data, the company has established a unified data collection platform to collect and store these production business data in real time through various sensors and collection equipment.

[0206] Taking one of the engineering machinery production lines in the company's production workshop as an example, the specific data collected are shown in Table 1.

[0207] Table 1 Example of data collected from construction machinery production line

[0208] Data type Data item Equipment operation data Main motor speed, hydraulic oil pressure, hydraulic oil temperature, bearing temperature Process parameter data Hydraulic system oil supply pressure, welding machine current, air pressure in spraying process Quality inspection data Product dimensions, product weight, product strength Dispatch instruction data Production task assignment, production schedule adjustment, equipment maintenance plan Environmental monitoring data Workshop temperature, workshop humidity, workshop illumination, workshop noise

[0209] It can be seen that these data cover all aspects of the entire production process, laying the foundation for subsequent business relationship analysis and microservice extraction. Figure 2 It is a hierarchical structure diagram that shows the complete data acquisition architecture from the bottom-level sensors to the top-level unified data acquisition platform. The diagram contains four layers: sensor layer (including speed, pressure, temperature and other sensors), data type layer (equipment operation, process parameters, quality inspection, environmental monitoring), system layer (PLC, SCADA, MES) and platform layer. Arrows are used between the layers to indicate the data flow, clearly showing the hierarchical relationship of data acquisition.

[0210] Step 2: Establish the business relationship graph. Based on the collected production data, a business relationship graph of the enterprise's construction machinery production line was constructed. Figure 3 It is a directed graph that shows the call relationships between different types of nodes (process parameters, quality inspections, environmental monitoring). Different colors are used to distinguish node types, and the call frequencies are marked on the connecting lines between nodes, intuitively showing the interaction relationships between business nodes. The specific approach is as follows:

[0211] First, each category of production data is regarded as a node, and there are a total of 15 nodes. Then, based on the direct call relationships between the nodes, a business relationship adjacency matrix A was constructed. The following is a partial content of this adjacency matrix:

[0212]

[0213] It can be seen from this adjacency matrix that node 1 (main motor speed) directly calls node 5 (welding current) and node 6 (air pressure in the spraying process); node 5 (welding current) directly calls node 8 (product size) and node 11 (workshop temperature), etc.

[0214] Next, the call frequencies between nodes were analyzed, and a data call frequency matrix F was constructed. Part of the content is as follows:

[0215]

[0216] It can be seen from this that node 1 (main motor speed) calls node 5 (welding current) 24 times and calls node 6 (air pressure in the spraying process) 36 times; node 5 (welding current) calls node 8 (product size) 27 times and calls node 11 (workshop temperature) 18 times, etc.

[0217] By constructing the business relationship adjacency matrix A and the data call frequency matrix F, a business relationship graph of the enterprise's construction machinery production line was established, laying a foundation for subsequent microservice extraction.

[0218] Step 3: Calculate the node participation value and the node - to - node influence value. Based on the aforementioned business relationship adjacency matrix A and data call frequency matrix F, the participation values of each node and the influence values between nodes were calculated. Figure 4 It is an optimized bar chart that shows the distribution of the participation values of 15 nodes. Nodes with a participation value greater than 50 are marked in red, and the others are in blue. The specific values are marked above each bar, and gridlines are added to improve readability.

[0219] First, the node participation value P i The calculation formula is:

[0220] Among them, α1 = 0.2 is the indirect influence attenuation coefficient, and δ = 0.3 is the distance attenuation coefficient. The participation values of each node are calculated according to this formula, and the results are shown in Table 2.

[0221] Table 2 Node Participation Values

[0222]

[0223]

[0224] As can be seen from Table 2, the participation values of Node 5 (welding machine current) and Node 1 (main motor speed) are the highest, 69 and 60 respectively, indicating that these two nodes play key roles in the entire production process. The participation value of Node 15 (production task / schedule / maintenance) is 0, indicating that this node is not directly called by other nodes.

[0225] Secondly, the influence matrix I between nodes is calculated, where i ij represents the influence degree of Node i on Node j. The calculation formula is:

[0226]

[0227] According to this formula, part of the content of the influence matrix between nodes is obtained as follows:

[0228]

[0229] As can be seen from Matrix I, the influence degree of Node 5 (welding machine current) on Node 8 (product size) is 0.6, while the influence degree on Node 11 (workshop temperature) is 0.4; the influence degree of Node 7 (hydraulic system oil supply pressure) on Node 4 (bearing temperature) is 0.7, and the influence degree on Node 10 (product strength) is 0.3. These data reflect the mutual influence relationship between nodes.

[0230] By calculating the node participation values and the influence degree between nodes, the status and role of each production data node in the entire production system can be initially understood, laying a foundation for subsequent microservice extraction.

[0231] Fourth step, construct an optimization equation system for node contribution. Based on the previously calculated node participation value P i and the influence matrix I between nodes, an optimization equation system for node contribution is constructed to determine the contribution weight of each node. This optimization equation system includes the following four parts:

[0232] 1. Objective function:

[0233] The objective function aims to maximize the sum of node contribution degrees, while considering the deviation constraint, normalization constraint, and entropy constraint of node contribution degrees.

[0234] 2. Constraint condition: 0.01 ≤ D ij ≤ 0.9; |D ij -D ji | ≤ 0.1;

[0235] This constraint condition limits the value range of the node contribution degree D ij and requires the node contribution degree to satisfy normalization and symmetry in the row and column directions.

[0236] 3. Balance function:

[0237] This balance function aims to balance the distribution of node contribution degrees.

[0238] 4. Convergence condition:

[0239] This convergence condition is used to determine whether the optimization process converges.

[0240] According to the above optimization equations, numerical optimization algorithms are used for iterative calculations, and finally a stable node contribution degree matrix D is obtained. Some of the results are as follows:

[0241]

[0242] From this node contribution degree matrix, it can be seen that the contribution degree of node 5 (welding machine current) is the highest, reaching 0.14; the contribution degrees of node 1 (main motor speed), node 8 (product size), and node 5 (welding machine current) are also relatively high, being 0.08, 0.10, and 0.15 respectively. While the contribution degree of node 15 (production task / schedule / maintenance) is 0, indicating that the role of this node in the entire production system is relatively small.

[0243] In the fifth step, the spectral clustering algorithm is used to identify tightly connected subgraphs. Based on the node contribution degree matrix D calculated in the previous step, the spectral clustering algorithm is used to perform clustering analysis on the industrial production business relationship graph to automatically identify business microservices with high cohesion and low coupling. Figure 5 is a curve graph of eigenvalue distribution, showing the distribution of 15 eigenvalues of the node contribution degree matrix. A red dashed line is added at k = 5 to mark the clustering threshold, which reflects the basis for determining the number of microservices in the spectral clustering algorithm.

[0244] The specific approach is as follows: First, calculate the normalized Laplacian matrix Among them, I is the identity matrix and D is the degree matrix. Then, perform eigenvalue decomposition on L to obtain the eigenmatrix composed of eigenvectors. Finally, take the first 5 eigenvectors of the eigenmatrix as the input and use the k-means algorithm to cluster the nodes. Through cluster analysis, the 15 nodes are divided into 5 tightly connected subgraphs, namely 5 initial business microservices. The composition of these 5 microservices is shown in Table 3.

[0245] Table 3 Initial Business Microservices

[0246]

[0247]

[0248] As can be seen from Table 3, these 5 initial microservices focus on different business areas such as process parameter monitoring, product quality inspection, and environmental monitoring respectively, and the coupling degree between them is relatively low. This lays a foundation for subsequent microservice optimization.

[0249] Step 6: Calculate the cohesion contribution degree of microservices and the coupling contribution degree of microservices. To further optimize the microservice partitioning, the cohesion contribution degree of each initial microservice and the coupling contribution degree between microservices are calculated.

[0250] Cohesion Contribution Degree i It reflects the tightness between the nodes inside microservice i, and the calculation formula is:

[0251] Coupling Contribution Degree ij It reflects the coupling degree between microservice i and microservice j, and the calculation formula is:

[0252] According to the above formulas, the cohesion contribution degree and coupling contribution degree of each initial microservice are obtained, and the results are shown in Table 4.

[0253] Table 4 Cohesion Contribution Degree and Coupling Contribution Degree of Initial Microservices

[0254]

[0255] As can be seen from Table 4, the cohesion contribution degree of microservice 1 is the highest, reaching 0.37, indicating that the connection between the nodes inside this microservice is the closest. While the cohesion contribution degree of microservice 5 is the lowest, only 0.10. From the perspective of the coupling contribution degree, the coupling degree between microservice 1 and other microservices is relatively high, especially the coupling degree with microservice 5 (environmental monitoring) reaches 0.06, which needs to be optimized keyly.

[0256] Step 7: Optimize the microservice partitioning. Based on the evaluation results of the above cohesion contribution degree and coupling contribution degree, the initial 5 microservices are optimized and adjusted.

[0257] First, an independence threshold of 0.8 is set. That is to say, if the cohesion contribution degree of a certain microservice divided by the sum of the coupling contribution degrees of other microservices is less than 0.8, then this microservice needs to be optimized.

[0258] After calculation, the independence scores of Microservice 1 and Microservice 2 are 0.85 and 0.83 respectively, meeting the requirements; while the independence scores of Microservice 3, Microservice 4 and Microservice 5 are 0.76, 0.67 and 0.59 respectively, which are lower than the threshold and need to be optimized.

[0259] The specific approach is to reallocate the nodes in Microservice 3, Microservice 4 and Microservice 5 to Microservice 1 and Microservice 2 with higher independence scores. After multiple rounds of iterative optimization, finally 3 optimized business microservices are obtained, as shown in Table 5.

[0260] Table 5 Optimized Business Microservices

[0261]

[0262]

[0263] Figure 6 It is a comparison chart of twin graphs. The left sub-graph (A) and the right sub-graph (B) respectively show the comparison of the cohesion contribution degree and independence scores of the three microservices before and after optimization. Different colors are used to distinguish the two indicators, and grid lines are added to improve readability. Through this comparison layout, the improvement of the microservice performance after optimization can be intuitively seen. It can be seen that after optimization, the cohesion contribution degrees of the 3 microservices all exceed 0.3, the coupling contribution degrees are all lower than 0.12, and the independence scores are all higher than 0.8, meeting the design requirements of the microservice architecture.

[0264] In the eighth step, determine the data synchronization mechanism of the microservices. Finally, according to the optimized node contribution degree matrix D, the data synchronization priorities, timings and consistency rules are determined for these 3 business microservices.

[0265] First, for the data synchronization within the microservice, the data synchronization priority is determined according to the size of the node contribution degree value. For example, within Microservice 1, the contribution degree of Node 5 (welding machine current) is the highest, so its data synchronization priority with other nodes is also the highest.

[0266] Secondly, according to the influence relationship between nodes, the data synchronization timing sequence is determined. For example, in Microservice 1, Node 1 (main motor speed) has a greater influence on Node 5 (welding machine current), so the data synchronization of the main motor speed needs to be completed first, and then the welding machine current data is synchronized.

[0267] Finally, for data synchronization between microservices, corresponding data consistency rules are formulated according to the symmetry or asymmetry of node contribution degrees. If the elements of the node contribution degree matrix between two microservices are basically symmetric, strong consistency is adopted; if there is obvious asymmetry, eventual consistency is adopted.

[0268] Through the above method, a unified synchronization mechanism is formulated for the key data in the entire industrial production process, which can not only ensure the timely synchronization of data, but also ensure the consistency of data, providing strong support for the refined management of the factory.

[0269] It should be noted that the detailed explanations of the variables involved in the present invention are shown in Table 6 below.

[0270] Table 6 Variable Explanation Table

[0271]

[0272]

[0273] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention.

Claims

1. A method for extracting microservices from industrial production Internet of Things business, characterized in that: include: Collect industrial production business data; establish industrial production business relationship diagram; Calculate node participation values ​​and inter-node influence values; Constructing and solving a node contribution optimization equation group to obtain a node contribution matrix, wherein the node contribution optimization equation group includes a target equation for maximizing the sum of node contributions, a constraint equation for limiting a value range, a balance equation for balancing contribution distribution, and a convergence equation for judging optimization convergence; Using the node contribution matrix and adopting a spectral clustering algorithm to obtain initial business microservices; Calculate the microservice cohesion contribution and microservice coupling contribution to obtain the microservice independence score; Optimizing the initial business microservice according to the microservice independence score; Determine the data synchronization mechanism for optimized business microservices.

2. The method for extracting microservices of industrial production Internet of Things business according to claim 1 is characterized in that: The industrial production business data includes production equipment operation data, production process parameter data, production quality inspection data, production scheduling instruction data and production environment monitoring data.

3. The method for extracting microservices of industrial production Internet of Things business according to claim 1 is characterized in that: The nodes in the industrial production business relationship graph represent the industrial production business data, the node participation value is obtained according to the number of times the node is called by other nodes, and the inter-node influence value is obtained according to the number of times the node calls other nodes.

4. The method for extracting microservices of industrial production Internet of Things business according to claim 1 is characterized in that: The node contribution optimization equation group includes a node contribution target equation, a node contribution constraint equation, a node contribution balance equation, and a node contribution convergence equation.

5. The method for extracting microservices of industrial production Internet of Things business according to claim 4 is characterized in that: The node contribution objective equation is used to maximize the sum of node contributions, the input of the node contribution objective equation includes the node participation value and the inter-node influence value, and the output of the node contribution objective equation is the node contribution matrix; The node contribution constraint equation is used to limit the value range of the node contribution matrix. The input of the node contribution constraint equation includes a preset maximum influence threshold and a preset minimum influence threshold. The output of the node contribution constraint equation is a node contribution constraint interval.

6. The method for extracting microservices of industrial production Internet of Things business according to claim 4 is characterized in that: The node contribution balance equation is used to balance the distribution of the node contribution matrix, the input of the node contribution balance equation includes the node participation value and the inter-node influence value, and the output of the node contribution balance equation is the node contribution balance coefficient; The node contribution convergence equation is used to determine the optimized convergence state of the node contribution matrix. The input of the node contribution convergence equation includes the iterative difference of the node contribution matrix and a preset convergence threshold. The output of the node contribution convergence equation is the optimized convergence state.

7. The method for extracting microservices of industrial production Internet of Things business according to claim 1 is characterized in that: The microservice cohesion contribution is the sum of the node contributions within the initial business microservice, and the microservice coupling contribution is the sum of the node contributions between the initial business microservice and other initial business microservices.

8. The method for extracting microservices of industrial production Internet of Things business according to claim 1 is characterized in that: The data synchronization mechanism includes data synchronization priority, data synchronization timing and data consistency rules.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed in a computer, they are used to execute the method for extracting microservices for industrial production Internet of Things business according to any one of claims 1 to 8.

10. An industrial production Internet of Things business microservice extraction system, characterized in that: The system comprises the computer-readable storage medium as claimed in claim 9, wherein the system is any one of a computer, a server, and a single-chip microcomputer, the computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

Citation Information

Patent Citations

  • Micro-service division method and device, computer equipment and readable storage medium

    CN112540749A

  • Micro-service evaluation method and device

    CN113222388A

  • Micro-service extraction method and system, medium, equipment and information processing terminal

    CN115309634A

  • Micro-service division method

    CN117459359A

  • Enterprise production data micro-service granularity optimization method, medium and system

    CN119356687A