Configuration information distribution method and system, electronic device and storage medium

By adopting a message subscription distribution mechanism during the configuration information distribution process, configuration information is distributed to the target database. Redis and message hub are used to realize the distribution and caching of configuration information, which solves the update delay problem caused by unstable communication between the configuration center server and the business service client, and improves the efficiency of configuration information distribution.

WO2026045979A1PCT designated stage Publication Date: 2026-03-05GD MIDEA AIR CONDITIONING EQUIP CO LTD +2
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

During the configuration information publishing process, the unstable communication between the configuration center server and the business service client resulted in the configuration information not being updated in a timely manner.

Method used

A message subscription and distribution mechanism is adopted, in which configuration information is distributed to the target database through the configuration center server, and the business service client reads the latest configuration information from the target database, avoiding direct communication. The distribution and caching of configuration information are realized by using Redis database and message hub.

Benefits of technology

It improved the efficiency of configuration information distribution, ensuring that business service clients can update configuration information in a timely manner, and solved the update problem caused by unstable communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025115395_05032026_PF_FP_ABST
    Figure CN2025115395_05032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a configuration information distribution method and system, an electronic device, and a storage medium. The configuration information distribution method comprises: determining first configuration information, the first configuration information comprising at least one information identifier; on the basis of subscription information and the first configuration information, processing at least one target database to obtain a processed database, the subscription information comprising at least one preset corresponding relationship, and the preset corresponding relationship being a corresponding relationship between the information identifier and the target database; and on the basis of startup of a business service client, controlling configuration information in the processed database so as to cache same in a local database of the business service client, the business service client being corresponding to the target database.
Need to check novelty before this filing date? Find Prior Art

Description

Methods and systems for distributing configuration information, electronic devices and storage media

[0001] This application claims priority to Chinese Patent Application No. 2024112033052, filed on August 29, 2024, entitled "Method and System for Distributing Configuration Information, Electronic Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of data processing technology, and more specifically, to a method and system for distributing configuration information, an electronic device, and a storage medium. Background Technology

[0003] In related technologies, during the process of publishing configuration information, the unstable communication between the configuration center server and the business service client leads to the inability to update the configuration information in a timely manner. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in the prior art or related technologies.

[0005] Therefore, the first aspect of this application proposes a method for distributing configuration information.

[0006] The second aspect of this application proposes a system for distributing configuration information.

[0007] The third aspect of this application proposes an electronic device.

[0008] The fourth aspect of this application proposes a storage medium.

[0009] The fifth aspect of this application proposes a computer program product.

[0010] In view of the above, according to the first aspect of this application, a method for distributing configuration information is proposed, comprising: determining first configuration information, wherein the first configuration information includes at least one information identifier; processing at least one target database according to subscription information and the first configuration information to obtain a processing database, wherein the subscription information includes at least one preset correspondence, the preset correspondence being a correspondence between the information identifier and the target database; and, based on the startup of a business service client, controlling the configuration information in the processing database to be cached in the local database of the business service client, wherein the business service client corresponds to the target database.

[0011] The method for distributing configuration information provided in this application mainly includes: firstly determining the first configuration information, which is the configuration information that the configuration center server needs to issue or modify to the business service client. The first configuration information includes at least one information identifier, wherein the information identifier is not a specific piece of information, but can be characteristic data in the first configuration information, or the transmission node of the first configuration information, etc. After determining the initial configuration information, at least one target database is processed based on the subscription information and the initial configuration information, transforming the target database into a processing database. The target database can be a Redis (Remote Dictionary Server, an open-source, in-memory data storage system) database. The subscription information includes at least one preset mapping relationship, which is a mapping between information identifiers and target databases. In other words, after determining the initial configuration information, it is analyzed to identify which information identifiers exist within it. Then, based on the mapping relationship between the information identifiers in the subscription information and the target databases, the initial configuration information is distributed to different target databases. The same information identifier can correspond to different target databases, and the same target database can also correspond to different information identifiers. By processing at least one target database based on the subscription information and the initial configuration information, different configuration information is distributed to different target databases. After obtaining the processing database, when the business service client starts, it can control the configuration information in the processing database to be cached in the business service client's local database. The business service client corresponds to the target database. In other words, each business service client corresponds to a target database. When the configuration information in the target database changes—that is, when the target database is processed into a processing database—the business service client can read the latest configuration information from the corresponding target database and cache the latest configuration information in its local database. This application improves the efficiency of configuration information distribution by employing a message subscription distribution mechanism during the distribution of configuration information to the target database. This mechanism distributes different configuration information to different target databases based on a pre-defined correspondence in the subscription information. Simultaneously, the configuration information is distributed to the target database through the configuration center server, and the business service client can then read the latest configuration information from the corresponding target database. This eliminates the need for direct communication between the configuration center server and the business service client, thus avoiding the problem of untimely updates to the business service client's configuration information due to unstable communication between the configuration center server and the business service client.

[0012] The method for distributing the configuration information described above in this application may also include the following technical features:

[0013] In some technical solutions, optionally, the step of determining the first configuration information includes:

[0014] Determine a first correspondence between the business service client and the information identifier; determine a second correspondence between the business service client and the target database; determine a preset correspondence based on the first and second correspondences; and add the preset correspondence to the subscription information.

[0015] In this technical solution, before determining the first configuration information, the following steps are taken: Before distributing the configuration information, a preset correspondence should be set in the subscription information so that different configuration information can be distributed to different target databases according to different preset correspondences. First, a first correspondence between the business service client and the information identifier is determined based on the business service client, i.e., determining which configuration information the business service client needs. Then, a second correspondence between the business service client and the target database is determined. The first and second correspondences are then combined, i.e., the correspondence between the business service client and the information identifier and the correspondence between the business service client and the target database are combined to obtain a correspondence between the information identifier and the target database. This correspondence is then defined as the preset correspondence and added to the subscription information. By determining the preset correspondence based on the first and second correspondences before distributing the configuration information, it is ensured that different configuration information can be distributed to different target databases, thereby ensuring the efficiency and accuracy of configuration information distribution.

[0016] In some technical solutions, optionally, the step of determining the first configuration information includes:

[0017] Receive a first processing operation instruction; determine second configuration information in a first database according to the first processing operation instruction, wherein the first database stores multiple configuration information; and process the second configuration information according to the first processing operation instruction to obtain the first configuration information.

[0018] In this technical solution, the step of determining the first configuration information includes: Since all configuration information is stored on the configuration center server, determining the first configuration information first requires receiving a first processing operation instruction input by the user to the configuration center server. This first processing operation instruction can be one or a combination of search, add, edit, delete, import, and export operations. In other words, the user can perform operations such as searching, adding, editing, deleting, importing, and exporting all configuration information on the configuration center server. Then, based on the first processing operation instruction, the second configuration information is determined from the first database. The first database is the configuration center server's own database, which stores all current configuration information. By determining the second configuration information from the first database using the first processing operation instruction, the configuration information that the user wants to operate on is selected from all current configuration information. Then, the second configuration information is processed according to the first processing operation instruction to obtain the first configuration information, i.e., operations such as searching, adding, editing, deleting, importing, and exporting are performed on the second configuration information, thereby changing the second configuration information into the first configuration information. By unifying the management of all configuration information and enabling operations such as searching, adding, editing, deleting, importing, and exporting configuration information, business service developers only need to focus on the configuration information required by the clients of the business services they are responsible for.

[0019] In some technical solutions, optionally, the process of processing at least one target database based on subscription information and first configuration information to obtain a processed database includes:

[0020] The first configuration information is reviewed to obtain a review result; if the review result is passed, a second processing operation instruction is received; if the second processing operation instruction is an online operation, the first configuration information is added to at least one target database according to the subscription information to obtain a processing database; and if the second processing operation instruction is an offline operation, the first configuration information is deleted from at least one target database according to the subscription information.

[0021] In this embodiment, the step of processing at least one target database based on subscription information and first configuration information to obtain a processed database includes: when a user with operation permissions obtains the first configuration information through a first processing operation instruction, the user reviews the first configuration information to determine whether it meets expectations or regulations. This review can be conducted by a user with review permissions or by the configuration center server itself. When the review result is passed, a second processing operation instruction is received. When the second processing operation is an instruction to go online, i.e., when the user wants to add configuration information to the business service client, the first configuration information is added to the target database corresponding to the business service client based on the subscription information. This changes the target database corresponding to the business service client into a processed database. Thus, when the business service client starts and reads the changed target database, the newly added first configuration information can be added to the business service client. When the second processing operation instruction is a shutdown operation, i.e., when a user wants to delete the configuration information in the business service client, the first configuration information in the target database corresponding to the business service client is deleted according to the subscription information. This changes the target database to a processing database. When the business service client starts, it will no longer read the first configuration information when reading the changed target database, thus achieving the deletion of the first configuration information in the business service client. Conversely, if the review result is a rejection, it indicates that the first configuration information does not conform to regulations or expectations. Therefore, feedback information needs to be sent to the user corresponding to the first processing operation instruction to inform them that the received first configuration information does not conform to regulations or expectations.

[0022] In some technical solutions, optionally, after processing at least one target database based on subscription information and first configuration information to obtain a processed database, the process includes:

[0023] Send broadcast information to the business service client corresponding to the target database.

[0024] In this technical solution, after processing at least one target database based on subscription information and first configuration information to obtain a processed database, the process includes: after processing the at least one target database based on subscription information and first configuration information, it is also necessary to send a broadcast message to the business service client corresponding to the processed target database, thereby notifying the corresponding business service client that the configuration information has changed, so that the business service client can promptly open and read the processed target database (i.e., the processed database) to obtain the changed configuration information. Wherein, when the target database is a Redis database, the broadcast message can be a PUB (Publish, Subscription) message. By sending a broadcast message to the corresponding business service client after the target database changes to the processed database, the business service client can update its configuration information in a timely manner.

[0025] In some technical solutions, optionally, after the step of starting the business service client and controlling the caching of configuration information in the database by the business service client's local database, the following steps are included:

[0026] It receives the configuration information change channels subscribed to by the business service client in the target database; and, based on changes in the target database, controls the updated target database to update the local database of the business service client.

[0027] In this technical solution, after the steps of starting the business service client and controlling the caching of configuration information in the database by the business service client's local database, the solution includes: receiving the configuration information change channel subscribed by the business service client in the target database. In other words, the business service client can subscribe to the channel for configuration information change messages in the target database. Therefore, when the configuration information changes, i.e., the target database changes, the changed target database can promptly update the business service client's local database after the change, because the target database contains the configuration information change message channel subscribed by the business service client. Specifically, when the target database is Redis, the business service client can subscribe to the configuration change message channel from Redis. By receiving the configuration information change channel subscribed by the business service client in the target database, it is ensured that the business service client can update promptly when the configuration information changes.

[0028] In some technical solutions, optionally, after the step of starting the business service client and controlling the caching of configuration information in the database by the business service client's local database, the following steps are included:

[0029] The system retrieves configuration information from the target database at preset intervals and sends the configuration information to the local database of the business service client for caching.

[0030] In this technical solution, after the steps of starting the business service client and controlling the configuration information in the database to be cached in the local database of the business service client, the following steps are added: a timed synchronization mechanism is added between the local database of the business service client and the target database, so that the target database is controlled to update the local database of the business service client at preset intervals. That is, the business service client can obtain the latest configuration information from the corresponding target database at a fixed frequency, i.e., at preset intervals, and cache it in the local database, thereby avoiding the problem of configuration information not being able to be updated due to the loss of broadcast information.

[0031] According to a second aspect of this application, a configuration information distribution system is proposed, comprising: a first determining module configured to determine first configuration information, wherein the first configuration information includes at least one information identifier; a first processing module configured to process at least one target database according to subscription information and the first configuration information to obtain a processed database, wherein the subscription information includes at least one preset correspondence, the preset correspondence being a correspondence between the information identifier and the target database; and a first caching module configured to be started based on a business service client, controlling the configuration information in the processed database to be cached in the local database of the business service client, wherein the business service client corresponds to the target database.

[0032] The configuration information distribution system provided in this application mainly includes: a first determining module, a first processing module, and a first caching module. The first determining module first determines the first configuration information, which is the configuration information that the configuration center server needs to issue or modify to the business service client. The first configuration information includes at least one information identifier, which is not a specific piece of information; it can be characteristic data within the first configuration information, or it can be a transmission node of the first configuration information, etc. After determining the initial configuration information, the first processing module processes at least one target database based on the subscription information and the initial configuration information, transforming the target database into a processing database. The target database can be a Redis database. The subscription information includes at least one preset mapping relationship, which is a mapping between information identifiers and target databases. In other words, after determining the initial configuration information, it analyzes the information to identify which information identifiers exist within it. Then, based on the mapping relationship between the information identifiers in the subscription information and the target databases, the initial configuration information is distributed to different target databases. The same information identifier can correspond to different target databases, and the same target database can correspond to different information identifiers. By processing at least one target database based on the subscription information and the initial configuration information, different configuration information is distributed to different target databases. After obtaining the processing database, the first caching module can control the configuration information in the processing database to be cached in the local database of the business service client when the business service client starts. The business service client corresponds to the target database. In other words, each business service client corresponds to a target database. When the configuration information in the target database changes—that is, when the target database is processed into a processing database—the business service client can read the latest configuration information from the corresponding target database and cache the latest configuration information in its local database. This application improves the efficiency of configuration information distribution by employing a message subscription distribution mechanism during the distribution of configuration information to the target database. This mechanism distributes different configuration information to different target databases based on a pre-defined correspondence in the subscription information. Furthermore, by distributing configuration information to the target database, the business service client can read the latest configuration information from the corresponding target database, eliminating the need for direct communication between the configuration center server and the business service client. This avoids the problem of untimely updates to the business service client's configuration information due to unstable communication between the configuration center server and the business service client.

[0033] According to a third aspect of this application, an electronic device is proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the configuration information distribution method as described in any of the above.

[0034] The steps of the electronic device provided in this application for implementing the above-mentioned configuration information distribution method when the processor executes the computer program are not described in detail here.

[0035] According to a fourth aspect of this application, a storage medium is provided on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the steps of the configuration information distribution method as described above.

[0036] The steps of the storage medium provided in this application, and the computer program executed by the processor to implement the above-mentioned configuration information distribution method, will not be described in detail here.

[0037] According to a fifth aspect of this application, a computer program product is proposed, comprising a computer program that, when executed by a processor, implements the steps of a method for distributing configuration information as described in any of the above technical solutions.

[0038] The steps of the computer program product provided by this technical solution to implement the configuration information distribution method of any technical solution of this application will not be repeated here.

[0039] Additional aspects and advantages of this application will become apparent in the following description or may be learned by practice of this application. Attached Figure Description

[0040] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0041] Figure 1 shows a flowchart illustrating a method for distributing configuration information according to an embodiment of this application;

[0042] Figure 2 shows a flowchart of a configuration information distribution method according to an embodiment of this application before the step of determining the first configuration information;

[0043] Figure 3 shows a flowchart illustrating the step of determining first configuration information in a configuration information distribution method according to an embodiment of this application;

[0044] Figure 4 shows a flowchart illustrating the steps of processing at least one target database according to subscription information and first configuration information to obtain a processed database in a configuration information distribution method according to an embodiment of this application.

[0045] Figure 5 shows a flowchart of a configuration information distribution method according to an embodiment of this application after the step of starting the business service client and caching the configuration information in the control processing database in the local database of the business service client.

[0046] Figure 6 illustrates a schematic diagram of the principle of a configuration information distribution method according to an embodiment of this application;

[0047] Figure 7 shows an interface diagram of the configuration management system in a configuration information distribution method according to an embodiment of this application;

[0048] Figure 8 shows a timing diagram of the configuration search / details / add / edit / delete / reject / approve / import / export of an embodiment of this application;

[0049] Figure 9 shows a timing diagram of the configuration online or offline process of one embodiment of this application;

[0050] Figure 10 shows a timing diagram of message hub creation subscription rules according to an embodiment of this application;

[0051] Figure 11 shows a timing diagram of message distribution at the message hub according to an embodiment of this application;

[0052] Figure 12 shows a schematic diagram of the configuration information in the Redis cache according to an embodiment of this application;

[0053] Figure 13 illustrates the principle of a business service client obtaining configuration information from Redis according to an embodiment of this application;

[0054] Figure 14 shows a schematic block diagram of a configuration information distribution system according to an embodiment of this application;

[0055] Figure 15 shows a schematic block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0056] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0057] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.

[0058] Figure 1 shows a flowchart illustrating a configuration information distribution method according to an embodiment of this application. The method includes:

[0059] Step 102: Determine the first configuration information, wherein the first configuration information includes at least one information identifier;

[0060] Step 104: Process at least one target database according to the subscription information and the first configuration information to obtain a processed database, wherein the subscription information includes at least one preset correspondence, which is the correspondence between information identifiers and target databases;

[0061] Step 106: Start based on the business service client, and the configuration information in the control processing database is cached in the local database of the business service client. The business service client corresponds to the target database.

[0062] The method for distributing configuration information provided in this application mainly includes: firstly determining the first configuration information, which is the configuration information that the configuration center server needs to issue or modify to the business service client. The first configuration information includes at least one information identifier, wherein the information identifier is not a specific piece of information, but can be characteristic data in the first configuration information, or the transmission node of the first configuration information, etc. After determining the initial configuration information, at least one target database is processed based on the subscription information and the initial configuration information, transforming the target database into a processing database. The target database can be a Redis (Remote Dictionary Server, an open-source, in-memory data storage system) database. The subscription information includes at least one preset mapping relationship, which is a mapping between information identifiers and target databases. In other words, after determining the initial configuration information, it is analyzed to identify which information identifiers exist within it. Then, based on the mapping relationship between the information identifiers in the subscription information and the target databases, the initial configuration information is distributed to different target databases. The same information identifier can correspond to different target databases, and the same target database can also correspond to different information identifiers. By processing at least one target database based on the subscription information and the initial configuration information, different configuration information is distributed to different target databases. After obtaining the processing database, when the business service client starts, it can control the configuration information in the processing database to be cached in the business service client's local database. The business service client corresponds to the target database. In other words, each business service client corresponds to a target database. When the configuration information in the target database changes—that is, when the target database is processed into a processing database—the business service client can read the latest configuration information from the corresponding target database and cache the latest configuration information in its local database. This application improves the efficiency of configuration information distribution by employing a message subscription distribution mechanism during the distribution of configuration information to the target database. This mechanism distributes different configuration information to different target databases based on a pre-defined correspondence in the subscription information. Furthermore, by distributing configuration information to the target database, the business service client can read the latest configuration information from the corresponding target database, eliminating the need for direct communication between the configuration center server and the business service client. This avoids the problem of untimely updates to the business service client's configuration information due to unstable communication between the configuration center server and the business service client.

[0063] Figure 2 illustrates a flowchart of a configuration information distribution method according to an embodiment of this application, prior to the step of determining the first configuration information; wherein, prior to the step of determining the first configuration information, the method includes:

[0064] Step 202: Determine the first correspondence between the business service client and the information identifier;

[0065] Step 204: Determine the second correspondence between the business service client and the target database;

[0066] Step 206: Determine the preset correspondence based on the first correspondence and the second correspondence;

[0067] Step 208: Add the preset correspondence to the subscription information.

[0068] In this embodiment, before determining the first configuration information, the following steps are included: Before distributing the configuration information, a preset correspondence should be set in the subscription information so that different configuration information can be distributed to different target databases according to different preset correspondences. First, a first correspondence between the business service client and the information identifier is determined based on the business service client, i.e., determining which configuration information the business service client needs. Then, a second correspondence between the business service client and the target database is determined. The first and second correspondences are then combined, i.e., the correspondence between the business service client and the information identifier and the correspondence between the business service client and the target database are combined to obtain a correspondence between the information identifier and the target database. This correspondence is then determined as the preset correspondence and added to the subscription information. By determining the preset correspondence based on the first and second correspondences before distributing the configuration information, it is ensured that different configuration information can be distributed to different target databases, thereby ensuring the efficiency and accuracy of configuration information distribution.

[0069] In one embodiment, FIG3 shows a flowchart illustrating the step of determining first configuration information in a configuration information distribution method according to an embodiment of the present application; wherein, the step of determining the first configuration information includes:

[0070] Step 302: Receive the first processing operation instruction;

[0071] Step 304: Determine the second configuration information in the first database according to the first processing operation instruction, wherein the first database stores multiple configuration information.

[0072] Step 306: Process the second configuration information according to the first processing operation instruction to obtain the first configuration information.

[0073] In this embodiment, the step of determining the first configuration information includes: since all configuration information is stored on the configuration center server, when determining the first configuration information, it is first necessary to receive the first processing operation instruction input by the user to the configuration center server. The first processing operation instruction can be one or a combination of search, add, edit, delete, import, and export. That is, the user can perform operations such as searching, adding, editing, deleting, importing, and exporting all configuration information on the configuration center server. Then, based on the first processing operation instruction, the second configuration information is determined in the first database. The first database is the configuration center server's own database, which stores all current configuration information. By determining the second configuration information in the first database through the first processing operation instruction, the configuration information that the user wants to operate on is selected from all current configuration information. Then, the second configuration information is processed according to the first processing operation instruction to obtain the first configuration information, i.e., operations such as searching, adding, editing, deleting, importing, and exporting are performed on the second configuration information, thereby changing the second configuration information into the first configuration information. By unifying the management of all configuration information and enabling operations such as searching, adding, editing, deleting, importing, and exporting configuration information, business service developers only need to focus on the configuration information required by the clients of the business services they are responsible for.

[0074] In one embodiment, Figure 4 illustrates a flowchart of a configuration information distribution method according to an embodiment of this application, showing the step of processing at least one target database based on subscription information and first configuration information to obtain a processed database; wherein, the step of matching statement information with second case data in a second case database includes:

[0075] Step 402: Review the first configuration information and obtain the review result;

[0076] Step 404: If the review result is approved, receive the second processing operation instruction;

[0077] Step 406: Based on the second processing operation instruction being an online operation, the first configuration information is added to at least one target database according to the subscription information to obtain the processing database;

[0078] Step 408: Based on the second processing operation instruction being an offline operation, delete the first configuration information in at least one target database according to the subscription information.

[0079] In this embodiment, the step of processing at least one target database based on subscription information and first configuration information to obtain a processing database includes: when a user with operation permissions obtains the first configuration information through a first processing operation instruction, the user reviews the first configuration information to determine whether it meets expectations or regulations. This review can be conducted by a user with review permissions or by the configuration center server itself. When the review result is passed, a second processing operation instruction is received. When the second processing operation instruction is an online operation, i.e., when the user wants to add configuration information to the business service client, the first configuration information is added to the target database corresponding to the business service client based on the subscription information. This changes the target database corresponding to the business service client into a processing database. Thus, when the business service client starts and reads the changed target database, the newly added first configuration information can be added to the business service client. When the second processing operation instruction is a shutdown operation, i.e., when a user wants to delete the configuration information in the business service client, the first configuration information in the target database corresponding to the business service client is deleted according to the subscription information. This changes the target database to a processing database. When the business service client starts, it will no longer read the first configuration information when reading the changed target database, thus achieving the deletion of the first configuration information in the business service client. Conversely, if the review result is a rejection, it indicates that the first configuration information does not conform to regulations or expectations. Therefore, feedback information needs to be sent to the user corresponding to the first processing operation instruction to inform them that the received first configuration information does not conform to regulations or expectations.

[0080] In some embodiments, optionally, after processing at least one target database according to subscription information and first configuration information to obtain a processed database, the method includes: sending broadcast information to a business service client corresponding to the target database.

[0081] In this embodiment, after processing at least one target database according to the subscription information and the first configuration information to obtain a processed database, the process includes: after processing at least one target database according to the subscription information and the first configuration information, it is also necessary to send a broadcast message to the business service client corresponding to the processed target database, thereby notifying the corresponding business service client that the configuration information has changed, so that the business service client can open in time and read the processed target database, i.e., the processed database, to obtain the changed configuration information. Wherein, when the target database is a Redis database, the broadcast message can be a PUB message. By sending a broadcast message to the corresponding business service client after the target database changes to the processed database, the business service client can update the configuration information in a timely manner.

[0082] In one embodiment, Figure 5 illustrates a flowchart of a configuration information distribution method according to an embodiment of this application, following the step of caching configuration information in the control processing database by the local database of the business service client after startup based on the business service client; wherein, after the step of caching configuration information in the control processing database by the local database of the business service client after startup based on the business service client, the method includes:

[0083] Step 502: Receive the configuration information change channel subscribed to by the business service client in the target database;

[0084] Step 504: Based on the change in the target database, control the updated target database to update the local database of the business service client.

[0085] In this embodiment, after the step of starting the business service client and caching the configuration information in the control processing database in the local database of the business service client, the process includes: receiving the configuration information change channel subscribed by the business service client in the target database. That is, the business service client can subscribe to the channel for configuration information change messages in the target database. Therefore, when the configuration information changes, i.e., the target database changes, the changed target database can promptly update the local database of the business service client after the change, because the target database contains the configuration information change message channel subscribed by the business service client. Specifically, when the target database is Redis, the business service client can subscribe to the configuration change message channel from Redis. By receiving the configuration information change channel subscribed by the business service client in the target database, it is ensured that the business service client can update in a timely manner when the configuration information changes.

[0086] In some embodiments, optionally, after the step of starting based on the business service client and controlling the caching of configuration information in the processing database by the local database of the business service client, the method includes: retrieving configuration information from the target database at preset intervals; and sending the configuration information to the local database of the business service client for caching.

[0087] In this embodiment, after the step of starting based on the business service client and controlling the configuration information in the processing database to be cached in the local database of the business service client, the method includes: adding a timed synchronization mechanism between the local database of the business service client and the target database, so that the target database is controlled to update the local database of the business service client at preset intervals. That is, the business service client can obtain the latest configuration information from the corresponding target database at a fixed frequency, i.e., at preset intervals, and cache it in the local database, thereby avoiding the problem of configuration information not being able to be updated due to the loss of broadcast information.

[0088] In one embodiment, Figure 6 illustrates a schematic diagram of the principle of a configuration information distribution method according to an embodiment of this application. As shown in Figure 6, firstly, the configuration management portal system can receive and process operation instructions, and obtain first configuration information according to the processing operation instructions. That is, the user can log in to the configuration management portal system and perform operations such as modification, review, and deployment of configuration information in the configuration management portal system. Then, the backend of the configuration management portal system will call the message sending interface of the message hub to send the changed configuration information to the message hub via HTTP (Hypertext Transfer Protocol). In the message hub, the business service client needs to set up the corresponding subscription rules in advance. The subscription rules are the subscription information, which includes at least one preset correspondence. The preset correspondence is the correspondence between configuration information and Redis, where Redis is the cloud vendor Redis. After receiving a configuration change message, the message hub writes the configuration message to the corresponding Redis according to the subscription rules and sends a Redis broadcast (PUB) message. For example, the message hub can write different configuration information to Redis instances A and B, respectively. Redis instance A corresponds to the A business service client, which has A service node 1, A service node 2, and A service node 3. Redis instance B corresponds to the B business service client, which has B service node 1, B service node 2, and B service node 3. Then, when each node in the business service client starts, it reads the corresponding configuration information from Redis and caches it in its local database. For example, when A service node 1 starts, it reads the configuration information from Redis instance A. It also subscribes to the Redis channel for configuration change messages to synchronize the latest configuration information to the local database cache in real time. A timed synchronization mechanism is also added to read the latest configuration information from Redis at a fixed frequency to refresh the local database cache. This application introduces the middleware Redis, enabling the configuration center server to write configuration information to the corresponding Redis cache of the business service client via a message hub. The business service client then reads the latest configuration information from its own dependent Redis cache, thus resolving the issue of unstable communication between the configuration center server and the business service client. Furthermore, since different business service clients configure different Redis caches, the message hub's message subscription and distribution mechanism can be utilized to distribute different configuration messages to different Redis caches according to subscription rules, thereby improving communication efficiency. Finally, using a cloud-based Redis provider instead of a self-built Redis service ensures the stability of the Redis service.

[0089] In one embodiment, Figure 7 shows the interface diagram of the configuration management system in the configuration information distribution method of an embodiment of this application. As shown in Figure 7, the configuration management portal system can provide a user interface for users to manage configuration information, and its functions include: search, details, add, edit, delete, reject, approve, go online, go offline, import, and export. As shown in Figures 8 and 9, Figure 8 shows a sequence diagram of configuration search / details / add / edit / delete / reject / approve / import / export in an embodiment of this application, and Figure 9 shows a sequence diagram of configuration going online or going offline in an embodiment of this application. First, business configuration personnel log in to the configuration management portal system to modify configuration information, and administrators with review permissions review, reject, or approve the configuration information. The process involves the user sending an HTTP request (Hypertext Transfer Protocol request) from config-web (the user interface) to config-api (an interface for configuring and managing application or system settings). This HTTP request includes commands for searching, detailing, adding, editing, deleting, rejecting, approving, importing, and exporting. config-api then generates a corresponding database request based on the HTTP request and sends it to mysql-db (the database). This database request includes commands for searching, detailing, adding, editing, deleting, rejecting, approving, importing, and exporting configuration information within the database. mysql-db then performs the operations on the corresponding configuration information based on the received commands. After the database completes these operations, it generates a corresponding database response, which includes a completion message. This database response is then sent to config-api. Finally, config-api generates a corresponding HTTP response and sends it to config-web to notify the user that the operation is complete. If the review is approved, as shown in Figure 9, administrators with online access will publish the configuration information online. After going online, the system will send a configuration write message to the message hub, which will then write the corresponding configuration information to the Redis cache corresponding to the business service client.If a shutdown operation is required, an administrator with shutdown privileges must perform the shutdown operation on the configuration information. After shutdown, the system will also send a configuration deletion message to the message hub. The message hub will then delete the corresponding configuration information from the Redis cache corresponding to the business service client. The process can be as follows: the user sends an HTTP request from config-web to config-api. This HTTP request can include configuration information shutdown or uplink instructions. config-api then generates a database request and sends it to mysql-db. mysql-db determines the configuration information corresponding to the configuration information shutdown or uplink instructions based on the received request, adds the configuration information to the database response, and sends it to config-api. config-api generates a corresponding HTTP request and sends it to the message hub. This HTTP request includes the configuration information shutdown or uplink instructions and the corresponding configuration information. The message hub distributes the configuration information according to the configuration information shutdown or uplink instructions. Upon completion, it generates an HTTP response as a completion feedback and sends it to config-api. config-api then generates a corresponding HTTP response and sends it to config-web to notify the user that the operation is complete.

[0090] In one embodiment, Figure 10 shows a timing diagram of message hub creation subscription rules according to an embodiment of this application, and Figure 11 shows a timing diagram of message distribution in the message hub according to an embodiment of this application. As shown in Figure 10, business developers first set subscription rules for the message hub. For example, a user sends an HTTP request to event-bus-api (event bus interface) through event-bus-web (event bus interface). The HTTP request includes the subscription rules to be set. Then, event-bus-api generates a corresponding database request to mongo-db (database). mongo-db stores the subscription rules to be set and generates feedback information, i.e., database response, which is fed back to event-bus-api. event-bus-api generates a corresponding HTTP response based on the database response and feeds it back to event-bus-web to prompt the user to complete the setting operation. As shown in Figure 11, when a user modifies configuration information in the configuration management portal system, the portal system sends the configuration change message to event-bus-api via HTTP. event-bus-api generates a query subscription rule instruction and sends it to mongo-db. Once the corresponding subscription rule is found in mongo-db, it is sent back to event-bus-api. event-bus-api then writes the configuration change message to the corresponding Redis instance based on the subscription rule. After Redis completes the writing process, it sends a success message to event-bus-api. Event-bus-api then sends a Redis broadcast (PUB) message, which broadcasts the configuration change. Upon receiving the broadcast message, Redis sends a success message back to event-bus-api. Finally, event-bus-api uses HTTP to notify the configuration management portal system of the successful response, indicating that the changed configuration information has been successfully written to the corresponding Redis instance.

[0091] In one embodiment, Figure 12 shows a schematic diagram of the structure of configuration information in Redis cache according to an embodiment of this application. As shown in Figure 12, the structure of configuration information in Redis cache is a Hash structure, the key is {fixed prefix}: {business ID}, the key of the Hash field is {business ID}.{business key}, and the value is the string format value of the business value.

[0092] In one embodiment, Figure 13 illustrates the principle of the business service client retrieving configuration information from Redis. As shown in Figure 13, when the business service client starts, it retrieves configuration information from Redis and caches it in its local database. It also subscribes to a channel for configuration change messages from Redis. When the configuration information changes, the cached configuration information in the business service client's local database is updated in real time. A timed synchronization mechanism is also added to retrieve the latest configuration information from Redis at a fixed frequency and update it in the business service client's local database cache, preventing the loss of Redis broadcast messages and ensuring the configuration information is updated. Furthermore, the code for retrieving configuration information in the business service client only needs to use the official SDK (Software Development Kit) for connecting to the Redis cache provided by its respective language; no third-party configuration center SDK dependency is required. For example, as shown in Figure 13, the business service client includes: Service Node 1 (A), Service Node 2 (A), and Service Node 3 (A). Each service node has a Redis Client SDK, and each service node reads configuration information from Service A's Redis using the Redis Client SDK. Meanwhile, the business service client does not need to rely on the configuration center SDK, but only on Redis. Therefore, after containerization deployment, no special code modification is required to obtain the latest configuration, which solves the problem that the business service client in containerized deployment cannot obtain configuration information.

[0093] Figure 14 shows a schematic block diagram of a configuration information distribution system according to an embodiment of this application; wherein, the configuration information distribution system 140 includes:

[0094] The first determining module 1402 is configured to determine first configuration information, wherein the first configuration information includes at least one information identifier;

[0095] The first processing module 1404 is configured to process at least one target database according to subscription information and first configuration information to obtain a processed database, wherein the subscription information includes at least one preset correspondence relationship, which is the correspondence relationship between information identifier and target database;

[0096] The first caching module 1406 is configured to start based on the business service client and control the caching of configuration information in the processing database to the local database of the business service client, wherein the business service client corresponds to the target database.

[0097] The configuration information distribution system 140 provided in this application mainly includes: a first determining module 1402, a first processing module 1404, and a first caching module 1406. The first determining module 1402 first determines first configuration information, which is the configuration information that the configuration center server needs to issue or modify to the business service client. The first configuration information includes at least one information identifier. This information identifier is not a specific piece of information; it can be characteristic data within the first configuration information, or it can be a transmission node of the first configuration information, etc. After determining the first configuration information, the first processing module 1404 processes at least one target database based on the subscription information and the first configuration information, transforming the target database into a processing database. The target database can be a Redis database, and the subscription information includes at least one preset mapping relationship, which is a mapping relationship between information identifiers and target databases. In other words, after determining the first configuration information, it analyzes the first configuration information to identify which information identifiers exist within it. Then, based on the mapping relationship between the information identifiers in the subscription information and the target databases, the first configuration information is distributed to different target databases according to the information identifiers and mapping relationships. The same information identifier can correspond to different target databases, and the same target database can also correspond to different information identifiers. By processing at least one target database based on the subscription information and the first configuration information, different configuration information is distributed to different target databases. After obtaining the processing database, the first caching module 1406 can control the configuration information in the processing database to be cached in the local database of the business service client when the business service client starts. The business service client corresponds to the target database. In other words, each business service client corresponds to a target database. When the configuration information in the target database changes—that is, when the target database is processed into a processing database—the business service client can read the latest configuration information from the corresponding target database and cache the latest configuration information in its local database. This application improves the efficiency of configuration information distribution by employing a message subscription distribution mechanism during the distribution of configuration information to the target database. This mechanism distributes different configuration information to different target databases based on a pre-defined correspondence in the subscription information. Furthermore, by distributing configuration information to the target database, the business service client can read the latest configuration information from the corresponding target database, eliminating the need for direct communication between the configuration center server and the business service client. This avoids the problem of untimely updates to the business service client's configuration information due to unstable communication between the configuration center server and the business service client.

[0098] In some embodiments, the configuration information distribution system 140 further includes: a preset module, which is specifically configured to determine a first correspondence between a business service client and an information identifier; determine a second correspondence between a business service client and a target database; determine a preset correspondence based on the first and second correspondences; and add the preset correspondence to the subscription information.

[0099] In this embodiment, the configuration information distribution system 140 further includes a preset module. Before distributing configuration information, the preset module can set preset correspondences in the subscription information, enabling different configuration information to be distributed to different target databases based on these preset correspondences. First, a first correspondence between the business service client and the information identifier is determined based on the business service client, i.e., determining which configuration information the business service client needs. Then, a second correspondence between the business service client and the target database is determined. The first and second correspondences are then combined, i.e., the correspondence between the business service client and the information identifier and the correspondence between the business service client and the target database are combined to obtain a correspondence between the information identifier and the target database. This correspondence is then defined as the preset correspondence and added to the subscription information. By determining the preset correspondence based on the first and second correspondences before distributing configuration information, it is ensured that different configuration information can be distributed to different target databases, thereby guaranteeing the efficiency and accuracy of configuration information distribution.

[0100] In some embodiments, optionally, the first determining module 1402 is specifically configured to receive a first processing operation instruction; determine second configuration information in a first database according to the first processing operation instruction, wherein the first database stores multiple configuration information; and process the second configuration information according to the first processing operation instruction to obtain the first configuration information.

[0101] In this embodiment, since all configuration information is stored on the configuration center server, when determining the first configuration information, the first determining module 1402 needs to receive a first processing operation instruction input by the user to the configuration center server. This first processing operation instruction can be one or a combination of search, add, edit, delete, import, and export operations. In other words, the user can perform operations such as searching, adding, editing, deleting, importing, and exporting all configuration information on the configuration center server. Then, based on the first processing operation instruction, the second configuration information is determined in the first database. The first database is the configuration center server's own database, which stores all current configuration information. By determining the second configuration information in the first database using the first processing operation instruction, the configuration information that the user wants to operate on is selected from all current configuration information. Then, the second configuration information is processed according to the first processing operation instruction to obtain the first configuration information, i.e., operations such as searching, adding, editing, deleting, importing, and exporting are performed on the second configuration information, thereby changing the second configuration information into the first configuration information.

[0102] In some embodiments, optionally, the first processing module 1404 is specifically configured to review the first configuration information and obtain a review result; if the review result is passed, receive a second processing operation instruction; if the second processing operation instruction is an online operation, add the first configuration information to at least one target database according to the subscription information to obtain a processing database; if the second processing operation instruction is an offline operation, delete the first configuration information from at least one target database according to the subscription information. In this embodiment, the first processing module 1404 is specifically configured to review the first configuration information after a user with operation permissions obtains the first configuration information through the first processing operation instruction, and determine whether the first configuration information meets expectations or regulations. This review can be conducted by a user with review permissions or by the configuration center server itself. When the review result is approved, a second processing operation instruction is received. If the second processing operation instruction is an "online" operation (i.e., when the user wants to add configuration information to the business service client), the first configuration information is added to the target database corresponding to the business service client according to the subscription information. This changes the target database to a processing database. When the business service client starts, reading the changed target database will then show the newly added first configuration information. If the second processing operation instruction is a "offline" operation (i.e., when the user wants to delete configuration information from the business service client), the first configuration information is deleted from the target database corresponding to the business service client according to the subscription information. This changes the target database to a processing database. When the business service client starts, reading the changed target database will no longer show the first configuration information, thus deleting the first configuration information from the business service client. Conversely, if the review result is a "rejection" operation, it indicates that the first configuration information does not meet the requirements or expectations. Therefore, feedback information needs to be sent to the user corresponding to the first processing operation instruction to inform them that the received first configuration information does not meet the requirements or expectations.

[0103] In some embodiments, the configuration information distribution system 140 may optionally include a sending module configured to send broadcast information to a business service client corresponding to the target database.

[0104] In this embodiment, the configuration information distribution system 140 further includes a sending module. After processing at least one target database according to the subscription information and the first configuration information, the sending module also needs to send broadcast information to the business service client corresponding to the processed target database, thereby reminding the corresponding business service client that the configuration information has changed, so that the business service client can open in time and read the processed target database, i.e., the processing database, to obtain the changed configuration information.

[0105] In some embodiments, the configuration information distribution system 140 may optionally include: a first receiving module, configured to receive the configuration information change channel subscribed by the business service client in the target database; and a first updating module, configured to control the changed target database to update the local database of the business service client based on the change in the target database.

[0106] In this embodiment, the configuration information distribution system 140 further includes a first receiving module and a first updating module. The first receiving module can receive configuration information change channels subscribed to by the business service client in the target database. That is, the business service client can subscribe to the channel of configuration information change messages in the target database. Therefore, when the configuration information changes, i.e., the target database changes, since the target database contains the configuration information change message channel subscribed to by the business service client, the first updating module can control the changed target database to update the local database of the business service client in a timely manner after the change.

[0107] In some embodiments, the configuration information distribution system 140 may optionally include: a second update module, configured to retrieve configuration information from the target database at preset intervals; and send the configuration information to the local database of the business service client for caching.

[0108] In this embodiment, the configuration information distribution system 140 further includes a second update module. A timed synchronization mechanism is added between the local database of the business service client and the target database. This allows the second update module to control the target database to update the local database of the business service client at preset intervals. In other words, the business service client can obtain the latest configuration information from the corresponding target database at a fixed frequency, i.e., at preset intervals, and cache it in its local database, thereby avoiding the problem of configuration information not being updated due to broadcast information loss.

[0109] Figure 15 shows a schematic block diagram of an electronic device according to an embodiment of the present application; wherein, the electronic device 150 includes a memory 1502, a processor 1504, and a computer program stored on the memory 1502 and executable on the processor 1504, wherein the processor 1504 executes the computer program to implement the steps of the configuration information distribution method as described above.

[0110] The steps of the electronic device 150 provided in this application, in which the processor 1504 executes the computer program to implement the above-mentioned method for distributing configuration information, will not be repeated here.

[0111] One embodiment of this application proposes a storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the configuration information distribution method as described above.

[0112] The steps for implementing the above-mentioned configuration information distribution method when the computer program is executed by the processor on the storage medium provided in this application will not be described again.

[0113] One embodiment of this application provides a computer program product including a computer program that, when executed by a processor, implements the steps of the configuration information distribution method as described in any of the above embodiments.

[0114] The steps of the computer program product provided in this embodiment to implement the configuration information distribution method as described in any embodiment of this application will not be repeated here.

[0115] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified and limited. The terms "connection," "installation," and "fixing," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0116] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0117] The above description is merely an optional embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for distributing configuration information, wherein, include: Determine first configuration information, wherein the first configuration information includes at least one information identifier; At least one target database is processed based on the subscription information and the first configuration information to obtain a processed database, wherein the subscription information includes at least one preset correspondence, the preset correspondence being the correspondence between the information identifier and the target database; and The configuration information in the processing database is cached in the local database of the business service client, which is started based on the business service client. The business service client corresponds to the target database.

2. The method for distributing configuration information according to claim 1, wherein, Prior to the step of determining the first configuration information, the method for distributing the configuration information includes: Determine the first correspondence between the business service client and the information identifier; Determine the second correspondence between the business service client and the target database; The preset correspondence is determined based on the first correspondence and the second correspondence; and, Add the preset correspondence to the subscription information.

3. The method for distributing configuration information according to claim 1 or 2, wherein, The step of determining the first configuration information includes: Receive the first processing operation instruction; The second configuration information is determined in the first database according to the first processing operation instruction, wherein the first database stores multiple configuration information; and, The first configuration information is obtained by processing the second configuration information according to the first processing operation instruction.

4. The method for distributing configuration information according to any one of claims 1 to 3, wherein, The step of processing at least one target database based on subscription information and the first configuration information to obtain a processed database includes: The first configuration information is reviewed to obtain the review result; If the audit result is approved, a second processing operation instruction is received. Based on the second processing operation instruction being an online operation, the first configuration information is added to at least one of the target databases according to the subscription information to obtain the processing database; and... Based on the fact that the second processing operation instruction is an offline operation, the first configuration information in at least one of the target databases is deleted according to the subscription information.

5. The method for distributing configuration information according to any one of claims 1 to 4, wherein, After the step of processing at least one target database according to the subscription information and the first configuration information to obtain a processed database, the method for distributing the configuration information includes: A broadcast message is sent to the business service client corresponding to the target database.

6. The method for distributing configuration information according to any one of claims 1 to 5, wherein, After the step of starting the service based on the business service client and controlling the configuration information in the processing database to be cached in the local database of the business service client, the method for distributing the configuration information further includes: The channel that receives the configuration information subscribed to by the service client in the target database; and, Based on the change in the target database, the changed target database is used to update the local database of the business service client.

7. The method for distributing configuration information according to any one of claims 1 to 6, wherein, After the step of starting the service based on the business service client and controlling the configuration information in the processing database to be cached in the local database of the business service client, the method for distributing the configuration information further includes: The configuration information is retrieved from the target database at preset time intervals; and, The configuration information is sent to the local database of the business service client for caching.

8. A configuration information distribution system, wherein, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method for distributing configuration information according to any one of claims 1 to 17; A first determining module is configured to determine first configuration information, wherein the first configuration information includes at least one information identifier; A first processing module is configured to process at least one target database based on subscription information and first configuration information to obtain a processed database, wherein the subscription information includes at least one preset correspondence, the preset correspondence being the correspondence between the information identifier and the target database; and... The first caching module is configured to be started based on the business service client and control the configuration information in the processing database to be cached in the local database of the business service client, wherein the business service client corresponds to the target database.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it implements the steps of the method for distributing configuration information as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the steps of the method for distributing configuration information as described in any one of claims 1 to 7.

11. A computer program product comprising computer instructions, wherein, When the computer instructions are executed by the processor, they implement the steps of the method for distributing configuration information as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Configuration management method and system

    CN102546218A

  • Distributed-system software configuration management method and system

    CN104065517A

  • Message subscription method and device, server and computer readable storage medium

    CN111163159A

  • Configuration information distribution method and system, electronic equipment and storage medium

    CN119211362A

  • Configuration data refreshing method, apparatus, system, storage medium, and electronic apparatus

    WO2024001564A1