Method and system for improving scalability of micro service, medium and processor

By building multi-cloud environments, layered design and service grid management in the microservice architecture, the problem of waste of microservice resources and collaborative work is solved, and the system is efficient, stable and flexible.

CN120353476AInactive Publication Date: 2025-07-22GUANGXI LVFA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510408038.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

There are problems in the microservice architecture with wasted resources and the hindered collaborative work in complex business scenarios, resulting in reduced system performance and stability.

Method used

By deploying microservices on different cloud platforms according to business types, building multi-cloud environments, adopting layered design and elastic storage, deploying Sidecar agents to form a service mesh, and performing full-range monitoring and automated scaling operations.

Benefits of technology

It realizes the precise allocation and efficient utilization of resources, improves system performance and stability, reduces operational costs, and improves development and deployment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353476A_ABST
    Figure CN120353476A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for improving scalability of a micro-service, a medium and a processor, focuses on the problems of idle and waste of resources, blocked business collaboration and the like faced by a micro-service architecture, and provides the method for improving scalability of the micro-service. Micro-services are deployed on different cloud platforms according to business types to construct a multi-cloud architecture, and the deployment is optimized by using a quantization formula; performing hierarchical design on the micro-service and elastically storing data; deploying a Sidecar agent to form a service grid to manage communication; the system is monitored in an omnibearing manner, and micro-service instances are automatically expanded The method effectively improves the resource utilization rate, reduces the cost, and enhances the system performance and stability. Meanwhile, the invention further relates to a system applying the method, a computer readable storage medium and a processor, and an effective scheme is provided for solving the problem of micro-service scalability in the field of software development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of microservices, and particularly to a method, system, medium and processor for improving the scalability of microservices. Background Art

[0002] At present, with the rapid development of information technology, the scale and complexity of software applications have increased exponentially. Taking fields such as e-commerce, social platforms, and fintech as examples, the number of users often reaches hundreds of millions, and the types of services are numerous and intertwined. In such an environment, due to its unique advantages, the microservice architecture has gradually become the mainstream choice for building large and complex software systems.

[0003] The microservice architecture splits a large application into small, single-functional service units. Each microservice can be developed, deployed, and upgraded independently, which enables the development team to respond more agilely to business changes and quickly iterate product functions. However, with the continuous expansion of the business, the microservice architecture faces a series of severe challenges.

[0004] For example, the lack of a scientific and reasonable resource planning and allocation strategy results in a large amount of idle and wasted resources, increasing the operating cost in vain. In complex business scenarios, the collaborative work between multiple microservices is severely hindered, reducing the overall performance and stability of the system.

[0005] Therefore, how to improve the scalability of microservices and solve the above problems in aspects such as cloud platform deployment, data storage, communication management, and system monitoring and dynamic adjustment has become an important issue that needs to be overcome urgently in the current software development field.

[0006] In view of this, a method, system, medium and processor for improving the scalability of microservices are needed. Summary of the Invention

[0007] Aiming at the problems of idle and wasted resources and severely hindered collaborative work in complex business scenarios in the prior art, the present invention provides a method, system, medium and processor for improving the scalability of microservices, which makes full use of system resources and increases the overall performance and stability of the system by improving the scalability of microservices. The specific technical solutions are as follows:

[0008] A method for improving the scalability of microservices includes:

[0009] S1: Deploy microservices on different cloud platforms according to business types to build a microservice architecture in a multi-cloud environment;

[0010] S2: Conduct hierarchical design for microservices and perform elastic storage for data according to the hierarchical architecture;

[0011] S3: Deploy a Sidecar proxy beside each microservice instance to form a service mesh;

[0012] S4: Conduct all-round monitoring of the microservice system and perform automated scaling operations on microservice instances.

[0013] Furthermore, in step S1, when deploying microservices on different cloud platforms according to business types, the pairing quantization formula is as follows:

[0014]

[0015] In the above formula, S m,p represents the comprehensive score of the m-th microservice deployed on the p-th cloud platform; P m,p is the performance index of the p-th cloud platform for the m-th microservice; P max,p is the maximum value of the performance indexes of microservices of the business type among all cloud platforms; C m,p is the deployment cost of the m-th microservice on the p-th cloud platform; C min,p is the minimum value of the deployment costs of microservices of the business type among all cloud platforms; R m,p is the demand of the m-th microservice for specific resources of the p-th cloud platform; R max,p is the maximum value of the resources that can meet the resource demands of microservices of the business type among all cloud platforms; St m,p is the stability evaluation score of the p-th cloud platform for the m-th microservice; e, b, c, and d are the weight coefficients of the four factors of performance, cost, resource demand, and stability respectively.

[0016] Furthermore, in step S2, the microservices are hierarchically designed and data is elastically stored according to the hierarchical architecture, including the following steps:

[0017] S21: Hierarchically design the tourism microservice architecture, which is divided into an access layer, a business logic layer, and a data access layer, and clarify the data access rules and data flow directions of each layer;

[0018] S22: On the basis of clarifying the data access rules and data flow directions, elastic storage is implemented for the tourism data due to its diversity.

[0019] Furthermore, in step S4, the microservice system is all-round monitored and automated scaling operations are performed on microservice instances, including the following steps:

[0020] S41: All-round collect microservice system metrics;

[0021] S42: Use the container orchestration tool Kubernetes to achieve automated deployment of microservice instances;

[0022] S43: Implement adaptive traffic scheduling and microservice instance scaling based on the microservice system metrics and the traffic data collected by the service mesh.

[0023] Further, in step S43, the implementation of adaptive traffic scheduling and microservice instance scaling includes the following steps:

[0024] S431: Obtain the traffic threshold for each microservice instance. The calculation formula is as follows:

[0025] T threshold =(T avg +k*T std )×h×s×a×(1+α×(1 - R util ))×(1 - β×C ratio );

[0026]

[0027] Where, T threshold is the traffic threshold for the entire microservice system for a specific business scenario or time period; T avg is the average value of the historical traffic of the entire microservice system; T std is the standard deviation of the historical traffic of the entire microservice system; k is the adjustment coefficient; h is the hardware upgrade coefficient; s is the software optimization coefficient; a is the architecture adjustment coefficient; α is the adjustment coefficient reflecting the influence degree of resource utilization rate on the traffic threshold; β is the adjustment coefficient reflecting the influence degree of cost - benefit ratio on the traffic threshold; R util is the resource utilization rate of the entire microservice system; L i is the current load of instance i; n is the total number of microservice instances in the system; C capacity is the processing capacity of a single instance; C ratio is the cost - benefit ratio of the entire microservice system; B revenue is the business revenue generated by the system; C cost-i is the cost of each instance;

[0028] S432: Obtain the weight of each microservice instance. The calculation formula is as follows:

[0029]

[0030] Where, L i is the current load of the i - th microservice instance; P i is the performance index of the i - th microservice instance; ∈ is the adjustment coefficient reflecting the influence degree of resource utilization rate on the instance weight; ζ is the adjustment coefficient reflecting the influence degree of cost - benefit ratio on the instance weight; R target is the target resource utilization rate; R util-i is the resource utilization rate of the i - th microservice instance; Cratio-i is the cost - benefit ratio of the \(i\) - th microservice instance;

[0031] S433: Perform microservice instance scaling calculation to obtain the number of increased microservice instances and the number of decreased microservice instances. The calculation formula is as follows:

[0032] When \(T\) current \(> T\) threshold :

[0033]

[0034] When \(T\) current \(< T\) threshold :

[0035]

[0036] In the above formula, \(T\) current is the current traffic of the entire microservice system; \(\gamma\) is the adjustment coefficient reflecting the influence degree of resource utilization rate on the number of instances; \(\delta\) is the adjustment coefficient reflecting the influence degree of cost - benefit ratio on the number of instances; \(C\) capacity is the processing capacity of a single microservice instance.

[0037] Further, in step S43, the implementation of adaptive traffic scheduling and microservice instance scaling further includes the following steps:

[0038] S434: Calculate the traffic that the microservice instance should undertake, and perform traffic management and scaling according to the difference between the actual traffic undertaken and the traffic that should be undertaken. The formula for the traffic that should be undertaken is as follows:

[0039]

[0040] In the above formula, \(W\) i is the weight of the \(i\) - th microservice instance; is the sum of the weights of all \(n\) microservice instances in the system; \(T\) total is the total traffic of the entire microservice system.

[0041] Further, the calculation formula for the hardware upgrade coefficient is as follows:

[0042]

[0043] Among them, \(n1\) is the number of requests that the entire system can process per second before hardware upgrade, and \(n2\) is the number of requests that the entire system can process per second after hardware upgrade.

[0044] A system for improving the scalability of microservices, which is applied to the method for improving the scalability of microservices described above, includes:

[0045] A deployment module, which is used to deploy microservices on different cloud platforms according to business types, and build a microservice architecture in a multi-cloud environment;

[0046] A layering module, which is used to perform layered design on microservices and perform elastic storage on data according to the layered architecture;

[0047] A mesh module, which is used to deploy a Sidecar proxy beside each microservice instance to form a service mesh;

[0048] A scaling module, which is used to comprehensively monitor the microservice system and perform automated scaling operations on microservice instances.

[0049] A computer-readable storage medium, the computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the method for improving the scalability of microservices described above.

[0050] A processor, the processor is used to run a program, wherein when the program runs, it executes the method for improving the scalability of microservices described above.

[0051] Compared with the prior art, the beneficial effects of the present invention are:

[0052] 1. Resource optimization and configuration

[0053] Precise multi-cloud deployment: With the help of a unique pairing quantization formula, considering factors such as performance, cost, resource requirements, and stability, microservices are precisely deployed on suitable cloud platforms. For example, in the tourism business, microservices such as flight ticket and hotel reservation are allocated according to the characteristics of the cloud platform, and resources are flexibly allocated during the peak and off-peak seasons of tourism. The situation of resource idleness and waste is greatly improved, and the operation cost is significantly reduced.

[0054] Elastic data storage: The layered design clarifies the responsibilities and data flow directions of each layer. For the diversity of tourism data, structured data uses a distributed relational database, and unstructured data uses object storage, realizing elastic expansion of storage nodes, improving storage efficiency, and reducing storage costs.

[0055] 2. System performance improvement

[0056] Collaboration of the layered architecture: After the tourism microservice architecture is layered, the access layer performs intelligent routing, the business logic layer processes efficiently, and the data access layer reads and writes quickly. Each layer collaborates closely. During the peak season, the load balancer distributes requests, the business logic layer processes in parallel, and the data access layer elastically expands storage. The system response speed and concurrent processing ability are significantly improved.

[0057] Service Mesh Optimizes Communication: The service mesh built by Sidecar proxies manages microservice communication, enabling traffic control, load balancing, and service discovery. In the tourist scenic area guide system, it precisely monitors traffic, records key metrics, provides a basis for optimization, and ensures the stable and efficient operation of the system.

[0058] 3. Enhanced System Stability

[0059] Fault Tolerance Handling Mechanism: Each layer of the hierarchical architecture collaborates with each other and has fault tolerance capabilities. When a failure occurs in the data access layer, the business logic layer processes with cached data, and the access layer prompts the user to maintain the stable operation of the system and improve the user experience.

[0060] Adaptive Scaling and Traffic Scheduling: It comprehensively monitors and collects system metrics, and performs adaptive traffic scheduling and instance scaling according to traffic thresholds and instance weights. The microservice for booking tickets for popular scenic spots automatically schedules traffic and increases microservice instances during peak seasons, and reduces microservice instances during off-peak seasons to ensure the stable operation of the system.

[0061] 4. Efficient Development and Deployment

[0062] Automated Deployment Process: Using Kubernetes and CI / CD processes, after developers submit code, CI automatically builds and tests, and CD pushes the image and deploys according to the Kubernetes configuration, achieving efficient delivery, reducing deployment time and errors, and improving development efficiency. Description of the Drawings

[0063] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0064] Figure 1 It is a flowchart showing a method for improving the scalability of microservices;

[0065] Figure 2 It is a structural diagram showing the combination of microservices and service meshes;

[0066] Figure 3 It is a structural diagram of a system for improving the scalability of microservices Detailed Embodiments

[0067] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0068] It should be understood that when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0069] It should also be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0070] It should be further understood that the term " / and" as used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0071] Embodiment 1

[0072] As Figure 1 shown is a schematic flowchart of a method for improving the scalability of microservices, including the following steps:

[0073] S1: Deploy microservices on different cloud platforms according to business types to build a microservice architecture in a multi-cloud environment.

[0074] Deploy microservices on different cloud platforms according to business types, and use a multi-cloud management tool to uniformly allocate resources to achieve flexible resource allocation.

[0075] Considering the characteristics of the tourism business comprehensively, integrate the resources of multiple public cloud platforms (such as AWS, Azure, and Alibaba Cloud) to build a multi-cloud environment. According to the advantages and costs of each cloud platform, deploy different types of microservices or business modules on the appropriate cloud platform. Use multi-cloud management tools to uniformly manage resources and achieve flexible allocation of resources. For example, deploy the flight reservation microservice with extremely high real-time requirements in the tourism reservation system to a specific area of AWS with low network latency; deploy the hotel reservation microservice, which has a large data storage requirement, to Alibaba Cloud with lower storage costs and stable performance; deploy microservices with high network bandwidth requirements to cloud platform areas with excellent network performance, and deploy microservices with large storage capacity requirements to cloud platforms with high storage cost performance. Use multi-cloud management tools to uniformly allocate resources and achieve flexible distribution of resources. During the peak tourism season, resources can be quickly obtained from different cloud platforms to expand services; during the off-season, release redundant resources in a timely manner to reduce costs.

[0076] Furthermore, when deploying microservices on different cloud platforms according to business types, the quantification formula is as follows:

[0077]

[0078] In the above formula, S m,p represents the comprehensive score of the m-th microservice deployed on the p-th cloud platform. The higher the score, the higher the adaptability of the microservice to the cloud platform; P m,p is the performance index of the p-th cloud platform for the m-th microservice, such as network latency, computing power, etc.; P max,p is the maximum value of the performance index of the microservice for the business type among all cloud platforms, used for normalizing P m,p ; C m,p is the deployment cost of the m-th microservice on the p-th cloud platform; C min,p is the minimum value of the deployment cost of the microservice for the business type among all cloud platforms, used for normalizing C m,p ; R m,p is the demand of the m-th microservice for specific resources (such as storage capacity, network bandwidth) of the p-th cloud platform; R max,p is the maximum value among all cloud platforms that can meet the resource requirements of the microservice for the business type, used for normalizing R m,p ; St m,p is the stability evaluation score of the p-th cloud platform for the m-th microservice, with a full score set to 1. The higher the score, the more stable the cloud platform; a, b, c, d: are the weight coefficients of the four factors of performance, cost, resource demand, and stability respectively, and a + b + c + d = 1, which can be adjusted according to business priorities.

[0079] S2: Conduct hierarchical design for microservices and perform elastic storage on data according to the hierarchical architecture.

[0080] S21: Perform a layered design on the tourism microservice architecture, which is divided into an access layer, a business logic layer, and a data access layer, and clarify the data access rules and data flow directions of each layer.

[0081] The access layer uses a high-performance load balancer (such as Nginx Plus) to intelligently route requests based on information such as the request source and request type of tourists. An asynchronous message queue (such as Apache Kafka) is used to decouple the business logic layer and the data access layer, improving the system's response speed and concurrent processing ability. Taking an online tourism platform as an example, the access layer receives requests such as hotel inquiries and flight ticket bookings from tourists, and quickly routes the hotel inquiry request to a dedicated hotel information query microservice instance according to the request type; when processing a flight ticket booking request, the business logic layer asynchronously sends data to the data access layer for storage through the message queue, avoiding affecting the processing efficiency of the business logic layer due to database operation delays.

[0082] In the technical solution for improving the scalability of microservices in the tourism scenario, the access layer, the business logic layer, and the data access layer are both independent and closely cooperate to jointly support the stable operation and efficient expansion of the tourism microservice system.

[0083] The access layer is the entrance of the system and provides data input for the business logic layer: As the interface between the system and the external world, the access layer is responsible for receiving various requests from tourists, such as tourism product bookings and information inquiries. It is like the "front desk" of tourism services, directly facing tourists. The access layer preliminarily processes and classifies requests and then passes them to the business logic layer. In an online tourism reservation platform, the access layer receives a hotel reservation request from a tourist, parses the parameters in the request (such as check-in date, check-out date, hotel location, etc.), and passes this information to the business logic layer for subsequent processing, providing the data input required for the business logic layer to process the business.

[0084] The business logic layer is the core processing unit, connecting the access layer and the data access layer: The business logic layer is the core of the entire architecture and is responsible for processing specific tourism business logics. It receives requests from the access layer, processes them according to business rules, and calls the data access layer to obtain or store data. The business logic layer is like the "brain" of tourism services, determining how the system responds to tourists' requests. When processing a hotel reservation business, the business logic layer will, according to the needs of tourists, call the data access layer to query the hotel's inventory and price information, and then judge whether there are available rooms according to the reservation rules and perform corresponding reservation operations. The business logic layer realizes the interaction with data storage by calling the data access layer, and at the same time returns the processing result to the access layer to complete the entire business process.

[0085] The data access layer is responsible for data storage and retrieval, providing data support for the business logic layer. The data access layer is the bridge between the system and the data storage, responsible for managing and operating data. It hides the details of data storage and provides a unified data access interface for the business logic layer. In the tourism system, the data access layer is responsible for retrieving structured data (such as user information, order data, etc.) from a distributed relational database (such as TiDB) and unstructured data (such as tourism pictures, videos, etc.) from an object storage (such as MinIO). The data access layer is like the "warehouse keeper" of tourism services, ensuring that the business logic layer can efficiently retrieve and store data. When the business logic layer needs to query hotel information, the data access layer retrieves data from the corresponding storage according to the request of the business logic layer and returns it to the business logic layer to support the processing of business logic.

[0086] The three layers cooperate with each other to achieve the scalability and stability of the system. These three layers cooperate with each other to jointly achieve the scalability and stability of the tourism microservice system. During the peak tourism season, the access layer can evenly distribute a large number of requests to multiple microservice instances through a load balancer. The business logic layer processes requests in parallel, and the data access layer meets the read and write requirements of a large amount of data through elastic data storage technologies (such as the horizontal expansion of TiDB and the addition of storage nodes in MinIO). When a problem occurs in a certain layer, the other layers can perform fault tolerance processing to a certain extent. If the data access layer experiences a short-term failure, the business logic layer can perform partial business processing based on cached data, and the access layer can return a friendly prompt message to tourists to ensure the stability of the system and the user experience.

[0087] S22: On the basis of clarifying the data access rules and data flow, for the diversity of tourism data, elastic storage of data is implemented. For structured tourist order data, user information, etc., a distributed relational database (such as TiDB) is used, which has the ability of automatic sharding and horizontal expansion and can dynamically adjust storage nodes according to the data volume and concurrent access volume. For unstructured multimedia data such as tourism pictures and videos, object storage (such as MinIO) is adopted, and the capacity is elastically expanded by adding storage nodes. For example, in a tourism social platform, the tourism pictures and videos shared by users are stored in MinIO, and the storage nodes can be expanded at any time as the number of users and the data volume increase; while the structured data such as user comments and likes are stored in TiDB to ensure the efficient storage and query of data.

[0088] The layered architecture clarifies the data flow and access rules, providing an orderly environment for elastic data storage: The layered design of the tourism microservice architecture divides the system into an access layer, a business logic layer, and a data access layer, clearly defining the functions of each layer and the data flow. The access layer receives external requests and performs preliminary processing. The business logic layer focuses on the execution of business rules, and the data access layer is responsible for interacting with the data storage. In this layered model, the data access rules are clear and the data flow is distinct. In a tourism reservation system, when a tourist initiates a hotel reservation request, the access layer receives it and passes it to the business logic layer. The business logic layer calls the data access layer to obtain hotel inventory, prices, and other data according to business requirements. This enables elastic data storage to operate in an orderly environment, efficiently processing data read and write operations according to established rules, avoiding data access chaos, and enhancing storage efficiency and system performance.

[0089] The decoupling feature of the layered architecture facilitates the independent expansion and optimization of elastic data storage: The layered architecture achieves the decoupling of each layer, enabling the data access layer to be expanded and optimized independently of other layers, which is crucial for elastic data storage. The data access layer is separated from the business logic layer and the access layer. When the scale of the tourism business expands and the data volume and concurrent access volume increase sharply, the elastic data storage relied on by the data access layer can be expanded independently. For a distributed relational database for structured data storage (such as TiDB), storage nodes can be added for horizontal expansion; for an object storage for unstructured data storage (such as MinIO), storage nodes can be added as needed to increase capacity. This independent expansion does not affect the normal operation of other layers, ensuring system stability. At the same time, elastic data storage can be optimized specifically according to data characteristics and business requirements, improving data processing capabilities.

[0090] The layered architecture provides a unified interface, facilitating the adaptation and management of elastic data storage: In the layered architecture, the data access layer provides a unified data access interface for the business logic layer, which brings convenience to the adaptation and management of elastic data storage. The business logic layer obtains or stores data through this interface without caring about the specific implementation details of the data storage. When the tourism business develops and requires replacing the elastic data storage solution or upgrading the existing solution, only adjustments need to be made in the data access layer, modifying the interface implementation to adapt to the new storage technology or architecture, without significant changes to the business logic layer and the access layer. In a tourism social platform, if the original picture storage solution cannot meet the growing demand and is replaced with a new object storage solution, only the relevant code needs to be modified in the data access layer to ensure that the interface function remains unchanged, enabling the upgrade of elastic data storage, reducing system maintenance costs, and ensuring business continuity.

[0091] The layered microservices architecture provides an orderly data access pattern for elastic data storage: The layered microservices architecture divides the tourism microservices into an access layer, a business logic layer, and a data access layer. This layered design makes data access more orderly and lays the foundation for the efficient operation of elastic data storage. When the business logic layer processes tourism business, it interacts with the elastic data storage through the data access layer according to established rules. Taking the tourism reservation system as an example, when the business logic layer processes hotel reservation business, the data access layer obtains structured data such as hotel inventory and prices from a distributed relational database (such as TiDB) or unstructured data such as hotel pictures from an object storage (such as MinIO) according to the requirements of the business logic. The layered architecture makes the data access path clear, improves the efficiency of data acquisition, and also facilitates the optimization of elastic data storage according to different business requirements.

[0092] Elastic data storage supports the dynamic expansion of the layered microservices architecture: The tourism business has obvious seasonality and volatility. The layered microservices architecture needs to cope with changes in business volume, and elastic data storage provides strong support for this. With the arrival of the tourism peak season, the data volume such as the number of orders and user accesses increases sharply, and elastic data storage can dynamically expand. For example, the distributed relational database TiDB can automatically shard and horizontally expand storage nodes, and the object storage MinIO can add storage nodes to expand the capacity. This ensures that the data access layer in the layered microservices architecture can still quickly obtain data under high load, guarantees the normal operation of the business logic layer and the access layer, and enables the entire layered microservices architecture to flexibly respond to business changes.

[0093] The two cooperate with each other to optimize system performance and maintainability: The layered microservices architecture and elastic data storage cooperate with each other to improve system performance and maintainability. The decoupling feature of the layered architecture enables each layer to focus on its own functions, and the data access layer can be better optimized to adapt to the characteristics of elastic data storage. In the tourism scenic area guide system, the business logic layer focuses on business processing such as scenic spot introduction and route planning, and the data access layer optimizes data reading and writing operations for elastic data storage. When it is necessary to adjust or upgrade the storage solution, only modifications need to be made in the data access layer, which will not affect other layers, reducing the complexity of system maintenance and improving the overall performance and stability of the system.

[0094] S3: Deploy a Sidecar proxy beside each microservice instance to form a service mesh.

[0095] Such as Figure 2As shown, service mesh technology (such as Istio) is introduced, and a Sidecar proxy (such as Envoy) is deployed beside each microservice instance. These proxies together build an independent infrastructure layer in the tourism microservice architecture, forming a service mesh. This infrastructure layer undertakes the important responsibility of managing the communication between microservices, covering key functions such as traffic control, load balancing, and service discovery. With the traffic monitoring and analysis capabilities of the service mesh, it is possible to obtain the traffic data and performance metrics of the tourism microservices in real time. Just like in the tourist attraction guide system, the Istio service mesh can precisely monitor the request traffic between microservices such as scenic spot introductions and route planning, and detailedly record key metrics such as the success rate of requests and response times. These data provide strong support for subsequent traffic management and system optimization. The Sidecar proxy is a key component in the service mesh architecture. It runs in parallel with the main application (microservice) and undertakes multiple important responsibilities, effectively enhancing the functions and performance of the microservice architecture.

[0096] S4: Conduct comprehensive monitoring of the microservice system and perform automated scaling operations on microservice instances.

[0097] S41: Select tools such as Prometheus and Grafana to comprehensively collect microservice system metrics, such as CPU usage, memory occupancy, network traffic, request response time, and error rate. For the tourism business, it also focuses on monitoring metrics such as the success rate of order processing and the response time of scenic spot information queries in the scenic spot guide system. Grafana visualizes the collected data and presents the system operation status in intuitive charts, facilitating operation and maintenance personnel to promptly detect potential problems.

[0098] S42: Use the container orchestration tool Kubernetes to achieve automated deployment of microservice instances. In Kubernetes, by defining resource objects such as Deployment and Service, key information such as the deployment strategy, number of replicas, and service exposure method of microservices is detailedly described. When deploying a new microservice instance, modify the configuration file, and Kubernetes automatically completes container creation, scheduling, and startup according to the configuration, ensuring that the microservice is quickly and accurately deployed to the target node. To improve deployment efficiency and reliability, introduce the continuous integration and continuous deployment (CI / CD) process. After developers submit the code to the code repository, the CI tool automatically triggers the build and test processes to ensure code quality. After the test passes, the CD tool pushes the built image to the image repository and performs automated deployment according to the Kubernetes configuration, realizing efficient delivery from code to the production environment.

[0099] S43: Implement adaptive traffic scheduling and microservice instance scaling based on the microservice system metrics and the traffic data collected by the service mesh. When the traffic of a certain tourism microservice exceeds the threshold, automatically schedule part of the traffic to other idle instances and trigger the auto-scaling mechanism to increase the number of instances of this microservice; when the traffic decreases, reduce the number of microservice instances. At the same time, it can also dynamically adjust the traffic allocation according to the health status of the microservices to ensure the stability and performance of the system. For example, in the ticket reservation microservice of popular scenic spots, when a large number of tourists book tickets simultaneously during the peak tourist season, resulting in a sharp increase in traffic, it is detected that the traffic exceeds the threshold, and part of the traffic is automatically forwarded to other idle ticket reservation microservice instances, and the cloud platform is notified to increase the number of instances of the ticket reservation microservice; when the traffic decreases during the off-peak tourist season, the number of microservice instances is gradually reduced according to the traffic change. Specifically, it includes the following steps:

[0100] S431: Obtain the traffic threshold of each microservice instance. The calculation formula is as follows:

[0101] T threshold =(T avg +k*T std )×h×s×a×(1+α×(1-R util ))×(1-β×C ratio );

[0102]

[0103] Where:

[0104] T threshold is the traffic threshold of the entire microservice system for a specific business scenario or time period;

[0105] T avg is the average value of the historical traffic of the entire microservice system. It is obtained by statistically analyzing the traffic data of the system over a period of time in the past, reflecting the average level of the system traffic.

[0106] T std is the standard deviation of the historical traffic of the entire microservice system. It reflects the degree of dispersion of the system historical traffic data relative to the average value. The larger the standard deviation, the greater the traffic fluctuation; conversely, the smaller the fluctuation.

[0107] k is the adjustment coefficient, and its value range is usually between 1 and 3. This coefficient can be adjusted according to the requirements of the business for stability. The larger the k value, the higher the calculated traffic threshold, which means that the system can withstand greater traffic fluctuations and has stronger fault tolerance for high traffic; conversely, the smaller the k value, the lower the threshold, and the system will respond more sensitively to traffic changes.

[0108] h is the hardware upgrade coefficient, Among them, n1 is the number of requests that the entire system can process per second before hardware upgrade, and n2 is the number of requests that the entire system can process per second after hardware upgrade.

[0109] s is the software optimization coefficient, which is determined by the change ratio of the processing capacity of the entire system before and after software optimization. After operations such as optimizing the system code, adopting a more efficient algorithm, or introducing a new caching mechanism, the improvement ratio of the system processing capacity obtained through performance testing is s.

[0110] a is the architecture adjustment coefficient, which is determined by the multiple of the processing capacity of the entire system after architecture adjustment relative to that before adjustment through stress testing. Upgrading from a monolithic architecture to a microservices architecture, or introducing a distributed architecture, etc., will all affect the system processing capacity. By simulating different traffic scenarios for stress testing, the ratio of the processing capacity after adjustment to that before adjustment is a.

[0111] α and β are adjustment coefficients, which are used to adjust the influence degrees of resource utilization rate and cost-benefit ratio on the traffic threshold respectively. They can be adjusted according to the actual business situation. If more attention is paid to the resource utilization rate, the value of α can be appropriately increased; if more importance is attached to the cost-benefit, the value of β can be increased;

[0112] R util is the resource utilization rate of the entire microservices system, reflecting the usage of system resources;

[0113] L i is the current load of instance i; n is the total number of microservices instances in the system;

[0114] C capacity is the processing capacity of a single instance;

[0115] C ratio is the cost-benefit ratio of the entire microservices system, which is used to measure the balance between the cost and benefit of the system;

[0116] B revenue is the business revenue generated by the system;

[0117] C cost-i is the cost of each instance (including hardware cost, software license cost, etc.).

[0118] S432: Obtain the weight of each microservices instance, and the calculation formula is as follows:

[0119]

[0120] Among them, L i is the current load of the i-th microservices instance, which can be measured by monitoring indicators such as the CPU usage rate and memory usage rate of this instance in real time;

[0121] Pi is the performance metric of the i-th microservice instance, which is comprehensively evaluated based on the hardware configuration, software performance, etc. of the instance. For example, a server instance with higher configuration has a relatively higher performance metric;

[0122] ∈ and ζ are adjustment coefficients, which are used to adjust the influence degrees of resource utilization rate and cost-benefit ratio on the instance weight respectively. They can be adjusted according to actual business requirements.

[0123] R target is the target resource utilization rate, which can be set according to business requirements. For example, if it is desired that the overall resource utilization rate of the system remains at 70%, then R target = 0.7.

[0124] R util-i is the resource utilization rate of the i-th microservice instance, which is calculated from the actual load and processing capacity of the instance.

[0125] C ratio-i is the cost-benefit ratio of the i-th microservice instance, which is calculated based on the cost and the generated revenue of the instance.

[0126] S433: Perform microservice instance scaling calculation to obtain the number of increased microservice instances and the number of decreased microservice instances. The calculation formula is as follows:

[0127] When T current > T threshold :

[0128]

[0129] When T current < T threshold :

[0130]

[0131] In the above formula, T current is the current traffic of the entire microservice system, which can be obtained in real time through the traffic monitoring system; γ and δ are adjustment coefficients, which are used to adjust the influence degrees of resource utilization rate and cost-benefit ratio on the number of increased microservice instances; C capacity is the processing capacity of a single microservice instance, which can be obtained through performance testing.

[0132] S434: Calculate the traffic that a certain microservice instance should undertake, and perform traffic management and scaling according to the difference between the actual traffic undertaken and the traffic that should be undertaken. The formula is as follows:

[0133]

[0134] In the above formula, W iis the weight of the i-th microservice instance, which is calculated by the above traffic scheduling formula; is the sum of the weights of all n microservice instances in the system; T total is the total traffic of the entire microservice system, which can be obtained in real time through the traffic monitoring system.

[0135] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0136] 1. Optimal resource allocation

[0137] Precise multi-cloud deployment: With the help of a unique pairing quantization formula, considering factors such as performance, cost, resource requirements, and stability, microservices are precisely deployed on suitable cloud platforms. For example, in the tourism business, microservices such as flight ticket and hotel reservation are allocated according to the characteristics of the cloud platform, and resources are flexibly adjusted during the peak and off-peak seasons of tourism, significantly improving the situation of resource idle waste and significantly reducing operating costs.

[0138] Elastic data storage: The hierarchical design clarifies the responsibilities and data flow directions of each layer. For the diversity of tourism data, distributed relational databases are used for structured data, and object storage is used for unstructured data, realizing elastic expansion of storage nodes, improving storage efficiency, and reducing storage costs.

[0139] 2. System performance improvement

[0140] Collaboration of hierarchical architecture: After the tourism microservice architecture is layered, the access layer performs intelligent routing, the business logic layer processes efficiently, and the data access layer reads and writes quickly, with each layer collaborating closely. During the peak season, the load balancer distributes requests, the business logic layer processes them in parallel, and the data access layer elastically expands storage, significantly improving the system response speed and concurrent processing ability.

[0141] Service mesh optimizes communication: The service mesh constructed by the Sidecar proxy manages microservice communication, realizing traffic control, load balancing, and service discovery. In the tourism scenic area guide system, traffic is accurately monitored, key metrics are recorded, providing a basis for optimization, and ensuring the stable and efficient operation of the system.

[0142] 3. System stability enhancement

[0143] Fault tolerance processing mechanism: Each layer of the hierarchical architecture collaborates with each other and has fault tolerance capabilities. When the data access layer fails, the business logic layer processes with cached data, and the access layer prompts users, maintaining the stable operation of the system and improving the user experience.

[0144] Adaptive scaling and traffic scheduling: System metrics are comprehensively monitored and collected, and adaptive traffic scheduling and instance scaling are performed according to traffic thresholds and instance weights. For example, for the microservice of popular scenic area ticket reservation, traffic is automatically scheduled and microservice instances are increased during the peak season and decreased during the off-peak season to ensure the stable operation of the system.

[0145] 4. Efficient Development and Deployment

[0146] Automated Deployment Process: By leveraging Kubernetes and CI / CD processes, after developers submit code, CI automatically builds and tests, and CD pushes the image and deploys it according to the Kubernetes configuration, achieving efficient delivery, reducing deployment time and errors, and improving development efficiency.

[0147] Example Two

[0148] As Figure 3 shown, a system for enhancing the scalability of microservices, which is applied to the method for enhancing the scalability of microservices described above, includes:

[0149] A deployment module, which is used to deploy microservices on different cloud platforms according to business types and build a microservice architecture in a multi-cloud environment;

[0150] A layering module, which is used to perform hierarchical design on microservices and elastically store data according to the hierarchical architecture;

[0151] A mesh module, which is used to deploy a Sidecar proxy beside each microservice instance to form a service mesh;

[0152] A scaling module, which is used to comprehensively monitor the microservice system and perform automated scaling operations on microservice instances.

[0153] Example Three

[0154] A computer-readable storage medium, which includes a stored program. When the program runs, it controls the device where the computer-readable storage medium is located to execute the method for enhancing the scalability of microservices described above.

[0155] Example Four

[0156] A processor, which is used to run a program. When the program runs, it executes the method for enhancing the scalability of microservices described above.

[0157] This invention focuses on problems such as resource idle waste and blocked business collaboration faced by the microservice architecture, and proposes a method for enhancing the scalability of microservices. By deploying microservices on different cloud platforms according to business types to build a multi-cloud architecture, using a quantization formula to optimize the deployment; performing hierarchical design on microservices and elastically storing data; deploying Sidecar proxies to form a service mesh for communication management; comprehensively monitoring the system and automatically scaling microservice instances. This method effectively improves resource utilization, reduces costs, and enhances system performance and stability. At the same time, it also involves a system, a computer-readable storage medium, and a processor applying this method, providing an effective solution for solving the problem of microservice scalability in the software development field.

[0158] Those of ordinary skill in the art can realize that the units of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0159] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc.

[0160] In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0161] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs, etc., which can store program codes.

[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered by the scope of the claims and the description of the present invention.

Claims

1. A method for improving the scalability of microservices, characterized in that, Including: S1: Deploy microservices on different cloud platforms according to business types to build a microservice architecture in a multi-cloud environment; S2: Conduct hierarchical design for microservices and perform elastic storage of data according to the hierarchical architecture; S3: Deploy a Sidecar proxy beside each microservice instance to form a service mesh; S4: Conduct comprehensive monitoring of the microservice system and perform automated scaling operations on microservice instances.

2. The method for improving the scalability of microservices according to claim 1, wherein In step S1, when deploying microservices on different cloud platforms according to business types, the pairing quantization formula is as follows: In the above formula, S m,p represents the comprehensive score of the m-th microservice deployed on the p-th cloud platform; P m,p is the performance metric of the p-th cloud platform for the m-th microservice; P max,p is the maximum value of the performance metrics of the microservices of the business type among all cloud platforms; C m,p is the deployment cost of the m-th microservice on the p-th cloud platform; C min,p is the minimum value of the deployment costs of the microservices of the business type among all cloud platforms; R m,p is the demand of the m-th microservice for the p-th cloud platform specific resource; R max,p is the maximum value among all cloud platforms that can meet the resource requirements of the business type microservice; is the stability evaluation score of the p-th cloud platform for the m-th microservice; e, b, c, and d are the weight coefficients of the four factors of performance, cost, resource requirements, and stability respectively.

3. The method for improving the scalability of microservices according to claim 2, wherein, In step S2, the conduct of hierarchical design for microservices and the performance of elastic storage of data according to the hierarchical architecture include the following steps: S21: Conduct hierarchical design for the tourism microservice architecture, which is divided into an access layer, a business logic layer, and a data access layer, and clarify the data access rules and data flow directions of each layer; S22: On the basis of clarifying the data access rules and data flow directions, perform elastic storage of data in view of the diversity of tourism data.

4. The method for improving the scalability of microservices according to claim 1, wherein In step S4, the conduct of comprehensive monitoring of the microservice system and the performance of automated scaling operations on microservice instances include the following steps: S41: Comprehensively collect microservice system metrics; S42: Use the container orchestration tool Kubernetes to achieve automated deployment of microservice instances; S43: According to the microservice system metrics and the traffic data collected by the service mesh, achieve adaptive traffic scheduling and microservice instance scaling.

5. The method for improving the scalability of microservices according to claim 4, characterized in that, In step S43, the achievement of adaptive traffic scheduling and microservice instance scaling includes the following steps: S431: Obtain the traffic threshold of each microservice instance, and the calculation formula is as follows: T threshold = (T avg + k * T std ) × h × s × a × (1 + α × (1 - R util )) × (1 - β × C ratio ); Among them, T threshold is the traffic threshold of the entire microservice system for a specific business scenario or time period; T avg is the average value of the historical traffic of the entire microservice system; T std is the standard deviation of the historical traffic of the entire microservice system; k is the adjustment coefficient; h is the hardware upgrade coefficient; s is the software optimization coefficient; a is the architecture adjustment coefficient; α is the adjustment coefficient reflecting the influence degree of resource utilization rate on the traffic threshold; β is the adjustment coefficient reflecting the influence degree of cost-benefit ratio on the traffic threshold; R util is the resource utilization rate of the entire microservice system; L i is the current load of instance i; n is the total number of microservice instances in the system; C capacity is the processing capacity of a single instance; C ratio is the cost-benefit ratio of the entire microservice system; B revenue is the business revenue generated by the system; C cost-i is the cost of each instance; S432: Obtain the weight of each microservice instance, and the calculation formula is as follows: Among them, L i is the current load of the i-th microservice instance; P i is the performance metric of the i-th microservice instance; ∈ is the adjustment coefficient reflecting the influence degree of resource utilization rate on the instance weight; ζ is the adjustment coefficient reflecting the influence degree of cost-benefit ratio on the instance weight; R target is the target resource utilization rate; R util-i is the resource utilization rate of the i-th microservice instance; C ratio-i is the cost-benefit ratio of the i-th microservice instance; S433: Conduct microservice instance scaling calculation to obtain the number of increased microservice instances and the number of decreased microservice instances, and the calculation formula is as follows: When T current > T threshold : When T current <T threshold : In the above formula, T current is the current traffic of the entire microservice system; γ is the adjustment coefficient reflecting the influence degree of resource utilization rate on the number of instances; δ is the adjustment coefficient reflecting the influence degree of cost-benefit ratio on the number of instances; C capacity is the processing capacity of a single microservice instance.

6. The method for enhancing the scalability of microservices according to claim 5, wherein In step S43, the achievement of adaptive traffic scheduling and microservice instance scaling further includes the following steps: S434: Calculate the traffic that microservice instances should undertake, and perform traffic management and scaling according to the difference between the actual traffic undertaken and the traffic that should be undertaken. The formula for the traffic that should be undertaken is as follows: In the above formula, W i is the weight of the i-th microservice instance; is the sum of the weights of all n microservice instances in the system; T total is the total traffic of the entire microservice system.

7. The method for enhancing the scalability of microservices according to claim 5, wherein The calculation formula for the hardware upgrade coefficient is as follows: Wherein, n1 is the number of requests that the entire system can process per second before hardware upgrade, and n2 is the number of requests that the entire system can process per second after hardware upgrade.

8. A system for enhancing the scalability of microservices, characterized in that, Applied to the method for improving the scalability of microservices according to any one of claims 1 to 7, it includes: A deployment module, which is used to deploy microservices on different cloud platforms according to business types to build a microservice architecture in a multi-cloud environment; A hierarchical module, which is used to conduct hierarchical design for microservices and perform elastic storage of data according to the hierarchical architecture; A grid module, which is used to deploy a Sidecar proxy beside each microservice instance to form a service mesh; A scaling module, which is used to conduct comprehensive monitoring of the microservice system and perform automated scaling operations on microservice instances.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the method for improving the scalability of microservices according to any one of claims 1 to 7.

10. A processor, characterized in that, The processor is used to run a program, wherein when the program runs, it executes the method for improving the scalability of microservices according to any one of claims 1 to 7.

Citation Information

Cited By

  • Low-code process platform micro-service elastic scaling method and system

    CN120832244A