An industrial production data micro-service partition optimization method, medium and system
By constructing a microservice coupling index matrix and a data dependency weight matrix, and combining a neural network model and optimization equations, an optimal partitioning scheme is generated, which solves the problem of balancing data consistency and system performance in industrial production environments, and realizes dynamic optimization of system performance and improvement of resource utilization.
Patent Information
- Application Number
- CN202510214885.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-02-26
AI Technical Summary
Existing technologies struggle to achieve dynamic system performance optimization in industrial production environments while ensuring data consistency. Traditional microservice partitioning methods cannot adapt to dynamic changes in data traffic and business needs, leading to uneven utilization of system resources, increased service response latency, and difficulty in meeting diverse industrial production requirements.
By constructing a microservice coupling index matrix and a data dependency weight matrix, a neural network model is used for dynamic evaluation. Combining resource balancing, response time, data consistency, and stability equations, multiple candidate partitioning schemes are generated, and the optimal partitioning scheme is finally selected for optimization.
It significantly improves system performance and resource utilization efficiency while ensuring data consistency, and can handle complex data dependencies and dynamic load changes, solving the problem of insufficient optimization of microservice partitioning of industrial production data.
Smart Images

Figure CN120123091B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic digital data processing technology, and more specifically, relates to a method, medium, and system for optimizing microservice partitioning of industrial production data. Background Technology
[0002] With the rapid development of the Industrial Internet, the scale and complexity of data in industrial production environments are constantly increasing, making microservice architecture the mainstream technical solution for industrial data processing. In industrial production scenarios, traditional microservice partitioning methods primarily rely on static partitioning based on service call relationships and data access patterns, or employ dynamic partitioning strategies based on load balancing. These methods perform well in handling small-scale, simple scenarios, effectively improving system performance and resource utilization. Currently, mainstream industrial production data microservice partitioning schemes include static partitioning methods based on service dependency graphs, dynamic partitioning methods based on data affinity, and adaptive partitioning methods based on resource utilization. These methods have been widely applied in industrial settings, providing crucial support for the efficient processing of industrial data.
[0003] However, traditional microservice partitioning methods have significant drawbacks. First, static partitioning methods cannot adapt to the dynamic changes in data traffic and business demands during industrial production, leading to uneven system resource utilization and increased service response latency. Second, load-balancing-based dynamic partitioning methods focus excessively on system performance metrics, neglecting the consistency requirements of industrial data, which can easily cause data synchronization delays and inconsistencies in data-intensive scenarios. Third, while existing adaptive partitioning methods consider system performance and data characteristics, they fail to establish effective performance evaluation models, making it difficult to accurately predict the impact of partition adjustments on the overall system performance. Furthermore, these methods often use single-dimensional evaluation metrics, failing to comprehensively measure the merits of partitioning schemes, resulting in optimization results that are difficult to meet the diverse needs of industrial production.
[0004] Data processing in industrial production environments presents unique requirements such as high concurrency, strong real-time performance, and strict data consistency. Existing technologies struggle to effectively balance system performance with data consistency. With the continuous growth in the scale of industrial data and the increasing complexity of business processes, dynamically optimizing system performance while ensuring data consistency has become a key challenge for microservice architectures in industrial production data. Particularly in large-scale distributed systems, adjustments to microservice partitions not only affect system performance but also profoundly impact data synchronization efficiency and business continuity. This makes traditional partition optimization methods insufficient to meet the actual needs of modern industrial production. In other words, existing technologies suffer from inadequate optimization of microservice partitioning for industrial production data. Summary of the Invention
[0005] In view of this, the present invention provides a method, medium and system for optimizing microservice partitioning of industrial production data, which can solve the technical problem of insufficient optimization of microservice partitioning of industrial production data in the prior art.
[0006] The present invention is implemented as follows: The first aspect of the present invention provides a method for microservice partitioning optimization of industrial production data, comprising the following steps: constructing a microservice coupling index matrix based on the access frequency, data volume, data type, data lifecycle, data consistency requirements, data security level, data real-time requirements, and data access patterns of industrial production data. The coupling index matrix is used to characterize the data interaction frequency and data dependency degree between microservices, and the coupling index matrix adopts a non-negative matrix form; collecting resource usage data of industrial production data microservices to construct microservice load balancing indicators; calculating partition change gain rate using a neural network model, the partition change gain rate including positive gain rate and negative gain rate; generating multiple sets of candidate partitioning schemes based on resource balance equations, response time equations, data consistency equations, and stability constraint equations; calculating the resource utilization, service responsiveness, data consistency index, and system stability index of each set of candidate partitioning schemes; selecting the optimal partitioning scheme and completing partitioning optimization.
[0007] The steps for constructing the microservice coupling index matrix are as follows: First, a comprehensive scan and statistical analysis of industrial production data is performed to obtain the access frequency and time distribution of each data item, and the access correlation between data items is calculated. Then, the data is classified according to its size, into small, medium, and large data in gigabytes. Next, the data types are analyzed, including structured, semi-structured, and unstructured data, and weight coefficients are assigned according to type characteristics. The data lifecycle is assessed, and the data is classified into temporary, short-term, and long-term data according to its storage time. Finally, the characteristics of each dimension are integrated, and a weighted summation method is used to calculate the coupling index between microservices.
[0008] The resource usage data includes processor utilization, memory utilization, network transmission volume, disk read / write speed, service response time, number of concurrent service requests, service failure rate, and service recovery time. The neural network model adopts a multilayer perceptron structure, including an input layer, a hidden layer, and an output layer. The input layer receives the microservice load balancing metrics, 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] The resource balancing equation is used to balance the resource utilization of each partition. The inputs of the resource balancing equation include the processor utilization, the memory utilization, the network transmission volume, the disk read / write speed, 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 chain. 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 responsiveness.
[0010] The data consistency equation is used to ensure the efficiency of data synchronization between different data segments. 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 system availability. The inputs of the stability constraint equation include the service dependency, the fault 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] The process includes establishing a data lineage graph using historical access logs of industrial production data, performing a depth-first traversal of the data lineage graph to obtain a data dependency weight matrix; performing singular value decomposition on the microservice coupling index matrix and combining it with the data dependency weight matrix to obtain a microservice association strength matrix; calculating an initial microservice partitioning scheme based on the microservice association strength matrix and establishing a partition change gain matrix.
[0012] The data lineage graph is represented by a directed graph data structure, where nodes represent data items and edges represent the direction of data flow. The data lineage graph is traversed using a depth-first search algorithm, and the node access order and edge weights are recorded during the traversal. During the traversal, the edge weights are calculated based on the access frequency and dependencies between data items.
[0013] The partition change gain matrix is used to quantify the performance improvement before and after a microservice partition change. The partition change gain matrix includes resource utilization improvement, service responsiveness improvement, data consistency improvement, and system stability improvement. Resource utilization is used to represent the efficiency of computing resource utilization within the partition, and service responsiveness is used to represent the request processing capability of the microservice.
[0014] A second aspect of the present invention provides a computer-readable storage medium storing program instructions, which, when executed in a computer, are used to perform the above-described industrial production data microservice partitioning optimization method.
[0015] A third aspect of the present invention provides an industrial production data microservice partition optimization system, comprising the aforementioned computer-readable storage medium, wherein the system is any one of a computer, a server, or a microcontroller, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.
[0016] Compared with existing technologies, this invention provides a method, medium, and system for microservice partitioning optimization of industrial production data. The proposed method 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 characteristics such as data lifecycle and security level, achieving a comprehensive characterization of the microservice partitioning optimization problem. By analyzing data lineage using a depth-first traversal algorithm, the impact of data dependencies on system performance is accurately grasped, providing a reliable decision-making basis for partitioning optimization.
[0017] This invention employs a neural network model to dynamically evaluate microservice partitions, capturing the complex relationship between system performance and data consistency through a bidirectional long short-term memory network. Based on the solution process of the partition optimization equations, it achieves coordinated optimization of multiple objectives such as resource utilization, service response time, and data consistency. In particular, the introduction of service failure rate and recovery time indicators into the stability constraint equations effectively reduces the impact of partition adjustments on system stability. Compared with traditional methods, this invention can more accurately predict the impact of partition changes and achieve continuous optimization of system performance while ensuring data consistency.
[0018] This invention successfully solves the problem of balancing system performance and data consistency in microservice partitioning optimization of industrial production data by establishing a complete theoretical framework for partitioning optimization. This method significantly improves the overall system performance and resource utilization efficiency while ensuring data consistency. By introducing the concept of partition change gain rate, a quantitative evaluation system for partitioning optimization is established, making the optimization process more scientific and controllable. Especially in large-scale distributed systems, the method of this invention can effectively handle complex data dependencies and dynamic load changes, solving the technical problem of insufficient partitioning optimization in existing industrial production data microservices. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention.
[0020] Figure 2 This is a diagram illustrating the microservice data interaction characteristics in Example 2.
[0021] Figure 3This is the data dependency weight network diagram in Example 2.
[0022] Figure 4 This is a system resource usage analysis diagram from Example 2.
[0023] Figure 5 This is a comparison chart of the system optimization effects in Example 2. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0025] like Figure 1 The diagram shown is a flowchart of a microservice partitioning optimization method for industrial production data provided by the first aspect of this invention. This method includes the following steps:
[0026] S01. Construct a microservice coupling index matrix based on the access frequency, data volume, data type, data lifecycle, data consistency requirements, data security level, data real-time requirements, and data access patterns 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 of the data lineage graph to obtain a data dependency weight matrix.
[0028] S03. Perform singular value decomposition on the microservice coupling index matrix and combine it with the data dependency weight matrix to obtain the microservice association strength matrix.
[0029] S04. Calculate the initial microservice partitioning scheme based on the microservice association strength matrix, and establish a partition change gain matrix;
[0030] S05. Collect the resource usage data of the industrial production data microservice. The resource usage data includes processor utilization rate, memory utilization rate, network transmission volume, disk read / write speed, service response time, number of concurrent service requests, service failure rate, and service recovery time.
[0031] S06. Construct a microservice load balancing index based on the resource usage data, and input the microservice load balancing index into a neural network model;
[0032] S07. Use the neural network model to dynamically evaluate the microservice partitions and obtain the partition change gain rate;
[0033] S08. Solve the partition optimization equation set based on the partition change gain rate to generate multiple candidate partition schemes;
[0034] S09. Calculate the resource utilization, service responsiveness, data consistency index, and system stability index of each group of candidate partitioning schemes to form an evaluation index set;
[0035] S10. Select the optimal partitioning scheme according to the set of evaluation indicators, and use the optimal partitioning scheme as the target partitioning scheme.
[0036] S11. Reorganize the microservices according to the target partitioning scheme to complete partitioning optimization;
[0037] The coupling index matrix is used to characterize the frequency of data interaction and the degree of data dependence between microservices. The coupling index matrix adopts a non-negative matrix form, and the element values of the coupling index matrix range from 0 to 1.
[0038] The partition change gain matrix is used to quantify the performance improvement before and after microservice partition changes. The partition change gain matrix includes resource utilization improvement value, service responsiveness improvement value, data consistency improvement value, and system stability improvement value.
[0039] The partition 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 partition change, and the negative gain rate represents the system stability risk brought about by the partition change. The positive gain rate and the negative gain rate together determine the feasibility of the partitioning scheme.
[0040] The neural network model adopts a multilayer 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.
[0041] The partitioning optimization equation set includes resource balance equations, response time equations, data consistency equations, and stability constraint equations:
[0042] The resource balancing equation is used to balance the resource utilization of each partition. The inputs of the resource balancing equation include the processor utilization, the memory utilization, the network transmission volume, the disk read / write speed, and the resource utilization threshold. The output of the resource balancing equation is the resource utilization.
[0043] The response time equation is used to optimize the service call chain. 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.
[0044] The data consistency equation is used to ensure the efficiency of data synchronization between different data segments. 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.
[0045] The stability constraint equation is used to ensure system availability. The inputs of the stability constraint equation include service dependency, fault propagation risk value, service failure rate, and service recovery time. The output of the stability constraint equation is the system stability index.
[0046] Wherein, the resource utilization is used to represent the efficiency of computing resource utilization within a partition; the service responsiveness is used to represent the request processing capability of a microservice; 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 is used to represent the strength of the dependency relationship between microservices; and the fault propagation risk value is used to represent the probability of fault propagation between services.
[0047] The specific implementation methods of the above steps are described in detail below. Specific implementation method of step S01: Based on the access frequency and data characteristics of industrial production data, a microservice coupling index matrix is constructed. First, a comprehensive scan and statistical analysis of the industrial production data is performed to obtain the access frequency and time distribution of each data item, and the access correlation between data items is calculated. Then, the data is classified according to its size, divided into small data (less than 1), medium data (1 to 10), and large data (greater than 10) in gigabytes. Next, the data types are analyzed, including structured data, semi-structured data, and unstructured data, and weight coefficients are assigned according to type characteristics. The data lifecycle is evaluated, and... Data is categorized into temporary data (less than 7 days), short-term data (7 to 90 days), and long-term data (more than 90 days) based on retention time. Considering data consistency requirements, consistency levels are divided into strong consistency, eventual consistency, and weak consistency. Based on data security levels, data is classified into four categories: public, internal, confidential, and secret. Analyzing real-time data requirements, response time requirements are categorized into ultra-fast (less than 100 milliseconds), fast (100 to 500 milliseconds), and normal (more than 500 milliseconds). Finally, by integrating features from various dimensions and using a weighted summation method, a non-negative coupling index matrix is constructed to calculate the coupling degree between microservices. The purpose of this step is to quantify the data interaction relationships between microservices, providing foundational data support for subsequent partition optimization.
[0048] The specific implementation of step S02 is as follows: A data lineage graph is constructed using historical access logs of industrial production data, and a data dependency weight matrix is calculated. First, the historical access logs are cleaned to remove abnormal records and redundant information. Log analysis is used to extract the call relationships between data items, including read, write, update, and delete operations. A directed graph data structure is used to represent the data lineage, where nodes represent data items and edges represent the direction of data flow. A depth-first search algorithm is used to traverse the data lineage graph, recording the node access order and edge weights during the traversal. During the traversal, the edge weights are calculated based on the access frequency and dependency relationships between data items. Finally, a data dependency weight matrix is constructed based on the traversal results, where the matrix element values represent the dependency strength between data items. The purpose of this step is to uncover the inherent relationships between data, providing a basis for microservice partitioning.
[0049] The specific implementation of step S03 is as follows: The microservice coupling index matrix is subjected to singular value decomposition (SVD) and combined with the data dependency weight matrix to calculate the microservice association strength matrix. First, the microservice coupling index matrix is standardized to eliminate the influence of data dimensions. Then, the standardized matrix is decomposed into a left singular matrix, a singular value diagonal matrix, and a right singular matrix using the singular value decomposition algorithm. By analyzing the magnitude of the singular values, the main eigenvectors are determined, and the influence of noise is removed. The data dependency weight matrix is normalized. Finally, matrix multiplication is used to multiply the normalized data dependency weight matrix with the singular value decomposition result. The final result is the microservice association strength matrix, which comprehensively reflects the coupling and data dependency relationships between microservices. The purpose of this step is to reduce data dimensionality and extract the essential association features between microservices.
[0050] The specific implementation of step S04 is as follows: Based on the microservice association strength matrix, an initial microservice partitioning scheme is calculated and a partition change gain matrix is established. First, a spectral clustering algorithm is used to analyze the microservice association strength matrix to determine the optimal number of partitions; the eigenvalues and eigenvectors of the Laplace matrix are calculated; a balanced partitioning algorithm is used to initially partition the microservices to ensure load balancing among partitions; the performance indicators of the initial partitioning scheme are evaluated, including partition cohesion and inter-partition coupling; a partition change gain matrix is constructed to record the performance differences between different partitioning schemes; the resource utilization improvement value is calculated, and the resource utilization efficiency before and after the partition change is compared; the service responsiveness improvement value is analyzed to evaluate the impact of partition changes on service performance; the data consistency improvement value is calculated to measure the impact of partition changes on data synchronization; finally, the system stability improvement value is evaluated to predict the impact of partition changes on system reliability. The purpose of this step is to generate an initial partitioning scheme and provide an evaluation benchmark for subsequent optimization.
[0051] The specific implementation of step S05 is as follows: Collect resource usage data for the industrial production data microservice. First, deploy resource monitoring probes to collect the real-time operating status of each microservice node; obtain processor utilization through performance counters, setting the sampling period to 1 second; monitor memory utilization, recording heap and non-heap memory usage; statistically analyze network traffic, including inbound and outbound traffic; measure disk read / write speeds, monitoring input / output operation performance; record service response time, collecting end-to-end latency for request processing; statistically analyze the number of concurrent service requests, monitoring system throughput; calculate the service failure rate, recording the number of service anomalies and failures; measure service recovery time, statistically analyzing the time interval from the occurrence of a failure to normal recovery. The purpose of this step is to obtain performance indicators of the microservice runtime, providing data support for load balancing optimization.
[0052] The specific implementation of step S06 is as follows: Based on resource usage data, microservice load balancing metrics are constructed and input into the neural network model. First, the collected resource usage data is normalized, mapping each metric value to a range of 0 to 1. The processor load balancing metric is calculated, setting a processor utilization threshold of 80%. A memory load balancing metric is constructed, setting a memory utilization threshold of 75%. A network load balancing metric is calculated, determined based on network bandwidth utilization. A disk load balancing metric is evaluated, setting a disk utilization threshold of 70%. A service response time balancing metric is constructed, setting a response time threshold of 200 milliseconds. A concurrent request balancing metric is calculated, determined based on system processing capacity. A failure rate balancing metric is evaluated, setting a failure rate threshold of 1%. A recovery time balancing metric is analyzed, setting a recovery time threshold of 5 minutes. Finally, the various load balancing metrics are combined to form a feature vector, which is then input into the neural network model. The purpose of this step is to construct a comprehensive load balancing evaluation metric, providing a basis for dynamic optimization.
[0053] The specific implementation of step S07 is as follows: A neural network model is used to dynamically evaluate microservice partitions and calculate the partition change gain rate. First, a multilayer perceptron network structure is adopted, with the number of input layer nodes matching the load balancing metric dimension. In the hidden layer, a bidirectional long short-term memory network is used for feature extraction, with the number of hidden layer nodes set to twice that of the input layer. Time series analysis is used to capture load change trends. A forget gate mechanism is used to filter irrelevant features. The input gate is used to update the current state information. An output gate is used to generate prediction results. Finally, positive and negative gain rates are calculated in the output layer. The positive gain rate represents the 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] The specific implementation of step S08 is as follows: Based on the partition change gain rate, solve the partition optimization equation set and generate candidate partition schemes. First, construct a resource balancing equation, using processor utilization, memory utilization, network bandwidth, and disk read / write speed as input variables; set resource utilization thresholds: processor utilization capped at 85%, memory utilization capped at 80%, network bandwidth utilization capped at 75%, and disk utilization capped at 70%; construct a response time equation, using service response time and concurrent request count as input variables; set a response time threshold of 300 milliseconds; establish a data consistency equation, inputting data update frequency and synchronization delay time; set a data consistency threshold of 500 milliseconds; construct a stability constraint equation, inputting service dependency and fault propagation risk values; solve the equation set using a heuristic algorithm; generate multiple candidate partition schemes using a genetic algorithm; and optimize the scheme quality using simulated annealing. The purpose of this step is to generate candidate partition schemes that satisfy multiple constraints.
[0055] The specific implementation of step S09 is as follows: Calculate the evaluation metrics for candidate partitioning schemes and form an evaluation metric set. First, calculate the resource utilization of each partitioning scheme to evaluate the efficiency of computing resource utilization; statistically analyze the average utilization rate and fluctuation range of various resources; calculate the service responsiveness to evaluate request processing capacity; statistically analyze the average response time and response time distribution; calculate the data consistency index to evaluate data synchronization efficiency; statistically analyze update latency and consistency maintenance overhead; calculate the system stability index to evaluate system availability; statistically analyze the service failure rate and average recovery time; use a comprehensive scoring method to weightedly sum the various metrics; construct the evaluation metric set, and record the evaluation results for each scheme. The purpose of this step is to comprehensively evaluate the performance of candidate schemes and provide a quantitative basis for scheme selection.
[0056] The specific implementation of step S10 is as follows: Based on the evaluation index set, the optimal partitioning scheme is selected and the target partitioning scheme is determined. First, the evaluation index set is normalized to eliminate dimensional differences between different indicators; index weights are set: resource utilization weight is 0.3, service responsiveness weight is 0.3, data consistency index weight is 0.2, and system stability index weight is 0.2; the comprehensive score of each scheme is calculated; the Pareto optimality criterion is used for scheme selection; the technical feasibility of scheme implementation is evaluated; the cost-benefit analysis of scheme implementation is performed; risk factors for scheme implementation are considered; finally, the optimal partitioning scheme is determined as the target scheme. The purpose of this step is to select the most suitable partitioning scheme from multiple candidate schemes.
[0057] The specific implementation of step S11 is as follows: Reorganize the microservices according to the target partitioning scheme and complete partition optimization. First, develop a detailed partitioning adjustment plan, including the service migration sequence and timeline; prepare necessary computing and storage resources; establish service degradation and rollback mechanisms; initiate the service migration process, gradually adjusting service deployment locations; monitor the system status during the migration process; verify the correctness of service functions; test service performance and stability; evaluate the optimization effect, including resource utilization, service response time, data consistency, and system availability; make necessary fine-tuning based on the evaluation results; finally, complete the partition optimization and restore 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 calculation process involved in this invention will now be described in detail.
[0059] 1. The calculation of the microservice coupling index matrix is expressed as follows:
[0060] C ij =α1f ij +α2v ij +α3t ij +α4l ij +α5s ij +α6r ij ;
[0061] In the formula, C ij f represents the coupling index between the i-th microservice and the j-th microservice; ij Relevance to data access frequency; v ij For data volume correlation; t ij For data type relevance; l ij For lifecycle relevance; s ij For security level relevance; r ij For real-time relevance; α1, α2, α3, α4, α5, α6 are weighting coefficients, and satisfy the following conditions:
[0062] 2. The edge weights of the data lineage graph are calculated as follows:
[0063]
[0064] In the formula, w ij n represents the edge weight from data item i to data item j; ij d represents the number of accesses between data items; N represents the total number of accesses; ij D represents the degree of data dependency; t represents the maximum degree of dependency. ij Let be the average access time interval; λ be the time decay coefficient; β1, β2, β3 be weighting coefficients, and satisfy .
[0065] 3. The calculation representation of the microservice association strength matrix is as follows:
[0066] R=UΣV T ⊙W;
[0067] In the formula, 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 Hadamard product of the matrices.
[0068] 4. The calculation method for the gain rate of zone changes is expressed as follows:
[0069] G p =γ1Δr+γ2Δt+γ3Δc+γ4Δs-δ1e r -δ2e s ;
[0070] In the formula, G p Δr represents the gain rate of partition changes; Δr represents the improvement in resource utilization; Δt represents the improvement in response time; Δc represents the improvement in consistency; Δs represents the improvement in stability; e r Risks associated with resource migration; e s γ1, γ2, γ3, and γ4 represent system stability risk; δ1 and δ2 represent positive gain weights; and δ1 and δ2 represent negative risk weights.
[0071] 5. The resource balance equation is expressed as follows:
[0072]
[0073] In the formula, B r For resource balance; CPU i mem i net i disk i These represent the processor, memory, network, and disk usage of the i-th partition, respectively; CPU max MEM max NET max DISK max ω1, ω2, ω3, and ω4 are the maximum threshold values for the corresponding resources.
[0074] 6. The response time equation is expressed as follows:
[0075]
[0076] In the formula, T r t represents the average response time. i q represents the processing time for the i-th request; i Q represents the number of concurrent requests. maxt represents the maximum concurrency. 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 Δt is a measure of data consistency. i T represents the synchronization delay of the i-th data. max p is the maximum allowable delay. ij Let n be the synchronization success rate of the i-th data on the j-th node; i is the number of data synchronization nodes; k is the number of data items.
[0080] 8. The stability constraint equations are expressed as follows:
[0081]
[0082] In the formula, S c d is a system stability indicator; i For service dependency; r i Risk of fault propagation; f i F represents the failure rate; max The maximum allowable failure rate; t ri For recovery time; T max θ1 represents the maximum recovery time; θ2, θ3, and θ4 are weighting coefficients; and l represents the number of services.
[0083] The principles and significance of constructing these equations are as follows:
[0084] 1. The coupling degree index matrix adopts a linear weighting method, taking into account the influence of multi-dimensional features, and adjusting the importance of each factor through weight coefficients;
[0085] 2. The bloodline edge weight combines access frequency, dependency degree and time decay characteristics, and uses exponential decay to reflect the impact of time on dependency;
[0086] 3. The correlation strength matrix is reduced in dimensionality through singular value decomposition and combined with the dependency weight matrix to extract essential correlation features;
[0087] 4. The gain ratio calculation balances positive returns and negative risks, and the linear combination method facilitates optimization.
[0088] 5. The resource balance equation normalizes the utilization rates of various resources, making it easier to comprehensively evaluate resource utilization.
[0089] 6. The response time equation takes into account the impact of concurrency and network latency, reflecting the service performance in real-world scenarios;
[0090] 7. The consensus equation takes into account both synchronization delay and success rate, and reflects the strict requirements of multi-node synchronization through cumulative multiplication;
[0091] 8. The stability constraint equations normalize and linearly combine multiple risk factors, which facilitates quantitative assessment and optimization control.
[0092] The derivation process of each equation is explained in detail below.
[0093] 1. Derivation of the microservice coupling index matrix:
[0094] First, construct an n×n dimensional coupling index matrix C, where n is the number of microservices:
[0095]
[0096] For each element c ij The calculation is performed through the following steps:
[0097] The first step is to calculate the relevance of data access frequency: Where count ij This represents the number of data interactions between microservices i and j, with total_count representing the total number of interactions.
[0098] The second step is to calculate the correlation between the data volumes: Where size ij The maximum amount of data to be interacted with is `max_size`.
[0099] The third step is to calculate the data type relevance:
[0100] Step 4: Calculate lifecycle relevance:
[0101] Step 5: Calculate the correlation between security levels:
[0102] Step 6: Calculate the real-time relevance: Where Δt ij The response delay is represented by μ, which is the time decay factor.
[0103] 2. Data Dependency Weight Matrix Construction Process:
[0104] Construct an m×m dimensional weight matrix W, where m is the number of data items:
[0105]
[0106] Edge weight calculation steps:
[0107] The first step is to calculate the access frequency ratio:
[0108] The second step is to calculate the dependency strength:
[0109] The third step is to calculate the time decay:
[0110] The final weight is: w ij =β1freq ij +β2dep ij +β3time ij .
[0111] 3. Singular value decomposition process of the correlation strength matrix:
[0112] The first step is to perform singular value decomposition on the coupling degree matrix C: C = UΣV T ;
[0113] The second step is to select the top k largest singular values and construct a dimension-reduced matrix:
[0114] Σ k =diag(σ1, σ2, ..., σ k );
[0115] The third step is to calculate the dimensionality-reduced association strength matrix:
[0116] Among them U k and V k These are the corresponding first k column vectors.
[0117] 4. Calculation process for gain rate change in partition:
[0118] The first step is to define how to improve resource utilization:
[0119] The second step is to define response time improvements:
[0120] The third step is to define consistency enhancement: Δc = c new -c old ;
[0121] Fourth step, define stability improvement: Δs = s new -s old ;
[0122] Step 5: Define risk factors:
[0123] Where κ1 and κ2 are risk coefficients, cost is migration cost, and risk is stability risk value.
[0124] 5. The optimization process of the resource balance equation:
[0125] The first step is to normalize the utilization rate of each resource:
[0126] The second step is to introduce resource weighting coefficients:
[0127] The third step is to construct the equilibrium objective function:
[0128] By minimizing the B between each partition r Differences enable resource balance.
[0129] 6. The process of constructing the response time equation:
[0130] Step 1, Basic Processing Time:
[0131] Step 2: Concurrency Impact Factor
[0132] Step 3, Network Latency:
[0133] The final average response time is: T r =t b ase+f concurrent +η.
[0134] 7. Steps for constructing the data consistency equation:
[0135] Step 1, normalize synchronization delay:
[0136] Step 2, Calculating the synchronization success rate:
[0137] The third step is consistency measurement:
[0138] This equation reflects the quality of data synchronization through a combination of latency and success rate.
[0139] 8. The process of constructing stability constraint equations:
[0140] Step 1, Dependency Calculation:
[0141] Step 2, Risk propagation calculation:
[0142] The third step is to normalize the failure rate:
[0143] Step 4, recovery time normalization:
[0144] The final stability index is as follows:
[0145] A second aspect of the present invention provides a computer-readable storage medium storing program instructions, which, when executed in a computer, are used to perform the above-described industrial production data microservice partitioning optimization method.
[0146] A third aspect of the present invention provides an industrial production data microservice partition optimization system, comprising the aforementioned computer-readable storage medium, wherein the system is any one of a computer, a server, or a microcontroller, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.
[0147] Specifically, the principle of this invention is based on a deep understanding of the characteristics of industrial production data and the features of microservice architecture. First, by constructing a microservice coupling index matrix, considering multiple dimensions such as data access frequency and data volume, the relationships between microservices are accurately described. This matrix adopts a non-negative matrix form, ensuring the comparability and additivity of the indicators, providing a reliable mathematical foundation for subsequent optimization calculations. Through a depth-first traversal of the data lineage graph, the data flow paths and dependency strengths are systematically analyzed, avoiding indirect dependencies that are easily overlooked in traditional methods.
[0148] In the dynamic evaluation phase, the neural network model employed in this invention possesses powerful feature extraction and pattern recognition capabilities. The multilayer perceptron structure effectively handles high-dimensional nonlinear problems, while the introduction of a bidirectional long short-term memory network enhances 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 equations embodies the idea of multi-objective optimization, achieving coordinated optimization of multiple objectives such as resource balance, response time, and data consistency through carefully designed constraints.
[0149] By transforming the complex problem of microservice partitioning of industrial production data into a solvable mathematical model, this invention establishes a complete theoretical framework. In particular, the introduction of key parameters such as resource utilization thresholds and response time thresholds fully considers the actual needs of industrial production, ensuring the practicality of the optimization results. A system stability guarantee mechanism is implemented throughout the entire optimization process; through quantitative assessment of fault propagation risk and precise calculation of service dependencies, the potential risks of partitioning adjustments are 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 below.
[0151] The specific implementation of step S01: A microservice coupling index matrix is constructed based on industrial production data. This step first involves a comprehensive scan of the industrial production data, using a distributed log collection system to obtain data access records for each microservice node. These records include access timestamps, source service identifiers, target service identifiers, data item identifiers, operation types, and data sizes. Then, a sliding time window method is used to statistically analyze access frequency. The time window size is set to 1 hour, and the sliding step is 5 minutes. The frequency correlation f is calculated. ij The calculation formula is: Where count ij The total number of data interactions between microservices i and j is given by `total_count`. Next, the data volume characteristics are analyzed, dividing the data volume into small data (less than 1), medium data (1 to 10), and large data (greater than 10) in gigabytes, and calculating the data volume correlation. Where size ij The amount of interactive data is denoted by `max_size`, which represents the maximum data size. Data types are categorized: structured data has a weight of 0.8, semi-structured data has a weight of 0.6, and unstructured data has a weight of 0.4. Type relevance is then calculated. To assess the data lifecycle, temporary data (less than 7 days) is weighted at 0.3, short-term data (7 to 90 days) at 0.6, and long-term data (more than 90 days) at 0.9. The lifecycle relevance is then calculated. Considering data consistency requirements, strong consistency has a weight of 0.9, eventual consistency has a weight of 0.6, and weak consistency has a weight of 0.3. Based on data security levels, public data has a weight of 0.3, internal data has a weight of 0.5, confidential data has a weight of 0.7, and classified data has a weight of 0.9. The correlation between security levels is then calculated. To analyze the real-time requirements of data, the weighting is as follows: ultra-fast response (less than 100 milliseconds) is 0.9, fast response (100 to 500 milliseconds) is 0.6, and normal response (greater than 500 milliseconds) is 0.3. The real-time relevance is then calculated. Where Δt ij To account for response latency, μ is the time decay factor; finally, an n×n dimensional coupling index matrix C is constructed, where n is the number of microservices: The matrix element calculation uses a linear weighting method: C ij =α1f ij +α2v ij +α3t ij +α4lij +α5s ij +α6r ij The weighting coefficients satisfy The optimal weight values are determined based on historical data using the least squares method.
[0152] The specific implementation of step S02: A data lineage graph is established using historical access logs of industrial production data, and a data dependency weight matrix is obtained. This step first cleans the historical access logs, using an outlier detection algorithm to identify and delete abnormal records, and a deduplication algorithm to remove redundant information. Then, the call relationships between data items are extracted, including read, write, update, and delete operations, constructing 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. A 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 values of the edges are calculated using the following formula: Where n ij Let d be the number of accesses between data items, N be the total number of accesses, and d be the number of accesses between data items. ij The degree of data dependency is represented by D, where D is the maximum dependency and t is the maximum dependency. ij Let λ be the average access time interval, β1, β2, and β3 be the time decay coefficients, and satisfy the following conditions: Finally, construct an m×m dimensional data dependency weight matrix W, where m is the number of data items: The matrix element values range from 0 to 1, with larger values indicating stronger dependencies.
[0153] The specific implementation of step S03: Perform singular value decomposition on the microservice coupling index matrix and combine it with the data dependency weight matrix to obtain the microservice association strength matrix. This step first standardizes the coupling index matrix, using the minimax normalization method to map matrix elements to the range of 0 to 1; then, perform singular value decomposition on the standardized matrix, with the decomposition formula being C = UΣV T Where U is the left singular vector matrix, Σ is the singular value diagonal matrix, and V T This is the transpose of the right singular vector matrix; by analyzing the magnitude of the singular values, a suitable truncation threshold is determined, retaining the main eigenvectors with a contribution rate exceeding 90%, and constructing a dimensionality-reduced matrix Σ. k =diag(σ1, σ2, ..., σ k ), where k is the feature dimension to be retained; then the dimensionality-reduced correlation strength matrix is calculated. Among them U k and V kThese are the corresponding first k column vectors, and ⊙ represents the Hadamard product of the matrix. Finally, the correlation strength matrix is normalized so that the matrix element values are kept in the range of 0 to 1.
[0154] The specific implementation of step S04: Calculate the initial microservice partitioning scheme based on the microservice association strength matrix and establish the partition change gain matrix. This step first uses a spectral clustering algorithm to analyze the microservice association strength matrix and constructs a normalized Laplace matrix L = ID. -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, and select the eigenvectors corresponding to the k smallest 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 partitioning scheme; evaluate the performance metrics of the initial partitioning scheme, and the formula for calculating the partition cohesion is: The formula for calculating the inter-regional coupling degree is: Construct a partition change gain matrix, and the gain calculation formula is G. p =γ1Δr+γ2Δt+γ3Δc+γ4Δs-δ1e r -δ2e s Where Δr represents the improvement in resource utilization, Δt represents the improvement in response time, Δc represents the improvement in consistency, Δs represents the improvement in stability, and e r For resource migration risks, e s To mitigate system stability risks, the coefficients were determined using a multi-objective optimization method.
[0155] The specific implementation of step S05: Collect resource usage data for the industrial production data microservice. This step first deploys resource monitoring probes on each microservice node and uses a distributed monitoring framework to collect performance indicators in real time. Processor utilization monitoring uses performance counters to count user-mode time, system-mode time, and idle time, with a sampling period of 1 second. Memory utilization monitoring includes heap memory and non-heap memory usage, recording allocated memory, used memory, and maximum available memory. Network traffic monitoring uses traffic statistics to record inbound and outbound traffic, including the number of requests, packet size, and network bandwidth utilization. Disk read / write rate monitoring uses IO performance statistics to record the number of read / write operations, the amount of data read / written, and the average response time. Service response time monitoring uses distributed tracing technology to record the latency at each stage of request processing. Service concurrent request monitoring uses request queue statistics to record the number of active connections and the number of waiting connections. Service failure rate monitoring uses anomaly log analysis to count the ratio of erroneous requests to the total number of requests. Service recovery time monitoring uses fault detection and recovery process tracking to record the time interval from the occurrence of a fault to normal recovery.
[0156] Specific implementation of step S06: Construct microservice load balancing metrics based on resource usage data. This step first normalizes the collected resource metrics by using a maximum-minimum standardization method to map the metric values to the range of 0 to 1. The standardization formula is as follows: Then calculate the processor load balancing metric, using the formula: CPU i The current processor utilization rate, CPU max Set the processor utilization threshold to 80%; construct a memory load balancing metric using the following formula: mem i MEM represents the current memory usage. max Set the memory utilization threshold to 75%; calculate the network load balancing metric using the following formula: Among them net i For the current network traffic, NET max The network bandwidth threshold is set to 70% of the maximum bandwidth; the disk load balancing metric is evaluated using the following formula: disk i DISK represents the current disk usage. max Set the disk utilization threshold to 70%; construct a service response time balancing metric, the formula is: Where t i T represents the current response time. max The response time threshold is set to 200 milliseconds; the concurrent request balancing metric is calculated using the following formula: Where q i Q represents the current number of concurrent requests. max The maximum concurrency threshold; the failure rate balancing metric is evaluated using the following formula: Where f i For the current failure rate, F max The failure rate threshold is set to 1%; the recovery time equilibrium index is analyzed using the following formula: Where t ri T represents the current recovery time. max The recovery time threshold is set to 5 minutes; finally, the various load balancing metrics are combined to form a feature vector. As input to a neural network model.
[0157] The specific implementation of step S07: Dynamic evaluation of microservice partitions is performed using a neural network model. This step employs a multilayer perceptron network structure, with the number of input layer nodes matching the load balancing metric dimension, set to 8 nodes. The hidden layer uses a bidirectional long short-term memory network for feature extraction, containing two bidirectional LSTM layers, each with 16 hidden units. The activation function is the hyperbolic tangent function. Load change trends are captured through time series analysis, with a time window size of 10. The forget gate update formula is f. t =σ(W f ·[h t-1 x t ]+b f ), where W f Let h be the weight matrix. t-1 x is the hidden state from the previous moment. t For the current input, b f The bias term is used; 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, the positive and negative gain rates are calculated in the output layer. The output layer uses the Sigmoid activation function to ensure that the output value is in the range of 0 to 1.
[0158] The specific implementation of step S08: Solve the partition optimization equation system based on the partition change gain rate. This step first constructs the resource balance equation. Where ω1, ω2, ω3, and ω4 are resource weight coefficients, and their weight values are determined using the analytic hierarchy process (AHP); a response time equation is constructed. Where t i For processing time, q i Q represents the number of concurrent requests. max For the maximum concurrency, t waitLet η be the waiting time and η be the network latency; establish a data consistency equation. Where Δt i For synchronization delay, T max For the maximum allowable delay, p ij To improve synchronization success rate; construct stability constraint equations. Where θ1, θ2, θ3, and θ4 are weight coefficients; a genetic algorithm is used to solve the system of equations, with a population size of 100, a maximum number of iterations of 500, a crossover probability of 0.8, and a mutation probability of 0.1; a non-dominated sorting method is used for multi-objective optimization to generate multiple sets of candidate partitioning schemes.
[0159] The specific implementation of step S09 is as follows: Calculate the evaluation indicators of the candidate partitioning scheme. This step first calculates resource utilization, including average utilization, peak utilization, and fluctuation coefficient; calculates service responsiveness, including average response time, 90th percentile response time, and timeout rate; calculates data consistency indicators, including synchronization latency, consistency maintenance overhead, and data conflict rate; evaluates system stability indicators, including service availability, fault recovery capability, and system robustness; and uses the analytic hierarchy process (AHP) to determine the indicator weights and construct an evaluation indicator set.
[0160] The specific implementation of step S10 is as follows: Select the optimal partitioning scheme based on the evaluation index set. This step first normalizes the evaluation index and calculates the comprehensive score; then uses the Pareto optimality criterion to screen the schemes; evaluates the technical feasibility and cost-benefit of the scheme implementation; and finally determines the optimal partitioning scheme.
[0161] The specific implementation of step S11: This step is a routine operation in the prior art. It can be simply described as reorganizing microservices according to the target partitioning scheme. This step includes formulating a migration plan, preparing resources, executing the migration, verifying functions, and evaluating the effect.
[0162] To better understand and implement this invention, the following is a specific application scenario example 2: A research and development team mainly optimized the data acquisition and processing system for an engine block machining production line, involving multiple business modules such as equipment monitoring, quality inspection, process parameters, and production planning. The original system had 25 microservice nodes, generating an average of approximately 280GB of data per day. The specific implementation process is as follows.
[0163] First, the R&D team conducted a comprehensive analysis of industrial production data, using a distributed log collection system to obtain one month's worth of data access records from each microservice node, totaling approximately 8.5 million log entries. The analysis revealed the data interaction patterns between the microservices, as shown in Table 1.
[0164] Table 1. Statistics on the frequency of microservice data interaction
[0165]
[0166]
[0167] Figure 2 (Microservice Data Interaction Characteristics Analysis): This chart uses a dual-axis display method. The left axis uses a bar chart to show the average daily interaction frequency of each microservice, and the right axis uses a line chart to show the peak QPS. The chart clearly shows that S001 (device status monitoring) has the highest interaction frequency and QPS, while S004 (production planning and scheduling) has a relatively lower interaction frequency. Based on the data interaction characteristics, the R&D team constructed a microservice coupling index matrix. The weight coefficients were determined using the least squares method as follows: α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. Data Type Distribution Statistics
[0169] Data types percentage 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 a quarter's worth of historical access logs to build a data lineage graph. Using a depth-first search algorithm, the parameters used to calculate edge weights were: β1 = 0.4, β2 = 0.35, β3 = 0.25, and a time decay coefficient λ = 0.05. The main data dependencies 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) Equipment operating parameters Quality inspection results 0.85 10 Process parameters Product size data 0.78 15 Raw material data Product quality data 0.72 20 Production Plan Equipment Scheduling 0.68 30 Inventory data Material Requirements 0.65 45
[0173] Singular value decomposition was performed on the coupling index matrix, and the eigenvectors with a cumulative contribution rate of 92% were selected, retaining the first 8 singular values. Combined with the data dependency weight matrix, the association strength analysis results are shown in Table 4.
[0174] Table 4 Microservice Association Strength Analysis Table
[0175] Service to Correlation strength Data flow Coupling type S001-S003 0.92 Two-way Strong coupling S002-S003 0.85 unidirectional Strong coupling S001-S002 0.78 Two-way Medium coupling S003-S004 0.65 unidirectional Medium coupling S004-S005 0.45 Two-way Weak coupling
[0176] Figure 3(Data Dependency Weight Network): This diagram uses a network graph to illustrate the dependencies between key data items. Nodes represent different data items, arrows indicate data flow, and the labeled weight values show the strength of the dependency. The diagram clearly shows the strongest dependency (weight 0.85) from equipment operating parameters to quality inspection results. Based on the correlation strength matrix, the R&D team used a spectral clustering algorithm to calculate the initial partitioning scheme. Resource usage data collected through 24-hour system monitoring is shown in Table 5.
[0177] Table 5 System Resource Usage Statistics
[0178]
[0179]
[0180] Figure 4 (System Resource Usage Analysis): This chart uses grouped bar charts to show the average and peak values of different system resources. Each indicator contains two adjacent bars; blue represents the average, and red represents the peak, with specific values labeled. The chart shows that memory usage peaked at 85%. The neural network model built for the system uses a 2-layer bidirectional LSTM structure with 16 hidden units per layer. The input features are an 8-dimensional load balancing indicator vector. The training data consists of one week of system operation data, sampled every 5 minutes, totaling 2016 samples. The model's training parameters and performance metrics are shown in Table 6.
[0181] Table 6. Training Parameters for Neural Network Models
[0182] Parameter name Value Remark Batch size 32 Number of training batches Learning rate 0.001 Adam optimizer parameters Training rounds 100 Number of iterations of the complete dataset Validation set ratio 20% The proportion of data used for model validation Training accuracy 94.5% Accuracy on the training set Verification accuracy 92.8% Accuracy on the validation set
[0183] The optimization equations were solved using a genetic algorithm with a population size of 100 and 500 iterations. The weighting coefficients used for calculating the gain rate of partition changes were: γ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.
[0184] Table 7 Evaluation Indicators for Zoning Scheme
[0185] Scheme Number resource utilization Service responsiveness Data consistency System stability Overall 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] Ultimately, the P001 scheme, with the highest overall score, was selected as the optimal partitioning scheme. This scheme reorganizes the original 25 microservice nodes into 8 partitions, and the resource balancing equation is calculated using the following weights: ω1 = 0.3, ω2 = 0.3, ω3 = 0.2, ω4 = 0.2. The performance comparison after partition reorganization is shown in Table 8.
[0187] Table 8 Performance Comparison Before and After System Optimization
[0188] Performance indicators Before optimization After optimization Increase 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 chart uses a combination of stacked bar charts and line charts to show the performance comparison and improvement percentage before and after system optimization. The bar chart shows the actual values before and after optimization, while the line chart shows the percentage improvement. The chart shows the most significant improvement in data synchronization latency, reaching 54.2%. Traditional industrial production data microservice optimization mainly adopts the following methods: 1. Static load balancing, which performs simple request distribution based on server configuration; 2. Threshold-based automatic scaling, which increases or decreases service instances when the system load exceeds a preset threshold; 3. Service grouping based on manual experience, where system maintenance personnel determine service deployment plans based on experience.
[0190] Compared to traditional methods, this invention achieves the following technological advancements: 1. It introduces data lineage analysis, accurately identifying data dependencies through a depth-first traversal algorithm, making service partitioning more rational; 2. It employs a combination of singular value decomposition and neural networks to achieve automatic discovery and dynamic evaluation of microservice relationships; 3. It establishes a complete set of partitioning optimization equations, quantifying and evaluating multiple objectives such as resource balance, response time, data consistency, and system stability; 4. It achieves adaptive optimization based on historical data, allowing the system to automatically adjust the partitioning scheme according to actual operating conditions. Implementation results show that this invention significantly improves system performance, reducing average response time by 47.1%, increasing system throughput by 50.6%, improving resource utilization by 51.1%, shortening fault recovery time by 52.8%, and reducing data synchronization latency by 54.2%. Simultaneously, this invention reduces manual intervention, improves system operation and maintenance efficiency, and lowers operation and maintenance costs.
[0191] It should be noted that the variables involved in this invention are explained in detail in Table 9 below.
[0192] Table 9. Variable Explanation Table
[0193]
[0194]
[0195] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A microservice partitioning optimization method for industrial production data, characterized in that, The process includes the following steps: Constructing a microservice coupling index matrix based on the access frequency, data volume, data type, data lifecycle, data consistency requirements, data security level, data real-time requirements, and data access patterns of industrial production data. This coupling index matrix characterizes the frequency of data interaction and the degree of data dependency between microservices, and is in non-negative matrix form. A data lineage graph is then established using historical access logs of the industrial production data, and a depth-first traversal is performed on the graph to obtain a data dependency weight matrix. Singular value decomposition is performed on the microservice coupling index matrix, and the microservice association strength matrix is obtained by combining it with the data dependency weight matrix; Calculate the initial microservice partitioning scheme based on the microservice association strength matrix, and establish a partition change gain matrix; Resource usage data from industrial production data microservices is collected to construct microservice load balancing indicators. A neural network model is used to calculate partition change gain rate to evaluate the feasibility of partition changes. The partition change gain rate includes positive gain rate and negative gain rate. Based on resource balance equation, response time equation, data consistency equation and stability constraint equation, multiple sets of candidate partition schemes are generated. The resource utilization, service responsiveness, data consistency index and system stability index of each set of candidate partition schemes are calculated. The optimal partition scheme is selected and partition optimization is completed. The specific steps for establishing the partition change gain matrix include: firstly, using a spectral clustering algorithm to analyze the microservice association strength matrix, and then constructing a standardized Laplacian matrix L = ID. -1 / 2 RD -1 / 2 Where I is the identity matrix, D is the degree matrix, and R is the dimensionality-reduced association strength matrix; calculate the eigenvalues and eigenvectors of the Laplacian matrix, and select the eigenvectors corresponding to the k smallest non-zero eigenvalues to construct the feature space; use the K-means clustering algorithm to group microservices in the feature space to obtain the initial partitioning scheme; evaluate the performance metrics of the initial partitioning scheme, and the formula for calculating the partition cohesion is: Where k is the number of partitions in the initial partitioning scheme, and C i Let R represent the i-th partition. pq Let |C| be the association strength value between the p-th microservice and the q-th microservice in the microservice association strength matrix. i | represents set C i The cardinality is the number of microservices in the i-th partition; the formula for calculating the inter-partition coupling degree is... Among them, C j Represent the j-th partition; construct the partition change gain matrix, and the gain calculation formula is G. p =γ1Δr+γ2Δt+γ3Δc+γ4Δs-δ1e r -δ2e s Where Δr represents the improvement in resource utilization, Δt represents the improvement in response time, Δc represents the improvement in consistency, Δs represents the improvement in stability, and e r For resource migration risks, e s For system stability risk, γ1 to γ4 are positive gain weights; δ1 and δ2 are negative risk weights.
2. The industrial production data microservice partitioning optimization method according to claim 1, characterized in that, The steps for constructing the microservice coupling index matrix are as follows: First, a comprehensive scan and statistical analysis of industrial production data is performed to obtain the access frequency and time distribution of each data item, and the access correlation between data items is calculated. Then, the data is classified according to its size, divided into small, medium, and large data in gigabytes. Next, the data types are analyzed, including structured, semi-structured, and unstructured data, and weight coefficients are assigned according to type characteristics. The data lifecycle is assessed, and the data is divided into temporary, short-term, and long-term data according to its storage time. Finally, the characteristics of each dimension are integrated, and a weighted summation method is used to calculate the coupling index between microservices.
3. The industrial production data microservice partitioning optimization method according to claim 2, characterized in that, The resource usage data includes processor utilization, memory utilization, network transmission volume, disk read / write speed, service response time, number of concurrent service requests, service failure rate, and service recovery time. The neural network model adopts a multilayer perceptron structure, including an input layer, a hidden layer, and an output layer. The input layer receives the microservice load balancing metrics, 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 partitioning optimization method according to claim 3, characterized in that, The resource balancing equation is used to balance the resource utilization of each partition. The inputs of the resource balancing equation include the processor utilization, the memory utilization, the network transmission volume, the disk read / write speed, 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 chain. 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 responsiveness.
5. The industrial production data microservice partitioning optimization method according to claim 4, characterized in that, The data consistency equation is used to ensure the efficiency of data synchronization between different data segments. 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 system availability. The inputs of the stability constraint equation include the service dependency, the fault propagation risk value, the service failure rate, and the service recovery time. The output of the stability constraint equation is the system stability index.
6. The industrial production data microservice partitioning optimization method according to claim 5, characterized in that, The data lineage graph is represented by a directed graph data structure, where nodes represent data items and edges represent the direction of data flow. The data lineage graph is traversed using a depth-first search algorithm, and the node access order and edge weights are recorded during the traversal. During the traversal, the edge weights are calculated based on the access frequency and dependencies between data items.
7. The industrial production data microservice partitioning optimization method according to claim 6, characterized in that, The partition change gain matrix is used to quantify the performance improvement before and after microservice partition changes. 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 rate is used to represent the efficiency of computing resource utilization within a partition, and the service responsiveness rate is used to represent the request processing capability of a microservice.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions, which, when executed in a computer, are used to perform the industrial production data microservice partitioning optimization method according to any one of claims 1-7.
9. A microservice partitioning optimization system for industrial production data, characterized in that, The system includes the computer-readable storage medium of claim 8, wherein the system is any one of a computer, a server, or a microcontroller, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor that executes the program instructions stored in the computer-readable storage medium.
Citation Information
Patent Citations
Resource mapping method, device and equipment for micro service and medium
CN118585327A
Containerized micro-service intelligent collaborative arrangement method and device
CN119248414A