A configuration management system and method based on a JAVA configuration center

By establishing associations between projects, configuration groups, configuration items, and project environments on both the server and client sides, the problem of inconsistent configuration items in the configuration center across different project environments is solved. This achieves consistent and accurate configuration provision of configuration items in all project environments, reduces resource waste, and detects configurations that are no longer in use.

CN116302063BActive Publication Date: 2025-12-12QUANTONG JINXIN HLDG (GUANGDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310261639.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-17
Publication Date
2025-12-12
Estimated Expiration
2043-03-17

AI Technical Summary

Technical Problem

The existing configuration center has inconsistent configuration items in different project environments, which makes it impossible to accurately provide the configuration required by the client and to determine the usage of configuration items in each project environment, resulting in configuration chaos and waste of resources.

Method used

By establishing associations between projects, configuration groups, configuration items, and project environments on both the server and client sides, the values ​​of configuration items are associated with the project environment, ensuring consistency of configuration items across all projects and environments. Furthermore, the values ​​of configuration items can be directly obtained through the client, avoiding the need for developers to manually download configuration files.

Benefits of technology

It achieves consistency of configuration items across all project environments, accurately provides the configuration required by the client, reduces resource waste, can detect configuration items that are no longer in use, and eliminates the need to manually download test environment configurations to the local machine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302063B_ABST
    Figure CN116302063B_ABST
Patent Text Reader

Abstract

The application discloses a configuration management system and method based on a JAVA configuration center, and relates to the technical field of configuration management.The system comprises a server setting module, a client setting module and a configuration acquisition module.The server setting module is used for associating projects with configuration groups, associating configuration groups with configuration items, associating configuration items with project environments, and associating the values of configuration items with the project environments corresponding to the configuration items in the server.The client setting module is used for defining configuration registration classes in the client and taking configuration items as attribute values of the configuration registration classes.The configuration acquisition module is used for acquiring the values of configuration items corresponding to the project environments in the server according to the configuration items, and returning the configuration items and the values of the configuration items to the client.The method comprises a server setting step, a client setting step and a configuration acquisition step.The configuration management system and method based on the JAVA configuration center solve the problem that the matching between configuration items and the values of the configuration items and current project environments is not accurate in the prior art, so that the configuration of the client under different project environments is prone to confusion.
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, in particular to a configuration management system and method based on JAVA configuration center. BACKGROUND

[0002] The configuration center is a platform for centralized management of all project configurations. The configuration in the present application is composed of multiple key = value, wherein the key is a configuration item, and the value is the value of the configuration item. Figure 1

[0003] The mainstream configuration centers in the JAVA ecological market at present include Disconf, Apollo and Nacos. Their principles are divided into two categories, one is based on configuration files, and the other is based on key = value (i.e. kv). Regardless of which mode, their principles are as shown in Figure 2 From Figure 2 , it can be seen that the project is bound to kv. But in actual development, the same project will have multiple project environments, generally including local environment, test environment, pre-online environment and formal environment. In different project environments, the same key often corresponds to different values. The existing configuration center solves the problem as shown in Figure 3 , all configuration files have three versions, which are respectively used for test environment, pre-online and formal, and the keys in the three versions can be inconsistent. Figure 3 The configuration of the local environment is not included in the present application, because the local environment is more complex, and in the local environment, some kv is consistent with the test environment, and the value in some kv is set by the developer himself, so generally the configuration of the test environment is downloaded to the local in the form of a file, and then the local development uses the configuration file to disconnect the configuration center.

[0004] Therefore, the existing configuration center has the following defects:

[0005] 1. The configuration items of the configuration center may be inconsistent in each project environment. It is possible that the configuration items in different environments are inconsistent due to different maintenance personnel of different project environments. For example, Figure 1 the "warn.phone" in the above table has been deleted in the test environment but is still retained in the formal environment, or is added in the test environment and the pre-online environment but is forgotten to be added in the formal environment.

[0006] 2. The configuration required by the client cannot be accurately provided. For example, Figure 4 ​As shown, the configuration center adds three kvs to the configuration of project B, but project B only uses two, but the configuration center still transmits all configurations to project B, that is, one useless kv is transmitted to project B, and in the implementation scenario, dozens of useless kvs may be transmitted to the client.

[0007] 3. For each configuration item in the configuration center, it cannot be determined which projects use these configuration items.

[0008] 4. It cannot detect configurations that are no longer used in the business.

[0009] 5. All configuration centers now require that only the kvs provided by the configuration center can be used, but for local environments, the values of some configuration items need to be different from the test environment, or some kvs that are only used in the local environment need to be added to simulate some situations. At this time, the developer can only download the test environment configuration in the form of a file to the local environment, and then use the configuration file to disconnect the configuration center.

[0010] Therefore, the existing configuration management system has the problem that the configuration items and the values of the configuration items do not match the current project environment accurately, which leads to confusion in the configuration of the client in different project environments. SUMMARY

[0011] In order to overcome the defects of the prior art, one object of the present application is to provide a configuration management system of a JAVA-based configuration center to solve the above problems.

[0012] In order to overcome the defects of the prior art, another object of the present application is to provide a configuration management method of a JAVA-based configuration center to solve the above problems.

[0013] The technical scheme adopted by the present application to solve its technical problems is: a configuration management system of a JAVA-based configuration center, the configuration center comprising a server and a client, the server and the client being in communication connection;

[0014] Further comprising a server setting module, a client setting module and a configuration acquisition module;

[0015] The server setting module is used to associate projects with configuration groups in the server, associate configuration groups with configuration items, associate configuration items with project environments, and associate the project environment corresponding to the configuration item with the value of the configuration item;

[0016] The client setting module is used to define a configuration registration class in the client, and use the configuration item as an attribute value of the configuration registration class;

[0017] The acquisition configuration module is configured to acquire the value of the configuration item corresponding to the project environment in the server according to the configuration item, and return the configuration item and the value of the configuration item to the client.

[0018] It is worth noting that the server setting module is configured to establish a project configuration table, a configuration item table, and a value table in each environment in the server.

[0019] It is also configured to acquire the project and store it in the project id of the project configuration table, acquire the configuration group and store it in the configuration group id of the project configuration table and the configuration group id of the configuration item table, acquire the configuration item and store it in the configuration item id of the configuration item table and the configuration item id of the value table in each environment, acquire the value of the configuration item and store it in the configuration item setting value of the value table in each environment, and acquire the project environment and store it in the project environment setting value of the value table in each environment. In the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; and in the value table in each environment, one configuration item is associated with multiple values of the configuration item.

[0020] Optionally, in the server setting module, the configuration item table further includes a non-empty judgment item.

[0021] The server setting module is further configured to return a setting success when all values of the configuration item corresponding to the configuration item in the value table in each environment are non-empty values when the acquired configuration non-empty judgment item is true, and return a setting failure otherwise.

[0022] Preferably, in the server setting module, the configuration item table further includes a must judgment item.

[0023] The server setting module is further configured to return the configuration item and the corresponding value of the configuration item to the client when the must judgment item is true and the configuration item is not specified in the client.

[0024] Specifically, in the server setting module, the configuration item table further includes a default value.

[0025] The server setting module is further configured to return the content in the default value to the client when the acquired default value is not empty and the values of the configuration item corresponding to all project environments in the configuration item in the value table in each environment are empty.

[0026] It is worth noting that a configuration management method based on a JAVA configuration center, the configuration center including a server and a client, the server and the client being in communication connection, the method including:

[0027] The server setting step: associating the project with the configuration group in the server, associating the configuration group with the configuration item, associating the configuration item with the project environment, associating the project environment corresponding to the configuration item with the value of the configuration item;

[0028] The client setting step: defining a configuration registration class in the client, and taking the configuration item as the attribute value of the configuration registration class;

[0029] The configuration obtaining step: obtaining the value of the configuration item corresponding to the project environment in the server according to the configuration item, and returning the configuration item and the value of the configuration item to the client.

[0030] Optionally, the server setting step comprises:

[0031] establishing a project configuration table, a configuration item table and a value table in the server;

[0032] obtaining the project and storing the project id in the project configuration table, obtaining the configuration group and storing the configuration group id in the project configuration table and the configuration group id in the configuration item table, obtaining the configuration item and storing the configuration item id in the configuration item table and the configuration item id in the value table in each environment, obtaining the value of the configuration item and storing the configuration item setting value in the value table in each environment, and obtaining the project environment and storing the project environment setting value in the value table in each environment; wherein, in the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; and in the value table in each environment, one configuration item is associated with multiple values of the configuration item.

[0033] Preferably, the configuration item table comprises a non-empty judgment item;

[0034] The server setting step further comprises: when the obtained configuration non-empty judgment item is true, returning setting success only when all the values of the configuration item corresponding to the configuration item in the value table in each environment are non-empty, and otherwise returning setting failure.

[0035] Specifically, the configuration item table further comprises a must judgment item;

[0036] The server setting step further comprises: when the obtained must judgment item is true, returning the configuration item and the value of the corresponding configuration item to the client when the configuration item is not specified in the client.

[0037] Preferably, the configuration item table further comprises a default value;

[0038] The service end setting step further comprises: when the acquired default value is not empty and the values of the configuration items corresponding to all project environments in the value table configured in each environment are empty, returning the content in the default value to the client.

[0039] The JAVA-based configuration center configuration management system has the advantages that: the project is associated with the configuration group, the configuration group and the configuration item are associated, the configuration item and all project environments are associated, and the project environment corresponding to the configuration item is associated with the value of the configuration item, so that all configuration items are consistent in all projects and project environments and the configuration item only needs to be written once, and the configuration required by the client can be accurately provided; in addition, in the finally formed association relationship, the project is associated with the configuration item, so that the configuration item used by each project can be determined, and the configuration no longer used in the business can be detected; the JAVA-based configuration center configuration management system distinguishes the configurations in the local environment and the test environment when setting, so that the client can directly acquire the configurations when using, and the configurations in the test environment do not need to be downloaded to the local in the form of a file by the developer. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 A relationship diagram of an existing configuration item and a value of the configuration item;

[0041] Figure 2 A relationship diagram of a project and a configuration in an existing scheme;

[0042] Figure 3 A relationship diagram of a project, a project environment and a configuration in an existing scheme;

[0043] Figure 4 A relationship diagram of a project and a configuration in an existing scheme;

[0044] Figure 5 A relationship diagram of a project, a configuration item, a value of the configuration item and a project environment in an embodiment of the application;

[0045] Figure 6 A diagram of a client in an embodiment of the application;

[0046] Figure 7 A diagram of a project configuration table of a service end in an embodiment of the application;

[0047] Figure 8 A diagram of a configuration item table of a service end in an embodiment of the application;

[0048] Figure 9A diagram of the value table of the server in one embodiment of the present application in various environments;

[0049] Figure 10 A system block diagram of the configuration management system of the configuration center in JAVA in one embodiment of the present application;

[0050] Figure 11 A flow chart of the configuration management method of the configuration center in JAVA in one embodiment of the present application. DETAILED DESCRIPTION

[0051] The specific embodiments of the present application will be further described below with reference to the accompanying drawings. It is to be noted that the description of the embodiments is used to help understand the present application and does not constitute a limitation of the present application. In addition, the technical features involved in the various embodiments of the present application described below can be combined with each other as long as there is no conflict.

[0052] As shown in Figures 1-10 A configuration management system based on the configuration center in JAVA, the configuration center comprising a server and a client, the server and the client being in communication connection;

[0053] Further comprising a server setting module, a client setting module and an obtaining configuration module;

[0054] The server setting module is used to associate the project with the configuration group, associate the configuration group with the configuration item, associate the configuration item with the project environment, and associate the project environment corresponding to the configuration item with the value of the configuration item in the server;

[0055] The client setting module is used to define a configuration registration class in the client, and take the configuration item as the attribute value of the configuration registration class;

[0056] As shown in Figure 6As shown, the acquisition configuration module is configured to acquire the value of the configuration item in the corresponding project environment in the server according to the configuration item, and return the configuration item and the value of the configuration item to the client. In this way, the client scans the configuration registration class to obtain the required configuration item before taking the configuration, and then acquires the value of the corresponding configuration item in the project environment according to the configuration item, so that the server can accurately provide the kv. When the client starts, the local configuration is read first, wherein the local configuration includes the address of the server and the name of the project, and then the configuration registration class is scanned to obtain the configuration item. Then, the client acquires the configuration item and the variable in the project environment according to the configuration item and the name of the project. After the configuration is acquired, the local configuration and the configuration acquired from the server are combined. For a certain configuration item, if the current project environment is the local environment, the value of the local configuration is used, otherwise the value of the server is used. In this way, the configurable file and the kv of the server can be used together, and the value of a certain configuration item can be customized in the local environment. The client records the usage frequency of a certain kv every time it is used. The client pushes the usage of the kv of the day to the server at a set time, and the server records the usage. In this way, the usage of each configuration item can be seen in the table of the database in the server.

[0057] In the configuration management system of the JAVA-based configuration center, the project is associated with the configuration group, the configuration group is associated with the configuration item, the configuration item is associated with all project environments, and the corresponding project environment of the configuration item is associated with the value of the configuration item. In this way, all configuration items can be consistent in all projects and project environments, and the configuration item only needs to be written once, and the configuration required by the client can be accurately provided, such as Figure 5 As shown, test.c=hh represents that the value of test.c in all environments is hh. In addition, since the final formed association relationship associates the project with the configuration item, the configuration item used by each project can be determined, and the configuration item that is no longer used in the business can also be determined, so that the configuration that is no longer used in the business can be detected. Since the JAVA-based configuration center configuration management system distinguishes the configurations in the local environment and the test environment when setting, the client can directly acquire the configurations when using, so that the developer does not need to download the configurations in the test environment to the local environment in the form of a file.

[0058] It is worth noting that the server setting module is configured to establish a project configuration table, a configuration item table, and a value table in each environment in the server; as Figures 7-9As shown, the project configuration table includes project id and configuration group id, the configuration item table includes configuration item id and configuration item setting value, and the value table of configuration in each environment includes configuration item setting value, project environment setting value and project environment id; further used for obtaining the project and storing in the project id of the project configuration table, obtaining the configuration group and storing in the configuration group id of the project configuration table and the configuration group id of the configuration item table, such as jdbc in Figure 7 and Figure 8 , obtaining the configuration item and storing in the configuration item id of the configuration item table and the configuration item id of the value table of configuration in each environment, such as jdbc.driver in Figure 8 and Figure 9 , obtaining the value of the configuration item and storing in the configuration item setting value of the value table of configuration in each environment, such as aaaa in Figure 9 , and obtaining the project environment and storing in the project environment setting value of the value table of configuration in each environment; the project environment id is used for storing project environment, such as test environment in Figure 9 ; wherein, in the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; in the value table of configuration in each environment, one configuration item is associated with multiple values of the configuration item, and each value of the configuration item has corresponding project environment.

[0059] In the embodiment, the server is provided with a configuration management option, a value option of the configuration item in each environment, an engineering-configuration option and an environment ip option. Through the configuration management option, all the configuration items in the same project group can be set, and then the configuration item table is updated. The value of the configuration item in each project environment can also be set. For example, the configuration items of the configuration group "redis" set in the configuration management option are "redis.database", "redis.host", "redis.maxIdele" and "redis.maxTotal". In order to classify the configuration items conveniently, the prefix of the configuration item needs to be set to be consistent with the name of the configuration group. However, in some scenarios, the same configuration item needs to have different values in different projects. Therefore, in the embodiment, the name of the configuration group is further distinguished by @ to distinguish the configuration of different projects. For example, jdbc is a database configuration. When there are multiple databases, the name after @ is used to distinguish. That is, the name of each configuration item must be prefixed with the configuration group. If the configuration group has a @ character, the name before the @ character is the prefix of the configuration item. For example, in jdbc@t, jdbc is the prefix of the configuration item. The value of the configuration item corresponding to each project environment is set through the value option of the configuration item in each environment, and then the value table of the configuration in each environment is updated. The project and the configuration group are associated through the engineering-configuration option, and then the project configuration table is updated. The engineering-configuration option is to associate the project and the configuration group. In the embodiment, the upper part of the page is the existing project, and the lower part is the selected project associated with which configuration groups. The project environment is set through the environment ip option, and then the value table of the configuration in each environment is updated. When the client takes the configuration, the server obtains the ip of the node where the client is located from the request, so as to obtain the project environment where the client is located. In this way, the server can provide the client with the value of the configuration item in the current project environment. Specifically, the above functions are realized through the existing JAVA coding.

[0060] Optionally, in the server setting module, the configuration item table further includes a non-empty judgment item; and the server setting module is further configured to return a setting success when all the values of the configuration items corresponding to the configuration item in the value table of the configuration in each environment are non-empty values when the obtained configuration non-empty judgment item is true, and return a setting failure otherwise. When the configuration non-empty judgment item corresponding to the configuration item is true, the values of the configuration items in each project environment corresponding to the configuration item must have values, otherwise the position of the configuration item in the project environment with empty values is highlighted in red. At the same time, when the client takes the project environment without values, the server returns a failure and prompts that the value of the configuration item corresponding to the project environment is missing. In this way, the function of reminding when the value of the non-empty configuration item is empty can be realized.

[0061] In particular, the configuration item table further comprises a must-determine item in the server setting module; the server setting module is further used to return the configuration item and the corresponding configuration item value to the client when the must-determine item is true and the configuration item is not specified in the client. When the must-determine item corresponding to the configuration item is true, the client does not specify the configuration item as long as the project is associated with the configuration group where the configuration item is located, and the configuration item and the configuration item value are returned to the client. This function is mainly used in database configuration and other non-business configurations, such as the project a configuration registration class shown in Figure 7 and Figure 8 When only private static final String SAY_HELLO="say.hello" is written in the project a configuration registration class, and the must-determine items of the configuration items jdbc.driver and jdbc.url are true, i.e. Figure 8 jdbc.driver and jdbc.url are must, and say.hello is not must, so the actual configuration items and configuration item values are: jdbc.driver, jdbc.url and say.hello.

[0062] Preferably, the configuration item table further comprises a default value in the server setting module; the server setting module is further used to return the content in the default value to the client when the obtained default value is not empty and the configuration item values of all project environments corresponding to the configuration item in the value table configured in each environment are empty. When the default value corresponding to the configuration item has a value, and the configuration item values corresponding to various project environments are empty, the value is taken. When the configuration item values corresponding to all project environments of a certain configuration item are the same, the value can be filled in the default value, and the configuration item values corresponding to various environments are kept empty. In addition, the configuration item table further comprises an explanation item, and the function of the configuration item can be recorded in the explanation item.

[0063] Specifically, the configuration item has test environment, pre-online environment and formal environment under the menu of value option of each environment. The page function in each submenu is exactly the same. Taking the test environment as an example, all configuration groups are displayed on the top of the page, and after clicking a configuration group, all item configuration items (key names) of the configuration group and the values (key values) of the project items in the visited project environment will be displayed below the page. When the configuration of a configuration item is non-empty and there is no value in the project environment, the "edit" button will turn red to remind the user to set the value of the project item for the configuration item, and when a client takes the value of the configuration item, the server will report an error to the client. When there is only one non-empty configuration item with a null value in a configuration group, the name of the configuration group will be red. For the value of the project item, when the configuration item has a default value and the current project environment has no value of the configuration item, the default value is used; when the current project environment has a value of the configuration item, the value of the configuration item in the current project environment is used. For operation, there are three operations: edit, take effect and history record. Editing is to edit the value of the configuration item; taking effect is to push the value of the current configuration item to all project nodes that reference the configuration item in the current project environment; the history record can see the historical value of the value of the configuration item in the current project environment and can be restored to a certain historical value. The middle part of the page will display which project the mouse points to the configuration item in the current environment. The principle is that when the client takes the configuration from the server, the server will record all the configurations taken out. The server will refresh the configuration item reference situation of the project name in the current project environment. Therefore, the server can find out which projects reference the configuration item according to the configuration item and the current project environment.

[0064] It is worth noting that, as shown in Figure 11 A configuration management method based on a JAVA-based configuration center, the configuration center includes a server and a client, the server and the client are in communication connection, and the method comprises:

[0065] The server setting step: in the server, the project is associated with the configuration group, the configuration group is associated with the configuration item, the configuration item is associated with the project environment, and the corresponding project environment of the configuration item is associated with the value of the configuration item;

[0066] The client setting step: defining a configuration registration class in the client, and taking the configuration item as the attribute value of the configuration registration class;

[0067] The configuration acquisition step: according to the configuration item, the value of the configuration item in the corresponding project environment in the server is acquired, and the configuration item and the value of the configuration item are returned to the client.

[0068] Optionally, the server setting step comprises:

[0069] Create a project configuration table, a configuration item table, and a value table for each environment on the server side;

[0070] The process involves: retrieving the project and storing its ID in the project configuration table; retrieving the configuration group and storing its ID in both the configuration group table and the configuration item table; retrieving the configuration item and storing its ID in both the configuration item table and the value table configured in each environment; retrieving the value of the configuration item and storing its setting value in the value table configured in each environment; and retrieving the project environment and storing its setting value in the value table configured in each environment. Specifically, in the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; and in the value table configured in each environment, one configuration item is associated with the values ​​of multiple configuration items.

[0071] Specifically, the configuration item table includes a non-empty determination item; the server-side setting step further includes: when the obtained configuration non-empty determination item is true, the setting is returned as successful only when all the values ​​of the configuration items corresponding to the configuration item in the value table configured in each environment are non-empty; otherwise, the setting is returned as failed.

[0072] Preferably, the configuration item table also includes a mandatory determination item; the server setting step further includes: when the obtained mandatory determination item is true, if the configuration item is not specified in the client, returning the configuration item and the value of the corresponding configuration item to the client.

[0073] It is worth noting that the configuration item table also includes default values; the server-side setting steps also include: when the obtained default value is not empty and the values ​​of the configuration items corresponding to the configuration item in the value table of each environment are all empty, the content of the default value is returned to the client.

[0074] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.

Claims

1. A JAVA-based configuration management system of a configuration center, the configuration center comprising a server and a client, the server and the client being communicatively connected, characterized in that: it further comprises a server setting module, a client setting module and a configuration obtaining module; the server setting module is configured to associate a project with a configuration group, associate the configuration group with a configuration item, associate the configuration item with a project environment, and associate the project environment corresponding to the configuration item with a value of the configuration item in the server; the server setting module is configured to establish a project configuration table, a configuration item table and a value table in each environment in the server; it is further configured to obtain the project and store it in a project id of the project configuration table, obtain the configuration group and store it in a configuration group id of the project configuration table and a configuration group id of the configuration item table, obtain the configuration item and store it in a configuration item id of the configuration item table and a configuration item id of the value table in each environment, obtain the value of the configuration item and store it in a configuration item setting value of the value table in each environment, and obtain the project environment and store it in a project environment setting value of the value table in each environment; wherein in the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; and in the value table in each environment, one configuration item is associated with multiple values of the configuration item; the client setting module is configured to define a configuration registration class in the client, and take the configuration item as an attribute value of the configuration registration class; the configuration obtaining module is configured to obtain the value of the configuration item corresponding to the project environment in the server according to the configuration item, and return the configuration item and the value of the configuration item to the client.

2. The configuration management system based on the JAVA-based configuration center according to claim 1, characterized in that: in the server setting module, the configuration item table further comprises a non-empty judgment item; the server setting module is further configured to return a setting success when all the values of the configuration item corresponding to the configuration item in the value table in each environment are non-empty values when the obtained configuration non-empty judgment item is true, and return a setting failure otherwise.

3. The configuration management system of claim 2, wherein: in the server setting module, the configuration item table further comprises a must judgment item; the server setting module is further configured to return the configuration item and the corresponding value of the configuration item to the client when the configuration item is not specified in the client when the obtained must judgment item is true.

4. The configuration management system of claim 3, wherein: in the server setting module, the configuration item table further comprises a default value; the server setting module is further configured to return the content in the default value to the client when the obtained default value is not empty and the values of the configuration item corresponding to all the project environments of the configuration item in the value table in each environment are empty.

5. A configuration management method based on a JAVA-based configuration center, the configuration center comprising a server and a client, the server and the client being communicatively connected, characterized in that, the method comprises: a server setting step of associating a project with a configuration group, associating the configuration group with a configuration item, associating the configuration item with a project environment, and associating the project environment corresponding to the configuration item with a value of the configuration item in the server; establishing a project configuration table, a configuration item table and a value table in each environment in the server; The project is acquired and stored in the project id of the project configuration table, the configuration group is acquired and stored in the configuration group id of the project configuration table and the configuration group id of the configuration item table, the configuration item is acquired and stored in the configuration item id of the configuration item table and the configuration item id of the value table configured in each environment, the value of the configuration item is acquired and stored in the configuration item setting value of the value table configured in each environment, and the project environment is acquired and stored in the project environment setting value of the value table configured in each environment; wherein in the project configuration table, one project is associated with one configuration group; in the configuration item table, one configuration group is associated with multiple configuration items; and in the value table configured in each environment, one configuration item is associated with multiple values of the configuration item. The client setting step comprises: defining a configuration registration class in the client, and taking the configuration item as the attribute value of the configuration registration class. The configuration acquiring step comprises: acquiring the value of the configuration item corresponding to the project environment in the server according to the configuration item, and returning the configuration item and the value of the configuration item to the client.

6. The configuration management method of a JAVA-based configuration center according to claim 5, characterized in that: The configuration item table comprises a non-empty judgment item. The server setting step further comprises: when the acquired configuration non-empty judgment item is true, returning setting success only when all the values of the configuration item corresponding to the configuration item in the value table configured in each environment are non-empty values, and returning setting failure otherwise.

7. The configuration management method of a JAVA-based configuration center according to claim 6, characterized in that: The configuration item table further comprises a must judgment item. The server setting step further comprises: when the acquired must judgment item is true, returning the configuration item and the corresponding value of the configuration item to the client when the configuration item is not specified in the client.

8. The configuration management method of a JAVA-based configuration center according to claim 7, characterized in that: The configuration item table further comprises a default value. The server setting step further comprises: when the acquired default value is not empty and the values of the configuration item corresponding to all the project environments of the configuration item in the value table configured in each environment are empty, returning the content in the default value to the client.

Citation Information

Patent Citations

  • Method for managing application configuration parameters in concentrated mode and method for configuring application parameters

    CN104022894A

  • Spring-based configuration center management configuration method and configuration management device thereof

    CN115421810A