A microservice architecture expansion processing method and system
Through the optimization of monitoring tools, business flow diagrams, data access patterns and elastic infrastructure, the problem of poor expansion adaptability of microservice architecture is solved, achieving more efficient load processing and meeting business needs.
Patent Information
- Application Number
- CN202410551644.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-07
AI Technical Summary
The microservice architecture has poor adaptability and low accuracy when expanding, making it difficult to effectively cope with the growth of load and business needs.
Collect performance data by deploying monitoring tools, identify system bottlenecks, and split services based on business process diagrams and performance requirements; build objective functions to optimize splitting granularity; analyze data access patterns to expand databases and optimize cache; build elastic infrastructure and Automatic scaling strategy; implement current limiting and circuit breaker mechanisms.
It improves the expansion adaptability and accuracy of the microservice architecture, enhances the scalability and responsiveness of the system, and ensures that business needs are met.
Smart Images

Figure CN118138632B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and more specifically, to an extended processing method and system for a microservice architecture. Background Art
[0002] With the rapid development of Internet technology, the scale and complexity of enterprise applications are also increasing. Traditional monolithic architectures are often difficult to cope with when faced with requirements such as high concurrency, high availability, and high scalability. As a solution to these challenges, microservice architecture has gradually become the mainstream architecture for enterprise application development.
[0003] The microservice architecture splits a large application into multiple small, independent, and reusable services. Each service runs in its own independent process and interacts using lightweight communication mechanisms such as HTTP RESTful APIs. This architecture allows each service to be deployed, expanded, and maintained independently, thereby improving the scalability, maintainability, and agility of the system.
[0004] However, with the development of business and the growth of users, microservice architecture also faces the challenge of expansion. How to effectively expand microservices to meet the growing load and business needs has become an important research topic.
[0005] In the existing technology, the microservice architecture has poor adaptability and accuracy in expansion, and poor expansion effect.
[0006] Therefore, how to expand the adaptability and accuracy of the microservice architecture is a technical problem that needs to be solved. Summary of the invention
[0007] The present invention provides a method for extending a microservice architecture, which is used to solve the technical problems of poor adaptability and low accuracy of microservice architecture extension in the prior art. The method comprises:
[0008] Deploy monitoring tools to collect system performance data to identify system bottlenecks, and determine services that need to be expanded based on business process diagrams and system bottlenecks;
[0009] Build an objective function based on business needs, determine the decomposition granularity through the objective function, and decompose the services to be expanded to obtain multiple microservices;
[0010] Analyze the data access patterns and performance requirements of each microservice, and scale the database and optimize the cache;
[0011] Build corresponding elastic infrastructure and automatic scaling strategies based on microservice performance data;
[0012] Implement current limiting and circuit breaker mechanisms for microservices.
[0013] In some embodiments of the present application, a monitoring tool is deployed to collect system performance data to determine system bottlenecks, including:
[0014] According to the performance data category, a performance curve of each performance data over a corresponding period of time is collected to obtain a real-time performance curve;
[0015] Compare the real-time performance curve with a preset standard performance curve corresponding to the performance parameter category of the real-time performance curve to obtain a longitudinal difference portion curve;
[0016] Aligning multiple real-time performance curves with bottleneck relationships on a time scale and then comparing them, and determining horizontal synchronous partial curves and horizontal non-synchronous partial curves corresponding to the multiple real-time performance curves based on the size and change trend of performance parameters;
[0017] Determine the system bottleneck based on the common vertical difference curve and horizontal synchronization curve involved in the same performance data;
[0018] If one or more longitudinal difference partial curves represent a certain bottleneck category, and the transverse synchronization partial curve also represents the bottleneck category, then the bottleneck category is determined to be a system bottleneck;
[0019] If a single or multiple longitudinal difference partial curves represent a certain bottleneck category, but the horizontal synchronous partial curve represents another bottleneck category, then the strength of the horizontal synchronous partial curve and the horizontal asynchronous partial curve are compared. If the horizontal synchronous partial curve is stronger than the horizontal asynchronous partial curve, the bottleneck category represented by the horizontal synchronous partial curve is taken as the system bottleneck. Otherwise, the bottleneck category represented by a single or multiple longitudinal difference partial curves is taken as the system bottleneck.
[0020] In some embodiments of the present application, determining the services to be expanded based on the business process diagram and system bottlenecks includes:
[0021] Analyze the dependencies and number of interactions between services within a preset distance in the business process diagram;
[0022] Combine services whose dependencies exceed the corresponding threshold or whose number of interactions exceeds the corresponding threshold into one service to obtain a new business process diagram;
[0023] Services that present system bottlenecks are identified as services that need to be expanded.
[0024] In some embodiments of the present application, an objective function is constructed based on business needs, including:
[0025] Determine multiple demand indicators based on business needs, and divide the multiple demand indicators into maximum demand indicators and minimum demand indicators;
[0026] The objective function is constructed by maximizing and minimizing the demand index, and the corresponding constraints are determined to solve the problem;
[0027] ;
[0028] Where P is the objective function, is the conversion coefficient corresponding to the maximization demand, n is the number of maximization demand indicators, is the weight corresponding to the i-th maximization demand index, is the ith maximization demand index, is the conversion coefficient corresponding to the minimized demand, m is the number of minimized demand indicators, is the weight corresponding to the jth minimization demand index, is the jth minimization demand index.
[0029] In some embodiments of the present application, the data access mode and performance requirements of each microservice are analyzed, and the database is expanded and the cache is optimized, including:
[0030] Use database auditing, log analysis tools, or APM tools to collect data access logs and identify data access patterns;
[0031] Extract performance metrics from data access logs and determine the performance requirements of each microservice;
[0032] Expand the corresponding database according to the data access mode and optimize the database configuration based on performance requirements;
[0033] Determine the corresponding cache strategy based on the data access pattern.
[0034] In some embodiments of the present application, corresponding elastic infrastructure and automatic scaling strategies are constructed based on the performance data of microservices, including:
[0035] Integrate the load balancer with the message queue to distribute messages to service instances according to the distribution priority, which includes the business logic distribution priority and the service instance performance distribution priority.
[0036] Determine the distribution priority corresponding to the business logic and the performance distribution priority of each service instance;
[0037] The distribution priority corresponding to the business logic takes precedence over the performance distribution priority of the service instance;
[0038] Set storage resource usage thresholds based on business needs and system performance goals, and define automatic scaling rules;
[0039] Select the auto-scaling library and configure the auto-scaling controller. When the predefined auto-scaling rules are triggered, the auto-scaling controller will adjust the storage resources according to the policy.
[0040] In some embodiments of the present application, a current limiting and fuse mechanism is implemented for microservices, including:
[0041] Select a current limiting algorithm, integrate a current limiting library, configure current limiting parameters, and implement current limiting logic at the microservice entry point;
[0042] Deploy service monitoring tools to monitor the health status of key system services, set circuit breaker logic and corresponding degradation strategies, implement circuit breaker logic in the service call link, and provide degradation strategies.
[0043] In some embodiments of the present application, a current limiting algorithm is selected, including:
[0044] Determine the traffic patterns, resource types, and system architectures that correspond to each current limiting algorithm;
[0045] Analyze the current traffic pattern, resource type, and system architecture to determine the corresponding current limiting algorithm.
[0046] In some embodiments of the present application, setting the fuse logic and the corresponding degradation strategy includes:
[0047] Implement degradation logic by identifying all failure modes that cause service unavailability and defining degradation conditions and degradation levels.
[0048] Correspondingly, the present application also provides an extended processing system for a microservice architecture, including:
[0049] The first module is used to deploy monitoring tools to collect system performance data to determine system bottlenecks, and determine the services that need to be expanded based on the business process diagram and system bottlenecks;
[0050] The second module is used to build an objective function based on business needs, determine the decomposition granularity through the objective function, and decompose the services to be expanded to obtain multiple microservices;
[0051] The third module is used to analyze the data access patterns and performance requirements of each microservice, and to scale the database and optimize the cache;
[0052] The fourth module is used to build corresponding elastic infrastructure and automatic scaling strategies based on the performance data of microservices;
[0053] The fifth module is used to implement current limiting and circuit breaker mechanisms for microservices.
[0054] By applying the above technical solutions, monitoring tools are deployed to collect system performance data to determine system bottlenecks, and services that need to be expanded are determined based on business process diagrams and system bottlenecks; objective functions are built based on business needs, and the decomposition granularity is determined through objective functions. Services that need to be expanded are split to obtain multiple microservices; data access patterns and performance requirements of each microservice are analyzed, and databases are expanded and caches are optimized; corresponding elastic infrastructure and automatic scaling strategies are built through microservice performance data; and current limiting and fuse mechanisms are implemented for microservices. This ensures the adaptability and accuracy of microservice architecture expansion and improves the expansion effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 A schematic diagram of a process flow of an expansion processing method of a microservice architecture proposed in an embodiment of the present invention is shown;
[0057] Figure 2 A schematic diagram of the structure of an extended processing system of a microservice architecture proposed in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] The present application embodiment provides a method for extending a microservice architecture, such as Figure 1 As shown, the method comprises the following steps:
[0060] Step S101, deploy monitoring tools to collect system performance data to determine system bottlenecks, and determine services that need to be expanded based on the business process diagram and system bottlenecks.
[0061] In this embodiment, monitoring tools (such as Prometheus and Grafana) are deployed to collect and analyze system performance data, and whether the current service needs to be expanded is evaluated based on business conditions and performance.
[0062] In some embodiments of the present application, a monitoring tool is deployed to collect system performance data to determine system bottlenecks, including:
[0063] According to the performance data category, a performance curve of each performance data over a corresponding period of time is collected to obtain a real-time performance curve;
[0064] Compare the real-time performance curve with the preset standard performance curve corresponding to the performance parameter category to obtain a longitudinal difference curve;
[0065] Aligning multiple real-time performance curves with bottleneck relationships on a time scale and then comparing them, and determining horizontal synchronous partial curves and horizontal non-synchronous partial curves corresponding to the multiple real-time performance curves based on the size and change trend of performance parameters;
[0066] Determine the system bottleneck based on the common vertical difference curve and horizontal synchronization curve involved in the same performance data;
[0067] If one or more longitudinal difference partial curves represent a certain bottleneck category, and the transverse synchronization partial curve also represents the bottleneck category, then the bottleneck category is determined to be a system bottleneck;
[0068] If a single or multiple longitudinal difference partial curves represent a certain bottleneck category, but the horizontal synchronous partial curve represents another bottleneck category, then the strength of the horizontal synchronous partial curve and the horizontal asynchronous partial curve are compared. If the horizontal synchronous partial curve is stronger than the horizontal asynchronous partial curve, the bottleneck category represented by the horizontal synchronous partial curve is taken as the system bottleneck; otherwise, the bottleneck category represented by a single or multiple longitudinal difference partial curves is taken as the system bottleneck.
[0069] In this embodiment, the longitudinal difference partial curves are multiple real-time performance curves that have a bottleneck relationship when the performance parameter is compared with its own threshold, that is, multiple performances are related to a certain bottleneck, and these performance changes have a certain relationship. Based on the size and change trend of the performance parameters, the horizontal synchronous partial curves and the horizontal asynchronous partial curves corresponding to the multiple real-time performance curves are determined, and the part that meets the relationship is determined in two directions of parameters and change trends. If it meets the relationship, it is the horizontal synchronous partial curve, and if it does not meet the relationship, it is the horizontal asynchronous partial curve.
[0070] In this embodiment, if the longitudinal difference curve and the transverse synchronization curve represent the same bottleneck relationship, the bottleneck relationship is determined, otherwise, the strength between the transverse synchronization curve and the transverse non-synchronization curve is determined. The strength here can be compared by comparing the degree to which the two curves occupy the entire curve.
[0071] In some embodiments of the present application, determining the services to be expanded based on the business process diagram and system bottlenecks includes:
[0072] Analyze the dependencies and number of interactions between services within a preset distance in the business process diagram;
[0073] Combine services whose dependencies exceed the corresponding threshold or whose number of interactions exceeds the corresponding threshold into one service to obtain a new business process diagram;
[0074] Services that present system bottlenecks are identified as services that need to be expanded.
[0075] Step S102: construct an objective function based on business requirements, determine the decomposition granularity through the objective function, decompose the service to be expanded, and obtain multiple microservices.
[0076] In some embodiments of the present application, an objective function is constructed based on business needs, including:
[0077] Determine multiple demand indicators based on business needs, and divide the multiple demand indicators into maximum demand indicators and minimum demand indicators;
[0078] The objective function is constructed by maximizing and minimizing the demand index, and the corresponding constraints are determined to solve the problem;
[0079] ;
[0080] Where P is the objective function, is the conversion coefficient corresponding to the maximization demand, n is the number of maximization demand indicators, is the weight corresponding to the i-th maximization demand index, is the ith maximization demand index, is the conversion coefficient corresponding to the minimized demand, m is the number of minimized demand indicators, is the weight corresponding to the jth minimization demand index, is the jth minimization demand index.
[0081] In this embodiment, maximizing the demand index includes maximizing the overall performance and the degree of maintenance, and minimizing the demand index includes minimizing the cost and complexity.
[0082] In this embodiment, the constraint conditions are obtained by synthesizing the following contents:
[0083] Business logic integrity:
[0084] The split services should maintain the integrity of business logic to ensure that business processes are not affected.
[0085] Service Independence:
[0086] Each service should be independent and able to be deployed, scaled, and upgraded independently.
[0087] Team autonomy:
[0088] Services should correspond to the organizational structure of teams so that teams can develop and maintain services autonomously.
[0089] Performance requirements:
[0090] The split services should meet performance requirements, such as response time, throughput, etc.
[0091] Data consistency:
[0092] The split services should maintain data consistency, especially in transaction processing involving multiple services.
[0093] Cost-effectiveness:
[0094] The cost of splitting (including development, operation and maintenance, and training costs) should be within an acceptable range.
[0095] Minimum serving size:
[0096] Services should be large enough to avoid wasting resources by being too small.
[0097] Maximum serving size:
[0098] Services should not be too large to avoid excessive complexity and maintenance costs.
[0099] Communication cost:
[0100] Communication between services should be as minimal as possible to reduce the overall complexity and latency of the system.
[0101] Technical feasibility:
[0102] The decomposition plan should take into account the existing technology stack and infrastructure to ensure technical feasibility.
[0103] Step S103: Analyze the data access mode and performance requirements of each microservice, expand the database and optimize the cache.
[0104] In some embodiments of the present application, the data access mode and performance requirements of each microservice are analyzed, and the database is expanded and the cache is optimized, including:
[0105] Use database auditing, log analysis tools, or APM tools to collect data access logs and identify data access patterns;
[0106] Extract performance metrics from data access logs and determine the performance requirements of each microservice;
[0107] Expand the corresponding database according to the data access mode and optimize the database configuration based on performance requirements;
[0108] Determine the corresponding cache strategy based on the data access pattern.
[0109] In this embodiment, common data access patterns are identified based on the collected data, such as more reads and fewer writes, write-intensive, batch operations, etc. A service level agreement (SLA) is set to ensure that performance requirements are met, and the CPU, memory, storage and other resources of the database server are increased according to performance requirements. Optimize database configuration, such as adjusting buffer size, connection pool configuration, etc. Expand the corresponding database according to the data access pattern. For read-intensive operations, consider adding read-only replicas or using database sharding. For write-intensive operations, consider master-slave replication or multi-master replication. Design appropriate caching strategies based on data access patterns, such as caching hot data, frequently accessed data, etc.
[0110] Step S104: Build corresponding elastic infrastructure and automatic scaling strategy based on the performance data of microservices.
[0111] In this embodiment, load balancing can be used in conjunction with message queues (such as RabbitMQ, Kafka) to achieve asynchronous communication and load distribution between services. Under high load conditions, message queues can help decouple services and reduce the pressure on a single service, while load balancing can ensure that messages are effectively distributed to all healthy service instances. Automatic scaling can dynamically adjust the number of service instances based on system load and resource usage. Distributed file storage systems (such as HDFS, Ceph) can also automatically expand storage resources based on demand, improving data read and write performance and system scalability.
[0112] In some embodiments of the present application, corresponding elastic infrastructure and automatic scaling strategies are constructed based on the performance data of microservices, including:
[0113] Integrate the load balancer with the message queue to distribute messages to service instances according to the distribution priority, which includes the business logic distribution priority and the service instance performance distribution priority.
[0114] Determine the distribution priority corresponding to the business logic and the performance distribution priority of each service instance;
[0115] The distribution priority corresponding to the business logic takes precedence over the performance distribution priority of the service instance;
[0116] Set storage resource usage thresholds based on business needs and system performance goals, and define automatic scaling rules;
[0117] Select the auto-scaling library and configure the auto-scaling controller. When the predefined auto-scaling rules are triggered, the auto-scaling controller will adjust the storage resources according to the policy.
[0118] In this embodiment, in the service architecture, the load balancer can be integrated with the message queue to ensure that the messages are distributed to all service instances according to the business logic and performance. In some business scenarios, messages may need to be distributed specifically according to the business logic and policy. If there are differences in performance or resource utilization between service instances, messages may need to be distributed according to the actual capabilities of the instances. Automatic scaling can adjust the number of storage resources according to the load and performance indicators of the distributed file storage system. For example, when the I / O requests of the file storage system increase, automatic scaling can increase the number of storage nodes to improve the processing capacity of the system. Set thresholds: Set thresholds for storage resource usage according to business requirements and system performance goals. For example, when the storage utilization rate reaches 80%, storage resources are automatically increased. Rule definition: Define rules for automatic scaling, including when to increase or decrease resources, the number of resources to increase or decrease, etc. Select an automatic scaling library: Select or develop an automatic scaling library that can be integrated with a distributed file storage system, such as Horizontal Pod Autoscaler (HPA) and Kubernetes. Configure an automatic scaling controller: Configure the automatic scaling controller so that it can automatically adjust storage resources based on monitoring data and scaling policies.
[0119] Step S105: Implement current limiting and fuse mechanisms on microservices.
[0120] In some embodiments of the present application, a current limiting and fuse mechanism is implemented for microservices, including:
[0121] Select a current limiting algorithm, integrate a current limiting library, configure current limiting parameters, and implement current limiting logic at the microservice entry point;
[0122] Deploy service monitoring tools to monitor the health status of key system services, set circuit breaker logic and corresponding degradation strategies, implement circuit breaker logic in the service call link, and provide degradation strategies.
[0123] In this embodiment, the current limiting parameters, such as the token generation rate or the size of the bucket, are dynamically adjusted according to the real-time load and performance data of the system. Deploy service monitoring tools, such as health checks and anomaly detection mechanisms, to monitor the health status of service instances. Determine the threshold for service unavailability, such as the response time exceeding the threshold or the abnormal error rate exceeding the threshold. When the service is detected to be unavailable or the performance is degraded, the fuse can temporarily disconnect the service instance to prevent further accumulation of requests and service avalanche. Implement degradation logic, such as returning a default response, a retry mechanism, or an error prompt to reduce the negative impact on user experience.
[0124] In some embodiments of the present application, a current limiting algorithm is selected, including:
[0125] Determine the traffic patterns, resource types, and system architectures that correspond to each current limiting algorithm;
[0126] Analyze the current traffic pattern, resource type, and system architecture to determine the corresponding current limiting algorithm.
[0127] In some embodiments of the present application, setting the fuse logic and the corresponding degradation strategy includes:
[0128] Implement degradation logic by identifying all failure modes that cause service unavailability and defining degradation conditions and degradation levels.
[0129] In this embodiment, the traffic pattern, resource type and system architecture corresponding to each current limiting algorithm are determined.
[0130] Traffic pattern:
[0131] If the traffic pattern is bursty, you may want to use a token bucket algorithm to smooth the traffic.
[0132] If the traffic is constant and uniform, the leaky bucket algorithm may be more suitable.
[0133] Resource Type:
[0134] For CPU-intensive applications, you may need to limit the flow based on CPU usage.
[0135] For IO-intensive applications, you may need to limit the flow based on disk read and write speed or network bandwidth.
[0136] System architecture:
[0137] If the system has a distributed architecture, it is necessary to ensure that the current limiting algorithm can work together on different nodes.
[0138] If the system is a microservice architecture, it may be necessary to implement current limiting at each service entry point.
[0139] It should be noted that the above traffic patterns, resource types and system architectures are only some examples and may also include other examples, which are not specifically limited here.
[0140] In this embodiment, the failure modes that may cause the service to be unavailable are identified, such as database connection failure, external service call timeout, etc. The conditions that trigger the degradation are defined according to the failure modes, such as service response time exceeding a threshold, abnormal error rate exceeding a threshold, etc. Different degradation levels are determined, such as slight degradation, moderate degradation, and severe degradation, and each level corresponds to a different processing strategy.
[0141] Degradation logic includes but is not limited to the following:
[0142] Return default response: Design logic to return default data, such as default product information, static pages, etc.
[0143] Implement a retry mechanism: Design service retry logic, including the number of retries, retry interval, etc.
[0144] Provide error prompts: Design user-friendly error prompt messages, such as "Service temporarily unavailable", "Please try again later", etc.
[0145] By applying the above technical solutions, monitoring tools are deployed to collect system performance data to determine system bottlenecks, and services that need to be expanded are determined based on business process diagrams and system bottlenecks; objective functions are built based on business needs, and the decomposition granularity is determined through objective functions. Services that need to be expanded are split to obtain multiple microservices; data access patterns and performance requirements of each microservice are analyzed, and databases are expanded and caches are optimized; corresponding elastic infrastructure and automatic scaling strategies are built through microservice performance data; and current limiting and fuse mechanisms are implemented for microservices. This ensures the adaptability and accuracy of microservice architecture expansion and improves the expansion effect.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present invention can be implemented by hardware, or by software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present invention.
[0147] In order to further explain the technical idea of the present invention, the technical solution of the present invention is now described in combination with specific application scenarios.
[0148] Correspondingly, the present application also provides an extended processing system for a microservice architecture, such as Figure 2 As shown, including:
[0149] The first module is used to deploy monitoring tools to collect system performance data to determine system bottlenecks, and determine the services that need to be expanded based on the business process diagram and system bottlenecks;
[0150] The second module is used to build an objective function based on business needs, determine the decomposition granularity through the objective function, and decompose the services to be expanded to obtain multiple microservices;
[0151] The third module is used to analyze the data access patterns and performance requirements of each microservice, and to scale the database and optimize the cache;
[0152] The fourth module is used to build corresponding elastic infrastructure and automatic scaling strategies based on the performance data of microservices;
[0153] The fifth module is used to implement current limiting and circuit breaker mechanisms for microservices.
[0154] Those skilled in the art will appreciate that the modules in the system in the implementation scenario can be distributed in the system of the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more systems different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing expansion of a microservice architecture, characterized in that: include: Deploy monitoring tools to collect system performance data to identify system bottlenecks, and determine services that need to be expanded based on business process diagrams and system bottlenecks; Build an objective function based on business needs, determine the decomposition granularity through the objective function, and decompose the services to be expanded to obtain multiple microservices; Analyze the data access patterns and performance requirements of each microservice, and scale the database and optimize the cache; Build corresponding elastic infrastructure and automatic scaling strategies based on microservice performance data; Implement current limiting and circuit breaking mechanisms for microservices; Deploy monitoring tools to collect system performance data to identify system bottlenecks, including: According to the performance data category, a performance curve of each performance data over a corresponding period of time is collected to obtain a real-time performance curve; Compare the real-time performance curve with a preset standard performance curve corresponding to the performance parameter category of the real-time performance curve to obtain a longitudinal difference portion curve; Aligning multiple real-time performance curves with bottleneck relationships on a time scale and then comparing them, and determining horizontal synchronous partial curves and horizontal non-synchronous partial curves corresponding to the multiple real-time performance curves based on the size and change trend of performance parameters; Determine the system bottleneck based on the common vertical difference curve and horizontal synchronization curve involved in the same performance data; If one or more longitudinal difference partial curves represent a certain bottleneck category, and the transverse synchronization partial curve also represents the bottleneck category, then the bottleneck category is determined to be a system bottleneck; If a single or multiple longitudinal difference partial curves represent a certain bottleneck category, but a horizontal synchronous partial curve represents another bottleneck category, then the strength of the horizontal synchronous partial curve and the horizontal asynchronous partial curve are compared. If the horizontal synchronous partial curve is stronger than the horizontal asynchronous partial curve, the bottleneck category represented by the horizontal synchronous partial curve is regarded as the system bottleneck. Otherwise, the bottleneck category represented by the single or multiple longitudinal difference partial curves is regarded as the system bottleneck. Determine the services that need to be expanded based on the business process diagram and system bottlenecks, including: Analyze the dependencies and number of interactions between services within a preset distance in the business process diagram; Combine services whose dependencies exceed the corresponding threshold or whose number of interactions exceeds the corresponding threshold into one service to obtain a new business process diagram; Treat services with system bottlenecks as services that need to be expanded; Build an objective function based on business requirements, including: Determine multiple demand indicators based on business needs, and divide the multiple demand indicators into maximum demand indicators and minimum demand indicators; The objective function is constructed by maximizing and minimizing the demand index, and the corresponding constraints are determined to solve the problem; ; Where P is the objective function, is the conversion coefficient corresponding to the maximization demand, n is the number of maximization demand indicators, is the weight corresponding to the i-th maximization demand index, is the ith maximization demand index, is the conversion coefficient corresponding to the minimized demand, m is the number of minimized demand indicators, is the weight corresponding to the jth minimization demand index, is the jth minimization demand index.
2. The microservice architecture expansion processing method according to claim 1, characterized in that: Analyze the data access patterns and performance requirements of each microservice, and scale the database and optimize the cache, including: Use database auditing, log analysis tools, or APM tools to collect data access logs and identify data access patterns; Extract performance metrics from data access logs and determine the performance requirements of each microservice; Expand the corresponding database according to the data access mode and optimize the database configuration based on performance requirements; Determine the corresponding cache strategy based on the data access pattern.
3. The microservice architecture expansion processing method according to claim 1, characterized in that: Build corresponding elastic infrastructure and automatic scaling strategies based on microservice performance data, including: Integrate the load balancer with the message queue to distribute messages to service instances according to the distribution priority, which includes the business logic distribution priority and the service instance performance distribution priority. Determine the distribution priority corresponding to the business logic and the performance distribution priority of each service instance; The distribution priority corresponding to the business logic takes precedence over the performance distribution priority of the service instance; Set storage resource usage thresholds based on business needs and system performance goals, and define automatic scaling rules; Select the auto-scaling library and configure the auto-scaling controller. When the predefined auto-scaling rules are triggered, the auto-scaling controller will adjust the storage resources according to the policy.
4. The microservice architecture expansion processing method according to claim 1, characterized in that: Implement current limiting and circuit breaker mechanisms for microservices, including: Select a current limiting algorithm, integrate a current limiting library, configure current limiting parameters, and implement current limiting logic at the microservice entry point; Deploy service monitoring tools to monitor the health status of key system services, set circuit breaker logic and corresponding degradation strategies, implement circuit breaker logic in the service call link, and provide degradation strategies.
5. The microservice architecture expansion processing method according to claim 4, characterized in that: Select the current limiting algorithm, including: Determine the traffic patterns, resource types, and system architectures that correspond to each current limiting algorithm; Analyze the current traffic pattern, resource type, and system architecture to determine the corresponding current limiting algorithm.
6. The microservice architecture expansion processing method according to claim 4, characterized in that: Set the circuit breaker logic and corresponding downgrade strategy, including: Implement degradation logic by identifying all failure modes that cause service unavailability and defining degradation conditions and degradation levels.
7. An extended processing system for a microservice architecture, characterized in that: include: The first module is used to deploy monitoring tools to collect system performance data to determine system bottlenecks, and determine the services that need to be expanded based on the business process diagram and system bottlenecks; The second module is used to build an objective function based on business needs, determine the decomposition granularity through the objective function, and decompose the services to be expanded to obtain multiple microservices; The third module is used to analyze the data access patterns and performance requirements of each microservice, and to scale the database and optimize the cache; The fourth module is used to build corresponding elastic infrastructure and automatic scaling strategies based on the performance data of microservices; The fifth module is used to implement current limiting and circuit breaking mechanisms for microservices; Deploy monitoring tools to collect system performance data to identify system bottlenecks, including: According to the performance data category, a performance curve of each performance data over a corresponding period of time is collected to obtain a real-time performance curve; Compare the real-time performance curve with a preset standard performance curve corresponding to the performance parameter category of the real-time performance curve to obtain a longitudinal difference portion curve; Aligning multiple real-time performance curves with bottleneck relationships on a time scale and then comparing them, and determining horizontal synchronous partial curves and horizontal non-synchronous partial curves corresponding to the multiple real-time performance curves based on the size and change trend of performance parameters; Determine the system bottleneck based on the common vertical difference curve and horizontal synchronization curve involved in the same performance data; If one or more longitudinal difference partial curves represent a certain bottleneck category, and the transverse synchronization partial curve also represents the bottleneck category, then the bottleneck category is determined to be a system bottleneck; If a single or multiple longitudinal difference partial curves represent a certain bottleneck category, but a horizontal synchronous partial curve represents another bottleneck category, then the strength of the horizontal synchronous partial curve and the horizontal asynchronous partial curve are compared. If the horizontal synchronous partial curve is stronger than the horizontal asynchronous partial curve, the bottleneck category represented by the horizontal synchronous partial curve is regarded as the system bottleneck. Otherwise, the bottleneck category represented by the single or multiple longitudinal difference partial curves is regarded as the system bottleneck. Determine the services that need to be expanded based on the business process diagram and system bottlenecks, including: Analyze the dependencies and number of interactions between services within a preset distance in the business process diagram; Combine services whose dependencies exceed the corresponding threshold or whose number of interactions exceeds the corresponding threshold into one service to obtain a new business process diagram; Treat services with system bottlenecks as services that need to be expanded; Build an objective function based on business requirements, including: Determine multiple demand indicators based on business needs, and divide the multiple demand indicators into maximum demand indicators and minimum demand indicators; The objective function is constructed by maximizing and minimizing the demand index, and the corresponding constraints are determined to solve the problem; ; Where P is the objective function, is the conversion coefficient corresponding to the maximization demand, n is the number of maximization demand indicators, is the weight corresponding to the i-th maximization demand index, is the ith maximization demand index, is the conversion coefficient corresponding to the minimized demand, m is the number of minimized demand indicators, is the weight corresponding to the jth minimization demand index, is the jth minimization demand index.
