Business application high-reliability optimization method and system based on micro-service architecture

By deploying K8S and Docker in the microservice architecture, configuring the Istio service mesh, and combining Apriori association rules and graph neural network to optimize data processing, the overload problem of the microservice architecture in high concurrency situations is solved, and the system is highly reliable. performance and performance improvement.

CN119211013APending Publication Date: 2024-12-27STATE GRID INFORMATION & TELECOMM BRANCH +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411085798.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing microservice architectures are prone to overload or even crashes under high concurrent or abnormal traffic conditions. Traditional load balancing strategies are difficult to cope with complex business traffic, and the current associated rule mining methods are inefficient, making it difficult to provide valuable business insights in real time.

Method used

By deploying K8S and Docker, configuring the Istio service mesh, setting routing policies and traffic control rules using the Istioctl command, collecting front-end browser data and generating data tags, using the Apriori association rule algorithm for data insights and business traffic control, combining with principal component analysis And graph neural network optimizes data processing.

Benefits of technology

It improves system reliability and performance, ensures stable operation under high load conditions, realizes accurate monitoring and analysis of user behavior and system status, dynamically adjusts business traffic, and avoids system overload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211013A_ABST
    Figure CN119211013A_ABST
Patent Text Reader

Abstract

The invention discloses a service application high-reliability optimization method and system based on a micro-service architecture. The method comprises the steps of establishing a high-reliability cloud environment, deploying K8S and Docker, and configuring grid capability services. The method comprises the following steps of: initializing grid service, and setting a routing strategy and a flow control rule through an Istioctl command; front-end browser data is collected and stored, and a data mark is generated. And carrying out data insight by using an Apriori association rule algorithm to realize service flow control. According to the service application high-reliability optimization method and system based on the micro-service architecture provided by the invention, the reliability and performance of the system are improved. By adapting to a high-reliability cloud server, an operating system, a database and domestic chip basic software and hardware, faults are reduced, the continuity and availability of services are improved, and the requirements of large-scale data processing and high-concurrency access are met. The autonomous and controllable level of the technology is improved, the national information security is guaranteed, and the development of related industrial chains is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of microservice architecture, and specifically to a high-reliability optimization method and system for business applications based on microservice architecture. Background Art

[0002] As the digital transformation of the power industry accelerates, the stability and reliability of the State Grid Cloud, as a key supporting platform, are crucial to ensuring the continuity and security of power supply. Digital transformation requires the State Grid Cloud system to be efficient, stable, and scalable to cope with increasingly complex business needs. This includes implementing redundancy, fault tolerance, and backup mechanisms at multiple levels, including hardware, software, and networks, to ensure that services can be quickly restored in the event of a single point of failure or abnormality.

[0003] With the rapid development of information technology, microservice architecture has been widely used in modern software development. Microservice architecture improves the flexibility and scalability of the system by splitting the monolithic application into multiple independent service modules, each of which is independently deployed and managed. In recent years, the advancement of cloud computing technology has further promoted the popularity of microservice architecture, enabling enterprises to flexibly deploy and manage complex application systems. Kubernetes (K8S), as a container orchestration tool, combined with Docker container technology, has become the mainstream solution for implementing microservice architecture. In addition, Istio, as a service mesh technology, provides advanced functions such as traffic management, service discovery, and fault handling, which greatly enhances the stability and controllability of the microservice architecture.

[0004] However, the existing microservice architecture still faces some challenges in practical applications. First, traditional load balancing strategies are difficult to cope with complex business traffic, often resulting in uneven resource allocation and affecting system performance. Second, due to the lack of effective traffic control and circuit breaker mechanisms, the system is prone to overload or even crash under high concurrency or abnormal traffic conditions. In addition, the existing association rule mining methods are inefficient in big data environments and it is difficult to provide valuable business insights in real time. Although some solutions have attempted to alleviate these problems by improving load balancing algorithms and introducing circuit breaker mechanisms, they have not been able to completely solve the high reliability and high efficiency management problems in microservice architectures. Summary of the invention

[0005] In view of the above-mentioned problems, the present invention is proposed.

[0006] Therefore, the technical problem solved by the present invention is that the existing technical projects are highly dependent on Kubernetes, Docker open source technologies, and their own technical solutions. Once these technologies or solutions have security vulnerabilities, compatibility issues, or delayed updates and iterations, they will have a significant impact on the entire cloud platform. Traditional load balancing strategies are difficult to cope with complex business traffic, often resulting in uneven resource allocation. Existing systems are prone to overload or even crash under high concurrency or abnormal traffic conditions.

[0007] To solve the above technical problems, the present invention provides the following technical solutions: a high-reliability optimization method for business applications based on microservice architecture, including: establishing a high-reliability cloud environment, deploying K8S, Docker, and configuring grid capability services.

[0008] Initialize the grid service and set routing policies and traffic control rules through the Istioctl command.

[0009] Collect and store front-end browser data and generate data tags.

[0010] Use the Apriori association rule algorithm to gain data insights and implement business traffic control.

[0011] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, the establishment of a high-reliability cloud environment and the deployment of K8S and Docker include installing K8s in the multi-cloud cluster service of the power business system, installing the istio tool in the K8s cluster, initializing the routing strategy and traffic control of the istio control panel, and realizing application service discovery through the Envoy component to form an application service grid. Deploy Docker and use the Cilium plug-in to configure a high-performance container network.

[0012] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, the configuration of grid capability services includes building a microservice environment, building a Kubernetes cluster on a multi-cloud platform, using Kubernetes tools to create and configure a multi-cloud cluster environment, and installing Istio software in the Kubernetes cluster through the Helm package management tool as the basic component of the service grid.

[0013] Configure the Istio control plane, initialize the Istiod component and Ingress Gateway, and form a complete service governance architecture.

[0014] Use virtual services and target rules to define traffic distribution rules between service versions. Configure load balancing policies in Istio to support the minimum number of connections algorithm, distribute requests to the service instance with the least number of active connections, and achieve even distribution of traffic, as shown below:

[0015]

[0016] Among them, C i Indicates the current number of connections of the i-th service instance.

[0017] Configure the Kiali component and use Kiali to display the communication relationship, load balancing status, and health status between services for real-time monitoring and fault detection.

[0018] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, wherein: the routing strategy and traffic control rules are set through the Istioctl command, including routing strategies based on request types, routing strategies based on request priorities, current limiting strategies based on traffic peaks, and fuse strategies based on resource utilization.

[0019] The routing strategy based on the request type includes using the type information in the request header as a matching condition to route read requests to the read-only instance and to route write requests to the write-only instance.

[0020] The routing strategy based on request priority includes setting the priority information in the request header. When the priority is higher than the priority threshold, the request is routed to the high-priority instance group. Otherwise, it is routed to the common instance group.

[0021] The priority threshold is obtained by calculation. First, the basic priority threshold formula is constructed. The normalization function normalizes the request priority. The exponential function describes the growth of the request priority, which is expressed as:

[0022]

[0023] Introducing request complexity, system load impact, and historical data weight, the basic priority threshold is optimized, expressed as:

[0024]

[0025] Among them, P opt represents the optimized request priority threshold, x represents the original priority value of the current request, min(x) represents the lowest priority value among all requests, max(x) represents the highest priority value among all requests, C represents the complexity coefficient of the request, L represents the current load coefficient of the system, e represents the complexity coefficient of the request, -L represents the exponential decay of the load factor, represents the weighted priority and of historical requests, represents the weighted sum of historical requests, H i Represents the weight of historical requests, P i represents the priority value of historical requests, and λ represents the priority growth rate.

[0026] The flow limiting strategy based on traffic peak includes setting the flow threshold. When the real-time traffic exceeds the flow threshold, the flow limiting is automatically triggered, and the excess requests are delayed. When the real-time traffic does not exceed the flow threshold, the flow limiting is canceled.

[0027] The resource usage-based circuit breaker strategy includes setting CPU and memory usage monitoring indicators. When the CPU and memory usage exceeds the corresponding threshold, the circuit breaker is automatically triggered to route new requests to other instances with light loads. When the CPU and memory usage do not exceed the corresponding threshold, the circuit breaker is canceled.

[0028] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, wherein: the collecting and storing of front-end browser data and generating data tags include collecting data from the front-end browser, including CPU usage CPU_usage, memory usage memory_usage, network bandwidth usage network_bandwidth, user request frequency request_frequency and request response time response_time.

[0029] The collected data is standardized and expressed as:

[0030]

[0031] Among them, X represents the original data, μ represents the mean of the data, σ represents the standard deviation of the data, and X norm Represents the normalized data.

[0032] The comprehensive data is clustered and the distance metric in multidimensional space is used to optimize the clustering results, which can be expressed as:

[0033]

[0034] Among them, D ij represents the Euclidean distance between data points i and j, x ik represents the value of data point i in the kth dimension, x jk Represents the value of data point j in the kth dimension.

[0035] Use principal component analysis to reduce data dimensionality, reduce the dimension of data, and improve the efficiency and accuracy of clustering algorithms. PCA dimensionality reduction is expressed as:

[0036] Z=XW

[0037] Among them, Z represents the data after dimensionality reduction, X represents the original data matrix, and W represents the eigenvector matrix.

[0038] First, the hierarchical clustering method is used to perform preliminary clustering on the data to obtain clustering results at different levels, and then the clusters with deeper levels are selected as the initial K clustering centers to further optimize the K-Means clustering process.

[0039] The hierarchical clustering method uses the minimum distance, maximum distance, and average distance link methods to calculate the distance between two clusters, merge the two closest clusters to form a new cluster, and repeat the process until all data points are clustered into one cluster.

[0040] Use the results of hierarchical clustering to select the initial cluster center, perform K-Means iterative optimization, calculate the distance from the data point to the centroid, and assign the data point to the cluster corresponding to the nearest centroid. Update the centroid position until the centroid no longer changes, expressed as:

[0041]

[0042] Among them, μ k represents the centroid of the kth cluster, |C k ∣ represents the number of data points in the kth cluster, x i represents the data point belonging to the kth cluster.

[0043] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, the generating of data tags also includes optimizing using a graph neural network-based method to achieve intelligent tag adjustment. The data points are regarded as nodes in the graph, and the relationships between the nodes are regarded as edges in the graph, making full use of the complex relationships between the data for optimization.

[0044] Each node contains a variety of data. The message passing mechanism in GNN is used to pass the information of neighbor nodes to the current node for feature update. The transfer formula is expressed as:

[0045]

[0046] in, represents the feature representation of node v at layer k, represents the set of neighbor nodes of node v, W (k) represents the weight matrix of the kth layer, b (k) represents the bias term of the kth layer, and σ represents the activation function.

[0047] Through multi-layer message passing and feature updating, the information of neighbor nodes is aggregated to obtain the final feature representation of each node. The aggregation formula is expressed as:

[0048]

[0049] Among them, h v Represents the final feature representation of node v, and Aggregate(`) represents the aggregation function.

[0050] Using the aggregated node feature representation, we classify the nodes through a fully connected layer and label them into different categories, expressed as:

[0051] y=softmax(W f h v +b f )

[0052] Among them, y represents the classification result of the node, W f represents the weight matrix of the fully connected layer, b f represents the bias term of the fully connected layer, and softmax(`) represents the normalization function, which converts the output into a probability distribution.

[0053] The classification result y includes fuse, current limiting and normal conditions. When y≥0.8, it means that an extremely high risk is detected, it is judged as a fuse, and the service is immediately interrupted. When 0.5≤y<0.80, it means that a high risk is detected, it is judged as a current limiting condition, and the flow is restricted. When y<0.5, it means that the system is running normally and no additional measures are required.

[0054] As a preferred solution of the high-reliability optimization method for business applications based on microservice architecture described in the present invention, the use of the Apriori association rule algorithm for data insight to achieve business traffic control includes using the classification result y as the input data of the Apriori algorithm, including three states: fuse, current limiting and normal.

[0055] Use the Apriori algorithm to generate frequent item sets from the data set. Frequent item sets refer to item sets that appear frequently in the data set and meet a certain support threshold. The support calculation formula is expressed as:

[0056]

[0057] Among them, support(A) represents the support of item set A, count(A) represents the number of times item set A appears in the data set, and N represents the total number of transactions in the data set.

[0058] Generate association rules from frequent item sets, including confidence and lift. The form of association rules is It means that if item set A appears, item set B is also likely to appear.

[0059] The confidence calculation formula is expressed as:

[0060]

[0061] in, Represents association rules , support(A∪B) represents the support for item sets A and B to appear simultaneously.

[0062] The calculation formula of lift is expressed as:

[0063]

[0064] in, Represents association rules The lift degree measures the strength of the association between A and B.

[0065] Based on the generated association rules, data insights are conducted to identify key business behavior patterns and traffic characteristics, and business traffic control is achieved by combining the classification results.

[0066] A high-reliability optimization system for business applications based on a microservice architecture, characterized by: including:

[0067] Build environment modules, establish a highly reliable cloud environment, deploy K8S and Docker, and configure grid capability services.

[0068] Set the rule module, initialize the grid service, and set the routing policy and traffic control rules through the Istioctl command.

[0069] Generate data tag module, collect and store front-end browser data, and generate data tags.

[0070] The data insight module uses the Apriori association rule algorithm to perform data insight and implement business traffic control.

[0071] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0072] A computer-readable storage medium stores a computer program, which implements the steps of the method described above when executed by a processor.

[0073] The beneficial effects of the present invention are as follows: the reliability and performance of the system are improved. By adapting high-reliability cloud servers, operating systems, databases, and domestic chip basic software and hardware, faults are reduced, business continuity and availability are improved, and the needs of large-scale data processing and high concurrent access are met. The level of technological autonomy and controllability is improved, national information security is guaranteed, and the development of related industrial chains is promoted. Advanced data preprocessing technology and hierarchical clustering methods are used to perform standardized processing and cluster analysis on front-end data. Combined with principal component analysis (PCA) and graph neural network (GNN) optimization, high-precision data tags are generated. This step realizes accurate monitoring and analysis of user behavior and system status, and provides basic data support for subsequent business traffic control. Frequent item sets and association rules are extracted from the data set through the Apriori algorithm, and key business behavior patterns are identified in combination with the data labeling results of the previous step. These rules are used for real-time traffic control, and dynamic adjustment and optimization of business traffic are achieved through fuse, current limiting and intelligent routing strategies, ensuring the stable operation of the system under high load and abnormal conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0075] Figure 1 An overall flow chart of a high-reliability optimization method and system for business applications based on a microservice architecture provided in the first embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0077] Example 1, reference Figure 1 , as an embodiment of the present invention, provides a method, comprising:

[0078] S1: Establish a highly reliable cloud environment, deploy K8S and Docker, and configure grid capability services.

[0079] It should be noted that the combination of Kubernetes (K8S) and Docker is designed to achieve efficient container orchestration and management. Docker is used to create, deploy and run application containers, while K8S provides container orchestration capabilities that can automate container deployment, expansion and management. By packaging applications into Docker containers, the consistency and isolation of the environment are ensured, while K8S ensures high availability and scalability of containers through its scheduling and management capabilities.

[0080] Install K8s in the multi-cloud cluster service of the power business system, install the istio tool in the K8s cluster, initialize the routing policy and traffic control of the istio control panel, and implement application service discovery through the Envoy component to form an application service grid. Deploy Docker and use the Cilium plug-in to configure a high-performance container network.

[0081] Build a microservice environment, build a Kubernetes cluster on a multi-cloud platform, use Kubernetes tools to create and configure a multi-cloud cluster environment, and install Istio software in the Kubernetes cluster through the Helm package management tool as the basic component of the service mesh.

[0082] Configure the Istio control plane, initialize the Istiod component and Ingress Gateway, and form a complete service governance architecture.

[0083] Use virtual services and target rules to define traffic distribution rules between service versions. Configure load balancing policies in Istio to support the minimum number of connections algorithm, distribute requests to the service instance with the least number of active connections, and achieve even distribution of traffic, as shown below:

[0084]

[0085] Among them, C i Indicates the current number of connections of the i-th service instance.

[0086] Configure the Kiali component and use Kiali to display the communication relationship, load balancing status, and health status between services for real-time monitoring and fault detection.

[0087] S2: Initialize the grid service and set routing policies and traffic control rules through the Istioctl command.

[0088] Setting routing policies and traffic control rules includes routing policies based on request type, routing policies based on request priority, current limiting policies based on traffic peak, and circuit breaker policies based on resource usage.

[0089] The routing strategy based on the request type includes using the type information in the request header as a matching condition to route read requests to the read-only instance and to route write requests to the write-only instance.

[0090] The routing strategy based on request priority includes setting the priority information in the request header. When the priority is higher than the priority threshold, the request is routed to the high-priority instance group. Otherwise, it is routed to the common instance group.

[0091] The priority threshold is obtained by calculation. First, the basic priority threshold formula is constructed. The normalization function normalizes the request priority. The exponential function describes the growth of the request priority, which is expressed as:

[0092]

[0093] Introducing request complexity, system load impact, and historical data weight, the basic priority threshold is optimized, expressed as:

[0094]

[0095] Among them, P opt represents the optimized request priority threshold, x represents the original priority value of the current request, min(x) represents the lowest priority value among all requests, max(x) represents the highest priority value among all requests, C represents the complexity coefficient of the request, L represents the current load coefficient of the system, e represents the complexity coefficient of the request, -L represents the exponential decay of the load factor, represents the weighted priority and of historical requests, represents the weighted sum of historical requests, H i Represents the weight of historical requests, P i represents the priority value of historical requests, and λ represents the priority growth rate.

[0096] It should be noted that the priority threshold formula is designed to dynamically calculate the priority of each request based on the multi-dimensional data of the request. The request priority is standardized by a normalization function, the priority growth is described by an exponential function, the request complexity coefficient and the system load impact are combined, and finally the basic priority threshold is optimized by the weight of historical data. This formula can dynamically adjust the priority of requests based on real-time data to ensure that high-priority requests are given priority, improve system response speed and user experience. By combining request complexity and system load, the importance of requests and their impact on the system can be more comprehensively evaluated, and resource allocation can be optimized. Using the weight of historical data, the formula can smooth the impact of current requests and historical requests, and enhance the stability and rationality of priority calculation. The design of this priority threshold formula improves the system's intelligent management capabilities for different types of requests, allowing the system to handle complex business scenarios more flexibly and efficiently.

[0097] The flow limiting strategy based on traffic peak includes setting the flow threshold. When the real-time traffic exceeds the flow threshold, the flow limiting is automatically triggered, and the excess requests are delayed. When the real-time traffic does not exceed the flow threshold, the flow limiting is canceled.

[0098] The resource usage-based circuit breaker strategy includes setting CPU and memory usage monitoring indicators. When the CPU and memory usage exceeds the corresponding threshold, the circuit breaker is automatically triggered to route new requests to other instances with light loads. When the CPU and memory usage do not exceed the corresponding threshold, the circuit breaker is canceled.

[0099] S3: Collects and stores front-end browser data and generates data tags.

[0100] Collect data from the front-end browser, including CPU usage CPU_usage, memory usage memory_usage, network bandwidth usage network_bandwidth, user request frequency request_frequency and request response time response_time.

[0101] The collected data is standardized and expressed as:

[0102]

[0103] Among them, X represents the original data, μ represents the mean of the data, σ represents the standard deviation of the data, and X norm Represents the normalized data.

[0104] The comprehensive data is clustered and the distance metric in multidimensional space is used to optimize the clustering results, which can be expressed as:

[0105]

[0106] Among them, D ij represents the Euclidean distance between data points i and j, x ik represents the value of data point i in the kth dimension, x jk Represents the value of data point j in the kth dimension.

[0107] Use principal component analysis to reduce data dimensionality, reduce the dimension of data, and improve the efficiency and accuracy of clustering algorithms. PCA dimensionality reduction is expressed as:

[0108] Z=XW

[0109] Among them, Z represents the data after dimensionality reduction, X represents the original data matrix, and W represents the eigenvector matrix.

[0110] First, the hierarchical clustering method is used to perform preliminary clustering on the data to obtain clustering results at different levels, and then the clusters with deeper levels are selected as the initial K clustering centers to further optimize the K-Means clustering process.

[0111] The hierarchical clustering method uses the minimum distance, maximum distance, and average distance link methods to calculate the distance between two clusters, merge the two closest clusters to form a new cluster, and repeat the process until all data points are clustered into one cluster.

[0112] Use the results of hierarchical clustering to select the initial cluster center, perform K-Means iterative optimization, calculate the distance from the data point to the centroid, and assign the data point to the cluster corresponding to the nearest centroid. Update the centroid position until the centroid no longer changes, expressed as:

[0113]

[0114] Among them, μ k represents the centroid of the kth cluster, |C k ∣ represents the number of data points in the kth cluster, x i represents the data point belonging to the kth cluster.

[0115] To achieve intelligent tag adjustment, a graph neural network-based method is used for optimization. The data points are regarded as nodes in the graph, and the relationship between the nodes is regarded as the edges in the graph, making full use of the complex relationship between the data for optimization.

[0116] Each node contains a variety of data. The message passing mechanism in GNN is used to pass the information of neighbor nodes to the current node for feature update. The transfer formula is expressed as:

[0117]

[0118] in, represents the feature representation of node v at layer k, represents the set of neighbor nodes of node v, W (k) represents the weight matrix of the kth layer, b (k) represents the bias term of the kth layer, and σ represents the activation function.

[0119] Through multi-layer message passing and feature updating, the information of neighbor nodes is aggregated to obtain the final feature representation of each node. The aggregation formula is expressed as:

[0120]

[0121] Among them, h v Represents the final feature representation of node v, and Aggregate(`) represents the aggregation function.

[0122] Using the aggregated node feature representation, we classify the nodes through a fully connected layer and label them into different categories, expressed as:

[0123] y=softmax(W f h v +b f )

[0124] Among them, y represents the classification result of the node, W f represents the weight matrix of the fully connected layer, b f represents the bias term of the fully connected layer, and softmax(`) represents the normalization function, which converts the output into a probability distribution.

[0125] The classification result y includes fuse, current limiting and normal conditions. When y≥0.8, it means that an extremely high risk is detected, it is judged as a fuse, and the service is immediately interrupted. When 0.5≤y<0.80, it means that a high risk is detected, it is judged as a current limiting condition, and the flow is restricted. When y<0.5, it means that the system is running normally and no additional measures are required.

[0126] It should be noted that the graph neural network (GNN) regards data points as nodes in the graph and uses the edges between nodes to represent the relationship between data. GNN passes the information of neighbor nodes to the current node for feature update through a multi-layer message passing mechanism, and finally obtains the final feature representation of each node by aggregating the information of neighbor nodes, thereby achieving efficient clustering optimization.

[0127] GNN can process data in non-Euclidean space, capture complex relationships and dependencies between data points, and improve the accuracy of clustering results. Through multi-layer message passing and feature updates, GNN can generate richer and more meaningful node feature representations and improve the quality of clustering. GNN can be flexibly applied to various types of data (such as social networks, knowledge graphs, etc.) and has strong scalability. GNN shows good computational efficiency when processing large-scale data, can quickly generate high-quality clustering results, and is suitable for real-time data analysis and processing scenarios.

[0128] S4: Use the Apriori association rule algorithm to gain data insights and implement business traffic control.

[0129] The classification result y is used as the input data of the Apriori algorithm, including three states: fuse, current limiting, and normal.

[0130] Use the Apriori algorithm to generate frequent item sets from the data set. Frequent item sets refer to item sets that appear frequently in the data set and meet a certain support threshold. The support calculation formula is expressed as:

[0131]

[0132] Among them, support(A) represents the support of item set A, count(A) represents the number of times item set A appears in the data set, and N represents the total number of transactions in the data set.

[0133] Generate association rules from frequent item sets, including confidence and lift. The form of association rules is It means that if item set A appears, item set B is also likely to appear.

[0134] The confidence calculation formula is expressed as:

[0135]

[0136] in, Represents association rules , support(A∪B) represents the support for item sets A and B to appear simultaneously.

[0137] The calculation formula of lift is expressed as:

[0138]

[0139] in, Represents association rules The lift degree measures the strength of the association between A and B.

[0140] It should be noted that the Apriori association rule algorithm extracts frequent item sets from the data set in a layer-by-layer incremental manner and generates strong association rules. The algorithm uses the properties of frequent item sets to gradually narrow the scope of candidate item sets and ultimately generates association rules with high confidence and lift, which are used to identify key business behavior patterns and traffic characteristics.

[0141] The Apriori algorithm can mine hidden associations from massive data and help identify key business behavior patterns and potential problems.

[0142] By generating strong association rules, enterprises can make more accurate business decisions based on data insights, thereby improving operational efficiency and user satisfaction.

[0143] By using association rules to identify high-risk behavior patterns, the system can promptly trigger circuit breakers and current limiting mechanisms to prevent system overload and ensure stable business operation.

[0144] Through insight into and analysis of real-time data, the system can dynamically adjust traffic control strategies to adapt to different business scenarios and load changes, thereby improving the stability and reliability of the overall system.

[0145] Based on the generated association rules, data insights are conducted to identify key business behavior patterns and traffic characteristics, and business traffic control is achieved by combining the classification results.

[0146] The above embodiments also include a high-reliability optimization system for business applications based on a microservice architecture, specifically:

[0147] Build environment modules, establish a highly reliable cloud environment, deploy K8S and Docker, and configure grid capability services.

[0148] Set the rule module, initialize the grid service, and set the routing policy and traffic control rules through the Istioctl command.

[0149] Generate data tag module, collect and store front-end browser data, and generate data tags.

[0150] The data insight module uses the Apriori association rule algorithm to perform data insight and implement business traffic control.

[0151] The computer device may be a server. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data cluster data of a power monitoring system. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method is implemented.

[0152] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0153] Example 2, an embodiment of the present invention, provides a high-reliability optimization method and system for business applications based on a microservice architecture. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments.

[0154] Configure highly reliable State Grid cloud servers, use redundant power supplies and network connections to ensure high reliability at the hardware level. Deploy Kubernetes (K8S) clusters, install Docker and Istio, and configure grid capability services. Use Prometheus and Grafana for real-time monitoring. Integrate data collection scripts to collect user behavior data, system resource usage, and other information in the front-end browser and store them in the back-end database.

[0155] Install K8S in the multi-cloud cluster service of the power business system, deploy Docker, and use the Cilium plug-in to configure a high-performance container network. Initialize the Istio control panel, implement application service discovery through the Envoy component, and form an application service mesh.

[0156] Use Kubernetes to create and configure a multi-cloud cluster environment, and use the Helm package management tool to install Istio software in the K8S cluster as the basic component of the service grid. Configure the Istio control plane, initialize the Istiod component and Ingress Gateway, and form a complete service governance architecture.

[0157] Use virtual services and target rules to define traffic distribution rules between service versions, configure load balancing policies in Istio, and use the minimum number of connections algorithm to distribute requests to the service instance with the least number of active connections to achieve even distribution of traffic.

[0158] Configure the Kiali component and use Kiali to display the communication relationship, load balancing status, and health status between services for real-time monitoring and fault detection.

[0159] Collect data from the front-end browser, including CPU usage, memory usage, network bandwidth usage, user request frequency, and request response time. Standardize the collected data and use principal component analysis (PCA) to reduce the dimension of the data and improve the efficiency and accuracy of the clustering algorithm.

[0160] The comprehensive data is clustered. The hierarchical clustering method is first used to perform preliminary clustering on the data to obtain clustering results at different levels. Then, the clusters with deeper levels are selected as the initial K clustering centers to further optimize the K-Means clustering process. The graph neural network-based method is used for intelligent label adjustment to generate high-precision data labels.

[0161] The classification results are used as input data for the Apriori algorithm, including three states: circuit breaker, current limiting, and normal. The Apriori algorithm is used to generate frequent item sets and association rules from the data set, including confidence, lift, etc.

[0162] Identify key business behavior patterns and traffic characteristics through association rules, and combine classification results to achieve business traffic control. Trigger the fuse mechanism based on high-risk behavior patterns, trigger the current limiting mechanism based on potential risk behavior patterns, and the intelligent routing strategy routes traffic to service instances with lighter loads to optimize system resource utilization.

[0163] The existing technology is used as the comparative experimental group. The existing technology is a widely used microservice architecture method that mainly relies on traditional load balancing and traffic control methods. Although these technical methods have been put into practice in many applications, they still have certain limitations under high load and complex business scenarios.

[0164] The prior art experimental group is divided into three groups, as follows:

[0165] Prior art (1): A simple round-robin algorithm is used to distribute requests to each service instance. The round-robin algorithm cannot be adjusted dynamically according to the current load of the instance, resulting in uneven resource allocation. The lack of effective current limiting and fuse mechanisms can easily lead to system overload in high concurrency situations.

[0166] Existing technology (2): Uses a weight-based load balancing algorithm. The weight allocation is based on static configuration and cannot dynamically respond to real-time load changes in the system. A basic current limiting mechanism is introduced, but there is a lack of intelligent adjustment strategies, and there are still performance bottlenecks and potential system overload risks.

[0167] Existing technology (3): uses a load balancing algorithm based on the minimum number of connections, but does not combine dynamic resource monitoring and cannot optimize resource allocation in real time. It has a preliminary fuse mechanism, but the fuse strategy is not flexible enough and cannot be intelligently adjusted according to the real-time status of the system.

[0168] The present invention also conducted three experiments to compare with the prior art, and the experimental results are shown in Table 1.

[0169] Table 1 Experimental results

[0170]

[0171]

[0172] It can be seen from the table data that the performance and reliability of the present invention and the prior art under high-load environments are significantly different. When processing high-concurrency requests, the prior art has high CPU and memory utilization, and the network bandwidth utilization is also at a high level, resulting in a long request response time and the system is prone to overload. The present invention, through the optimized microservice architecture and intelligent traffic control strategy, effectively reduces the system resource utilization, improves the response speed and system stability.

[0173] The CPU usage rate of the prior art is between 85% and 90%, which is at a high level and easily leads to system overload. However, the CPU usage rate of the present invention is significantly reduced and controlled between 70% and 75%, indicating that the system can still maintain low resource consumption under high load. This is because the present invention evenly distributes requests to each service instance through optimized load balancing strategy and intelligent routing mechanism, thereby reducing the pressure of a single instance.

[0174] The memory usage rate of the prior art is between 78% and 82%, which is at a high level and affects the scalability of the system. The memory usage rate of the present invention is controlled between 65% and 68%, which significantly reduces memory consumption. This is due to the fact that the present invention adopts an efficient data processing and storage strategy, optimizes the data structure through principal component analysis and hierarchical clustering methods, and reduces memory usage.

[0175] The network bandwidth utilization rate of the prior art is between 120Mbps and 130Mbps, and network bottlenecks are prone to occur under high load conditions. The network bandwidth utilization rate of the present invention is between 100Mbps and 105Mbps, which reduces the network load and improves the data transmission efficiency. This is because the present invention uses an intelligent flow control strategy to reasonably allocate network resources and avoid unnecessary flow waste.

[0176] Under the same user request frequency (500 to 520 req / s), the response time of the present invention is significantly better than the prior art. The request response time of the prior art is between 150ms and 180ms, while the request response time of the present invention is controlled between 100ms and 110ms, which significantly improves the user experience. This is because the present invention timely adjusts the system load through intelligent routing and current limiting fuse mechanism to ensure the rapid processing of requests.

[0177] The request response time of the prior art is long, which easily leads to a decline in user experience. The present invention significantly shortens the request response time and improves the overall performance and reliability of the system through multi-level data processing and optimization.

[0178] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A high-reliability optimization method for business applications based on microservice architecture, characterized in that: include: Establish a highly reliable cloud environment, deploy K8S and Docker, and configure grid capability services; Initialize the grid service and set routing policies and traffic control rules through the Istioctl command; Collect and store front-end browser data and generate data tags; Use the Apriori association rule algorithm to gain data insights and implement business traffic control.

2. The high-reliability optimization method for business applications based on microservice architecture according to claim 1, characterized in that: The establishment of a highly reliable cloud environment and the deployment of K8S and Docker include installing K8s in the multi-cloud cluster service of the power business system, installing the istio tool in the K8s cluster, initializing the routing policy and traffic control of the istio control panel, and realizing application service discovery through the Envoy component to form an application service grid; deploying Docker and using the Cilium plug-in to configure a high-performance container network.

3. The high-reliability optimization method for business applications based on microservice architecture according to claim 2, characterized in that: The configuration grid capability service includes building a microservice environment, building a Kubernetes cluster on a multi-cloud platform, using Kubernetes tools to create and configure a multi-cloud cluster environment, and installing Istio software in the Kubernetes cluster through the Helm package management tool as a basic component of the service grid; Configure the Istio control plane, initialize the Istiod component and Ingress Gateway, and form a complete service governance architecture; Use virtual services and target rules to define traffic distribution rules between service versions. Configure load balancing policies in Istio to support the minimum number of connections algorithm, distribute requests to the service instance with the least number of active connections, and achieve even distribution of traffic, as shown below: Among them, C i Indicates the current number of connections of the i-th service instance; Configure the Kiali component and use Kiali to display the communication relationship, load balancing status, and health status between services for real-time monitoring and fault detection.

4. The high-reliability optimization method for business applications based on microservice architecture according to claim 3, characterized in that: The routing strategy and traffic control rules are set by the Istioctl command, including a routing strategy based on request type, a routing strategy based on request priority, a current limiting strategy based on traffic peak, and a fuse strategy based on resource utilization; The routing strategy based on the request type includes using the type information in the request header as a matching condition, routing the read request to the read-only instance, and routing the write request to the write-only instance; The routing strategy based on request priority includes setting the priority information in the request header, and routing the request to the high-priority instance group when the priority is higher than the priority threshold; Otherwise, route to the common instance group; The priority threshold is obtained by calculation. First, the basic priority threshold formula is constructed. The normalization function normalizes the request priority. The exponential function describes the growth of the request priority, which is expressed as: Introducing request complexity, system load impact, and historical data weight, the basic priority threshold is optimized, expressed as: Among them, P opt represents the optimized request priority threshold, x represents the original priority value of the current request, min(x) represents the lowest priority value among all requests, max(x) represents the highest priority value among all requests, C represents the complexity coefficient of the request, L represents the current load coefficient of the system, e represents the complexity coefficient of the request, -L represents the exponential decay of the load factor, represents the weighted priority and of historical requests, represents the weighted sum of historical requests, H i Represents the weight of historical requests, P i represents the priority value of historical requests, and λ represents the priority growth rate; The flow limiting strategy based on traffic peak includes setting a traffic threshold. When the real-time traffic exceeds the traffic threshold, the flow limiting is automatically triggered, and the excess requests are delayed. When the real-time traffic does not exceed the traffic threshold, the flow limiting is canceled. The resource utilization-based circuit breaker strategy includes setting CPU and memory utilization monitoring indicators. When either CPU or memory utilization exceeds the corresponding threshold, the circuit breaker is automatically triggered to route new requests to other lightly loaded instances. When neither CPU nor memory utilization exceeds the corresponding threshold, the circuit breaker is canceled.

5. The high-reliability optimization method for business applications based on microservice architecture according to claim 4, characterized in that: The collecting and storing of the front-end browser data and generating the data tag comprises collecting data from the front-end browser, including CPU usage CPU_usage, memory usage memory_usage, network bandwidth usage network_bandwidth, user request frequency request_frequency and request response time response_time; The collected data is standardized and expressed as: Among them, X represents the original data, μ represents the mean of the data, σ represents the standard deviation of the data, and X norm Represents the standardized data; The comprehensive data is clustered and the distance metric in multidimensional space is used to optimize the clustering results, which can be expressed as: Among them, D ij represents the Euclidean distance between data points i and j, x ik represents the value of data point i in the kth dimension, x jk Represents the value of data point j in the kth dimension; Use principal component analysis to reduce data dimensionality, reduce the dimension of data, and improve the efficiency and accuracy of clustering algorithms. PCA dimensionality reduction is expressed as: Z=XW Among them, Z represents the data after dimensionality reduction, X represents the original data matrix, and W represents the eigenvector matrix; First, use the hierarchical clustering method to perform preliminary clustering on the data to obtain clustering results at different levels, and then select the deeper clusters as the initial K clustering centers to further optimize the K-Means clustering process; The hierarchical clustering method uses the minimum distance, maximum distance, and average distance link methods to calculate the distance between two clusters, merge the two closest clusters to form a new cluster, and repeat the process until all data points are clustered into one cluster; Use the results of hierarchical clustering to select the initial cluster center, perform K-Means iterative optimization, calculate the distance from the data point to the centroid, and assign the data point to the cluster corresponding to the nearest centroid. Update the centroid position until the centroid no longer changes, expressed as: Among them, μ k represents the centroid of the kth cluster, |C k ∣ represents the number of data points in the kth cluster, x i represents the data point belonging to the kth cluster.

6. The high-reliability optimization method for business applications based on microservice architecture according to claim 5, characterized in that: Generating data tags also includes optimizing using a graph neural network-based method to achieve intelligent tag adjustment; treating data points as nodes in a graph, and the relationships between nodes as edges in the graph, making full use of the complex relationships between data for optimization; Each node contains a variety of data. The message passing mechanism in GNN is used to pass the information of neighbor nodes to the current node for feature update. The transfer formula is expressed as: in, represents the feature representation of node v at layer k, represents the set of neighbor nodes of node v, W (k) represents the weight matrix of the kth layer, b (k) represents the bias term of the kth layer, σ represents the activation function; Through multi-layer message passing and feature updating, the information of neighbor nodes is aggregated to obtain the final feature representation of each node. The aggregation formula is expressed as: Among them, h v Represents the final feature representation of node v, Aggregate(`) represents the aggregation function; Using the aggregated node feature representation, we classify the nodes through a fully connected layer and label them into different categories, expressed as: y =softmax(W f h v +b f ) Among them, y represents the classification result of the node, W f represents the weight matrix of the fully connected layer, b f represents the bias term of the fully connected layer, and softmax(`) represents the normalization function, which converts the output into a probability distribution; The classification result y includes circuit breaking, current limiting and normal situations. When y≥0.8, it means that an extremely high risk is detected and it is judged to be a circuit breaking situation, and the service is interrupted immediately. When 0.5≤y<0.80, it means that a higher risk is detected and it is judged to be a current limiting situation, and the traffic is restricted. When y<0.5, it means that the system is operating normally and no additional measures are needed.

7. The high-reliability optimization method for business applications based on microservice architecture according to claim 6, characterized in that: The use of the Apriori association rule algorithm for data insight and service flow control includes using the classification result y as input data of the Apriori algorithm, including three states: fuse, current limiting and normal; Use the Apriori algorithm to generate frequent item sets from the data set. Frequent item sets refer to item sets that appear frequently in the data set and meet a certain support threshold. The support calculation formula is expressed as: Among them, support(A) represents the support of item set A, count(A) represents the number of times item set A appears in the data set, and N represents the total number of transactions in the data set; Generate association rules from frequent item sets, including confidence and lift. The form of association rules is It means that if item set A appears, item set B is also likely to appear; The confidence calculation formula is expressed as: in, Represents association rules , support(A∪B) represents the support of item sets A and B appearing simultaneously; The calculation formula of lift is expressed as: in, Represents association rules The lift of , which measures the strength of the association between A and B; Based on the generated association rules, data insights are conducted to identify key business behavior patterns and traffic characteristics, and business traffic control is achieved by combining the classification results.

8. A high-reliability optimization system for business applications based on a microservice architecture using the method according to any one of claims 1 to 7, characterized in that: Build environment modules, establish a highly reliable cloud environment, deploy K8S and Docker, and configure grid capability services; Set up the rule module, initialize the grid service, and set up routing policies and traffic control rules through the Istioctl command; Generate data tag module, collect and store front-end browser data, and generate data tags; The data insight module uses the Apriori association rule algorithm to perform data insight and implement business traffic control.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Cited By

  • Software performance optimization method and system under domestic chip architecture

    CN120029741A

  • A Software Performance Optimization Method and System under a Domestic Chip Architecture

    CN120029741B