Three-layer micro-service architecture design and deployment method

By combining the three-tier microservice architecture design with the CatBoost model, the problem of insufficient dynamic identification and feedback capabilities in the existing microservice architecture is solved, efficient dynamic configuration management and hybrid deployment are achieved, and the stability and monitoring capabilities of the system are improved.

CN120780320AActive Publication Date: 2025-10-14HANGZHOU GUOYAN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202511255393.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-10-14
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

The existing microservice architecture lacks dynamic identification and feedback capabilities in service registration and discovery, load balancing, configuration management, and monitoring, resulting in waste of resources, difficulty in ensuring security, unpredictable risks of failures caused by configuration changes, and difficulty in ensuring system stability.

Method used

A three-layer microservice architecture design is adopted, including the service registration layer, governance layer and operation layer. A service registration center, configuration management mechanism and CatBoost model are introduced for risk prediction. Combined with the full-link tracking mechanism, dynamic configuration management and hybrid deployment are realized.

Benefits of technology

It improves the architectural elasticity, deployment security, and configuration risk controllability of the microservice system, enhances the system's stability and monitoring capabilities, and is suitable for high-reliability application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780320A_ABST
    Figure CN120780320A_ABST
Patent Text Reader

Abstract

The invention discloses a three-layer micro-service architecture design and deployment method, which comprises the following steps of: constructing a service registration layer, and deploying a registration center to obtain a service registration information set; service discovery, routing distribution, load balancing and fusing control are executed based on the service registration information set, and a service governance configuration set is constructed; deploying a decoupled function service module, and configuring an independent database and cache to form a micro-service operation system structure; establishing a configuration management mechanism, and generating a configuration change request information set; based on the configuration change request information set, training a batch ordered lifting CatBoost model, and outputting configuration risk level information; obtaining hybrid deployment result information based on the micro-service operation system structure and the configuration risk level information; and constructing a full-link tracking mechanism based on the service governance configuration set and the service deployment topological structure to obtain an operation observation information set. According to the invention, a three-layer architecture and risk prediction are adopted, and stable and intelligent deployment of micro-services is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software engineering information technology, and in particular to a three-tier microservice architecture design and deployment method. Background Art

[0002] Currently, microservices architecture, as the mainstream technical paradigm for building large, complex software systems, is widely used across multiple industries, including finance, e-commerce, government affairs, and manufacturing. This architecture typically achieves high maintainability, scalability, and flexible deployment by dividing the system into multiple loosely coupled service units, each responsible for independent business functions. Existing microservices systems typically include service registration and discovery, load balancing, routing forwarding, configuration management, service deployment, and monitoring. These systems are often deployed using cloud-native container orchestration platforms for elastic scaling and automated operations and maintenance.

[0003] In existing technologies, service registration relies primarily on basic metadata collection and heartbeat mechanism maintenance. Governance mechanisms are often based on static rule configuration, lacking the ability to dynamically identify and provide feedback on service health status and risks. At the service deployment level, most systems adopt a unified cloud deployment model, failing to effectively combine service sensitivity with differentiated distributed deployment, resulting in resource waste and difficulty in ensuring security. In addition, there is a lack of effective risk prediction methods for the impact of configuration changes on system stability, making it impossible to estimate potential failure risks before deployment, which can easily lead to service interruptions or cascading failures. Monitoring mechanisms generally focus on indicator collection and log collection, making it difficult to track call links across services and locate root causes.

[0004] Therefore, how to provide a three-tier microservice architecture design and deployment method is an urgent problem that technicians in this field need to solve. Summary of the Invention

[0005] One purpose of the present invention is to propose a three-tier microservice architecture design and deployment method. The present invention integrates service registration and governance mechanisms, service operation and deployment mechanisms, and a configuration management mechanism based on risk prediction. It describes in detail the processing flow of the microservice system in the registration discovery, governance control, decoupled operation, dynamic configuration and risk assessment stages, and introduces the batch orderly improvement CatBoost model to predict the configuration change risk. It has the advantages of strong architectural flexibility, high deployment security, strong controllability of configuration risks and high service stability.

[0006] A three-tier microservice architecture design and deployment method according to an embodiment of the present invention includes the following steps: Build a service registration layer, deploy a registration center, collect and process the information of each microservice at startup, and obtain a collection of service registration information; Build a service governance layer to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set, and build a service governance configuration set; Build the service operation layer, deploy decoupled functional service modules, configure independent databases and caches, and form a microservice operation architecture; Establish a configuration management mechanism. Service startup pulls configuration. Configuration changes are pushed and dynamically loaded via the message bus to generate a configuration change request information set. Based on the configuration change request information set, the training batch sequentially improves the CatBoost model and outputs the configuration risk level information; Based on the microservice operation architecture and configuration risk level information, service components are deployed locally and in the cloud according to sensitivity to obtain hybrid deployment results information; Based on the service governance configuration set and service deployment topology, a full-link tracing mechanism is built. By injecting and passing Trace-ID to record the call chain, a set of operation observation information is obtained.

[0007] Optionally, the construction of the service registration layer, deployment of the registration center, collection and processing of information of each microservice at startup, and obtaining a service registration information set specifically include: Deploy the service registration center, build the service registration interface, health check interface, heartbeat status management module and service removal module, and initialize the empty service list; When each microservice instance is started, the microservice instance information is collected to form a service metadata information set; Send each service metadata in the service metadata information set to the service registration center through the service registration interface to obtain the initial service list; The service registration center assigns the corresponding heartbeat status recorder to the service metadata, updates the heartbeat timestamp in real time, and establishes a mapping relationship to form a heartbeat status mapping table; The service registration center periodically traverses the heartbeat status mapping table, compares the latest heartbeat timestamp corresponding to each service metadata with the current system time, and obtains the abnormal service metadata set; The service registration center removes all abnormal service metadata from the initial service list based on the abnormal service metadata set to obtain a service registration information set.

[0008] Optionally, the service governance layer is constructed to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set. Constructing the service governance configuration set specifically includes: Build the service governance layer, deploy the service gateway, load balancing components, circuit breaker and degradation modules, and routing management modules, and initialize the service governance configuration structure; Call the service registration information collection, group the service metadata according to the service name, and build a service discovery index mapping table; When receiving a client request, the target service name is identified according to the service discovery index mapping table, and a set of target service candidate instances is obtained; Execute the load balancing strategy on the target service candidate instance set, determine the target service instance, and generate the target service routing path; Forward the client request to the selected service instance according to the target service routing path through the service gateway; During the service call process, the response status of the target service instance is monitored in real time. When the number of consecutive exceptions exceeds the set threshold, the circuit breaker logic is triggered, the service instance is removed from the service registration information set, and the service discovery index mapping table is updated; Write the latest status of the current load balancing policy configuration, routing path mapping, circuit breaker rule parameters and service registration information set into the service governance configuration structure to obtain the updated service governance configuration set.

[0009] Optionally, building a service operation layer, deploying decoupled functional service modules, configuring independent databases and caches, and forming a microservice operation architecture specifically includes: Build the service operation layer, split the system into service modules according to business functions, and obtain a set of service modules; Each service module is containerized and deployed as an independently running process unit to obtain a service process set; Allocate an independent database instance and cache node to each service process, and configure data access permissions and connection pool parameters to form an independent data support unit set; Limit the communication mode between service processes to synchronous API calls or asynchronous message queue mechanisms, and build a process communication topology diagram; Constructing a business service set based on the service process set, the data support unit set and the process communication topology diagram; Deploy the business service collection to the available instances specified by the service governance layer and register the metadata information to the registration center to form a microservice operation architecture.

[0010] Optionally, the configuration management mechanism is established, the service starts pulling the configuration, the configuration changes are pushed and dynamically loaded via the message bus, and the configuration change request information set is generated, specifically including: Establish a configuration management mechanism and deploy a configuration server to centrally store environment-specific configuration files to form a configuration file collection; Configure a unified interface service and authentication mechanism for the configuration server, provide remote pull capabilities for accessing configuration content by service name, and form a service configuration pull interface set; When each service process starts, it accesses the configuration server through the corresponding configuration pull interface according to the service name to obtain the initialization configuration context set; The configuration server monitors changes in the content of the configuration file collection and builds a configuration broadcast message stream; After the service process receives the target configuration change event in the configuration broadcast message stream, it performs the configuration context replacement operation at the corresponding service runtime, dynamically loads the new configuration content, and records the change identifier; Each configuration file pull and update event is structured and encapsulated to form configuration change request information, and then aggregated by timestamp and service name to generate a configuration change request information set.

[0011] Optionally, the training batch sequentially improves the CatBoost model based on the configuration change request information set, and outputs the configuration risk level information specifically including: Based on the configuration change request information set, the change events are aggregated in timestamp order to obtain a configuration change batch set; Based on the order dependency relationship between batches in the configuration change batch set, a batch dependency directed acyclic graph is constructed; Perform a topological sorting operation on the batch dependency directed acyclic graph to obtain a batch topological sorting sequence; Organize the configuration change samples in each batch into a set of feature vectors, bind each feature vector to the corresponding label, and construct a training dataset; The batch ordered boosting mechanism is introduced to improve the CatBoost model and output the predicted risk probability; Compare the predicted risk probability with the pre-set risk level threshold set level by level to generate a risk level label; Bind the risk level label of each batch with the corresponding service name and configuration field to generate a configuration risk level information set.

[0012] Optionally, the batch ordered boosting mechanism is introduced to improve the CatBoost model, and the output of the predicted risk probability specifically includes: A batch ordered boosting mechanism is introduced to improve the CatBoost model to obtain an improved CatBoost model. The improved CatBoost model is formed by sequentially accumulating multiple batch CatBoost sub-models, and each CatBoost sub-model is composed of several ordered decision trees. Perform topological sorting on the configuration change batch set to obtain a batch sequence. For any target batch, only the residual information of the previous batch is allowed to be used to form a batch residual dependency set. Based on the batch residual dependency set, the residual of the sample is first calculated, and the residual is multiplied by the corresponding batch weight to obtain the weighted residual. The weighted residuals of all samples are normalized and aggregated to form a batch weighted residual set; An ordered target encoding mechanism is used for category features, and target statistics are calculated for samples to form a batch ordered feature set; Based on the batch ordered feature set and the batch weighted residual set, a CatBoost feature splitting gain function is constructed, and all splitting gain values ​​are combined to obtain the batch feature splitting gain set; Based on the batch feature split gain set, the feature with the largest gain is selected as the split point, a symmetric binary tree node is generated, and the split is repeated until the preset tree depth is reached to obtain the batch CatBoost sub-model; After completing the training of the CatBoost sub-model of the current batch, a weighted accumulation operation is performed based on the existing cumulative prediction values ​​of the previous round and the prediction results of the current batch sub-model to obtain the predicted risk probability of the target batch.

[0013] Optionally, the hybrid deployment result information obtained by deploying service components locally and in the cloud according to sensitivity based on the microservice operation architecture and configuration risk level information specifically includes: Based on the business functions and communication behaviors of each service module in the microservice operation architecture, key sensitivity assessment features are extracted to obtain a sensitivity feature set; Calculate the sensitivity score for each microservice instance based on the sensitivity feature set and the configuration risk level information set; Based on the sensitivity score, each microservice instance is divided into sensitive service components and non-sensitive service components to form a service sensitivity classification result; Deploy sensitive service components on local servers and non-sensitive service components on cloud-based Kubernetes clusters. Connect local servers and cloud-based Kubernetes clusters using private network tunnels to build a secure and isolated deployment architecture. Based on the service sensitivity division results and deployment architecture, a microservice deployment mapping relationship is established to form a service deployment topology diagram. The microservice deployment operation is completed according to the service deployment topology diagram to obtain hybrid deployment result information.

[0014] Optionally, the full-link tracing mechanism is constructed based on the service governance configuration set and the service deployment topology. By injecting and passing the Trace-ID to record the call chain, the operation observation information set obtained specifically includes: Based on the service governance configuration set and service deployment topology, a full-link tracing and operation observation mechanism is built. Request entry injection logic is configured in the API gateway to generate a globally unique request identifier, Trace-ID, for each request entering the system to obtain request identification information. When a service call is made between microservices, the upstream service carries the request identification information in the request message, which is then parsed and passed on by the downstream service to obtain link propagation information. Based on the link propagation information, a multi-hop call node graph is constructed and the call link tracing log is output to form a call tracing log collection; Upload the call tracking log collection to the centralized log analysis system, build a unified structured storage model, and obtain the call link monitoring data set; Based on the call link monitoring data set, performance indicators are calculated, and a graphical display view is built based on the business view to output the operation observation information set.

[0015] The beneficial effects of the present invention are: The present invention constructs a three-layer microservice architecture, divides the microservice system into a service registration layer, a service governance layer, and a service operation layer, deploys a registration center in the service registration layer to collect and manage service metadata information, and ensures the dynamic availability of service instances; implements service discovery, routing forwarding, load balancing, and circuit breaker control in the service governance layer, and improves the robustness of request scheduling by introducing a scheduling mechanism with a multi-strategy combination; adopts modular deployment and isolated resource configuration strategies in the service operation layer to complete the construction of a decoupled service operation structure, thereby improving service maintainability and system elasticity.

[0016] This paper further designs a dynamic configuration management mechanism, utilizing a configuration server to centrally pull service startup configurations and remotely update them. Furthermore, a CatBoost risk prediction model with batch-ordered improvement is constructed based on configuration change request information, enabling topological modeling and risk grading assessment for different configuration batches. This method generates batch ordering through dependency constraints and employs a residual training mechanism to enhance the model's risk prediction capabilities, effectively supporting decision-making rationality and deployment security control during configuration adjustments.

[0017] Furthermore, the present invention establishes a full-link monitoring mechanism based on the service governance configuration and deployment structure. By injecting Trace-ID, it enables complete tracing across the service call chain. Combined with the log analysis system, it forms a stable operational observation capability, thereby enabling refined monitoring and real-time visual management of the microservice system operation, enhancing the system's stability and abnormal response capabilities. This method supports hybrid cloud deployment strategies and can automatically dispatch services to local or cloud locations based on sensitivity levels. It is suitable for application scenarios with high requirements for system reliability and deployment compliance. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0019] Figure 1 This is a flowchart of a three-tier microservice architecture design and deployment method proposed by the present invention; Figure 2 This is a structural diagram of the CatBoost model for batch orderly improvement in the three-tier microservice architecture design and deployment method proposed in the present invention; Figure 3 This is a schematic diagram of the service scheduling structure of the hybrid cloud deployment strategy in the three-tier microservice architecture design and deployment method proposed in the present invention. DETAILED DESCRIPTION

[0020] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.

[0021] refer to Figure 1-3 , a three-tier microservice architecture design and deployment method, including the following steps: Build a service registration layer, deploy a registration center, collect and process the information of each microservice at startup, and obtain a collection of service registration information; Build a service governance layer to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set, and build a service governance configuration set; Build the service operation layer, deploy decoupled functional service modules, configure independent databases and caches, and form a microservice operation architecture; Establish a configuration management mechanism. Service startup pulls configuration. Configuration changes are pushed and dynamically loaded via the message bus to generate a configuration change request information set. Based on the configuration change request information set, the training batch sequentially improves the CatBoost model and outputs the configuration risk level information; Based on the microservice operation architecture and configuration risk level information, service components are deployed locally and in the cloud according to sensitivity to obtain hybrid deployment results information; Based on the service governance configuration set and service deployment topology, a full-link tracing mechanism is built. By injecting and passing Trace-ID to record the call chain, a set of operation observation information is obtained.

[0022] In this embodiment, the service registration layer is constructed, the registration center is deployed, and the information of each microservice at startup is collected and processed to obtain the service registration information set, which specifically includes: Deploy the service registration center, build the service registration interface, health check interface, heartbeat status management module and service removal module, initialize the empty service list, and obtain the service registration center structure; When each microservice instance is started, the service name, runtime instance address, listening port number, and health check interface path of the microservice instance are collected. The above four pieces of information are encapsulated into a set of service metadata in a fixed order. The service metadata generated by multiple microservice instances are aggregated to form a service metadata information set. Each service metadata in the service metadata information set is sent to the service registration center structure through the service registration interface. After receiving each service metadata, the service registration center structure writes the service metadata into the currently maintained service list and establishes an index relationship for each service metadata to complete the registration of the service instance and obtain the initial service list containing all registered service metadata; The service registration center assigns a corresponding heartbeat status recorder to each registered service metadata to record the running status of the service instance. Each microservice instance sends a heartbeat request to the service registration center at a set fixed time period during normal operation. After receiving the heartbeat request, the service registration center updates the latest heartbeat timestamp of the corresponding service instance in real time, and establishes a mapping relationship between the latest heartbeat timestamp and the corresponding service metadata to form a heartbeat status mapping table; The service registration center periodically traverses the heartbeat status mapping table and compares the latest heartbeat timestamp corresponding to each service metadata with the current system time. When the time difference between the current system time and the timestamp is greater than or equal to the preset expiration time threshold, the corresponding service instance is determined to be in an abnormal state and the service metadata is marked as unavailable, thus obtaining a set of abnormal service metadata. Based on the abnormal service metadata set, the service registration center removes all service metadata that has been determined to be unavailable from the currently maintained initial service list, updates the service list content, retains only the service instance information that is in a normal and active state, and obtains the service registration information set.

[0023] In this embodiment, the service governance layer is constructed to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set. The construction of the service governance configuration set specifically includes: Build the service governance layer, deploy the service gateway, load balancing components, circuit breaker and degradation modules, and routing management modules, and initialize the service governance configuration structure as the basic framework of the service governance configuration set; Call the service registration information collection, traverse each service metadata containing the service name, instance address, port number and health check path, group the service metadata according to the service name, combine the instance address, port number and health status of multiple service instances corresponding to the same service name into an instance list, establish a one-to-one correspondence between the service name and the corresponding instance list, and build a service discovery index mapping table; When receiving a client request, the target service name is identified according to the service discovery mapping table, and the corresponding service instance set is extracted to obtain the target service candidate instance set; Execute a load balancing strategy on the set of target service candidate instances, the load balancing strategy including round-robin, least connection, or dynamic response allocation based on weighted round-robin, determine the target service instance, and generate a target service routing path by splicing the target service instance based on its service name, instance address, listening port, and call path; The round-robin method selects the next service instance in the order in which the service instance is registered in the set of target service candidate instances. The minimum connection method selects the service instance with the least number of concurrent connections as the target service instance. The dynamic response allocation method based on weighted round-robin sets a weight value for each service instance and dynamically allocates the total requests according to the weight ratio of each instance. Forwarding the client request to the selected service instance according to the target service routing path through the service gateway to complete the service call distribution; During the service call process, the response status of the target service instance is monitored in real time. When the number of consecutive exceptions exceeds the set threshold, the circuit breaker logic is triggered, the service instance is removed from the service registration information set, and the service discovery mapping table is updated; Write the latest status of the current load balancing policy configuration, routing path mapping, circuit breaker rule parameters and service registration information set into the service governance configuration structure to obtain the updated service governance configuration set.

[0024] In this embodiment, the construction of the service operation layer, deployment of decoupled functional service modules, configuration of independent databases and caches, and formation of a microservice operation architecture specifically include: Divide the system by business function, extract functional units with single responsibilities, define them as independent service modules, and record them as a service module set; Each service module in the service module set is containerized, encapsulated as an independently runnable process, and deployed on the computing node to form a service process set, ensuring that each service module is isolated from each other at the process level; Configure independent database instances and cache resources for each service process in the service process set, establish data connection configuration and cache access interface respectively, ensure that each service process is independent of each other during data storage and reading, and form a complete data support unit set; Limit the communication between service processes to synchronous application programming interface (API) calls or asynchronous message queue mechanisms. API calls are used for direct request and response between services, while message queue mechanisms are used for asynchronous event delivery. Based on the communication relationship between each process in the service process set, a process communication topology graph is constructed. The process communication topology graph uses service processes as nodes in the graph and pairs of processes with call or message passing relationships as directed edges in the graph to represent the communication paths, directions, and dependency structures between each service process in the service operation layer. Based on the service process set, data support unit set and process communication topology diagram, a decoupled and autonomous business service set is constructed, the business service set is deployed to the available instance specified by the service governance layer, and its metadata information is registered with the registration center, ultimately forming a complete microservice operation architecture.

[0025] In this embodiment, the configuration management mechanism is established, the service starts to pull the configuration, the configuration change is pushed and dynamically loaded via the message bus, and the configuration change request information set is generated, specifically including: Establish a configuration management mechanism and introduce a configuration server into the deployment architecture as a unified configuration center to centrally manage the environment configuration files required by each service instance; The configuration files are categorized and stored based on the service name, ensuring that different services load their own independent configuration content, forming a structured configuration file collection. The configuration file collection supports differentiating deployment environments (such as development, testing, and production) and maintains version control information by service dimension; Configure a unified interface service for the configuration server to provide external configuration file access based on the service name. At the same time, establish an authentication mechanism to control the read permission of the configuration file. The interface service supports the service process to initiate remote configuration pull requests by service name during startup or operation, and ensures the integrity and security of configuration data during transmission, thereby forming a service configuration pull interface set for services to dynamically obtain configuration content; When each service process starts, it first identifies its own service name and initiates a request to the configuration server through the configuration pull interface to obtain the configuration file corresponding to the service name from the configuration server; The obtained configuration file content is then loaded into the context environment of the service runtime and used as the parameter input in the service initialization phase to complete the configuration initialization of the service process and obtain the initialization configuration context set containing various configuration items; The configuration server continuously monitors the content change status of each configuration file in the stored configuration file collection. When it detects that any configuration file has been modified, it immediately constructs a corresponding configuration change event based on the preset configuration broadcast channel and pushes it to all registered service processes in the form of a message, thus forming a continuous configuration broadcast message stream; After the service process receives the target configuration change event in the configuration broadcast message stream, it performs the configuration context replacement operation at the corresponding service runtime, dynamically loads the new configuration content, records the change identifier, and completes the configuration hot update process; Each configuration file pull and update event is structured and encapsulated to form configuration change request information, and then aggregated by timestamp and service name to generate a configuration change request information set. The configuration change request information set includes numerical features and category features, where category features represent discrete fields of configuration items, such as service name, version number or deployment environment.

[0026] In this embodiment, the training batch sequentially improves the CatBoost model based on the configuration change request information set, and outputs the configuration risk level information specifically including: Based on the configuration change request information set, the change events are aggregated in timestamp order, and the request information with the same change trigger time window or logical correlation is classified into a batch to obtain the configuration change batch set; Based on the dependencies between batches in the configuration change batch set, a batch dependency directed acyclic graph is constructed. Each node in the graph represents a configuration change batch. If a configuration change operation in one batch depends on the changes completed in another batch, a directed edge is created in the graph from the dependent batch to the current batch, thus forming a directed acyclic graph structure that can represent the dependency order between batches. Perform a topological sort on the batch dependency directed acyclic graph. Based on the direction of the edges in the graph, the dependency order of all configuration change batches is parsed layer by layer, starting from the nodes with no in-degree. Finally, a topologically sorted sequence of batches is obtained that does not violate any dependency relationships. Organize the configuration change samples in each batch into a feature vector set. The feature vector includes the configuration field name, field value, service name, current service status, number of historical changes, change interval, change field weight, call chain level, and call frequency. Bind each feature vector to its corresponding label. The label is a binary variable indicating whether the current configuration change caused a service failure. 1 indicates a failure, and 0 indicates no failure. Organize all feature vectors and labels in batches to construct a training dataset. The batch ordered boosting mechanism is introduced to improve the CatBoost model and output the predicted risk probability; After completing the calculation of the predicted risk probability of the current batch of configuration change samples, the predicted risk probability is compared with the pre-set risk level threshold set level by level; When the predicted risk probability is lower than the first threshold, the batch is marked as low risk. When the predicted risk probability is greater than or equal to the first threshold and lower than the second threshold, the batch is marked as medium risk. When the predicted risk probability is greater than or equal to the second threshold, the batch is marked as high risk, thereby generating a clear risk level label for the configuration change batch; Bind each batch of risk level labels with its corresponding service name and configuration fields to generate a configuration risk level information set.

[0027] In this embodiment, the batch order boosting mechanism is introduced to improve the CatBoost model, and the output prediction risk probability specifically includes: A batch ordered boosting mechanism is introduced to improve the CatBoost model to obtain an improved CatBoost model. The improved CatBoost model is formed by sequentially accumulating multiple batches of CatBoost sub-models, each of which is composed of several ordered decision trees. The batch ordered boosting mechanism divides the configuration change data into multiple sequentially numbered training subsets by batch, and trains each subset to obtain a CatBoost sub-model. Only the residual information of the previous batch is used as the input of the current batch to ensure the dependency order between the sub-models. Finally, the overall prediction model is formed by sequentially accumulating multiple CatBoost sub-models. Perform topological sorting on the configuration change batch set to obtain a batch sequence. For any target batch, only the residual information of the previous batch is allowed to be used to ensure that the training process meets the order constraint and form a batch residual dependency set. Based on the batch residual dependency set, the residual of each sample in the current batch is first calculated. Then, a batch weight is set for the current batch based on the risk level information of the configuration change. The residual is multiplied by the corresponding batch weight to obtain the weighted residual. Finally, the weighted residuals of all samples are normalized and aggregated to form a batch weighted residual set. An ordered target encoding mechanism is used for category features, and target statistics are calculated for samples to form a batch ordered feature set: ; in, Indicates that the batch order promotion mechanism is used to Configuration change samples The calculated target statistic, dimensionless, Indicates the configuration change batch set arranged in topological order. configuration change samples, dimensionless, Indicates the first The true risk label value of the configuration change sample, dimensionless, represents the smoothing parameter, represents the global prior probability, which is obtained based on the overall statistics of the configuration change request information set. Indicates the index position of the current configuration change sample arranged in topological order in the configuration change batch set, Indicates that in the configuration change batch set, the current configuration change sample Previous sample index; This formula is derived from the definition of ordered target statistics (TS) in the CatBoost algorithm in machine learning and is a statistical formula. Its original form is used to address the target leakage problem in model training. Building on this, this application constrains the variables in the formula to a batch-ordered boost configuration change risk prediction scenario, thereby enabling batch risk modeling of configuration change samples.

[0028] Based on the batch ordered feature set and the batch weighted residual set, a CatBoost feature splitting gain function is constructed, and all splitting gain values ​​are combined to obtain the batch feature splitting gain set: ; in, Indicates in In a configuration change batch, based on candidate features The splitting gain value, dimensionless, Represents the ordered feature set in the batch The selected candidate features, dimensionless, represents a single weighted residual value from the set of weighted residuals of the batch, dimensionless, Indicates that the candidate features The reduction in the conditional variance of the batch weighted residual set when participating in the split, dimensionless, Indicates the The number of valid samples participating in training in a batch, dimensionless, represents the batch-dependent penalty factor, dimensionless, Represents a batch dependency constraint function, if the candidate feature Satisfy batch ordered feature set The value is 1 if the dependency condition exists, otherwise it is 0. is a batch ordered feature set; The formula is an improved form of the node splitting gain formula in the CatBoost boosting tree model. The CatBoost batch ordered boosting mechanism proposed in this patent introduces the following innovative factors: Batch weighted residuals, unlike global residuals, only count the current and previous change batches, ensuring that the model conforms to the temporal dependency structure of configuration changes; Batch ordered feature collection ensures that feature selection is performed only on the subset that satisfies the DAG topology constraints; Dependency Penalty , a feature dependency control mechanism is introduced on the original CatBoost gain function to enhance the generalization ability of the model in a dynamic configuration environment, and finally the CatBoost feature splitting gain function in this patent is obtained; Based on the batch feature split gain set, the feature with the largest gain is selected as the split point, a symmetric binary tree node is generated, and the split is repeated until the preset tree depth is reached to obtain the batch CatBoost sub-model; After completing the training of the CatBoost sub-model of the current batch, a weighted accumulation operation is performed based on the existing cumulative prediction values ​​of the previous round and the prediction results of the sub-model of the current batch. Specifically, the prediction outputs of all decision tree sub-models for the samples in the current batch are summed, multiplied by the dynamic learning rate coefficient corresponding to the batch, and the cumulative prediction increment of this batch is obtained. The cumulative prediction increment of this batch is added to the cumulative prediction value of the previous batch to obtain the predicted risk probability of the target batch.

[0029] In this embodiment, based on the microservice operation architecture and configuration risk level information, the service components are deployed locally and in the cloud according to sensitivity, and the hybrid deployment result information obtained specifically includes: Based on the business functions and communication behaviors of each service module in the microservice operation architecture, key sensitivity assessment features are extracted. The key sensitivity assessment features include service processing data type, call chain complexity, access permission level, and external communication frequency, and a sensitivity feature set is obtained. Based on the sensitivity feature set and the configuration risk level information set, a sensitivity score is calculated for each microservice instance. The sensitivity score includes two parts: a static security level and a dynamic risk level. The static security level is calculated using a weighted scoring method based on each indicator in the sensitivity feature set, and the dynamic risk level is generated based on the predicted risk probability in the configuration risk level information set. Based on the sensitivity score, each microservice instance is divided into sensitive service components and non-sensitive service components to form a service sensitivity classification result; Deploy sensitive service components on local servers and non-sensitive service components on cloud-based Kubernetes clusters. Connect local servers and cloud-based Kubernetes clusters using private network tunnels to build a secure and isolated deployment architecture. Based on the service sensitivity division results and deployment architecture, a microservice deployment mapping relationship is established to form a service deployment topology diagram. The microservice deployment operation is completed according to the service deployment topology diagram to obtain hybrid deployment result information.

[0030] In this embodiment, the full-link tracing mechanism is constructed based on the service governance configuration set and the service deployment topology. By injecting and passing the Trace-ID to record the call chain, the operation observation information set obtained specifically includes: Based on the service governance configuration set and service deployment topology, a full-link tracing and operation observation mechanism is built. Request entry injection logic is configured in the API gateway to generate a globally unique request identifier, Trace-ID, for each request entering the system to obtain request identification information. When a service call is made between microservices, the upstream service carries the request identification information in the request message, which is then parsed and passed on by the downstream service. This ultimately enables the request identification information to be passed throughout the call chain, obtaining chain propagation information. Based on the link propagation information, the distributed link tracing system collects the start time, target service identifier, response time, call status, and exception mark of each call, builds a multi-hop call node graph, and outputs the call link tracing log to form a call tracing log collection; Upload the call tracking log collection to the centralized log analysis system, group and index it according to service name, instance ID, and time window, build a unified structured storage model, and obtain the call link monitoring data set; Based on the call link monitoring data set, performance indicators are calculated, including the average service response time, call success rate, exception rate and call frequency. A graphical display view is constructed based on the business view to output the operation observation information set.

[0031] Example 1: To verify the feasibility of this invention, we applied it to a hybrid cloud service platform transformation project for a financial technology company. The company's original system used a traditional microservices deployment architecture, which suffered from configuration synchronization delays, difficulty in tracing cross-service links, and system stability fluctuations caused by configuration changes, making it difficult to support high-concurrency business access and flexible expansion requirements.

[0032] During the transformation process, the service registration layer, service governance layer, and service operation layer are first constructed according to the method described in the present invention to realize the three-layer decoupling deployment of the system. In the service registration layer, the registration center component is used to uniformly manage the service instance life cycle and dynamically maintain the service registration information set. In the service governance layer, Trace-ID is injected through the unified gateway to realize service discovery, load balancing, and call link tracing; a dynamic distribution strategy based on weighted polling is introduced into the governance logic to effectively balance the pressure of different service nodes. In the service operation layer, each business module is divided into independent microservices, which are deployed and equipped with independent databases and cache systems to improve service isolation and maintainability.

[0033] To further address the impact of frequent configuration changes on system stability, the batch-ordered CatBoost risk prediction model constructed in this invention is employed. Sub-models are constructed through residual analysis of historical configuration change samples. Risk prediction probabilities for different change batches are obtained through batch training. Deployment strategies are dynamically adjusted based on risk levels to implement a pre-change risk warning mechanism. Finally, combining the configuration risk level information output by the model with the microservices operating architecture, a hybrid cloud deployment approach (on-premises + cloud) is employed to achieve differentiated deployment of sensitive and non-sensitive components.

[0034] A month-long comparison of operational monitoring data before and after the transformation showed that the average response time of system service instances decreased from 186ms to 103ms, the number of service interruptions caused by configuration changes decreased from 11 to 2 per month, and the call link tracing success rate increased from 74.6% to 96.2%. In terms of risk control, the model achieved an accuracy rate of 92.8% in warnings for high-risk change batches, significantly reducing system unavailability caused by configuration errors.

[0035] Table 1 Comparison of key performance before and after deployment of three-tier microservice architecture

[0036] As can be seen from the above table, the present invention has an optimization effect on multiple key performance indicators in the process of microservice system deployment and configuration management compared with the traditional system architecture. First, in terms of service response efficiency, the average response time of the system has dropped from 186 milliseconds to 103 milliseconds, an overall decrease of more than 44%, which has improved the user access experience and system throughput. Secondly, in terms of configuration change stability, although the number of configuration changes per month has increased slightly from 19 to 23 times, the service interruption incidents caused by the changes have been greatly reduced from 11 to 2 per month, indicating that the introduced configuration risk prediction mechanism has improved the system's fault tolerance to changes.

[0037] In terms of risk control effect, the batch orderly improvement CatBoost model introduced by the present invention achieved a high-risk warning accuracy of 92.8%, effectively avoiding system anomalies that may be caused by high-risk configuration changes. In addition, in terms of system observation and governance capabilities, the link tracking success rate increased from 74.6% to 96.2%, indicating that the established full-link tracking mechanism can more completely reflect the service call path, providing strong support for problem location and performance analysis. At the same time, the node-level CPU load fluctuation dropped from ±42% to ±19%, and the request failure rate dropped from 1.84% to 0.42%, indicating that the load balancing and circuit breaker control strategies are more efficient and the system stability is stronger.

[0038] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A three-tier microservice architecture design and deployment method, characterized in that: The steps include: Build a service registration layer, deploy a registration center, collect and process the information of each microservice at startup, and obtain a collection of service registration information; Build a service governance layer to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set, and build a service governance configuration set; Build the service operation layer, deploy decoupled functional service modules, configure independent databases and caches, and form a microservice operation architecture; Establish a configuration management mechanism. Service startup pulls configuration. Configuration changes are pushed and dynamically loaded via the message bus to generate a configuration change request information set. Based on the configuration change request information set, the training batch sequentially improves the CatBoost model and outputs the configuration risk level information; Based on the microservice operation architecture and configuration risk level information, service components are deployed locally and in the cloud according to sensitivity to obtain hybrid deployment results information; Based on the service governance configuration set and service deployment topology, a full-link tracing mechanism is built. By injecting and passing Trace-ID to record the call chain, a set of operation observation information is obtained.

2. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: The construction of the service registration layer, deployment of the registration center, collection and processing of information of each microservice at startup, and obtaining a service registration information set specifically include: Deploy the service registration center, build the service registration interface, health check interface, heartbeat status management module and service removal module, and initialize the empty service list; When each microservice instance is started, the microservice instance information is collected to form a service metadata information set; Send each service metadata in the service metadata information set to the service registration center through the service registration interface to obtain the initial service list; The service registration center assigns the corresponding heartbeat status recorder to the service metadata, updates the heartbeat timestamp in real time, and establishes a mapping relationship to form a heartbeat status mapping table; The service registration center periodically traverses the heartbeat status mapping table, compares the latest heartbeat timestamp corresponding to each service metadata with the current system time, and obtains the abnormal service metadata set; The service registration center removes all abnormal service metadata from the initial service list based on the abnormal service metadata set to obtain a service registration information set.

3. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: The service governance layer is constructed to perform service discovery, routing distribution, load balancing, and circuit breaker control based on the service registration information set. The construction of the service governance configuration set specifically includes: Build the service governance layer, deploy the service gateway, load balancing components, circuit breaker and degradation modules, and routing management modules, and initialize the service governance configuration structure; Call the service registration information collection, group the service metadata according to the service name, and build a service discovery index mapping table; When receiving a client request, the target service name is identified according to the service discovery index mapping table, and a set of target service candidate instances is obtained; Execute the load balancing strategy on the target service candidate instance set, determine the target service instance, and generate the target service routing path; Forward the client request to the selected service instance according to the target service routing path through the service gateway; During the service call process, the response status of the target service instance is monitored in real time. When the number of consecutive exceptions exceeds the set threshold, the circuit breaker logic is triggered, the service instance is removed from the service registration information set, and the service discovery index mapping table is updated; Write the latest status of the current load balancing policy configuration, routing path mapping, circuit breaker rule parameters and service registration information set into the service governance configuration structure to obtain the updated service governance configuration set.

4. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: The construction of the service operation layer, deployment of decoupled functional service modules, configuration of independent databases and caches, and formation of a microservice operation architecture specifically include: Build the service operation layer, split the system into service modules according to business functions, and obtain a set of service modules; Each service module is containerized and deployed as an independently running process unit to obtain a service process set; Allocate an independent database instance and cache node to each service process, and configure data access permissions and connection pool parameters to form an independent data support unit set; Limit the communication mode between service processes to synchronous API calls or asynchronous message queue mechanisms, and build a process communication topology diagram; Constructing a business service set based on the service process set, the data support unit set and the process communication topology diagram; Deploy the business service collection to the available instances specified by the service governance layer and register the metadata information to the registration center to form a microservice operation architecture.

5. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: The establishment of a configuration management mechanism, in which the service starts pulling configuration, configuration changes are pushed and dynamically loaded via the message bus, and a configuration change request information set is generated, specifically includes: Establish a configuration management mechanism and deploy a configuration server to centrally store environment-specific configuration files to form a configuration file collection; Configure a unified interface service and authentication mechanism for the configuration server, provide remote pull capabilities for accessing configuration content by service name, and form a service configuration pull interface set; When each service process starts, it accesses the configuration server through the corresponding configuration pull interface according to the service name to obtain the initialization configuration context set; The configuration server monitors changes in the content of the configuration file collection and builds a configuration broadcast message stream; After the service process receives the target configuration change event in the configuration broadcast message stream, it performs the configuration context replacement operation at the corresponding service runtime, dynamically loads the new configuration content, and records the change identifier; Each configuration file pull and update event is structured and encapsulated to form configuration change request information, and then aggregated by timestamp and service name to generate a configuration change request information set.

6. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: The training batch is based on the configuration change request information set to orderly improve the CatBoost model, and the output configuration risk level information specifically includes: Based on the configuration change request information set, the change events are aggregated in timestamp order to obtain a configuration change batch set; Based on the order dependency relationship between batches in the configuration change batch set, a batch dependency directed acyclic graph is constructed; Perform a topological sorting operation on the batch dependency directed acyclic graph to obtain a batch topological sorting sequence; Organize the configuration change samples in each batch into a set of feature vectors, bind each feature vector to the corresponding label, and construct a training dataset; The batch ordered boosting mechanism is introduced to improve the CatBoost model and output the predicted risk probability; Compare the predicted risk probability with the pre-set risk level threshold set level by level to generate a risk level label; Bind the risk level label of each batch with the corresponding service name and configuration field to generate a configuration risk level information set.

7. A three-tier microservice architecture design and deployment method according to claim 6, characterized in that: The batch order boosting mechanism is introduced to improve the CatBoost model, and the output prediction risk probability specifically includes: A batch ordered boosting mechanism is introduced to improve the CatBoost model to obtain an improved CatBoost model. The improved CatBoost model is formed by sequentially accumulating multiple batch CatBoost sub-models, and each CatBoost sub-model is composed of several ordered decision trees. Perform topological sorting on the configuration change batch set to obtain a batch sequence. For any target batch, only the residual information of the previous batch is allowed to be used to form a batch residual dependency set. Based on the batch residual dependency set, the residual of the sample is first calculated, and the residual is multiplied by the corresponding batch weight to obtain the weighted residual. The weighted residuals of all samples are normalized and aggregated to form a batch weighted residual set; An ordered target encoding mechanism is used for category features, and target statistics are calculated for samples to form a batch ordered feature set; Based on the batch ordered feature set and the batch weighted residual set, a CatBoost feature splitting gain function is constructed, and all splitting gain values ​​are combined to obtain the batch feature splitting gain set; Based on the batch feature split gain set, the feature with the largest gain is selected as the split point, a symmetric binary tree node is generated, and the split is repeated until the preset tree depth is reached to obtain the batch CatBoost sub-model; After completing the training of the CatBoost sub-model of the current batch, a weighted accumulation operation is performed based on the existing cumulative prediction values ​​of the previous round and the prediction results of the current batch sub-model to obtain the predicted risk probability of the target batch.

8. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: Based on the microservice operation architecture and configuration risk level information, service components are deployed locally and in the cloud according to sensitivity, and the hybrid deployment result information obtained specifically includes: Based on the business functions and communication behaviors of each service module in the microservice operation architecture, key sensitivity assessment features are extracted to obtain a sensitivity feature set; Calculate the sensitivity score for each microservice instance based on the sensitivity feature set and the configuration risk level information set; Based on the sensitivity score, each microservice instance is divided into sensitive service components and non-sensitive service components to form a service sensitivity classification result; Deploy sensitive service components on local servers and non-sensitive service components on cloud-based Kubernetes clusters. Connect local servers and cloud-based Kubernetes clusters using private network tunnels to build a secure and isolated deployment architecture. Based on the service sensitivity division results and deployment architecture, a microservice deployment mapping relationship is established to form a service deployment topology diagram. The microservice deployment operation is completed according to the service deployment topology diagram to obtain hybrid deployment result information.

9. A three-tier microservice architecture design and deployment method according to claim 1, characterized in that: Based on the service governance configuration set and service deployment topology, a full-link tracing mechanism is constructed. By injecting and passing Trace-ID to record the call chain, the operation observation information set obtained specifically includes: Based on the service governance configuration set and service deployment topology, a full-link tracing and operation observation mechanism is built. Request entry injection logic is configured in the API gateway to generate a globally unique request identifier, Trace-ID, for each request entering the system to obtain request identification information. When a service call is made between microservices, the upstream service carries the request identification information in the request message, which is then parsed and passed on by the downstream service to obtain link propagation information. Based on the link propagation information, a multi-hop call node graph is constructed and the call link tracing log is output to form a call tracing log collection; Upload the call tracking log collection to the centralized log analysis system, build a unified structured storage model, and obtain the call link monitoring data set; Based on the call link monitoring data set, performance indicators are calculated, and a graphical display view is built based on the business view to output the operation observation information set.

Citation Information

Patent Citations

  • Service identification method and device based on machine learning, and medium

    CN110544100A

  • Application management method based on micro-service architecture

    CN112000448A

  • Micro-service system and method based on multi-machine-room container deployment

    CN114827277A

  • Ansible-based micro-service deployment method and system

    CN115291892A

  • Dubbo containerization deployment method, system, equipment, medium and product

    CN119052319A

Cited By

  • Micro-service-based open source gap digital intelligent water affair APP source code generation method and system

    CN121277517A

  • Configuration health examination management system and method based on dynamic detection

    CN121309341A