Configuration content acquisition method for multi-machine room service, electronic equipment and storage medium

By introducing a combination of proxy services and application services in multi-computer room services, using key-value storage and reverse proxy server to realize cache and off-site switching of configuration content, the complexity and stability of cross-computer room service configuration acquisition is solved, ensuring that Timely acquisition and high availability of configuration content reduce network bandwidth usage and service impact.

CN119179682APending Publication Date: 2024-12-24BAIRONG FINANCIAL INFORMATION SERVICE CO LTD

Patent Information

Application Number
CN202310745097.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing multi-computer room service configuration acquisition method is complex and difficult to maintain. When accessing configuration across computer rooms, it is easy to cause network blockage and service instability, especially in the event of network failure, which cannot obtain configuration content in time, affecting business continuity.

Method used

Using the combination of proxy service subsystem and application service subsystem, the cache and off-site switching of configuration content are achieved through key-value storage and reverse proxy server, and the long polling mechanism and virtual routing redundant protocol ensure high availability and order of configuration content. renew.

Benefits of technology

It reduces the network bandwidth usage of cross-computer room access, realizes timely acquisition and high availability of configuration content, avoids the impact of network failures on other computer rooms, and ensures global service stability and the effect of multiple places and multiple places.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179682A_ABST
    Figure CN119179682A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration content acquisition method for multi-machine room service, each machine room is provided with a proxy service subsystem and an application service subsystem, the method comprises the following steps: a configuration end writes configuration content into a key value storage subsystem to generate change event information, and the change event information comprises a storage version message; the proxy service subsystem of each machine room monitors change event information of the key value storage subsystem, obtains a storage version message, pulls configuration content from the key value storage subsystem according to the storage version information, and stores the configuration content in a local cache; and the application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain the configuration content. The requirement for obtaining the configuration content through cross-machine-room access of the application service is reduced, the configuration content can be obtained in time, and when the proxy service fails, the configuration content can be obtained from the proxy service of the remote machine room. The invention further provides a corresponding system, electronic equipment and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer networks, and in particular to a method for acquiring configuration content of a multi-computer room service. In addition, the present application also relates to a related system, an electronic device, and a computer-readable storage medium. Background Art

[0002] When an application is started and running, it often needs to read some configuration content. Configuration basically accompanies the entire life cycle of the application. There are currently several existing ways for applications to obtain configuration: Disconf, SpringCloud Config, Apollo, and Nacos. However, these existing methods are complex to implement and difficult to maintain. They involve relatively more components and the access to configuration is centralized. They cannot solve the problem of cross-computer room access for services deployed in multiple computer rooms and configuration acquisition. For example, when a service is deployed in multiple computer rooms, when the configuration used by the same service in multiple computer rooms or multiple services in multiple computer rooms triggers the service to pull the changed configuration after the change, cross-computer room access will occur. If there is a problem with the network across computer rooms at this time, the service will not be able to obtain the configuration in time, which will have a certain impact on the service and business. At the same time, when all cross-computer room services access the configuration, it is easy to cause the network bandwidth across computer rooms to be occupied, which will eventually affect the overall service stability.

[0003] The content of this background technology description is only for facilitating understanding of the relevant technology in this field and is not regarded as an admission of the prior art. Summary of the invention

[0004] Therefore, the embodiment of the present invention intends to provide a method for obtaining configuration content of multi-computer room services, which can reduce the need for application services to access and obtain configuration content across computer rooms, can obtain configuration content in a timely manner, and support obtaining configuration content from a proxy service in a remote computer room when the proxy service fails. Specifically, the embodiment of the present invention provides a method for obtaining configuration content of multi-computer room services, each computer room is provided with a proxy service subsystem and an application service subsystem, and the method includes the following steps:

[0005] The configuration end writes the configuration content into the key-value storage subsystem and generates change event information, wherein the change event information includes a storage version message;

[0006] The proxy service subsystem of each computer room monitors the change event information of the key-value storage subsystem, obtains the storage version message, pulls the configuration content from the key-value storage subsystem according to the storage version information, and stores it in the local cache;

[0007] The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, wherein a reverse proxy server is deployed between the proxy service subsystem and the application service subsystem, and the reverse proxy server is configured with the proxy service pointing strategy that can be switched among multiple computer rooms, and the application service subsystem accesses the proxy service subsystems of different computer rooms through the proxy service pointing strategy.

[0008] In some embodiments of the present invention, the method further comprises:

[0009] The configuration end writes the configuration content into the database subsystem, wherein the database subsystem includes mutually master-slave databases, the proxy service subsystem accesses the database through a virtual routing redundancy protocol, and the application service subsystem accesses the database subsystem through the proxy service subsystem.

[0010] In some embodiments of the present invention, the method further comprises:

[0011] When the proxy service subsystem fails to access a database, the proxy service subsystem accesses other databases through a virtual routing redundancy protocol.

[0012] In some embodiments of the present invention, the application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, including:

[0013] The application service subsystem accesses the proxy service subsystem located in the same computer room through a long polling mechanism to obtain configuration content;

[0014] When the application service subsystem fails to access the proxy service subsystem located in the same computer room, the reverse proxy server switches the proxy service pointing strategy;

[0015] The application service subsystem accesses the proxy service subsystem of the remote computer room through a long polling mechanism to obtain configuration content.

[0016] In some embodiments of the present invention, pulling configuration content from the key-value storage subsystem according to the storage version information and storing it in the local cache includes:

[0017] When the proxy service subsystem determines that the monitored storage version information is greater than the storage version information in the local cache, it pulls the configuration content for local cache storage.

[0018] In some embodiments of the present invention, the pulling of configuration content for local cache storage includes:

[0019] Merge and store the configuration contents of the same type to generate merged configuration contents;

[0020] The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, including:

[0021] Returns the merged configuration content related to the configuration request type according to the configuration content request of the application service subsystem.

[0022] In some embodiments of the present invention, the proxy service subsystem is deployed via a cloud-native architecture.

[0023] In some embodiments of the present invention, the configuration content includes initial configuration content and / or configuration change content.

[0024] The embodiment of the present invention also provides a configuration content acquisition system for multi-computer room services, including a configuration terminal, a key-value storage subsystem, a proxy service subsystem and an application service subsystem deployed in each computer room, and also includes a reverse proxy server deployed between the proxy service subsystem and the application service subsystem, wherein:

[0025] The key-value storage subsystem is configured to receive configuration content from the configuration terminal and generate change event information, wherein the change event information includes a storage version message;

[0026] The proxy service subsystem is configured to monitor the change event information of the key-value storage subsystem, obtain the storage version message, pull the configuration content from the key-value storage subsystem according to the storage version information, and store it in the local cache;

[0027] The application service subsystem is configured to access the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content;

[0028] The reverse proxy server is configured with the proxy service pointing strategy that can be switched among multiple computer rooms, and the application service subsystem accesses the corresponding proxy service subsystem through the proxy service pointing strategy.

[0029] In some embodiments of the present invention, a database subsystem is further included, wherein the database subsystem includes a plurality of mutually master-slave databases;

[0030] The proxy service subsystem is configured to access the database via a virtual routing redundancy protocol;

[0031] The application service subsystem is configured to access the database subsystem through the proxy service subsystem.

[0032] In an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the configuration content acquisition method for a multi-computer room service of any embodiment of the present invention is implemented.

[0033] In an embodiment of the present invention, an electronic device is provided, including: a processor and a memory storing a computer program, wherein the processor is configured to execute any configuration content acquisition method for a multi-computer room service of an embodiment of the present invention when running the computer program.

[0034] The embodiment of the present invention proposes a configuration content acquisition method and system for multi-computer room services. The configuration end writes the configuration content into the key-value storage subsystem, triggers the key-value storage subsystem to generate a change event, and the change event contains storage version information (version information of the key key). The proxy service subsystem obtains the change event by monitoring the change event of the key-value storage subsystem, extracts the storage version information, and pulls the corresponding configuration content for local caching through the storage version information. The application service subsystem requests the configuration content from the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism. The proxy service subsystem returns the corresponding configuration content to the application service subsystem according to the request. A proxy service subsystem is set in each computer room. The application service subsystem of the local computer room accesses the proxy service subsystem according to the proxy service pointing strategy to obtain the configuration content, which reduces the problem of network congestion caused by centralized access. The version of the configuration content is judged by the storage version information, and the orderly change of the configuration content can be realized to avoid the occurrence of unplanned configuration rollback. The embodiment of the present invention continuously monitors the configuration change, does not lose the change event and the change version content of the configuration, ensures the sequentiality of the configuration change, and pulls the changed configuration in sequence. A network failure in a single computer room does not affect the proxy services and application services in other computer rooms to obtain configurations, thereby reducing the impact on business. When a network failure occurs, the application service can automatically switch to the proxy service in a remote computer room, and the proxy service can also automatically switch to a remote computer room to access the database. Through a multi-layer high-availability mechanism, the effect and benefits of multi-site multi-activity can be achieved. Giving priority to the application service local computer room to access the proxy service can effectively reduce the occurrence of bandwidth being occupied, thereby ensuring the stability of global services.

[0035] Other optional features and technical effects of the embodiments of the present invention are partially described below, and partially can be understood by reading this document. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The elements shown are not limited to the proportions shown in the accompanying drawings. The same or similar reference numerals in the accompanying drawings represent the same or similar elements, wherein:

[0037] Figure 1 The system structure diagram of the configuration content acquisition system of some multi-computer room services is shown;

[0038] Figure 2 It shows a structure diagram of a configuration content acquisition system for a multi-machine room service in an embodiment of the present invention;

[0039] Figure 3 An exemplary flow chart of a method for acquiring configuration content of a multi-machine room service according to an embodiment of the present invention is shown;

[0040] Figure 4 An exemplary flow chart showing a method for acquiring configuration content of a multi-machine room service according to some other embodiments of the present invention is shown;

[0041] Figure 5 An exemplary flow chart showing execution of business processing in a configuration content acquisition method for a multi-machine room service according to some other embodiments of the present invention is shown;

[0042] Figure 6 An exemplary flow chart showing the acquisition of configuration content by the application service subsystem in the configuration content acquisition method for multi-machine room services according to other embodiments of the present invention is shown;

[0043] Figure 7 An exemplary diagram of the equipment architecture of a computer room in a configuration content acquisition method for a multi-computer room service according to an embodiment of the present invention is shown;

[0044] Figure 8 An exemplary structural diagram of an electronic device capable of implementing the method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and drawings. Here, the exemplary implementation methods of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0046] In the embodiments of the present invention, "ETCD" refers to an open source, distributed key-value data storage system that provides shared configuration, service registration and discovery; "key" refers to the key in the key-value storage system; "Disconf" refers to software that provides distributed configuration management; "Spring Cloud Config" refers to the centralized external configuration support for microservices in the microservice architecture, and the configuration server provides a centralized external configuration for all environments of different microservice applications; "Apollo" refers to a distributed configuration center developed by a certain enterprise framework department; "Nacos" refers to building a service-centric application architecture; "nginx" refers to a high-performance HTTP (Hypertext Transfer Protocol) and reverse proxy web server; "vip" refers to a method of accessing through a virtual IP address; "cloud native" refers to a software development and deployment method based on containers, microservices and automated operation and maintenance, which can make applications more efficient, reliable and scalable, and is suitable for various cloud platforms.

[0047] like Figure 1 As shown, the inventors found that the existing solution for obtaining configuration changes is complex in deployment and has high maintenance costs, which is not conducive to the expansion of customized business function implementation and relies on too many components. By deploying a set of centralized system services, application services deployed in multiple computer rooms uniformly obtain configurations from the centralized system services. After a serious network failure, the configuration cannot be obtained or the changed configuration cannot be obtained in time. There are the following problems: complex deployment and high operation and maintenance costs; complex implementation and high development and maintenance costs; involving multiple external components, occupying resource costs; involving the problem of unavailability of cross-computer room access network failures.

[0048] The embodiment of the present invention proposes to solve this problem through a technology based on proxy services, so that these services avoid the problem of cross-computer room access configuration, can obtain the changed configuration in time, and provide an effective solution to the problem of obtaining changed configuration across computer rooms for services deployed in multiple computer rooms. In the embodiment of the present invention, the configuration end writes the configuration information into the key-value storage subsystem, the key-value storage subsystem generates a change event, the proxy service subsystem listens to the change event of the key-value storage subsystem, pulls the configuration content for local cache, and when the application service subsystem requests the configuration content through the long polling mechanism, the corresponding configuration content is returned. In the embodiment of the present invention, the configuration content is cached in multiple computer rooms, which can still provide high-availability services in the event of a single computer room network failure; when pulling the configuration, the service obtains it from the local computer room or the proxy service cache, which effectively solves the problem of a single computer room bandwidth being full and affecting global services.

[0049] Specifically, Figure 2 As shown, an embodiment of the present invention provides a configuration content acquisition system 200 for multi-computer room services, including a configuration terminal 220, a key-value storage subsystem 230, a proxy service subsystem 240 and an application service subsystem 250 deployed in each computer room, and also includes a reverse proxy server deployed between the proxy service subsystem 240 and the application service subsystem 250. In some embodiments, the reverse proxy server is, for example, an nginx server 260.

[0050] The key-value storage subsystem 230 is configured to receive the configuration content of the configuration terminal 220 and generate change event information, wherein the change event information includes a storage version message;

[0051] The proxy service subsystem 240 is configured to monitor the change event information of the key-value storage subsystem 230, obtain the storage version message, pull the configuration content from the key-value storage subsystem 230 according to the storage version information, and store it in the local cache;

[0052] The application service subsystem 250 is configured to access the proxy service subsystem 250 related to the proxy service pointing strategy to obtain configuration content through a long polling mechanism;

[0053] The reverse proxy server, such as the nginx server 260, is configured with the proxy service pointing strategy that can be switched among multiple computer rooms, and the application service subsystem 250 accesses the corresponding proxy service subsystem 240 through the proxy service pointing strategy.

[0054] In the system of the embodiment of the present invention, the proxy service subsystem monitors the change information of the key value storage subsystem, obtains the storage version information, extracts the corresponding configuration content according to the version information, and stores it locally. When the application service subsystem requests the proxy service subsystem to obtain the configuration content, the configuration content is returned.

[0055] In some embodiments of the present invention, the key-value storage subsystem may adopt ETCD. When the configuration end writes configuration content in the key-value storage subsystem, it sets the key key according to the type of configuration content, and the configuration content corresponds to the value value. When the configuration content is subsequently updated, when the configuration end writes the configuration content into ETCD, the key remains unchanged, the value is updated, and the storage version information of the key is updated. Generally, a self-increment update is performed. For example, the version information for the last write is v1, and the updated version information is v2.

[0056] In some embodiments of the present invention, the proxy service subsystem determines whether the configuration content of the local cache needs to be updated based on the storage version information. For example, if the version information in the local cache is v2 and the monitored storage version information is v2, local caching is not required.

[0057] The proxy service pointing strategy described in some embodiments of the present invention can provide a basis for the application service subsystem to access the proxy service subsystems of other computer rooms. In some emergency situations (such as the proxy service subsystem of the local computer room crashes), the configuration content request of the local application service subsystem can be transferred to the proxy service subsystem of the remote computer room for processing by switching the proxy service pointing strategy.

[0058] In some embodiments of the present invention, in order to avoid loss of configuration content after the proxy service subsystem is shut down, the embodiments of the present invention further store the configuration content permanently in a database. Specifically, the system of the embodiments of the present invention further includes a database subsystem 270, and the database subsystem 270 includes a plurality of mutually master-slave databases 271;

[0059] The proxy service subsystem 240 is configured to access the database 271 through a virtual routing redundancy protocol;

[0060] The application service subsystem 250 is configured to access the database subsystem 270 through the proxy service subsystem 240 .

[0061] In the embodiment of the present invention, the mutually master-slave databases 271 can perform master-slave backup, and through the virtual routing redundancy protocol, when a database 271 fails, it can switch to other databases 271 to obtain configuration content or access other data.

[0062] The application service subsystem 250 accesses the database through the proxy service subsystem 240, which can adapt to different load requirements and reduce the current limiting effect caused by network bandwidth.

[0063] In the embodiment of the present invention, the application service subsystem 240 accesses the proxy service subsystem 250 through a long polling mechanism, and can wait for the proxy service subsystem 250 to update the configuration content in the cache and then return the configuration content.

[0064] In some embodiments of the present invention, when the proxy service subsystem 240 fails to access the database 271, the proxy service subsystem 240 accesses other databases 271 through a virtual routing redundancy protocol.

[0065] The proxy service subsystem 240 accesses the database through a virtual IP address. For example, when currently accessing the main database, when the main database instance goes down, the virtual IP address can drift to the backup database, realizing imperceptible switching of the proxy service subsystem.

[0066] In order to reduce cross-computer room access to obtain configuration content, the application service subsystem 250 preferentially accesses the proxy service subsystem 240 in the same computer room. Specifically, the application service subsystem 250 accesses the proxy service subsystem 240 in the same computer room to obtain configuration content through a long polling mechanism.

[0067] When the application service subsystem 250 fails to access the proxy service subsystem 240 located in the same computer room, the reverse proxy server, such as the nginx server 260, switches the proxy service pointing strategy;

[0068] The application service subsystem 250 accesses the proxy service subsystem 240 of the remote computer room through a long polling mechanism to obtain configuration content.

[0069] For example, agent service subsystem agent_A and application service subsystem APP_A are deployed in computer room A, agent service subsystem agent_B and application service subsystem APP_B are deployed in computer room B, and nginx configures the proxy service pointing policy of application service subsystem APP_A to access proxy service subsystem agent_A. When access fails, nginx switches the proxy service pointing policy of application service subsystem APP_A to access proxy service subsystem agent_B, and obtains configuration content from proxy service subsystem agent_B.

[0070] In some embodiments of the present invention, in order to ensure orderly configuration content updates, the proxy service subsystem 240 in the embodiments of the present invention monitors the change event information, and does not pull the configuration content when it is determined that the storage version information is less than the local storage version information. When it is determined that it is greater than the local storage version information, the configuration content is pulled. Specifically, when the proxy service subsystem 240 determines that the monitored storage version information is greater than the storage version information in the local cache, the configuration content is pulled for local cache storage.

[0071] For example, the configuration end 220 writes the configuration content config1 into the key-value storage subsystem 230 for the first time. The key-value storage subsystem generates key1 and stores the configuration content config1 as the corresponding value1. The storage version information of key1 is v1, and change event information is generated. The proxy service subsystem 240 monitors the change event information. The change event information includes key1 and storage version information v1. The proxy service subsystem 240 does not store the storage version information locally. The proxy service subsystem 240 pulls the corresponding configuration content config1 from the key-value storage subsystem 230 according to key1, caches it locally, and stores the storage version information v1. When the configuration content needs to be updated later, the configuration end 220 writes the configuration change information config2 into the key-value storage subsystem 230, key1 remains unchanged, but the key-value storage subsystem 230 performs self-increment processing on the storage version information, generates storage version information v2, stores the configuration change information config2 as the corresponding value1, generates change event information, and the proxy service subsystem 240 monitors the change event information, determines that the storage version information v2 is greater than the locally cached storage version information v1, then pulls the corresponding change configuration content config2 according to key1 for local cache, and updates the storage version information v2.

[0072] By storing changes in version information, it is ensured that each configuration content update is pulled by the proxy service subsystem in an orderly manner, so that the application service subsystem can perform configuration updates in an orderly manner.

[0073] In order to reduce the number of configuration requests from the application service subsystem to the proxy service subsystem in the embodiment of the present invention, the proxy service subsystem also integrates the acquired configuration content and sends the integrated configuration content when receiving the configuration request. Reduce the number of configuration requests from the application service subsystem. Specifically, in the system in the embodiment of the present invention, the proxy service subsystem 240 merges and stores the configuration content of the same type to generate merged configuration content; and returns the merged configuration content related to the configuration request type according to the configuration content request of the application service subsystem 250.

[0074] For example, according to the above example, the proxy service subsystem 240 successively obtains the configuration content config1 and the configuration change information config2, and the key1 is the same, belonging to the same type of configuration content. Config1 and config2 are merged to generate config12. When the application service subsystem 250 requests the configuration content, config12 is returned, reducing the number of configuration requests of the application service subsystem 250.

[0075] In an embodiment of the present invention, for the same configuration content item, the original amount and the increment are merged, and the original configuration file and the incremental configuration file are merged, which can reduce the number of network requests of the application service subsystem and reduce bandwidth loss.

[0076] In some embodiments of the present invention, the proxy service subsystem 240 is deployed through a cloud native architecture, which greatly reduces operation and maintenance costs and greatly improves expansion and contraction efficiency.

[0077] In some embodiments of the present invention, the configuration content includes initial configuration content and / or configuration change content. It is possible to distribute and obtain both the initial full configuration content and the configuration change content (increment).

[0078] The system in the embodiment of the present invention has the following advantages: configuration change pulling is provided by the proxy service, so that the application service is unaware of the function iteration of the server; the cloud native architecture deployment of the proxy service greatly reduces the operation and maintenance cost and greatly improves the efficiency of expansion and contraction; the client application service relies on fewer services to realize the pull of the changed configuration; by classifying the configuration (configuration item increment, full configuration item, configuration file increment) before the application service initiates the request and merging it, the proxy service classifies it according to the application service request type, merges and returns the configuration of the same type, so that the pull of the changed configuration greatly reduces the number of network requests and reduces the bandwidth loss; the configuration change is continuously monitored, and the change event and the change version content of the configuration will not be lost; the sequence of configuration changes is guaranteed, so that the configuration of the pull change is pulled in sequence; the network failure of a single computer room does not affect the acquisition of the configuration by the proxy service and application service of other computer rooms, thereby reducing the business impact; when the network fails, the application service can automatically switch to the proxy service of the remote computer room, and the proxy service can also automatically switch to the remote computer room to access the database, and the multi-site multi-active effect and benefits can be achieved through the multi-layer high availability mechanism. Prioritizing application services in local data centers to access proxy services can effectively reduce the occurrence of bandwidth saturation, thereby ensuring the stability of global services.

[0079] like Figure 3As shown, the embodiment of the present invention provides a configuration content acquisition method for multi-computer room services, each computer room is provided with a proxy service subsystem and an application service subsystem, including the following steps:

[0080] S310: The configuration end writes the configuration content into the key-value storage subsystem and generates change event information, where the change event information includes a storage version message;

[0081] S320: The proxy service subsystem of each computer room monitors the change event information of the key-value storage subsystem, obtains the storage version message, pulls the configuration content from the key-value storage subsystem according to the storage version information, and stores it in the local cache;

[0082] S330: The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content.

[0083] In some embodiments, a reverse proxy server, such as an nginx server, is deployed between the proxy service subsystem and the application service subsystem. The reverse proxy server, such as the nginx server, can be configured with the proxy service pointing policy that can be switched among multiple computer rooms. The application service subsystem accesses the proxy service subsystems in different computer rooms through the proxy service pointing policy.

[0084] In the method of the embodiment of the present invention, the proxy service subsystem monitors the change information of the key-value storage subsystem, obtains the storage version information, extracts the corresponding configuration content according to the version information, and stores it locally. When the application service subsystem requests the proxy service subsystem to obtain the configuration content, the configuration content is returned.

[0085] In some embodiments of the present invention, the key-value storage subsystem may adopt ETCD. When the configuration end writes configuration content in the key-value storage subsystem, the key key is set according to the type of the configuration content, and the configuration content corresponds to the value value. When the subsequent configuration content is updated, when the configuration end writes the configuration content into ETCD, the key remains unchanged, the value is updated, and the storage version information of the key is updated. Generally, a self-increment update is performed. For example, the version information for the last write is v1, and the updated version information is v2.

[0086] In some embodiments of the present invention, the proxy service subsystem determines whether the configuration content of the local cache needs to be updated based on the storage version information. For example, if the version information in the local cache is v2 and the monitored storage version information is v2, local caching is not required.

[0087] The proxy service pointing strategy described in some embodiments of the present invention can provide a basis for the application service subsystem to access the proxy service subsystems of other computer rooms. In some emergency situations (such as the proxy service subsystem of the local computer room crashes), the configuration content request of the local application service subsystem can be transferred to the proxy service subsystem of the remote computer room for processing by switching the proxy service pointing strategy.

[0088] In the embodiment of the present invention, the application service subsystem accesses the proxy service subsystem 240 through a long polling mechanism, and can wait for the proxy service subsystem to update the configuration content in the cache and then return the configuration content.

[0089] In some embodiments of the present invention, in order to avoid the loss of configuration content after the proxy service subsystem is shut down, the embodiments of the present invention also permanently store the configuration content in the database. Specifically, similar to Figure 3 ,like Figure 4 The method shown may include S310 to S330, which are not described in detail here. Figure 4 The method shown may also include:

[0090] S340: The configuration end writes the configuration content into the database subsystem, wherein the database subsystem includes mutually master-slave databases, the proxy service subsystem accesses the database through a virtual routing redundancy protocol, and the application service subsystem accesses the database subsystem through the proxy service subsystem.

[0091] In the embodiment of the present invention, databases that are mutually master-slave can perform master-slave backup, and through the virtual routing redundancy protocol, when a database fails, it can switch to other databases to obtain configuration content or access other data.

[0092] The application service subsystem accesses the database through the proxy service subsystem, which can adapt to different load requirements and reduce the current limiting impact caused by network bandwidth.

[0093] In some embodiments of the present invention, in order to ensure stable database access, access switching can be performed. Specifically, similar to Figure 4 ,like Figure 5 The method shown may include S310 to S340, which are not described in detail here. In addition, Figure 5 The method shown may also include:

[0094] S350: When the proxy service subsystem fails to access the database, the proxy service subsystem accesses other databases through the virtual routing redundancy protocol.

[0095] The proxy service subsystem accesses the database through a virtual IP address. For example, when accessing the main database, if the main database instance goes down, the virtual IP address can drift to the backup database, achieving imperceptible switching of the proxy service subsystem.

[0096] In some embodiments of the present invention, Figure 6 As shown, the step S330 application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy to obtain configuration content through the long polling mechanism, which may specifically include:

[0097] S331: The application service subsystem accesses the proxy service subsystem located in the same computer room through a long polling mechanism to obtain configuration content;

[0098] S332: When the application service subsystem fails to access the proxy service subsystem located in the same computer room, the reverse proxy server, such as the nginx server, switches the proxy service pointing strategy;

[0099] S333: The application service subsystem accesses the proxy service subsystem of the remote computer room through the long polling mechanism to obtain the configuration content.

[0100] In order to reduce the number of cross-computer room accesses to obtain configuration content, the application service subsystem gives priority to accessing the proxy service subsystem in the same computer room. For example, in computer room A, proxy service subsystem agent_A and application service subsystem APP_A are deployed, and in computer room B, proxy service subsystem agent_B and application service subsystem APP_B are deployed. If nginx configures the proxy service pointing strategy of application service subsystem APP_A to access proxy service subsystem agent_A, when access fails, nginx switches the proxy service pointing strategy of application service subsystem APP_A to access proxy service subsystem agent_B, and obtains configuration content from proxy service subsystem agent_B.

[0101] In some embodiments of the present invention, configuration content is pulled from the key-value storage subsystem based on storage version information and stored in a local cache, including: when the proxy service subsystem determines that the monitored storage version information is greater than the storage version information in the local cache, the configuration content is pulled for local cache storage.

[0102] To ensure orderly configuration content update, the proxy service subsystem in the embodiment of the present invention monitors the change event information, and does not pull the configuration content when it determines that the storage version information is smaller than the local storage version information. It pulls the configuration content only when it determines that it is larger than the local storage version information.

[0103] For example, the configuration end writes the configuration content config1 into the key-value storage subsystem for the first time. The key-value storage subsystem generates key1 and stores the configuration content config1 as the corresponding value1. The storage version information of key1 is v1, and a change event information is generated. The proxy service subsystem monitors the change event information. The change event information contains key1 and storage version information v1. The proxy service subsystem does not store the storage version information locally. The proxy service subsystem pulls the corresponding configuration content config1 from the key-value storage subsystem according to key1, caches it locally, and stores the storage version information v1. When the configuration content needs to be updated later, the configuration end writes the configuration change information config2 into the key-value storage subsystem. Key1 remains unchanged, but the key-value storage subsystem performs self-increment processing on the storage version information to generate storage version information v2, and stores the configuration change information config2 as the corresponding value1. A change event information is generated. The proxy service subsystem monitors the change event information and determines that the storage version information v2 is greater than the locally cached storage version information v1. Then, the corresponding changed configuration content config2 is pulled according to key1 for local cache, and the storage version information v2 is updated.

[0104] By storing changes in version information, it is ensured that each configuration content update is pulled by the proxy service subsystem in an orderly manner, so that the application service subsystem can perform configuration updates in an orderly manner.

[0105] In some embodiments of the present invention, in order to reduce the number of configuration requests from the application service subsystem to the proxy service subsystem, the proxy service subsystem further integrates the acquired configuration content and sends the integrated configuration content when receiving the configuration request. Reducing the number of configuration requests from the application service subsystem. Specifically, the pulling of configuration content for local cache storage includes:

[0106] Merge and store the configuration contents of the same type to generate merged configuration contents.

[0107] More specifically, the application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through the long polling mechanism to obtain configuration content, including:

[0108] Returns the merged configuration content related to the configuration request type according to the configuration content request of the application service subsystem.

[0109] For example, according to the above example, the proxy service subsystem obtains the configuration content config1 and the configuration change information config2 in turn. The key1 is the same, and they belong to the same type of configuration content. Config1 and config2 are merged to generate config12. When the application service subsystem requests the configuration content, config12 is returned, reducing the number of configuration requests of the application service subsystem.

[0110] In an embodiment of the present invention, for the same configuration content item, the original amount and the increment are merged, and the original configuration file and the incremental configuration file are merged, which can reduce the number of network requests of the application service subsystem and reduce bandwidth loss.

[0111] In some embodiments of the present invention, the proxy service subsystem is deployed through a cloud native architecture, which greatly reduces operation and maintenance costs and greatly improves expansion and contraction efficiency.

[0112] In some embodiments of the present invention, the configuration content includes initial configuration content and / or configuration change content. It is possible to distribute and obtain both the initial full configuration content and the configuration change content (increment).

[0113] According to the method in the embodiment of the present invention, a set of proxy services is deployed in each of the multiple computer rooms where the application service is located; the application service obtains the configuration by accessing the proxy service; the database configuration is changed, and the changed configuration is written to ETCD; the proxy service initializes and pulls the full configuration; after the proxy service is started, the changed configuration is obtained by monitoring the ETCD changes; the application service initializes the configuration from the proxy service through a long polling mechanism or promptly pulls the changed configuration; after a network failure in a single computer room, it does not affect the acquisition of the configuration by the proxy services in other computer rooms, nor does it affect the acquisition of the configuration by the application services in other computer rooms from the proxy service; after a database failure, it does not affect the initialization configuration pulled from the proxy service cache when other services are started.

[0114] In actual use, the web end persists the configuration content and changes to the database; the configuration changes are written to ETCD through the web end; the proxy service monitors the ETCD configuration changes, updates the configuration cache of the proxy service, and responds to the changed configuration to the application service in a timely manner; the application service accesses the proxy service through the long polling mechanism to obtain the configuration and changed configuration; a set of nginx is deployed between the application service and the proxy service, and a proxy service pointing strategy that can be switched between multiple computer rooms is configured in nginx, such as Figure 7 As shown, when the network of a single computer room fails, it automatically switches to the proxy service of a remote computer room; the proxy service access data is configured through VIP. When a database fails, it can automatically access the data based on the data drifted to the remote computer room by VIP.

[0115] The method in the embodiment of the present invention has the following advantages: configuration change pulling is provided by the proxy service, so that the application service is unaware of the function iteration of the server; the cloud native architecture deployment of the proxy service greatly reduces the operation and maintenance cost and greatly improves the efficiency of expansion and contraction; the client application service relies on fewer services to realize the pull of the changed configuration; by classifying the configuration (configuration item increment, configuration item full amount, configuration file increment) before the application service initiates the request and merging it, the proxy service classifies it according to the application service request type, and merges and returns the configuration of the same type, so that the pull of the changed configuration greatly reduces the number of network requests and reduces the bandwidth loss; the configuration change is continuously monitored, and the change event and the change version content of the configuration will not be lost; the sequence of configuration changes is guaranteed, so that the configuration of the pull change is pulled in sequence; the network failure of a single computer room does not affect the acquisition of the configuration by the proxy service and application service of other computer rooms, thereby reducing the business impact; when the network fails, the application service can automatically switch to the proxy service of the remote computer room, and the proxy service can also automatically switch to the remote computer room to access the database, and the multi-site multi-active effect and benefits can be achieved through the multi-layer high availability mechanism. Prioritizing application services in local data centers to access proxy services can effectively reduce the occurrence of bandwidth saturation, thereby ensuring the stability of global services.

[0116] In some embodiments, the method may be combined with features of the configuration content acquisition system for multi-machine room services of any embodiment, and vice versa, which will not be elaborated herein.

[0117] In an embodiment of the present invention, an electronic device is provided, including: a processor and a memory storing a computer program, wherein the processor is configured to execute any configuration content acquisition method for a multi-computer room service of an embodiment of the present invention when running the computer program.

[0118] Figure 8 A schematic diagram of an electronic device 800 that can implement a method or implement an embodiment of the present invention is shown, and in some embodiments, more or fewer electronic devices may be included than shown. In some embodiments, a single or multiple electronic devices may be used for implementation. In some embodiments, a cloud or distributed electronic device may be used for implementation.

[0119] like Figure 8As shown, the electronic device 800 includes a central processing unit (CPU) 801, which can perform various appropriate operations and processes according to the programs and / or data stored in the read-only memory (ROM) 802 or the programs and / or data loaded from the storage part 808 to the random access memory (RAM) 803. CPU 801 can be a multi-core processor, or it can include multiple processors. In some embodiments, CPU 801 can include a general main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. In RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. CPU 1801, ROM 802 and RAM 803 are connected to each other via a bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0120] The processor and the memory are used together to execute the program stored in the memory. When the program is executed by the computer, the steps or functions of the method for acquiring configuration content of the multi-computer room service described in the above embodiments can be implemented.

[0121] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, a touch screen, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed. Figure 8 Only some components are schematically shown in the figure, which does not mean that the computer system 800 only includes Figure 8 Components shown.

[0122] In some embodiments, the electronic device 800 refers to a mobile terminal or a computer, including a mobile phone, a car terminal, a smart TV, etc. Taking a mobile phone as an example, the electronic device 800 also includes a display screen with a touch function, an external speaker, a gyroscope, a camera, a 4G / 5G antenna and other device modules.

[0123] The systems, devices, modules or units described in the above embodiments may be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, a smart phone, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a personal digital assistant, a media player, a navigation device, a game console, a tablet computer, a wearable device, a smart TV, an Internet of Things system, a smart home, an industrial computer, a server or a combination thereof.

[0124] Although not shown, in an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the task scheduling and monitoring methods of the embodiments of the present invention when executed.

[0125] Storage media in embodiments of the present invention include permanent and non-permanent, removable and non-removable items that can be used to store information by any method or technology. Examples of storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0126] The methods, programs, systems, devices, etc. of the embodiments of the present invention may be executed or implemented in a single or multiple networked computers, or may be practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks may be performed by remote processing devices connected via a communication network.

[0127] Those skilled in the art should understand that the embodiments of the present specification may be provided as methods, systems or computer program products. Therefore, those skilled in the art may imagine that the functional modules / units or controllers and related method steps described in the above embodiments may be implemented in software, hardware or a combination of software / hardware.

[0128] Unless explicitly stated, the actions or steps of the methods, programs, and embodiments of the present invention do not have to be performed in a specific order and can still achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.

[0129] In this article, multiple embodiments of the present invention are described, but for the sake of brevity, the description of each embodiment is not exhaustive, and the same or similar features or parts between the embodiments may be omitted. In this article, "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" are meant to be applicable to at least one embodiment or example according to the present invention, but not all embodiments. The above terms do not necessarily mean to refer to the same embodiment or example. In the absence of contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.

[0130] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best modes for implementing the present systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein when implementing the present systems and / or methods without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A method for obtaining configuration content of a multi-computer room service, characterized in that: Each computer room is provided with a proxy service subsystem and an application service subsystem, and the method comprises the following steps: The configuration end writes the configuration content into the key-value storage subsystem and generates change event information, wherein the change event information includes a storage version message; The proxy service subsystem of each computer room monitors the change event information of the key-value storage subsystem, obtains the storage version message, pulls the configuration content from the key-value storage subsystem according to the storage version information, and stores it in the local cache; The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, wherein a reverse proxy server is deployed between the proxy service subsystem and the application service subsystem, and the reverse proxy server is configured with the proxy service pointing strategy that can be switched among multiple computer rooms, and the application service subsystem accesses the proxy service subsystems of different computer rooms through the proxy service pointing strategy.

2. The method according to claim 1, characterized in that The method further comprises: The configuration end writes the configuration content into the database subsystem, wherein the database subsystem includes mutually master-slave databases, the proxy service subsystem accesses the database through a virtual routing redundancy protocol, and the application service subsystem accesses the database subsystem through the proxy service subsystem.

3. The method according to claim 2, characterized in that The method further comprises: When the proxy service subsystem fails to access a database, the proxy service subsystem accesses other databases through a virtual routing redundancy protocol.

4. The method according to claim 1, characterized in that: The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, including: The application service subsystem accesses the proxy service subsystem located in the same computer room through a long polling mechanism to obtain configuration content; When the application service subsystem fails to access the proxy service subsystem located in the same computer room, the reverse proxy server switches the proxy service pointing strategy; The application service subsystem accesses the proxy service subsystem of the remote computer room through a long polling mechanism to obtain configuration content.

5. The method according to claim 1, characterized in that Pulling configuration content from the key-value storage subsystem according to the storage version information and storing it in the local cache includes: When the proxy service subsystem determines that the monitored storage version information is greater than the storage version information in the local cache, it pulls the configuration content for local cache storage.

6. The method according to claim 5, characterized in that Pulling the configuration content for local cache storage includes: Merge and store the configuration contents of the same type to generate merged configuration contents; The application service subsystem accesses the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content, including: Returns the merged configuration content related to the configuration request type according to the configuration content request of the application service subsystem.

7. The method according to claim 1, characterized in that The proxy service subsystem is deployed through a cloud-native architecture.

8. The method according to claim 1, characterized in that The configuration content includes initial configuration content and / or configuration change content.

9. A configuration content acquisition system for multi-computer room services, characterized in that: It includes a configuration terminal, a key-value storage subsystem, a proxy service subsystem and an application service subsystem deployed in each computer room, and also includes a reverse proxy server deployed between the proxy service subsystem and the application service subsystem, wherein: The key-value storage subsystem is configured to receive configuration content from the configuration terminal and generate change event information, wherein the change event information includes a storage version message; The proxy service subsystem is configured to monitor the change event information of the key-value storage subsystem, obtain the storage version message, pull the configuration content from the key-value storage subsystem according to the storage version information, and store it in the local cache; The application service subsystem is configured to access the proxy service subsystem related to the proxy service pointing strategy through a long polling mechanism to obtain configuration content; The reverse proxy server is configured with the proxy service pointing strategy that can be switched among multiple computer rooms, and the application service subsystem accesses the corresponding proxy service subsystem through the proxy service pointing strategy.

10. The system according to claim 9, characterized in that It also includes a database subsystem, wherein the database subsystem includes a plurality of mutually master-slave databases; The proxy service subsystem is configured to access the database via a virtual routing redundancy protocol; The application service subsystem is configured to access the database subsystem through the proxy service subsystem.

11. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

12. An electronic device, characterized in that: include: A processor and a memory storing a computer program, wherein the processor is configured to execute the method according to any one of claims 1 to 8 when running the computer program.

Citation Information

Patent Citations

  • Nginx reverse proxy-based dynamic load adjustment method and apparatus for back-end server

    CN108712457A

  • Intranet data interaction method and equipment

    CN110545320A

  • Data configuration method

    CN112256344A

  • Distributed service discovery system and method, storage medium and terminal

    CN112422309A

  • Multi-tenant application configuration distribution system based on cross-IDC environment

    CN114143321A

Cited By

  • Configuration updating method, device and system

    CN121357008A