Industrial production data micro-service partition optimization method, medium and system

By constructing the microservice coupling degree index matrix and the data dependence weight matrix, dynamic evaluation is carried out in combination with the neural network model, multiple groups of candidate partition schemes are generated, and optimized through resource balance, response time, data consistency and stability constraint equations, and the optimal partition scheme is selected, which solves the problems of unbalanced resource utilization, increased service response delay, data synchronization delay and inconsistency in industrial production data microservice partitions, and realizes dynamic optimization of system performance under the premise of ensuring data consistency.

CN120123091AActive Publication Date: 2025-06-10BEIJING NANCAL RUIYUAN DIGITAL TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510214885.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-10
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

The prior art has problems of unbalanced resource utilization, increased service response delay, data synchronization delay and inconsistency in industrial production data microservice partitions, making it difficult to achieve dynamic optimization of system performance while ensuring data consistency.

Method used

By constructing the microservice coupling degree index matrix and the data dependence weight matrix, dynamic evaluation is carried out in combination with the neural network model, multiple groups of candidate partition schemes are generated, and optimized through resource balance, response time, data consistency and stability constraint equations to select the optimal partition scheme.

Benefits of technology

It realizes dynamic optimization of system performance while ensuring data consistency, significantly improves the overall performance and resource utilization efficiency of the system, and can more accurately predict the impact of partition changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123091A_ABST
    Figure CN120123091A_ABST
Patent Text Reader

Abstract

The invention provides an industrial production data micro-service partition optimization method, a medium and a system, and belongs to the technical field of electrical digital data process.The industrial production data micro-service partition optimization method comprises the steps that firstly, a micro-service coupling degree index matrix is constructed, and a dependency weight matrix is obtained through data blood relationship graph analysis; combining singular value decomposition to obtain a correlation intensity matrix; a neural network model is trained based on resource occupation data, a partition change gain rate is calculated, and candidate schemes are generated by solving an equation set including resource balance, response time, data consistency and stability constraints. Finally, an optimal partition scheme is selected according to the evaluation index set, micro-service recombination is completed, balance optimization of system performance and data consistency is achieved, and the technical problem that in the prior art, industrial production data micro-service partitions are not optimized enough is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electrical digital data processing. Specifically, it relates to an industrial production data microservice partition optimization method, medium, and system. Background Art

[0002] With the rapid development of industrial Internet, the data scale and complexity in industrial production environments are continuously increasing, and the microservice architecture has become the mainstream technical solution for industrial data processing. In industrial production scenarios, traditional microservice partition methods mainly perform static partitioning based on the call relationships and data access patterns between services, or adopt dynamic partition strategies based on load balancing. These methods perform well in dealing with small-scale and simple scenarios and can effectively improve system performance and resource utilization. Currently, the mainstream industrial production data microservice partition schemes include static partition methods based on service dependency graphs, dynamic partition methods based on data affinity, and adaptive partition methods based on resource utilization. These methods have been widely applied in industrial fields and provide important support for the efficient processing of industrial data.

[0003] However, traditional microservice partition methods have significant defects. First, static partition methods cannot adapt to the dynamic changes in data traffic and business requirements during the industrial production process, resulting in unbalanced system resource utilization and increased service response latency. Second, dynamic partition methods based on load balancing overly focus on system performance metrics and ignore the consistency requirements of industrial data, which are prone to cause data synchronization latency and inconsistency problems in data-intensive scenarios. Third, although existing adaptive partition methods consider system performance and data characteristics, they fail to establish an effective performance evaluation model and are difficult to accurately predict the impact of partition adjustment on the overall system performance. In addition, these methods often adopt single-dimensional evaluation metrics and cannot comprehensively measure the advantages and disadvantages of partition schemes, resulting in optimization results that are difficult to meet the diverse needs of industrial production.

[0004] Data processing in industrial production environments has special requirements such as high concurrency, strong real-time performance, and strict data consistency. Existing technologies are difficult to effectively solve the trade-off problem between system performance and data consistency. With the continuous growth of industrial data scale and the increasing complexity of business, how to achieve dynamic optimization of system performance while ensuring data consistency has become a key challenge for the industrial production data microservice architecture. Especially in large-scale distributed systems, the adjustment of microservice partitions not only affects the system performance but also has a profound impact on data synchronization efficiency and business continuity, making traditional partition optimization methods difficult to meet the actual needs of modern industrial production. That is to say, there are technical problems in the insufficient optimization of industrial production data microservice partitions in the existing technology. Summary of the Invention

[0005] In view of this, the present invention provides an industrial production data microservice partition optimization method, medium and system, which can solve the technical problem of insufficient optimization of industrial production data microservice partitioning in the prior art.

[0006] The present invention is implemented as follows: In the first aspect of the present invention, an industrial production data microservice partition optimization method includes the following steps: constructing a microservice coupling degree index matrix based on the access frequency, data volume, data type, data life cycle, data consistency requirements, data security level, data real-time requirements, and data access mode of industrial production data. The coupling degree index matrix is used to characterize the data interaction frequency and data dependence degree between microservices, and the coupling degree index matrix adopts a non-negative matrix form; collecting the resource occupancy data of industrial production data microservices to construct a microservice load balancing index, and using a neural network model to calculate the partition change gain rate, where the partition change gain rate includes a positive gain rate and a negative gain rate; generating multiple groups of candidate partition schemes based on the resource balance equation, response time equation, data consistency equation, and stability constraint equation, calculating the resource utilization degree, service response degree, data consistency index, and system stability index of each group of candidate partition schemes, and selecting the optimal partition scheme to complete the partition optimization.

[0007] Among them, the step of constructing the microservice coupling degree index matrix is specifically to first comprehensively scan and statistically analyze the industrial production data, obtain the access times and time distributions of each data item, and calculate the access correlation degree between data items; then classify according to the data volume size, and divide the data volume into small data, medium data, and large data in gigabytes; then analyze the data type, including structured data, semi-structured data, and unstructured data, and assign weight coefficients according to the type characteristics; evaluate the data life cycle, and divide the data into temporary data, short-term data, and long-term data according to the storage time; finally, integrate the characteristics of each dimension and calculate the coupling degree index between microservices by using the weighted summation method.

[0008] Among them, the resource occupancy data includes the processor occupancy rate, memory occupancy rate, network transmission volume, disk read and write rate, service response time, service concurrent request number, service failure rate, and service recovery time; the neural network model adopts a multi-layer perceptron structure, including an input layer, a hidden layer, and an output layer. The input layer receives the microservice load balancing index, the hidden layer uses a bidirectional long short-term memory network for feature extraction, and the output layer generates the partition change gain rate.

[0009] Among them, the resource balance equation is used to balance the resource utilization rates of each partition. The inputs of the resource balance equation include the processor occupancy rate, the memory occupancy rate, the network transmission volume, the disk read / write rate, and the resource utilization threshold. The output of the resource balance equation is the resource utilization degree; the response time equation is used to optimize the service call link. The inputs of the response time equation include the service response time, the number of concurrent service requests, and the response time threshold. The output of the response time equation is the service response degree.

[0010] Among them, the data consistency equation is used to ensure the data synchronization efficiency between partitions. The inputs of the data consistency equation include the data update frequency, the data synchronization delay time, and the data consistency threshold. The output of the data consistency equation is the data consistency index; the stability constraint equation is used to ensure the system availability. The inputs of the stability constraint equation include the service dependency degree, the failure propagation risk value, the service failure rate, and the service recovery time. The output of the stability constraint equation is the system stability index.

[0011] Among them, it also includes steps of establishing a data lineage graph using the historical access logs of industrial production data, performing a depth-first traversal on the data lineage graph to obtain a data dependency weight matrix; performing singular value decomposition on the microservice coupling degree index matrix, and obtaining a microservice association strength matrix in combination with the data dependency weight matrix; calculating an initial microservice partition scheme based on the microservice association strength matrix, and establishing a partition change gain matrix.

[0012] Among them, the data lineage graph is represented by a directed graph data structure, where nodes represent data items and edges represent the data flow direction; using the depth-first search algorithm to traverse the data lineage graph, recording the node access order and edge weights during the traversal process; during the traversal process, calculating the weight value of the edge according to the access frequency and dependency relationship between data items.

[0013] Among them, the partition change gain matrix is used to quantify the performance improvement degree before and after the microservice partition change. The partition change gain matrix includes the resource utilization degree improvement value, the service response degree improvement value, the data consistency improvement value, and the system stability improvement value; the resource utilization degree is used to represent the usage efficiency of computing resources within a partition, and the service response degree is used to represent the request processing ability of microservices.

[0014] 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 industrial production data microservice partition optimization method.

[0015] The third aspect of the present invention provides an industrial production data microservice partition optimization 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.

[0016] Compared with the prior art, for an industrial production data microservice partition optimization method, medium and system provided by the present invention, the industrial production data microservice partition optimization method proposed by the present invention establishes a unified evaluation framework for system performance and data consistency by constructing a multi-dimensional microservice coupling degree index matrix and a data dependency weight matrix. This method not only considers traditional performance indicators but also introduces key features such as data life cycle and security level, achieving a comprehensive characterization of the microservice partition optimization problem. By analyzing data lineage through a depth-first traversal algorithm, the impact of data dependency relationships on system performance is accurately grasped, providing a reliable decision-making basis for partition optimization.

[0017] The present invention uses a neural network model to dynamically evaluate microservice partitions and captures the complex correlation between system performance and data consistency through a bidirectional long short-term memory network. Based on the solution process of the partition optimization equation set, the coordinated optimization of multiple objectives such as resource utilization rate, service response time, and data consistency is realized. Especially by introducing service failure rate and recovery time indicators into the stability constraint equation, the impact of partition adjustment on system stability is effectively reduced. Compared with traditional methods, the present invention can more accurately predict the impact of partition changes and continuously optimize system performance on the premise of ensuring data consistency.

[0018] By establishing a complete partition optimization theoretical framework, the present invention successfully solves the problem of balancing system performance and data consistency in industrial production data microservice partition optimization. While ensuring data consistency, this method significantly improves the overall performance and resource utilization efficiency of the system. By introducing the concept of partition change gain rate, a quantitative evaluation system for partition optimization is established, making the optimization process more scientific and controllable. Especially in large-scale distributed systems, the method of the present invention can effectively handle complex data dependency relationships and dynamic load changes, solving the technical problem of insufficient optimization of industrial production data microservice partitions existing in the prior art. Brief Description of the Drawings

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

[0020] Figure 2 It is an analysis diagram of microservice data interaction characteristics in Embodiment 2.

[0021] Figure 3It is the data dependency weight network diagram in Embodiment 2.

[0022] Figure 4 It is the system resource occupancy analysis diagram in Embodiment 2.

[0023] Figure 5 It is the system optimization effect comparison diagram in Embodiment 2. Specific implementation manners

[0024] 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.

[0025] As Figure 1 shown, it is a flowchart of an industrial production data microservice partition optimization method provided in the first aspect of the present invention. This method includes the following steps:

[0026] S01. Construct a microservice coupling degree index matrix based on the access frequency, data volume, data type, data life cycle, data consistency requirement, data security level, data real-time requirement, and data access mode of the industrial production data;

[0027] S02. Establish a data lineage graph using the historical access logs of the industrial production data, and perform a depth-first traversal on the data lineage graph to obtain a data dependency weight matrix;

[0028] S03. Perform singular value decomposition on the microservice coupling degree index matrix, and combine it with the data dependency weight matrix to obtain a microservice association strength matrix;

[0029] S04. Calculate an initial microservice partition scheme based on the microservice association strength matrix, and establish a partition change gain matrix;

[0030] S05. Collect the resource occupancy data of the industrial production data microservice, where the resource occupancy data includes processor occupancy rate, memory occupancy rate, network transmission volume, disk read and write speed, service response time, service concurrent request number, service failure rate, and service recovery time;

[0031] S06. Construct a microservice load balancing index according to the resource occupancy data, and input the microservice load balancing index into a neural network model;

[0032] S07. Dynamically evaluate the microservice partition using the neural network model to obtain a partition change gain rate;

[0033] S08. Solve a partition optimization equation set according to the partition change gain rate to generate multiple groups of candidate partition schemes;

[0034] S09. Calculate the resource utilization, service response, data consistency index, and system stability index for each group of the candidate partitioning schemes to form an evaluation index set;

[0035] S10. Select the optimal partitioning scheme according to the evaluation index set, and use the optimal partitioning scheme as the target partitioning scheme;

[0036] S11. Reorganize the microservices according to the target partitioning scheme to complete the partitioning optimization;

[0037] The coupling degree index matrix is used to characterize the data interaction frequency and data dependence degree between microservices. The coupling degree index matrix adopts a non - negative matrix form, and the element value range of the coupling degree index matrix is from 0 to 1;

[0038] The partitioning change gain matrix is used to quantify the performance improvement degree before and after the microservice partitioning change. The partitioning change gain matrix includes the resource utilization improvement value, service response improvement value, data consistency improvement value, and system stability improvement value;

[0039] The partitioning change gain rate includes a positive gain rate and a negative gain rate. The positive gain rate represents the degree of performance improvement after the partitioning change, and the negative gain rate represents the system stability risk brought by the partitioning change. The positive gain rate and the negative gain rate jointly determine the feasibility of the partitioning scheme;

[0040] The neural network model adopts a multi - layer perceptron structure, including an input layer, a hidden layer, and an output layer. The input layer receives the microservice load balancing index, the hidden layer uses a bidirectional long short - term memory network for feature extraction, and the output layer generates the partitioning change gain rate;

[0041] The partitioning optimization equation set includes a resource balance equation, a response time equation, a data consistency equation, and a stability constraint equation:

[0042] The resource balance equation is used to balance the resource usage rate of each partition. The inputs of the resource balance equation include the processor occupancy rate, the memory occupancy rate, the network transmission volume, the disk read - write rate, and the resource utilization threshold. The output of the resource balance equation is the resource utilization;

[0043] The response time equation is used to optimize the service call link. The inputs of the response time equation include the service response time, the service concurrent request number, and the response time threshold. The output of the response time equation is the service response;

[0044] The data consistency equation is used to ensure the data synchronization efficiency between partitions. The inputs of the data consistency equation include the data update frequency, the data synchronization delay time, and the data consistency threshold, and the output of the data consistency equation is the data consistency index;

[0045] The stability constraint equation is used to ensure the system availability. The inputs of the stability constraint equation include the service dependency degree, the fault propagation risk value, the service failure rate, and the service recovery time, and the output of the stability constraint equation is the system stability index;

[0046] Among them, the resource utilization degree is used to represent the usage efficiency of computing resources within a partition; the service response degree is used to represent the request processing ability of microservices; the resource utilization threshold is used to limit the upper limit of resource usage; the response time threshold is used to limit the upper limit of service response time; the data consistency threshold is used to limit the upper limit of data synchronization time; the service dependency degree is used to represent the strength of the dependency relationship between microservices; the fault propagation risk value is used to represent the probability of fault propagation between services.

[0047] The following describes the specific implementation manners of the above steps in detail. Specific implementation manner of step S01: Construct a microservice coupling degree index matrix based on the industrial production data access frequency and data characteristics. First, conduct a comprehensive scan and statistical analysis of the industrial production data to obtain the access times and time distributions of each data item, and calculate the access correlation degree between data items; then classify according to the data volume size, and divide the data volume into small data (less than 1), medium data (1 to 10), and large data (greater than 10) in gigabytes as the unit; then analyze the data types, including structured data, semi-structured data, and unstructured data, and assign weight coefficients according to the type characteristics; evaluate the data life cycle, and divide the data into temporary data (less than 7 days), short-term data (7 to 90 days), and long-term data (greater than 90 days) according to the storage time; consider the data consistency requirements, and divide the consistency level into strong consistency, eventual consistency, and weak consistency; according to the data security level, divide the data into four levels: public, internal, confidential, and secret; analyze the data real-time requirements, and divide the response time requirements into extremely fast (less than 100 milliseconds), fast (100 to 500 milliseconds), and normal (greater than 500 milliseconds); finally, integrate the characteristics of each dimension, and use the weighted summation method to calculate the coupling degree index between microservices to construct a non-negative coupling degree index matrix. The purpose of this step is to quantify the data interaction relationship between microservices and provide basic data support for subsequent partition optimization.

[0048] Specific implementation method of step S02: Use the historical access log of industrial production data to build a data lineage relationship diagram and calculate the data dependency weight matrix. First, clean the historical access log to remove abnormal records and redundant information; extract the call relationship between data items through log analysis, including read, write, update and delete operations; use a directed graph data structure to represent the data lineage relationship, where nodes represent data items and edges represent the direction of data flow; use the depth-first search algorithm to traverse the data lineage relationship diagram, and record the node access order and edge weight during the traversal process; during the traversal process, calculate the edge weight value according to the access frequency and dependency relationship between data items; finally, build a data dependency weight matrix based on the traversal results, and the matrix element value represents the dependency strength between data items. The role of this step is to mine the intrinsic association between data and provide a basis for microservice partitioning.

[0049] Specific implementation method of step S03: singular value decomposition is performed on the microservice coupling index matrix and the microservice association strength matrix is ​​calculated in combination with the data dependency weight matrix. First, the microservice coupling index matrix is ​​standardized to eliminate the influence of data dimension; the standardized matrix is ​​decomposed into a left singular matrix, a singular value diagonal matrix and a right singular matrix by using the singular value decomposition algorithm; the main eigenvectors are determined by analyzing the size of the singular values ​​to remove the influence of noise; the data dependency weight matrix is ​​normalized; the normalized data dependency weight matrix is ​​multiplied by the singular value decomposition result by matrix multiplication; finally, the microservice association strength matrix is ​​obtained, which comprehensively reflects the coupling relationship and data dependency relationship between microservices. The purpose of this step is to reduce the data dimension and extract the essential association characteristics between microservices.

[0050] Specific implementation method of step S04: Calculate the initial microservice partitioning scheme based on the microservice association strength matrix and establish the partition change gain matrix. First, use the spectral clustering algorithm to analyze the microservice association strength matrix to determine the optimal number of partitions; calculate the eigenvalues ​​and eigenvectors of the Laplace matrix; use the balanced partitioning algorithm to preliminarily divide the microservices to ensure load balancing between partitions; evaluate the performance indicators of the initial partitioning scheme, including partition cohesion and inter-partition coupling; construct a partition change gain matrix to record the performance differences between different partitioning schemes; calculate the resource utilization improvement value and compare the resource utilization efficiency before and after the partition change; analyze the service responsiveness improvement value and evaluate the impact of the partition change on the service performance; calculate the data consistency improvement value and measure the impact of the partition change on data synchronization; finally, evaluate the system stability improvement value and predict the impact of the partition change on the system reliability. The role of this step is to generate an initial partitioning scheme and provide an evaluation benchmark for subsequent optimization.

[0051] Specific implementation of step S05: Collect resource occupancy data of the industrial production data microservices. First, deploy resource monitoring probes to collect the running status of each microservice node in real time; obtain the processor occupancy rate through performance counters, and set the sampling period to 1 second; monitor the memory occupancy rate and record the usage of heap memory and non-heap memory; count the network traffic volume, including inbound traffic and outbound traffic; measure the disk read and write rates and monitor the input / output operation performance; record the service response time and collect the end-to-end latency of request processing; count the number of concurrent service requests and monitor the system throughput; calculate the service failure rate and record the number of service exceptions and failures; measure the service recovery time and count the time interval from the occurrence of a failure to the return to normal. The purpose of this step is to obtain the performance metrics during the operation of the microservices and provide data support for load balancing optimization.

[0052] Specific implementation of step S06: Construct microservice load balancing metrics based on the resource occupancy data and input them into the neural network model. First, perform normalization processing on the collected resource occupancy data to map each metric value to the range of 0 to 1; calculate the processor load balancing metric and set the processor occupancy rate threshold to 80%; construct the memory load balancing metric and set the memory occupancy rate threshold to 75%; calculate the network load balancing metric based on the network bandwidth utilization rate; evaluate the disk load balancing metric and set the disk usage threshold to 70%; construct the service response time balancing metric and set the response time threshold to 200 milliseconds; calculate the concurrent request balancing metric based on the system processing capacity; evaluate the failure rate balancing metric and set the failure rate threshold to 1%; analyze the recovery time balancing metric and set the recovery time threshold to 5 minutes; finally, combine the various load balancing metrics to form a feature vector and input it into the neural network model. The role of this step is to construct comprehensive load balancing evaluation metrics and provide a basis for dynamic optimization.

[0053] Specific implementation of step S07: Use the neural network model to dynamically evaluate the microservice partitions and calculate the partition change gain rate. First, adopt a multi-layer perceptron network structure, and the number of input layer nodes is the same as the dimension of the load balancing metrics; use a bidirectional long short-term memory network in the hidden layer for feature extraction, and set the number of hidden layer nodes to twice that of the input layer; capture the load change trend through time series analysis; use the forgetting gate mechanism to filter out irrelevant features; use the input gate to update the current state information; adopt the output gate to generate the prediction result; finally, calculate the positive gain rate and negative gain rate in the output layer. The positive gain rate represents the degree of performance improvement, and the negative gain rate represents the stability risk. The purpose of this step is to evaluate the feasibility of partition changes and provide support for optimization decisions.

[0054] Specific implementation of step S08: Solve the partition optimization equation set according to the partition change gain rate and generate a candidate partition scheme. First, construct a resource balance equation, taking the processor occupancy rate, memory occupancy rate, network transmission volume, and disk read / write rate as input variables; set resource utilization thresholds, with the upper limit of processor utilization being 85%, the upper limit of memory utilization being 80%, the upper limit of network bandwidth utilization being 75%, and the upper limit of disk utilization being 70%; construct a response time equation, taking the service response time and the number of concurrent requests as input variables; set the response time threshold to 300 milliseconds; establish a data consistency equation, inputting the data update frequency and the synchronization delay time; set the data consistency threshold to 500 milliseconds; construct a stability constraint equation, inputting the service dependency degree and the failure propagation risk value; use a heuristic algorithm to solve the equation set; generate multiple groups of candidate partition schemes through a genetic algorithm; and optimize the scheme quality using a simulated annealing algorithm. The function of this step is to generate a candidate partition scheme that meets multiple constraint conditions.

[0055] Specific implementation of step S09: Calculate the evaluation indicators of the candidate partition scheme and form an evaluation indicator set. First, calculate the resource utilization degree of each partition scheme to evaluate the usage efficiency of computing resources; count the average utilization rate and fluctuation range of various resources; calculate the service response degree to evaluate the request processing ability; count the average response time and the response time distribution; calculate the data consistency indicator to evaluate the data synchronization efficiency; count the data update delay and the consistency maintenance overhead; calculate the system stability indicator to evaluate the system availability; count the service failure rate and the average recovery time; use a comprehensive scoring method to perform weighted summation of each indicator; construct an evaluation indicator set and record the evaluation results of each scheme. The purpose of this step is to comprehensively evaluate the performance of the candidate schemes and provide a quantitative basis for scheme selection.

[0056] Specific implementation of step S10: Select the optimal partition scheme according to the evaluation indicator set and determine the target partition scheme. First, perform normalization processing on the evaluation indicator set to eliminate the dimensional differences between different indicators; set the indicator weights, with the resource utilization degree weight being 0.3, the service response degree weight being 0.3, the data consistency indicator weight being 0.2, and the system stability indicator weight being 0.2; calculate the comprehensive scores of each scheme; use the Pareto optimality criterion for scheme screening; evaluate the technical feasibility of scheme implementation; analyze the cost-benefit of scheme implementation; consider the risk factors of scheme implementation; and finally determine the optimal partition scheme as the target scheme. The function of this step is to select the most suitable partition scheme from multiple candidate schemes.

[0057] Specific implementation of step S11: Reorganize microservices according to the target partitioning scheme and complete partitioning optimization. First, formulate a detailed partitioning adjustment plan, including service migration order and schedule; prepare necessary computing and storage resources; establish service degradation and rollback mechanisms; start the service migration program, gradually adjust the service deployment location; monitor the system status during migration; verify the correctness of service functions; test service performance and stability; evaluate the optimization effect, including resource utilization rate, service response time, data consistency, and system availability; make necessary fine-tuning according to the evaluation results; finally, complete partitioning optimization and resume normal service. The purpose of this step is to achieve a smooth transition of the partitioning scheme and ensure the stable operation of the system.

[0058] The following details the calculation process involved in the present invention.

[0059] 1. The calculation of the microservice coupling degree index matrix is expressed as follows:

[0060] C ij = α 1 f ij + α 2 v ij + α 3 t ij + α 4 l ij + α 5 s ij + α 6 r ij ;

[0061] In the formula, C ij represents the coupling degree index between the i-th microservice and the j-th microservice; f ij is the relevance of data access frequency; v ij is the relevance of data volume; t ij is the relevance of data type; l ij is the relevance of lifecycle; s ij is the relevance of security level; r ij is the relevance of real-time performance; α 1 , α 2 , α 3 , α 4 , α 5 , α 6 are weight coefficients and satisfy

[0062] 2. The calculation of the edge weights of the data lineage graph is expressed as follows:

[0063]

[0064] In the formula, w ijDenote the edge weight from data item i to data item j; n ij is the access count between data items; N is the total access count; d ij is the data dependency degree; D is the maximum dependency degree; t ij is the average access time interval; λ is the time decay coefficient; β 1 , β 2 , β 3 is the weight coefficient and satisfies

[0065] 3. The calculation of the microservice association strength matrix is expressed as follows:

[0066] R = UΣV T ⊙W;

[0067] where R is the microservice association strength matrix; U is the left singular matrix; Σ is the singular value diagonal matrix; V T is the transpose of the right singular matrix; W is the data dependency weight matrix; ⊙ represents the matrix Hadamard product.

[0068] 4. The calculation of the partition change gain rate is expressed as follows:

[0069] G p = γ 1 Δr + γ 2 Δt + γ 3 Δc + γ 4 Δs - δ 1 e r -δ 2 e s ;

[0070] where G p is the partition change gain rate; Δr is the improvement of resource utilization; Δt is the improvement of response time; Δc is the improvement of consistency; Δs is the improvement of stability; e r is the resource migration risk; e s is the system stability risk; γ 1 , γ 2 , γ 3 , γ 4 is the positive gain weight; δ 1 , δ 2 is the negative risk weight.

[0071] 5. The resource balance equation is expressed as follows:

[0072]

[0073] where B r is the resource balance degree; cpu i , mem i , neti , disk i are the processor, memory, network, and disk utilization rates of the i-th partition respectively; CPU max , MEM max , NET max , DISK max is the maximum threshold of the corresponding resource; ω 1 , ω 2 , ω 3 , ω 4 is the resource weight coefficient.

[0074] 6. The response time equation is expressed as follows:

[0075]

[0076] In the formula, T r is the average response time; t i is the processing time of the i-th request; q i is the number of concurrent requests; Q max is the maximum number of concurrent requests; t wait is the waiting time; η is the network latency; m is the total number of requests.

[0077] 7. The data consistency equation is expressed as follows:

[0078]

[0079] In the formula, C d is the data consistency metric; Δt i is the i-th data synchronization latency; T max is the maximum allowable latency; p ij is the synchronization success rate of the i-th data at the j-th node; n i is the number of data synchronization nodes; k is the number of data items.

[0080] 8. The stability constraint equation is expressed as follows:

[0081]

[0082] In the formula, S c is the system stability index; d i is the service dependency; r i is the failure propagation risk; f i is the failure rate; F max is the maximum allowable failure rate; t ri is the recovery time; T max is the maximum recovery time; θ 1 , θ 2 , θ 3 , θ 4is the weight coefficient; l is the number of services.

[0083] The principles and meanings of these equations are as follows:

[0084] 1. The coupling degree index matrix adopts a linear weighting method, considering the influence of multi-dimensional features, and adjusts the importance of each factor through the weight coefficient;

[0085] 2. The weight of the blood relationship edge combines the access frequency, dependence degree and time decay characteristics, and uses exponential decay to reflect the influence of time on the dependence relationship;

[0086] 3. The correlation strength matrix is reduced in dimension by singular value decomposition and combined with the dependence weight matrix to extract the essential correlation features;

[0087] 4. The gain rate calculation balances the positive return and negative risk, and adopts a linear combination method for easy optimization and solution;

[0088] 5. The resource balance equation normalizes the usage rates of various resources, facilitating the comprehensive evaluation of resource utilization;

[0089] 6. The response time equation considers the concurrency impact and network latency, reflecting the service performance in the actual scenario;

[0090] 7. The consistency equation comprehensively considers the synchronization delay and success rate, and reflects the strict requirements of multi-node synchronization through multiplication;

[0091] 8. The stability constraint equation linearly combines multiple risk factors after normalization, facilitating quantitative evaluation and optimal control.

[0092] The following details the process of deriving and establishing each equation.

[0093] 1. Derivation of the microservice coupling degree index matrix:

[0094] First, construct an n×n dimensional coupling degree index matrix C, where n is the number of microservices:

[0095]

[0096] For each element c ij , it is calculated through the following steps:

[0097] The first step is to calculate the data access frequency correlation: where count ij is the number of data interactions between microservices i and j, and total_count is the total number of interactions;

[0098] The second step is to calculate the data volume correlation: where size ijLet the interactive data volume be

[0099] Step 3: Calculate the relevance of data types:

[0100] Step 4: Calculate the relevance of the life cycle:

[0101] Step 5: Calculate the relevance of the security level:

[0102] Step 6: Calculate the relevance of real-time performance: where Δt ij is the response delay, and μ is the time decay factor.

[0103] 2. Process of constructing the data dependency weight matrix:

[0104] Construct an m×m weight matrix W, where m is the number of data items:

[0105]

[0106] Steps for calculating edge weights:

[0107] Step 1: Statistically calculate the access frequency ratio:

[0108] Step 2: Calculate the dependency strength:

[0109] Step 3: Calculate the time decay:

[0110] The final weight is: w ij = β 1 freq ij + β 2 dep ij + β 3 time ij .

[0111] 3. Process of singular value decomposition of the correlation strength matrix:

[0112] Step 1: Perform singular value decomposition on the coupling degree matrix C: C = UΣV T ;

[0113] Step 2: Select the top k largest singular values to construct a dimensionality reduction matrix:

[0114] Σ k = diag(σ 1 , σ 2 , …, σ k );

[0115] Step 3: Calculate the correlation strength matrix after dimensionality reduction:

[0116] where U k and V k are the corresponding first k column vectors respectively.

[0117] 4. Calculation process of partition change gain rate:

[0118] Step 1: Define the improvement of resource utilization:

[0119] Step 2: Define the improvement of response time:

[0120] Step 3: Define the improvement of consistency: Δc = c new - c old ;

[0121] Step 4: Define the improvement of stability: Δs = s new - s old ;

[0122] Step 5: Define the risk factor:

[0123] where κ 1 and κ 2 are risk coefficients, cost is the migration cost, and risk is the stability risk value.

[0124] 5. Optimization process of the resource balance equation:

[0125] Step 1: Normalize the resource utilization rates:

[0126] Step 2: Introduce the resource weight coefficient:

[0127] Step 3: Construct the balance objective function:

[0128] Achieve resource balance by minimizing the B r difference between partitions.

[0129] 6. Construction process of the response time equation:

[0130] Step 1: Basic processing time:

[0131] Step 2: Concurrent impact factor:

[0132] Step 3: Network delay term:

[0133] Finally, the average response time is obtained: T r = t b ase + f concurrent + η.

[0134] 7. Construction steps of the data consistency equation:

[0135] The first step is to normalize the synchronization delay:

[0136] The second step is to calculate the synchronization success rate:

[0137] The third step is to measure the consistency:

[0138] This equation reflects the data synchronization quality through the combination of delay and success rate.

[0139] 8. Construction process of the stability constraint equation:

[0140] The first step is to calculate the dependency degree:

[0141] The second step is to calculate the risk propagation:

[0142] The third step is to normalize the failure rate:

[0143] The fourth step is to normalize the recovery time:

[0144] Finally, the stability index is obtained:

[0145] 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 industrial production data microservice partitioning optimization method.

[0146] The third aspect of the present invention provides an industrial production data microservice partitioning optimization 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.

[0147] Specifically, the principle of the present invention is as follows: The technical principle of the present invention is based on an in-depth understanding of the characteristics of industrial production data and the characteristics of the microservice architecture. First, by constructing a microservice coupling degree index matrix, considering multiple dimensions of characteristics such as data access frequency and data volume, the association relationship between microservices is accurately described. This matrix adopts a non-negative matrix form, ensuring the comparability and additivity of the indicators, and providing a reliable mathematical basis for subsequent optimization calculations. By performing a depth-first traversal of the data lineage graph, the data flow path and dependence intensity are systematically analyzed, avoiding indirect dependence relationships that are easily overlooked in traditional methods.

[0148] In the dynamic evaluation link, the neural network model adopted by the present invention has powerful feature extraction and pattern recognition capabilities. The multi-layer perceptron structure can effectively handle high-dimensional non-linear problems, and the introduction of the bidirectional long short-term memory network improves the model's ability to capture temporal features. This deep learning architecture enables the system to accurately predict the impact of partition changes on performance and consistency. The design of the partition optimization equation system embodies the idea of multi-objective optimization, and through carefully designed constraint conditions, the coordinated optimization of multiple objectives such as resource balance, response time, and data consistency is achieved.

[0149] By transforming the complex industrial production data microservice partitioning problem into a solvable mathematical model, the present invention establishes a complete theoretical framework. Especially when introducing key parameters such as resource utilization thresholds and response time thresholds, the actual needs of industrial production are fully considered to ensure the practicality of the optimization results. The system stability guarantee mechanism runs through the entire optimization process, and through the quantitative evaluation of the fault propagation risk and the accurate calculation of the service dependence degree, the potential risk of partition adjustment is effectively reduced.

[0150] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail as follows.

[0151] Specific implementation of step S01: Based on industrial production data, construct a microservice coupling degree index matrix. This step first comprehensively scans the industrial production data, uses a distributed log collection system to obtain the data access records of each microservice node, and the records include information such as access timestamp, source service identifier, target service identifier, data item identifier, operation type, and data size; then uses the sliding time window method to count the data access frequency, the time window size is set to 1 hour, and the sliding step is 5 minutes, and the frequency correlation f ij is calculated, and the calculation formula is where count ijis the number of data interactions between microservices i and j, and total_count is the total number of interactions; then analyze the data volume characteristics, divide the data volume into small data (less than 1), medium data (1 to 10), and large data (greater than 10) in gigabytes, and calculate the data volume correlation where size ij is the interaction data volume, and max_size is the maximum data volume; classify the data types, the weight of structured data is 0.8, the weight of semi-structured data is 0.6, and the weight of unstructured data is 0.4, and calculate the type correlation Evaluate the data life cycle, the weight of temporary data (less than 7 days) is 0.3, the weight of short-term data (7 to 90 days) is 0.6, and the weight of long-term data (greater than 90 days) is 0.9, and calculate the life cycle correlation Consider the data consistency requirements, the weight of strong consistency is 0.9, the weight of eventual consistency is 0.6, and the weight of weak consistency is 0.3; according to the data security level, the weight of public data is 0.3, the weight of internal data is 0.5, the weight of confidential data is 0.7, and the weight of secret data is 0.9, and calculate the security level correlation Analyze the data real-time requirements, the weight of ultra-fast response (less than 100 milliseconds) is 0.9, the weight of fast response (100 to 500 milliseconds) is 0.6, and the weight of normal response (greater than 500 milliseconds) is 0.3, and calculate the real-time correlation where Δt ij is the response delay, and μ is the time decay factor; finally, construct an n×n dimensional coupling degree index matrix C, where n is the number of microservices: The matrix element calculation adopts the linear weighted method: C ij =α 1 f ij +α 2 v ij +α 3 t ij +α 4 l ij +α 5 s ij +α 6 r ij , where the weight coefficients satisfy Determine the optimal weight value according to historical data by the least squares method.

[0152] Specific implementation of step S02: Establish a data lineage graph using the historical access logs of industrial production data and obtain a data dependency weight matrix. This step first performs data cleaning on the historical access logs, identifying and deleting abnormal records using an outlier detection algorithm, and removing redundant information using a deduplication algorithm. Then, it extracts the call relationships between data items, including read, write, update, and delete operations, and constructs a directed graph data structure G = (V, E), where the vertex set V represents the set of data items and the edge set E represents the dependency relationships between data items. The depth-first search algorithm is used to traverse the data lineage graph. The algorithm starts from each source node and recursively visits adjacent nodes along the directed edges, recording the traversal path and access order. During the traversal, the weight value of the edge is calculated, and the weight calculation formula is where n ij is the number of accesses between data items, N is the total number of accesses, d ij is the degree of data dependency, D is the maximum degree of dependency, t ij is the average access time interval, λ is the time decay coefficient, β 1 , β 2 , β 3 is the weight coefficient and satisfies Finally, an m×m-dimensional data dependency weight matrix W is constructed, where m is the number of data items: The value range of the matrix elements is from 0 to 1, and the larger the value, the stronger the dependency relationship.

[0153] Specific implementation of step S03: Perform singular value decomposition on the microservice coupling degree index matrix and combine it with the data dependency weight matrix to obtain the microservice association strength matrix. This step first standardizes the coupling degree index matrix, mapping the matrix elements to the range of 0 to 1 using the maximum-minimum normalization method. Then, it performs singular value decomposition on the standardized matrix, and the decomposition formula is C = UΣV T , where U is the left singular vector matrix, Σ is the singular value diagonal matrix, and V T is the transpose of the right singular vector matrix. By analyzing the magnitudes of the singular values, a suitable truncation threshold is determined, and the main eigenvectors with a contribution rate exceeding 90% are retained to construct a reduced-dimensional matrix Σ k = diag(σ 1 , σ 2 , …, σ k ), where k is the number of retained eigen dimensions. Then, the reduced-dimensional association strength matrix is calculated where U k and V k are the corresponding first k column vectors, and ⊙ represents the matrix Hadamard product. Finally, the association strength matrix is normalized to keep the matrix element values in the range of 0 to 1.

[0154] Specific implementation of step S04: Calculate the initial microservice partition scheme based on the microservice association strength matrix and establish a partition change gain matrix. This step first analyzes the microservice association strength matrix using the spectral clustering algorithm to construct the normalized Laplacian matrix L = I - D -1 / 2 RD -1 / 2 , where I is the identity matrix and D is the degree matrix; calculate the eigenvalues and eigenvectors of the Laplacian matrix, select the eigenvectors corresponding to the smallest k non-zero eigenvalues to construct the feature space; use the K-means clustering algorithm to group the microservices in the feature space to obtain the initial partition scheme; evaluate the performance metrics of the initial partition scheme. The intra-partition cohesion formula is The inter-partition coupling degree formula is Construct the partition change gain matrix, and the gain formula is G p = γ 1 Δr + γ 2 Δt + γ 3 Δc + γ 4 Δs - δ 1 e r -δ 2 e s , where Δr is the improvement in resource utilization, Δt is the improvement in response time, Δc is the improvement in consistency, Δs is the improvement in stability, e r is the resource migration risk, e s is the system stability risk, and the coefficients are determined by the multi-objective optimization method.

[0155] Specific implementation of step S05: Collect the resource occupancy data of the industrial production data microservice. This step first deploys resource monitoring probes at each microservice node and uses a distributed monitoring framework to collect performance metrics in real time; the processor occupancy rate monitoring uses performance counters to count the user-mode time, system-mode time, and idle time, and the sampling period is 1 second; the memory occupancy rate monitoring includes the usage of heap memory and non-heap memory, and records the allocated memory, used memory, and maximum available memory; the network traffic monitoring uses traffic statistics to record the inbound traffic and outbound traffic, including the number of requests, packet size, and network bandwidth usage rate; the disk read and write rate monitoring uses IO performance statistics to record the number of read and write operations, the amount of read and written data, and the average response time; the service response time monitoring uses distributed tracing technology to record the delays at each stage of request processing; the service concurrent request number monitoring is counted through the request queue, and records the number of active connections and waiting connections; the service failure rate monitoring analyzes the exception logs and counts the ratio of the number of error requests to the total number of requests; the service recovery time monitoring tracks the fault detection and recovery process and records the time interval from the occurrence of the fault to the return to normal.

[0156] Specific implementation of step S06: Construct microservice load balancing metrics based on resource occupancy data. This step first normalizes the collected resource metrics. Using the maximum-minimum normalization method, the metric values are mapped to the range of 0 to 1. The normalization formula is Then calculate the processor load balancing metric, and the formula is where cpu i is the current processor occupancy rate, and CPU max is the processor occupancy rate threshold, which is set to 80%; construct the memory load balancing metric, and the formula is where mem i is the current memory occupancy rate, and MEM max is the memory occupancy rate threshold, which is set to 75%; calculate the network load balancing metric, and the formula is where net i is the current network traffic, and NET max is the network bandwidth threshold, which is set to 70% of the bandwidth upper limit; evaluate the disk load balancing metric, and the formula is where disk i is the current disk usage rate, and DISK max is the disk usage rate threshold, which is set to 70%; construct the service response time balancing metric, and the formula is where t i is the current response time, and T max is the response time threshold, which is set to 200 milliseconds; calculate the concurrent request balancing metric, and the formula is where q i is the current number of concurrent requests, and Q max is the maximum number of concurrent requests threshold; evaluate the failure rate balancing metric, and the formula is where f i is the current failure rate, and F max is the failure rate threshold, which is set to 1%; analyze the recovery time balancing metric, and the formula is where t ri is the current recovery time, and T max is the recovery time threshold, which is set to 5 minutes; finally, combine the load balancing metrics to form a feature vector as the input of the neural network model.

[0157] Specific implementation of step S07: Dynamically evaluate microservice partitions using a neural network model. This step adopts a multi-layer perceptron network structure. The number of nodes in the input layer is the same as the dimension of the load balancing metrics, set to 8 nodes. The hidden layer uses a bidirectional long short-term memory network for feature extraction, including two bidirectional LSTM layers, with the number of hidden units in each layer set to 16, and the activation function uses the hyperbolic tangent function. Capture the load change trend through time series analysis, and set the time window size to 10. The forgetting gate update formula is f t = σ(W f · [h t-1 , x t + b f ), where W f is the weight matrix, h t-1 is the previous hidden state, x t is the current input, and b f is the bias term; the input gate update formula is i t = σ(W i · [h t-1 , x t + b i ); the output gate update formula is o t = σ(W o · [h t-1 , x t + b o ); the cell state update formula is c t = f t · c t-1 + i t · tanh(W c · [h t-1 , x t + b c ); the hidden state update formula is h t = o t · tanh(c t ); finally, calculate the positive gain rate and negative gain rate in the output layer. The output layer uses the Sigmoid activation function to ensure that the output value is within the range of 0 to 1.

[0158] Specific implementation of step S08: Solve the partition optimization equation set according to the partition change gain rate. This step first constructs a resource balance equation where ω 1 , ω 2 , ω 3 , ω 4 are resource weight coefficients, and the weight values are determined by the analytic hierarchy process; construct a response time equation where t i is the processing time, q iis the number of concurrent requests, Q max is the maximum number of concurrent requests, t wait is the waiting time, η is the network latency; establish a data consistency equation where Δt i is the synchronization latency, T max is the maximum allowable latency, p ij is the synchronization success rate; construct a stability constraint equation where θ 1 , θ 2 , θ 3 , θ 4 are the weight coefficients; use the genetic algorithm to solve the system of equations, set the population size to 100, the maximum number of iterations to 500, the crossover probability to 0.8, and the mutation probability to 0.1; use the non-dominated sorting method for multi-objective optimization to generate multiple sets of candidate partitioning schemes.

[0159] Specific implementation of step S09: Calculate the evaluation indicators of the candidate partitioning scheme. This step first calculates the resource utilization, including the average utilization rate, peak utilization rate, and fluctuation coefficient; counts the service response degree, including the average response time, 90th percentile response time, and timeout rate; calculates the data consistency indicators, including synchronization latency, consistency maintenance overhead, and data conflict rate; evaluates the system stability indicators, including service availability, fault recovery ability, and system robustness; uses the analytic hierarchy process to determine the indicator weights and construct an evaluation indicator set.

[0160] Specific implementation of step S10: Select the optimal partitioning scheme according to the evaluation indicator set. This step first normalizes the evaluation indicators and calculates the comprehensive score; uses the Pareto optimality criterion for scheme screening; evaluates the technical feasibility and cost-benefit of scheme implementation; and finally determines the optimal partitioning scheme.

[0161] Specific implementation of step S11: This step is a conventional operation in the prior art, simply described as reorganizing the microservices according to the target partitioning scheme. This step includes links such as formulating a migration plan, preparing resources, executing the migration, verifying functions, and evaluating effects.

[0162] To better understand and implement the present invention, the following provides an embodiment 2 of a specific application scenario of the present invention: A research and development team mainly optimizes the data acquisition and processing system for the engine cylinder block processing production line, involving multiple business modules such as equipment monitoring, quality inspection, process parameters, and production plans. The system originally had 25 microservice nodes, and the daily generated data volume was approximately 280GB. The specific implementation process is as follows.

[0163] First, the R & D team conducted a comprehensive analysis of industrial production data. A distributed log collection system was used to obtain the data access records of each microservice node for one month, with a total of approximately 8.5 million log data. Through analysis, the data interaction situation between each microservice was obtained, as shown in Table 1:

[0164] Table 1 Statistical Table of Microservice Data Interaction Frequency

[0165]

[0166]

[0167] Figure 2 (Analysis of Microservice Data Interaction Characteristics): This figure uses a dual-axis display method. The left axis uses a bar chart to show the average daily interaction times of each microservice, and the right axis uses a line chart to show the QPS during peak periods. The chart clearly shows that S001 (Device Status Monitoring) has the highest interaction frequency and QPS, while the interaction frequency of S004 (Production Plan Scheduling) is relatively low. According to the data interaction characteristics, the R & D team constructed a microservice coupling degree index matrix. The weight coefficients were determined by the least squares method as: α 1 = 0.25, α 2 = 0.20, α 3 = 0.15, α 4 = 0.15, α 5 = 0.15, α 6 = 0.10. The distribution of data types is shown in Table 2:

[0168] Table 2 Statistical Table of Data Type Distribution

[0169] Data type Proportion Weight Update frequency (times / hour) Structured data 65% 0.8 360 Semi-structured data 25% 0.6 180 Unstructured data 10% 0.4 60

[0170] Next, the R & D team analyzed the historical access logs for one quarter and established a data lineage graph. When calculating the edge weights using the depth-first traversal algorithm, the parameters used were: β 1 = 0.4, β 2 = 0.35, β 3 = 0.25, and the time decay coefficient λ = 0.05. The main data dependency relationships obtained are shown in Table 3:

[0171] Table 3 Data Dependency Weight Table

[0172] Source data item Target data item Dependency weight Access time interval (seconds) Device operation parameters Quality inspection results 0.85 10 Process parameters Product dimension data 0.78 15 Raw material data Product quality data 0.72 20 Production plan Device scheduling 0.68 30 Inventory data Material requirements 0.65 45

[0173] Perform singular value decomposition on the coupling degree index matrix, select the eigenvectors with a cumulative contribution rate reaching 92%, and retain the first 8 singular values. Combining with the data dependency weight matrix, the results of the correlation strength analysis are shown in Table 4:

[0174] Table 4 Microservice Association Strength Analysis Table

[0175] Service pair Association strength Data flow direction Coupling type S001 - S003 0.92 Bidirectional Strong coupling S002 - S003 0.85 Unidirectional Strong coupling S001 - S002 0.78 Bidirectional Medium coupling S003 - S004 0.65 Unidirectional Medium coupling S004 - S005 0.45 Bidirectional Weak coupling

[0176] Figure 3 (Data Dependence Relationship Weight Network): This figure shows the dependence relationships between major data items in the form of a network diagram. Nodes represent different data items, arrows represent data flow directions, and the marked weight values show the dependence strength. The figure clearly shows the strongest dependence relationship (weight 0.85) from device operation parameters to quality inspection results. Based on the association strength matrix, the R & D team calculated the initial partitioning scheme using the spectral clustering algorithm. Through monitoring the system operation for 24 hours, the resource occupancy data collected is shown in Table 5 as follows:

[0177] Table 5 System Resource Occupancy Statistics Table

[0178]

[0179]

[0180] Figure 4 (System Resource Occupancy Analysis): This figure uses a grouped bar chart to show the comparison of the average values and peak values of different system resources. Each indicator contains two adjacent bars, with blue representing the average value, red representing the peak value, and specific values marked. The chart shows that the peak value of the memory usage rate is the highest, reaching 85%. The neural network model constructed by the system adopts a 2 - layer bidirectional LSTM structure, with 16 hidden units in each layer, and the input feature is an 8 - dimensional load balancing indicator vector. The training data uses one - week system operation data, sampled every 5 minutes, with a total of 2016 samples. The training parameters and performance indicators of the model are shown in Table 6 as follows:

[0181] Table 6 Neural Network Model Training Parameter Table

[0182] Parameter name Value Remarks Batch size 32 Number of samples in a training batch Learning rate 0.001 Adam optimizer parameters Number of training epochs 100 Number of iterations over the complete dataset Proportion of the validation set 20% Proportion of data used for model validation Training accuracy 94.5% Accuracy on the training set Validation accuracy 92.8% Accuracy on the validation set

[0183] The optimization equation solution adopts the genetic algorithm, with a population size of 100 and 500 iterations. The weight coefficients used for calculating the partition change gain rate are: γ 1 = 0.3, γ 2 = 0.25, γ 3 = 0.25, γ 4 = 0.2, δ 1 = 0.6, δ 2 = 0.4. The evaluation results of the generated candidate solutions are shown in Table 7 as follows:

[0184] Table 7 Partitioning Scheme Evaluation Index Table

[0185] Solution number Resource utilization Service response Data consistency System stability Comprehensive score P001 0.82 0.88 0.85 0.87 0.855 P002 0.85 0.84 0.86 0.84 0.848 P003 0.78 0.86 0.88 0.85 0.842 P004 0.80 0.85 0.84 0.86 0.837 P005 0.83 0.82 0.85 0.83 0.833

[0186] Finally, the P001 solution with the highest comprehensive score is selected as the optimal partitioning solution. This solution reorganizes the original 25 microservice nodes into 8 partitions, and the following weights are used for the calculation of the resource balance equation: ω 1 = 0.3, ω 2 = 0.3, ω 3 = 0.2, ω 4 = 0.2. The performance comparison after the partition reorganization is shown in Table 8:

[0187] Table 8 Performance Comparison Table Before and After System Optimization

[0188] Performance metrics Before optimization After optimization Improvement ratio Average response time (ms) 85 45 47.1% System throughput (TPS) 850 1280 50.6% Resource utilization rate 45% 68% 51.1% Fault recovery time (s) 180 85 52.8% Data synchronization delay (ms) 120 55 54.2%

[0189] Figure 5 (System Optimization Effect Comparison): This figure uses a combination of stacked bar charts and line charts to show the performance comparison and improvement ratio before and after system optimization. The bar chart shows the actual values before and after optimization, and the line chart shows the percentage of improvement. The chart shows that the improvement in data synchronization latency is the most significant, reaching a 54.2% increase. The traditional optimization of industrial production data microservices mainly uses the following means: 1. Static load balancing, which simply distributes requests according to server configurations; 2. Automatic scaling based on thresholds, which increases or decreases service instances when the system load exceeds a preset threshold; 3. Service grouping based on manual experience judgment, where system operation and maintenance personnel determine the service deployment plan based on experience.

[0190] Compared with the traditional means, the present invention has achieved the following technological advancements: 1. Introduced data lineage analysis, accurately identifying data dependencies through a depth-first traversal algorithm to make service partitioning more reasonable; 2. Adopted a method combining singular value decomposition and neural networks to achieve automatic discovery and dynamic evaluation of microservice association relationships; 3. Established a complete partition optimization equation set to quantitatively evaluate multiple objectives such as resource balance, response time, data consistency, and system stability; 4. Achieved adaptive optimization based on historical data, where the system can automatically adjust the partition plan according to the actual operation situation. The implementation results show that the present invention has significantly improved the system performance, with the average response time reduced by 47.1%, the system throughput increased by 50.6%, the resource utilization rate increased by 51.1%, the fault recovery time shortened by 52.8%, and the data synchronization latency reduced by 54.2%. At the same time, the present invention reduces manual intervention, improves system operation and maintenance efficiency, and reduces operation and maintenance costs.

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

[0192] Table 9 Variable Explanation Table

[0193]

[0194]

[0195] As described above, it 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 optimizing industrial production data microservice partitioning, characterized in that: The method comprises the following steps: constructing a microservice coupling index matrix based on the access frequency, data volume, data type, data life cycle, data consistency requirements, data security level, data real-time requirements, and data access mode of industrial production data, wherein the coupling index matrix is ​​used to characterize the data interaction frequency and data dependence degree between microservices, and the coupling index matrix adopts a non-negative matrix form; collecting resource occupancy data of industrial production data microservices to construct a microservice load balancing index, and using a neural network model to calculate a partition change gain rate, wherein the partition change gain rate includes a positive gain rate and a negative gain rate; generating multiple groups of candidate partitioning schemes based on a resource balance equation, a response time equation, a data consistency equation, and a stability constraint equation, calculating the resource utilization, service responsiveness, data consistency index, and system stability index of each group of the candidate partitioning schemes, selecting the optimal partitioning scheme, and completing partition optimization.

2. The industrial production data microservice partition optimization method according to claim 1 is characterized in that: The steps of constructing the microservice coupling index matrix are as follows: first, comprehensively scan and statistically analyze the industrial production data, obtain the number of accesses and time distribution of each data item, and calculate the access correlation between data items; then classify the data according to the size, and divide the data into small data, medium data and large data in units of gigabytes; then analyze the data type, including structured data, semi-structured data and unstructured data, and assign weight coefficients according to the type characteristics; evaluate the data life cycle, and divide the data into temporary data, short-term data and long-term data according to the storage time; finally, integrate the characteristics of each dimension, and use the weighted summation method to calculate the coupling index between microservices.

3. The industrial production data microservice partition optimization method according to claim 1 is characterized in that: The resource occupancy data includes processor occupancy, memory occupancy, network transmission volume, disk read and write rate, service response time, number of concurrent service requests, service failure rate and service recovery time; the neural network model adopts a multi-layer perceptron structure, including an input layer, a hidden layer and an output layer, the input layer receives the microservice load balancing indicator, the hidden layer uses a bidirectional long short-term memory network for feature extraction, and the output layer generates the partition change gain rate.

4. The industrial production data microservice partition optimization method according to claim 1 is characterized in that: The resource balancing equation is used to balance the resource utilization of each partition. The input of the resource balancing equation includes the processor occupancy, the memory occupancy, the network transmission volume, the disk read and write rate, and the resource utilization threshold. The output of the resource balancing equation is the resource utilization. The response time equation is used to optimize the service call link. The input of the response time equation includes the service response time, the number of concurrent service requests, and the response time threshold. The output of the response time equation is the service responsiveness.

5. The industrial production data microservice partition optimization method according to claim 1 is characterized in that: The data consistency equation is used to ensure the efficiency of data synchronization between partitions. The input of the data consistency equation includes data update frequency, data synchronization delay time and data consistency threshold, and the output of the data consistency equation is the data consistency index; the stability constraint equation is used to ensure system availability. The input of the stability constraint equation includes service dependency, fault propagation risk value, the service failure rate and the service recovery time, and the output of the stability constraint equation is the system stability index.

6. The industrial production data microservice partition optimization method according to claim 1 is characterized in that: It also includes using the historical access logs of industrial production data to establish a data lineage relationship graph, and performing a depth-first traversal on the data lineage relationship graph to obtain a data dependency weight matrix; performing a singular value decomposition on the microservice coupling index matrix, and combining the data dependency weight matrix to obtain a microservice association strength matrix; The step of calculating an initial microservice partitioning scheme based on the microservice association strength matrix and establishing a partition change gain matrix.

7. The industrial production data microservice partition optimization method according to claim 6 is characterized in that: The data lineage relationship graph is represented by a directed graph data structure, in which nodes represent data items and edges represent data flow directions; the data lineage relationship graph is traversed using a depth-first search algorithm, and the node access order and edge weights during the traversal process are recorded; during the traversal process, the edge weight values ​​are calculated based on the access frequency and dependency relationship between data items.

8. The industrial production data microservice partition optimization method according to claim 6 is characterized in that: The partition change gain matrix is ​​used to quantify the performance improvement degree before and after the microservice partition change. The partition change gain matrix includes resource utilization improvement value, service responsiveness improvement value, data consistency improvement value and system stability improvement value; The resource utilization is used to indicate the utilization efficiency of computing resources within a partition, and the service responsiveness is used to indicate the request processing capability of a microservice.

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, the method for optimizing industrial production data microservice partitioning according to any one of claims 1 to 8 is used to execute the method.

10. An industrial production data microservice partition optimization 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

  • Intrusion detection system and method based on intelligent network

    CN118413406A

  • Resource mapping method, device and equipment for micro service and medium

    CN118585327A

  • Automatic organization process optimization method and system based on artificial intelligence

    CN118780757A

  • Containerized micro-service intelligent collaborative arrangement method and device

    CN119248414A

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

    CN119356687A