Configuration management method and device based on micro-service architecture, equipment and storage medium

By receiving configuration change notifications in the microservice architecture and updating the local configuration library, the problem of the microservice configuration center lacks configuration management during business logic processing is solved, and high availability of business configuration and reduced dependence on configuration servers is achieved.

CN119449876APending Publication Date: 2025-02-14CHINA MERCHANTS BANK
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411432116.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing microservice configuration center lacks management of business processing process configuration during business logic processing, which causes the configuration center to fail or network interruption, and the dependency service may not be started, and even cause an avalanche production accident.

Method used

A configuration management method based on microservice architecture is proposed, which updates the local configuration library by receiving configuration change notifications sent by the configuration server, and executes subscription services to achieve persistence of configurations.

Benefits of technology

When an exception occurs in the configuration server, the subscriber can still read the configuration table that has been persisted to its own business library normally, ensuring high availability of business configuration, reducing dependence on the configuration server, maintaining the continuous and normal operation of business configuration, and effectively reducing the Systematic risk.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449876A_ABST
    Figure CN119449876A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration management method and device based on a micro-service architecture, equipment and a storage medium, and relates to the technical field of information processing, and the configuration management method based on the micro-service architecture comprises the following steps: receiving a configuration change notification sent by a configuration server, the configuration change notification comprises a configuration change type and configuration change information; updating a corresponding configuration table in a preset local configuration library based on the configuration change type and the configuration change information; and executing the subscription service corresponding to the configuration table based on the configuration table. According to the application, the subscription server implants the configuration table in the local database to achieve the purpose of persistent configuration, so that when the configuration server is abnormal, a subscriber can still normally read the configuration table persisted to the own service library, thereby ensuring high availability of service configuration and reducing dependence on the configuration server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to a configuration management method, apparatus, device and storage medium based on a microservice architecture. Background Art

[0002] With the rapid development of cloud computing and microservices, the current microservice configuration center has been gradually improved, and many standardized configuration center services have been born, such as Spring Cloud Config, HashiCorp's Consul, Alibaba's Nacos, etc. These services all support the push of central parameters to subscribers, and are generally used as a unified startup configuration management for various application services in the microservice cluster within the enterprise. The main convenience is that a centralized configuration center has been built. When the configuration is modified in the configuration center, it can be directly distributed to the corresponding microservices, which greatly simplifies the configuration management.

[0003] However, the current popular solutions in the industry rarely consider the management of business process configuration when the microservice is started and the business logic is processed. Even if the solution is improved to support centralized management of business configuration, such highly centralized management of mutable business configuration will inevitably increase the strong dependence of each microservice configuration center. When the configuration center is down or the network is interrupted due to various unexpected factors, the dependent services may not be able to start, and may even cause an avalanche of serious production accidents for all callers of the configuration center services. Summary of the invention

[0004] The main purpose of this application is to provide a configuration management method, device, equipment and storage medium based on a microservice architecture, aiming to ensure high availability of business configuration and reduce dependence on configuration servers.

[0005] To achieve the above objectives, the present application proposes a configuration management method based on a microservice architecture, the method comprising:

[0006] Receive a configuration change notification sent by the configuration server, wherein the configuration change notification includes a configuration change type and configuration change information;

[0007] Based on the configuration change type and the configuration change information, update the corresponding configuration table in the preset local configuration library;

[0008] Based on the configuration table, a subscription service corresponding to the configuration table is executed.

[0009] In one embodiment, the method further comprises:

[0010] Receive a configuration table verification request sent by the configuration server;

[0011] Determining a configuration table to be checked based on the configuration table check information in the configuration table check request;

[0012] Based on the configuration table, a second configuration table verification value is calculated, and the second configuration table verification value is sent to the configuration server.

[0013] In one embodiment, after executing the subscription service corresponding to the configuration table based on the configuration table, the method further includes:

[0014] Get the configuration execution effect after executing the subscription service;

[0015] Inputting the configuration execution effect, the configuration change type in the configuration table, and the configuration change information into a business configuration optimization model to obtain a configuration optimization solution output by the business configuration optimization model;

[0016] Based on the configuration optimization scheme, the configuration table is optimized.

[0017] This application proposes a configuration management method based on a microservice architecture, the method comprising:

[0018] Get the configuration change type and configuration change information;

[0019] Generate a configuration change notification based on the configuration change type and the configuration change information;

[0020] The configuration change notification is sent to a subscription service end so that the subscription service end executes the subscription service corresponding to the configuration table.

[0021] In one embodiment, the method further comprises:

[0022] Based on the preset checking rule, a configuration table checking request is generated, and a first configuration table checking value is calculated, wherein the configuration table checking request includes checking configuration table information;

[0023] Sending the configuration table check request to the subscription service end to receive the second configuration table check value returned by the subscription service end;

[0024] A configuration table verification result is obtained based on the first configuration table verification value and the second configuration table verification value.

[0025] In one embodiment, before obtaining the configuration change type and the configuration change information, the method further includes:

[0026] Determine whether the subscription server is performing business configuration for the first time;

[0027] If yes, get the full content of the configuration table;

[0028] Based on the data structure type corresponding to the full content, the full content is sent to a subscription service end for configuration by the subscription service end.

[0029] In one embodiment, after sending the configuration change notification to the subscription server so that the subscription server executes the subscription service corresponding to the configuration table, the method further includes:

[0030] Check whether the subscription service has received a successful notification based on the preset time.

[0031] If not, a reception failure alarm is generated and pushed to the security management personnel;

[0032] Based on the reception failure alarm, the configuration change notification is resent to the subscription server.

[0033] In addition, to achieve the above purpose, the present application also proposes a configuration management device based on a microservice architecture, and the configuration management device based on a microservice architecture includes:

[0034] A subscription module, configured to receive a configuration change notification sent by a configuration server, wherein the configuration change notification includes a configuration change type and configuration change information; based on the configuration change type and the configuration change information, update a corresponding configuration table in a preset local configuration library; based on the configuration table, execute a subscription service corresponding to the configuration table;

[0035] The configuration module is used to obtain the configuration change type and the configuration change information; generate a configuration change notification based on the configuration change type and the configuration change information; and send the configuration change notification to the subscription service end so that the subscription service end executes the subscription service corresponding to the configuration table.

[0036] In addition, to achieve the above-mentioned objectives, the present application also proposes a configuration management device based on a microservice architecture, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the configuration management method based on the microservice architecture as described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the configuration management method based on the microservice architecture as described above are implemented.

[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the configuration management method based on the microservice architecture as described above.

[0039] The present application provides a configuration management method, apparatus, device and storage medium based on a microservice architecture. The configuration management method based on a microservice architecture receives a configuration change notification sent by a configuration server, wherein the configuration change notification includes a configuration change type and configuration change information, and then based on the configuration change type and the configuration change information, updates a corresponding configuration table in a preset local configuration library, thereby executing a subscription service corresponding to the configuration table based on the configuration table, thereby achieving the purpose of persistent configuration, so that when an abnormality occurs in the configuration server, the subscriber can still normally read the configuration table that has been persisted to its own business library, thereby ensuring the high availability of the business configuration, reducing the dependence on the configuration server, and maintaining the continuous normal operation of the business configuration, thereby effectively reducing system risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A flow chart of the configuration management method based on microservice architecture provided in Example 1 of this application;

[0043] Figure 2 A flow chart of the second embodiment of the configuration management method based on microservice architecture provided in this application;

[0044] Figure 3 A flowchart of the third embodiment of the configuration management method based on the microservice architecture of this application is provided;

[0045] Figure 4 A flowchart of the fourth embodiment of the configuration management method based on the microservice architecture of this application is provided;

[0046] Figure 5 This is a schematic diagram of the module structure of a configuration management device based on a microservice architecture according to an embodiment of the present application;

[0047] Figure 6This is a schematic diagram of the device structure of the hardware operating environment involved in the configuration management method based on the microservice architecture in the embodiment of the present application.

[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a big data service platform, a configuration management system based on a microservice architecture, etc. The following takes a configuration management system based on a microservice architecture as an example to illustrate this embodiment and the following embodiments.

[0052] Based on this, the embodiment of the present application provides a configuration management method based on a microservice architecture. Figure 1 , Figure 1 A flowchart of the configuration management method based on microservice architecture provided in Example 1 of the present application.

[0053] In this embodiment, the configuration management method based on the microservice architecture includes steps S11 to S13:

[0054] Step S11, receiving a configuration change notification sent by a configuration server, wherein the configuration change notification includes a configuration change type and configuration change information;

[0055] It should be noted that the configuration server refers to a central service or system responsible for storing, managing and distributing business configuration information, representing the authoritative source of all configuration data to provide configuration reading, updating, monitoring and distribution functions. In one embodiment, the configuration server is a configuration center in a microservice architecture, which is used to manage and maintain configuration information in a distributed system. The configuration center centrally stores and manages the configuration data of all microservices, making configuration updates and distribution more efficient and consistent, thereby achieving centralized management of microservice configurations, dynamic configuration updates, and environmental isolation (i.e., different configurations can be maintained for different environments (such as development, testing, and production) to ensure isolation between environments), etc., for subsequent.

[0056] It should be further explained that the configuration change notification refers to a message or signal sent by the configuration server to the subscriber (subscription server) to inform the subscriber that the configuration information has changed so that the subscriber can take corresponding actions, such as updating the local configuration cache, including the configuration change type, configuration change information, timestamp (time when the change occurred) and version number (configuration version information), etc., which are not limited here.

[0057] Furthermore, the configuration change type refers to the type of change that occurs in the configuration data, including Create (new configuration items are added to the configuration library), Update (existing configuration items are modified), Delete (existing configuration items are removed), and Reset (configuration is restored to a certain historical state or default state), etc., which are not limited here. In addition, the configuration change information refers to which specific configuration items have changed and the details of the changes, including the identifier of the configuration item, such as the key name or path of the configuration item; the new configuration value, such as the value of the changed configuration item; metadata, that is, other information about the configuration item, such as description, source, owner, etc., which can be set according to actual conditions and are not limited here.

[0058] Specifically, the configuration change notification sent by the configuration server is received. In one embodiment, the received notification is generally processed by a load balancing device (such as F5 BIG-IP) for load balancing, so that a large number of concurrent connections and high throughput can be processed by the device to improve transmission performance. It can also ensure high availability of services through health checks and failover mechanisms, support multiple load balancing algorithms and strategies, and provide multi-level security protection, including data encryption, access control, etc.

[0059] In addition, since both the subscription server and the configuration server are based on the microservice architecture, that is, this method does not need to introduce a new technology stack, and can directly rely on microservice calls to be implemented. The underlying layer is HTTP and TCP, and there is no need to introduce new technical components, such as kafka, zookeeper, etc., which reduces the technical complexity of the project.

[0060] Step S12: based on the configuration change type and the configuration change information, updating the corresponding configuration table in the preset local configuration library;

[0061] It should be noted that the preset local configuration library refers to a database or file system for storing configuration data that is pre-set on the subscription server in each microservice instance. It can be in the form of an in-memory database, a configuration file (such as JSON, YAML, .properties file), etc., and is not limited here. The configuration table refers to a table or file used to store specific types of configuration data in the configuration library. These tables can be database tables, configuration files, or any form of collections used to organize and store configuration items, including configuration item names, configuration values ​​(such as URLs, numbers, strings, etc.), description information of configuration items (explaining the purpose and impact of the configuration item), data type (data type of configuration value, such as integers, strings, Boolean values, etc.) and update time (the time when the configuration item was last updated, which helps track the change history of the configuration), etc.

[0062] It should be further explained that the configuration table setting can support the isolation of different types of configurations by table. Since there is little logical isolation design for different types of business configurations in the current configuration center architecture, that is, the core configuration and general business configuration may use the same layer of logical structure, the user can perform personalized expansion according to their own business scenarios, and complete the logical isolation from the general business configuration at the data table level by customizing a configuration table specifically for their own business scenarios, ensuring independence from other business configurations or public configurations.

[0063] Specifically, according to the configuration table identifier in the configuration change information, the corresponding configuration table is queried in the preset local configuration library, and then according to the configuration change type and the configuration change value in the configuration change information and other information, the corresponding configuration table in the preset local configuration library is updated, thereby achieving the purpose of implanting the configuration expression into the subscriber's own database for persistent configuration. When the configuration center service is abnormal, the subscriber can still read the configuration that has been persisted to its own business library normally, which greatly ensures the high availability of the configuration and reduces the dependence on the configuration server.

[0064] Step S13: Based on the configuration table, executing the subscription service corresponding to the configuration table.

[0065] It should be noted that the subscription service refers to the business service corresponding to the configuration table, which can be set according to actual conditions and is not limited here.

[0066] Specifically, a service call request from a subscriber is obtained, and then a configuration table corresponding to the service call request is determined according to the service call request, thereby reading the business configuration information in the configuration table to execute the subscription service corresponding to the configuration table through the business configuration information.

[0067] This embodiment receives a configuration change notification sent by a configuration server, wherein the configuration change notification includes a configuration change type and configuration change information, and then based on the configuration change type and the configuration change information, updates a corresponding configuration table in a preset local configuration library, thereby executing a subscription service corresponding to the configuration table based on the configuration table, thereby achieving the purpose of persistent configuration, so that when an abnormality occurs in the configuration server, the subscriber can still normally read the configuration table that has been persisted to its own business library, thereby ensuring high availability of the business configuration, reducing dependence on the configuration server, maintaining continuous and normal operation of the business configuration, and effectively reducing system risks.

[0068] In a feasible implementation manner, the method further includes:

[0069] Step S21, receiving a configuration table verification request sent by the configuration server;

[0070] It should be noted that the configuration table check request refers to a request initiated by the configuration server, requiring the subscription server to check the configuration data, including check instructions, check configuration table information, timestamp or version number and identity authentication information.

[0071] Step S22, determining a configuration table to be checked based on the configuration table check information in the configuration table check request;

[0072] It should be noted that the configuration table verification information refers to the information used to determine which specific configuration data needs to be verified after receiving a configuration table verification request, including the configuration table identifier, the configuration items to be verified, the source of the configuration items, the last update time, etc., for verification and auditing.

[0073] Specifically, the configuration table to be checked is determined according to the configuration table check information in the configuration table check request. For example, the configuration table to be checked is determined by querying the configuration table identifier and the preset local configuration library. Furthermore, the corresponding configuration items in the configuration table can be extracted according to the configuration items to be checked, thereby improving the flexibility of the configuration table check.

[0074] Step S23: Calculate a second configuration table check value based on the configuration table, and send the second configuration table check value to the configuration server.

[0075] It should be noted that the second configuration table verification value refers to the verification value (such as MD5 hash value) calculated by the subscription server based on the locally stored configuration data, which is used to compare with the verification value provided by the configuration server to verify the consistency of the configuration data.

[0076] Specifically, according to the configuration items that need to be checked in the configuration table (usually a full check), the second configuration table check value is calculated. In one embodiment, each of the configuration items is calculated by a hash algorithm to obtain the corresponding MD5 value, and the MD5 values ​​are associated and combined to generate the second configuration table check value, and then the second configuration table check value is sent to the configuration server to perform configuration table data verification.

[0077] This embodiment receives a configuration table verification request sent by the configuration server, and then determines the configuration table to be verified based on the configuration table verification information in the configuration table verification request, thereby calculating a second configuration table verification value based on the configuration table, and sending the second configuration table verification value to the configuration server, thereby ensuring that the local configuration of all subscribed services is consistent with the configuration of the configuration server, avoiding abnormal service behavior due to configuration differences, ensuring data consistency, and promptly discovering errors or omissions in the configuration synchronization process, thereby enhancing the reliability and stability of the entire system. In addition, automatic verification is implemented to reduce manual intervention and reduce problems caused by human operational errors.

[0078] Based on this, the embodiment of the present application provides a configuration management method based on a microservice architecture. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the configuration management method based on microservice architecture of this application.

[0079] In a feasible implementation manner, after executing the subscription service corresponding to the configuration table based on the configuration table, the method further includes:

[0080] Step S31, obtaining the configuration execution effect after executing the subscription service;

[0081] It should be noted that the configuration execution effect refers to the performance and feedback of the system or service in actual operation after the changed configuration table is applied, including the impact of the configuration change on system performance, stability, resource utilization, etc. Specific indicators include performance indicators (such as response time, throughput, error rate, etc.), resource utilization (including CPU usage, memory usage, disk I / O, network traffic, etc.), stability and reliability (such as number of system crashes, service interruption time, recovery speed, etc.) and user feedback (including satisfaction surveys, error reports, etc.), logs and monitoring data, etc.

[0082] Specifically, the configuration execution effect after executing the subscription service can be obtained through system tools and user feedback reports, etc., which are not limited here and can be set according to actual conditions.

[0083] Step S32, inputting the configuration execution effect, the configuration change type in the configuration table, and the configuration change information into a business configuration optimization model to obtain a configuration optimization solution output by the business configuration optimization model;

[0084] It should be noted that the configuration optimization plan refers to an optimization plan generated by a series of suggestions or automatically adjusted configuration parameters proposed by a configuration optimization model or tool based on the analysis of the configuration execution effect, aiming to improve the performance, stability and resource utilization of the system. The configuration optimization plan includes parameter adjustment suggestions, resource allocation optimization (such as increasing or decreasing the number of service instances, adjusting load balancing strategies, etc.), performance improvement measures (such as optimizing database queries, improving algorithm efficiency, etc.), fault prevention strategies, security and compliance suggestions, and implementation plans.

[0085] It should be further explained that the training process of the business configuration optimization model is: obtaining several groups of historical configuration execution effects, configuration change types and configuration change information in several configuration tables, and then performing data preprocessing on each of the historical configuration execution effects, configuration change types and configuration change information in several configuration tables, such as data cleaning, normalization, etc., so as to input each of the historical configuration execution effects, configuration change types and configuration change information in several configuration tables into the initial business configuration optimization model, and obtain the predicted value output by the initial business configuration optimization model, and then based on the predicted value and the sample label, use the loss function to calculate the model loss value. In this embodiment, the loss function can be set according to actual needs and is not specifically limited here. After the model loss value is calculated, the training process ends, and the error back propagation algorithm is used to update the model parameters in the initial business configuration optimization model before the next training. During the training process, determine whether the updated initial business configuration optimization model meets the preset training end conditions. If so, the updated initial business configuration optimization model is used as the business configuration optimization model. If not, continue to train the model, wherein the preset training end conditions include loss convergence and reaching the maximum number of iterations threshold, etc.

[0086] Step S33: Optimize the configuration table based on the configuration optimization solution.

[0087] Specifically, the configuration table is optimized according to the configuration optimization plan. Preferably, before the optimization is performed, the configuration optimization plan can be pushed to the security management personnel for evaluation to prevent optimization failure and insufficient optimization performance. The system can also evaluate the configuration optimization plan and calculate the score, so as to determine whether to optimize the plan based on the plan score to ensure the accuracy and feasibility of the optimization.

[0088] This embodiment obtains the configuration execution effect after executing the subscription service, and then inputs the configuration execution effect, the configuration change type in the configuration table and the configuration change information into the business configuration optimization model to obtain the configuration optimization plan output by the business configuration optimization model, and then optimizes the configuration table based on the configuration optimization plan, and then continuously improves the configuration plan to adapt to the ever-changing business needs and system environment, thereby effectively improving the performance, quality and response speed of the business configuration service, improving resource utilization, and realizing automated adjustment and optimization, reducing the need for manual intervention, and integrating a large amount of historical configuration experience to reduce configuration problems caused by human errors, and supporting decisions through data to make more reasonable configuration adjustments and optimizations.

[0089] Based on this, the embodiment of the present application provides a configuration management method based on a microservice architecture. Figure 3 , Figure 3 This is a flow chart of the third embodiment of the configuration management method based on microservice architecture of this application.

[0090] In this embodiment, the configuration management method based on the microservice architecture includes steps S41 to S43:

[0091] Step S41, obtaining the configuration change type and configuration change information;

[0092] It should be noted that the subscription server refers to a service instance or service node that has subscribed to configuration update notifications, and is responsible for monitoring and responding to configuration change notifications from the configuration server, and then updating its own configuration status. Among them, monitoring can be achieved through some form of event subscription mechanism, such as WebSocket, long polling, server-sent events (Server-Sent Events, SSE), etc., which are not limited here.

[0093] Specifically, the configuration change type and configuration change information may be obtained through manual configuration by a management staff or according to information in a configuration optimization plan, which is not limited here and may be set according to actual conditions.

[0094] Step S42, generating a configuration change notification based on the configuration change type and the configuration change information;

[0095] Specifically, the configuration change type, the configuration change information, and the current time and other information are associated and combined to generate a configuration change notification.

[0096] Step S43: Send the configuration change notification to the subscription server so that the subscription server can execute the subscription service corresponding to the configuration table.

[0097] Specifically, the configuration change notification is sent to the subscription server so that the subscription server can execute the subscription service corresponding to the configuration table, wherein the sending method is based on high-availability parameter push at the database level, that is, referring to the master-slave implementation of the high-availability cluster and the push subscription implementation of the middleware, the parameter push process is abstracted into a master library-multiple subscription library mode, that is, the configuration server serves as a global centralized configuration library, which contains various configuration tables, and the subscription server subscribes to the configuration table to be used according to its own business processing scope, so that when the configuration server detects changes in the local table, it will notify the corresponding subscription server in real time to update the configuration table, and then the subscription server updates the local configuration table to achieve configuration persistence. Even if the configuration server crashes abnormally, the microservice bound to the subscription server can still use the various business configurations under its local table normally, or because of a sharp increase in traffic, when the configuration server service is abnormal, the subscription server can still expand new service instances, thereby effectively reducing the subscriber's dependence on the configuration server. In addition, in order to ensure that each push task can be processed to the final state, a task status field is added to the push task at the database layer to achieve real-time monitoring of the status of the push task.

[0098] In one embodiment, the configuration server implements the parameter change interface exposed to the outside through a custom interface (that is, develops a set of standardized application programming interfaces (APIs) that allow external systems or services to query, update, add or delete configuration parameters). Take the parameter adding interface as an example: such as protected abstractConfigPushParaminsert(JsonMessage request), where request is the parameter adding request passed in by the front end, including the information of the newly added parameters. The configuration party places the parameters in the custom personalized configuration table according to the newly added parameter information. The return parameter ConfigPushParam includes which subscribers need to be notified after the parameter configuration is changed, for example, the three microservices A, B, and C need to be notified to make corresponding changes.

[0099] In addition, since the configuration server is implemented based on the microservice architecture, there is no need to build a cluster specifically for the configuration server, which effectively reduces the difficulty of implementation and is lighter in architecture. If the microservice architecture is already used within the enterprise, it can be directly introduced and deployed without worrying about introducing third-party components to increase the complexity of the architecture and increase operation and maintenance costs.

[0100] This embodiment obtains the configuration change type and configuration change information, and then generates a configuration change notification based on the configuration change type and the configuration change information, and then sends the configuration change notification to the subscription server, so that the subscription server executes the subscription service corresponding to the configuration table, thereby achieving the purpose of persistent configuration. Therefore, when an exception occurs in the configuration server, the subscriber can still normally read the configuration table that has been persisted to its own business library, thereby ensuring the high availability of the business configuration, reducing the dependence on the configuration server, maintaining the continuous normal operation of the business configuration, and effectively reducing the system risk.

[0101] In a feasible implementation manner, the method further includes:

[0102] Step S51, based on a preset check rule, generating a configuration table check request, and calculating a first configuration table check value, wherein the configuration table check request includes check configuration table information;

[0103] It should be noted that the preset check rules refer to pre-set rules for triggering configuration table checks, such as periodic configuration table checks, checks at user-specified times, and checks when system failures occur, etc. They can be set according to actual conditions and are not limited here.

[0104] It should be further explained that the first configuration table verification value refers to the verification value (such as MD5 hash value) calculated by the configuration server based on the locally stored configuration data, which is used to compare with the verification value provided by the subscription server to verify the consistency of the configuration data.

[0105] Specifically, according to preset verification rules, a configuration table verification request is generated. For example, when a verification click event initiated by a user is received, a configuration table verification request is generated, and a first configuration table verification value is calculated, wherein the first configuration table verification value can be calculated based on the configuration items to be verified in the configuration table (usually a full verification). In one embodiment, each of the configuration items is calculated by a hash algorithm to obtain the corresponding MD5 value, and the values ​​are associated and combined to generate the first configuration table verification value.

[0106] Step S52, sending the configuration table check request to the subscription server to receive the second configuration table check value returned by the subscription server;

[0107] Step S53, obtaining a configuration table verification result based on the first configuration table verification value and the second configuration table verification value.

[0108] It should be noted that the configuration table verification result refers to the result of verifying the first configuration table verification value in the configuration server with the second configuration table verification value in the subscription server, including a verification consistent result and a verification inconsistent result.

[0109] Specifically, the first configuration table check value and the second configuration table check value are matched. For example, when the first configuration table check value and the second configuration table check value are MD5 values, the two are compared to obtain a configuration table check result.

[0110] Furthermore, if the configuration table verification result is an inconsistent verification result, a verification failure alarm is generated and pushed to the security management personnel for the security management personnel to check to ensure the normal operation of the system business and maintain system stability.

[0111] This embodiment generates a configuration table verification request based on preset verification rules, and calculates a first configuration table verification value, wherein the configuration table verification request includes configuration table verification information, and then sends the configuration table verification request to the subscription server to receive a second configuration table verification value returned by the subscription server, thereby obtaining a configuration table verification result based on the first configuration table verification value and the second configuration table verification value, thereby ensuring that the configuration data of the configuration server and the subscription server remain synchronized and consistent, avoiding service behavior errors caused by configuration differences, thereby timely discovering configuration inconsistencies, reducing system failures and instability caused by configuration errors, and verifying the integrity of the configuration data during transmission and application to ensure that no data is lost or tampered with, thereby effectively enhancing system security and improving operation and maintenance efficiency.

[0112] Based on this, the embodiment of the present application provides a configuration management method based on a microservice architecture. Figure 4 , Figure 4 This is a flow chart of the fourth embodiment of the configuration management method based on microservice architecture of this application.

[0113] In a feasible implementation manner, before obtaining the configuration change type and the configuration change information, the method further includes:

[0114] Step S61, determining whether the subscription server is performing service configuration for the first time;

[0115] Specifically, whether the subscription server is performing service configuration for the first time can be determined by querying and checking the configuration storage, configuration status flag, and configuration synchronization log, etc., which is not limited here.

[0116] Step S62: If yes, obtain the full content of the configuration table;

[0117] It should be noted that the full content refers to the complete set of all configuration data related to the configuration table, including all configuration items and their values, and possible metadata, such as the description, source, version, etc. of the configuration.

[0118] Step S63: Based on the data structure type corresponding to the full content, the full content is sent to the subscription server for configuration by the subscription server.

[0119] It should be noted that the data structure type refers to the way of storing and organizing data, including JSON (JavaScript Object Notation), XML (eXtensible Markup Language), YAML (YAML Ain't Markup Language), database table and binary format, etc., which are not limited here.

[0120] Specifically, based on the data structure type corresponding to the full content, the full content is sent to the subscription server for configuration by the subscription server. For example, if the data structure type is JSON, it can be pushed by sending JSON strings via RESTAPI, WebSocket or message queues (such as Kafka, RabbitMQ), so that it is easy to use across platforms; if the data structure type is XML, the XML document is transmitted via HTTP or other network protocols; if the data structure type is YAML, the YAML text is sent via API or file transfer. The push methods can be used in combination, which is not limited here and can be set according to actual conditions.

[0121] This embodiment determines whether the subscription server is configuring the service for the first time, and if so, obtains the full content of the configuration table, and then sends the full content to the subscription server based on the data structure type corresponding to the full content, so that the subscription server can configure it. For the newly added subscription server, the complete configuration data can be directly obtained, which simplifies the configuration initialization process, improves the configuration synchronization efficiency, supports flexible expansion, and improves the configuration synchronization efficiency.

[0122] In a feasible implementation manner, after sending the configuration change notification to the subscription server so that the subscription server executes the subscription service corresponding to the configuration table, the method further includes:

[0123] Step S71, detecting whether a successful reception notification returned by the subscription server is received according to a preset time;

[0124] It should be noted that the successful reception notification refers to a confirmation message sent by the subscription server to the configuration server after successfully receiving and processing the configuration change notification from the configuration server, including a notification ID, timestamp, server identifier, and processing status.

[0125] Specifically, it is detected whether a successful reception notification returned by the subscription server is received according to a preset time, wherein the preset time can be set according to actual conditions and is not limited here, so as to determine the processing status of the configuration task in real time.

[0126] Step S72: if not, a reception failure alarm is generated and pushed to the security management personnel;

[0127] It should be noted that the reception failure alarm refers to a warning message generated by the system when the subscription server fails to successfully receive or process the configuration change notification, including the error code or exception type of the failure reason, error description, notification ID, timestamp and recommended measures, etc.

[0128] Specifically, if not, a reception failure alarm is generated based on the failure time and other information, and the reception failure alarm is pushed to the security management personnel, wherein the push can be performed through APP notifications, mini programs, etc., and there is no restriction here.

[0129] Step S73: based on the reception failure alarm, resend the configuration change notification to the subscription server.

[0130] Specifically, based on the reception failure alarm, the configuration change notification is resent to the subscription server, wherein the reason for the reception failure is determined based on the reception failure alarm, and the push task query interface can be entered to query according to the custom configuration table name and the push target service to determine the configuration table information of the reception failure, thereby triggering the push mechanism and quickly re-pushing. In addition, when the configuration server detects that the push fails due to temporarily unrecoverable problems such as code, the push task can be revoked in the interface to avoid affecting subsequent processes.

[0131] This embodiment detects whether a successful reception notification returned by the subscription server is received according to a preset time, and if not, generates a reception failure alarm, and pushes the reception failure alarm to the security management personnel, so as to resend the configuration change notification to the subscription server based on the reception failure alarm, thereby ensuring that the configuration change can be reliably communicated to the subscription server, improving the stability and reliability of the entire system, and promptly discovering problems in the configuration distribution process, such as network failures, server errors, etc., to ensure that the configurations of all subscription servers remain up to date and consistent, and avoid problems caused by inconsistent configurations.

[0132] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0133] This application also provides a configuration management device based on microservice architecture, please refer to Figure 5 , the configuration management device based on microservice architecture includes:

[0134] The subscription module 51 is used to receive a configuration change notification sent by the configuration server, wherein the configuration change notification includes a configuration change type and configuration change information; based on the configuration change type and the configuration change information, update the corresponding configuration table in the preset local configuration library; based on the configuration table, execute the subscription service corresponding to the configuration table;

[0135] The configuration module 52 is used to obtain the configuration change type and configuration change information; generate a configuration change notification based on the configuration change type and the configuration change information; and send the configuration change notification to the subscription server so that the subscription server executes the subscription service corresponding to the configuration table.

[0136] The configuration management device based on microservice architecture is also used for:

[0137] Receive a configuration table verification request sent by the configuration server;

[0138] Determining a configuration table to be checked based on the configuration table check information in the configuration table check request;

[0139] Based on the configuration table, a second configuration table verification value is calculated, and the second configuration table verification value is sent to the configuration server.

[0140] The configuration management device based on microservice architecture is also used for:

[0141] Get the configuration execution effect after executing the subscription service;

[0142] Inputting the configuration execution effect, the configuration change type in the configuration table, and the configuration change information into a business configuration optimization model to obtain a configuration optimization solution output by the business configuration optimization model;

[0143] Based on the configuration optimization scheme, the configuration table is optimized.

[0144] The configuration management device based on microservice architecture is also used for:

[0145] Based on the preset checking rule, a configuration table checking request is generated, and a first configuration table checking value is calculated, wherein the configuration table checking request includes checking configuration table information;

[0146] Sending the configuration table check request to the subscription service end to receive the second configuration table check value returned by the subscription service end;

[0147] A configuration table verification result is obtained based on the first configuration table verification value and the second configuration table verification value.

[0148] The configuration management device based on microservice architecture is also used for:

[0149] Determine whether the subscription server is performing business configuration for the first time;

[0150] If yes, get the full content of the configuration table;

[0151] Based on the data structure type corresponding to the full content, the full content is sent to a subscription service end for configuration by the subscription service end.

[0152] The configuration management device based on microservice architecture is also used for:

[0153] Check whether the subscription service has received a successful notification based on the preset time.

[0154] If not, a reception failure alarm is generated and pushed to the security management personnel;

[0155] Based on the reception failure alarm, the configuration change notification is resent to the subscription service end.

[0156] The configuration management device based on microservice architecture provided by the present application adopts the configuration management method based on microservice architecture in the above-mentioned embodiment, which can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the configuration management device based on microservice architecture provided by the present application are the same as the beneficial effects of the configuration management method based on microservice architecture provided by the above-mentioned embodiment, and the other technical features in the configuration management device based on microservice architecture are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0157] The present application provides a configuration management device based on a microservice architecture, and the configuration management device based on the microservice architecture includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the configuration management method based on the microservice architecture in the above-mentioned embodiment 1.

[0158] Reference below Figure 6, which shows a schematic diagram of the structure of a configuration management device based on a microservice architecture suitable for implementing an embodiment of the present application. The configuration management device based on a microservice architecture in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The configuration management device based on the microservice architecture shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Figure 6 As shown, the configuration management device based on the microservice architecture may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the configuration management device based on the microservice architecture are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the configuration management device based on the microservice architecture to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a configuration management device based on the microservice architecture with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0160] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0161] The configuration management device based on microservice architecture provided by the present application adopts the configuration management method based on microservice architecture in the above embodiment, which can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the configuration management device based on microservice architecture provided by the present application are the same as the beneficial effects of the configuration management method based on microservice architecture provided by the above embodiment, and the other technical features in the configuration management device based on microservice architecture are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0162] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0164] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the configuration management method based on the microservice architecture in the above-mentioned embodiment.

[0165] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0166] The above-mentioned computer-readable storage medium may be included in the configuration management device based on the microservice architecture; or it may exist independently without being assembled into the configuration management device based on the microservice architecture.

[0167] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the configuration management device based on the microservice architecture, the configuration management device based on the microservice architecture:

[0168] Receive a configuration change notification sent by the configuration server, wherein the configuration change notification includes a configuration change type and configuration change information;

[0169] Based on the configuration change type and the configuration change information, update the corresponding configuration table in the preset local configuration library;

[0170] Based on the configuration table, a subscription service corresponding to the configuration table is executed.

[0171] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0172] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0173] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0174] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned configuration management method based on microservice architecture, and can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the configuration management method based on microservice architecture provided by the above-mentioned embodiment, and will not be repeated here.

[0175] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the configuration management method based on the microservice architecture as described above.

[0176] The computer program product provided in this application can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the configuration management method based on microservice architecture provided in the above embodiment, which will not be repeated here.

[0177] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A configuration management method based on microservice architecture, characterized in that: The method is applied to a subscription service end, and includes: Receive a configuration change notification sent by the configuration server, wherein the configuration change notification includes a configuration change type and configuration change information; Based on the configuration change type and the configuration change information, update the corresponding configuration table in the preset local configuration library; Based on the configuration table, a subscription service corresponding to the configuration table is executed.

2. The configuration management method based on microservice architecture according to claim 1, characterized in that: The method further comprises: Receive a configuration table verification request sent by the configuration server; Determining a configuration table to be checked based on the configuration table check information in the configuration table check request; Based on the configuration table, a second configuration table verification value is calculated, and the second configuration table verification value is sent to the configuration server.

3. The configuration management method based on microservice architecture according to claim 1, characterized in that: After executing the subscription service corresponding to the configuration table based on the configuration table, the method further includes: Get the configuration execution effect after executing the subscription service; Inputting the configuration execution effect, the configuration change type in the configuration table, and the configuration change information into a business configuration optimization model to obtain a configuration optimization solution output by the business configuration optimization model; Based on the configuration optimization scheme, the configuration table is optimized.

4. A configuration management method based on microservice architecture, characterized in that: The method is applied to configure the server, including: Get the configuration change type and configuration change information; Generate a configuration change notification based on the configuration change type and the configuration change information; The configuration change notification is sent to a subscription service end so that the subscription service end executes the subscription service corresponding to the configuration table.

5. The configuration management method based on microservice architecture according to claim 4, characterized in that: The method further comprises: Based on the preset checking rule, a configuration table checking request is generated, and a first configuration table checking value is calculated, wherein the configuration table checking request includes checking configuration table information; Sending the configuration table check request to the subscription service end to receive the second configuration table check value returned by the subscription service end; A configuration table verification result is obtained based on the first configuration table verification value and the second configuration table verification value.

6. The configuration management method based on microservice architecture according to claim 4, characterized in that: Before obtaining the configuration change type and configuration change information, the method further includes: Determine whether the subscription server is performing business configuration for the first time; If yes, get the full content of the configuration table; Based on the data structure type corresponding to the full content, the full content is sent to a subscription service end for configuration by the subscription service end.

7. The configuration management method based on microservice architecture according to claim 4, characterized in that: After sending the configuration change notification to the subscription server so that the subscription server executes the subscription service corresponding to the configuration table, the method further includes: Check whether the subscription service has received a successful notification based on the preset time. If not, a reception failure alarm is generated and pushed to the security management personnel; Based on the reception failure alarm, the configuration change notification is resent to the subscription server.

8. A configuration management device based on microservice architecture, characterized in that: include: A subscription module, configured to receive a configuration change notification sent by a configuration server, wherein the configuration change notification includes a configuration change type and configuration change information; based on the configuration change type and the configuration change information, update a corresponding configuration table in a preset local configuration library; based on the configuration table, execute a subscription service corresponding to the configuration table; The configuration module is used to obtain the configuration change type and the configuration change information; generate a configuration change notification based on the configuration change type and the configuration change information; and send the configuration change notification to the subscription service end so that the subscription service end executes the subscription service corresponding to the configuration table.

9. A configuration management device based on microservice architecture, characterized in that: The configuration management device based on microservice architecture includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the configuration management method based on microservice architecture as described in any one of claims 1-3 or 4-7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the configuration management method based on the microservice architecture as described in any one of claims 1-3 or 4-7 are implemented.

Citation Information

Patent Citations

  • Distributed system and configuration information updating method in distributed system

    CN104092718A

  • Configuration information updating method and device under micro-service architecture and electronic equipment

    CN112882738A

  • Service configuration dynamic updating method and system, electronic equipment and readable storage medium

    CN113067725A

  • File checking method and device, electronic equipment and storage medium

    CN114722008A

  • Data checking method, device and system and electronic equipment

    CN115080805A