A service configuration method, device, electronic device and storage medium

By using the configuration group as the minimum reuse unit and searching for configuration values ​​from the configuration group bound to itself during the microservice configuration process, the problems of repeated conflicts and low modification efficiency in microservice configuration adjustment are solved, and efficient configuration is achieved. manage.

CN112631648BActive Publication Date: 2025-01-21BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011545971.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-23
Publication Date
2025-01-21
Estimated Expiration
2040-12-23

AI Technical Summary

Technical Problem

In the process of microservice configuration adjustment, the traditional keyword-configuration value method is prone to repeated conflicts, and when different microservices share the same configuration, it is less efficient to modify the configuration.

Method used

By using the configuration group as the minimum reuse unit, each service is bound to one or more configuration groups, and during the service configuration process, the configuration value corresponding to the keyword is found from the configuration group bound to itself for parameter configuration.

Benefits of technology

Keyword conflicts between different services are avoided, and when modifying the service configuration, only the configuration group bound to the service needs to be modified or replaced, which improves the efficiency of configuration modification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112631648B_ABST
    Figure CN112631648B_ABST
Patent Text Reader

Abstract

The present disclosure provides a service configuration method, device, electronic device and storage medium. The configuration group is used as the smallest reuse unit, and each configuration group includes at least one pre-set configuration item. The service can bind one or more configuration groups based on the global unique identifier of the configuration group. In the service configuration process, after the service references the keyword in the business code, it will only search for the configuration value corresponding to the keyword from the configuration group bound to itself for parameter configuration. There will be no keyword conflict between different services of the present disclosure, and when modifying the service configuration, only the configuration group bound to the service needs to be modified or replaced, avoiding modifying the referenced configuration items one by one, which is more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of services, and in particular to a service configuration method, device, electronic device and storage medium. Background Art

[0002] In Internet applications, many business solutions will split the business into different parts, each part is responsible for a part of the service, such as order service, search service, etc. These split services are called microservices. A complete business service is usually composed of multiple microservices. This design not only reduces the coupling of the system, but also improves the efficiency of code reuse.

[0003] When adjusting the configuration (or parameters) of a microservice, the key-value method is usually used. For each configuration, a globally unique keyword and a corresponding configuration value (which can be a number, string, or other type) are created. Then, the above keyword is specified in the microservice code to obtain the configuration value corresponding to the keyword for parameter configuration.

[0004] In traditional solutions, keywords are globally unique and prone to duplication and conflict. Different microservices can reference the same keyword in the code and share the same configuration, but the configurations in microservices are often related. For example, in a search microservice, the number of search results displayed per page is one configuration, and the number of pages of search results displayed is another configuration. These configurations are related and need to be modified together when they are modified. In this case, the keywords originally specified in each part of the code need to be modified one by one, which is inefficient. Summary of the invention

[0005] In view of the above technical problems, the embodiments of the present disclosure provide a method, device, electronic device and storage medium for automatically setting an alarm threshold. The technical solution is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a service configuration method is provided, the method comprising:

[0007] Acquire a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein a namespace of the service to be configured is shared by the configuration group;

[0008] A keyword referenced by the service to be configured in the business logic is obtained, a configuration item corresponding to the keyword is searched from the configuration group, and the service to be configured is configured based on the searched configuration item.

[0009] Optionally, the service to be configured is bound to a globally unique identifier of the configuration group.

[0010] Optionally, searching the service configuration group for a configuration item corresponding to the keyword includes:

[0011] The configuration item corresponding to the keyword is searched from the configuration group. If configuration items of multiple configuration groups are found to include the keyword, the configuration group with the highest priority is selected from the different configuration groups, and the configuration item corresponding to the keyword is searched in the selected configuration group.

[0012] Optionally, the configuration group with the highest priority includes:

[0013] The configuration group that is bound to the service to be configured with the earliest binding time.

[0014] Optionally, the method further includes:

[0015] Obtaining a first configuration group to be updated and bound to the service to be configured;

[0016] Determine a second configuration group, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and modify the configuration value of each configuration item in the second configuration group to an updated value;

[0017] Unbind the service to be configured from the first configuration group, and bind the service to be configured to the second configuration group.

[0018] Optionally, the method for determining the second configuration group includes:

[0019] The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

[0020] Optionally, the unbinding the service to be configured from the first configuration group and binding the service to be configured to the second configuration group includes:

[0021] The globally unique identifier of the first configuration group referenced in the service is modified to the globally unique identifier of the second configuration group.

[0022] Optionally, the binding state of the configuration group includes one of the following:

[0023] Not bound to the task service;

[0024] is bound to a service;

[0025] Bound by multiple services at the same time.

[0026] According to a second aspect of an embodiment of the present disclosure, a service configuration device is provided, the device comprising:

[0027] a configuration group determination module, configured to obtain a service to be configured, the service to be configured is bound to at least one configuration group, the configuration group includes at least one configuration item, the configuration item includes a correspondence between a keyword and a configuration value, wherein the namespace of the service to be configured is shared by the configuration group;

[0028] The service configuration module is configured to obtain a keyword referenced by the service to be configured in the business logic, search for a configuration item corresponding to the keyword from the configuration group, and configure the service to be configured based on the found configuration item.

[0029] A globally unique identifier for the group.

[0030] Optionally, the service to be configured is bound to a globally unique identifier of the configuration group.

[0031] Optionally, the configuration group determination module, when searching for the configuration item corresponding to the keyword from the service configuration group, is configured to:

[0032] The configuration item corresponding to the keyword is searched from the configuration group. If configuration items of multiple configuration groups are found to include the keyword, the configuration group with the highest priority is selected from the different configuration groups, and the configuration item corresponding to the keyword is searched in the selected configuration group.

[0033] Optionally, the configuration group determination module, when selecting the configuration group with the highest priority from the different configuration groups, is configured to:

[0034] The configuration group that is bound to the service to be configured with the earliest binding time.

[0035] Optionally, the device further includes a configuration update module configured to:

[0036] Obtaining a first configuration group to be updated and bound to the service to be configured;

[0037] Determine a second configuration group, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and modify the configuration value of each configuration item in the second configuration group to an updated value;

[0038] Unbind the service to be configured from the first configuration group, and bind the service to be configured to the second configuration group.

[0039] Optionally, the configuration updating module, when determining the second configuration group, is configured to:

[0040] The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

[0041] Optionally, the configuration update module, when releasing the binding of the service to be configured from the first configuration group and binding the service to be configured to the second configuration group, is configured to:

[0042] The globally unique identifier of the first configuration group referenced in the service is modified to the globally unique identifier of the second configuration group.

[0043] Optionally, the binding state of the configuration group includes one of the following:

[0044] Not bound to the task service;

[0045] is bound to a service;

[0046] Bound by multiple services at the same time.

[0047] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the service configuration method as described in the first aspect.

[0048] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the service configuration method as described in the first aspect.

[0049] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the service configuration method as described in the first aspect is implemented.

[0050] The embodiments of the present disclosure provide a service configuration method, device, electronic device and storage medium. The configuration group is used as the smallest reuse unit, and each configuration group includes at least one pre-set configuration item. The service can bind one or more configuration groups based on the global unique identifier of the configuration group. During the service configuration process, after the service references the keyword in the business code, it will only search for the configuration value corresponding to the keyword from the configuration group bound to itself for parameter configuration. Since the namespace of each service is shared by the configuration group bound to the service and has nothing to do with the configuration groups of other services, there will be no keyword conflict between different services, and when modifying the service configuration, only the configuration group bound to the service needs to be modified or replaced, avoiding modifying the referenced configuration items one by one, which is more efficient.

[0051] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to limit the embodiments of the present disclosure.

[0052] In addition, any embodiment of the present disclosure does not need to achieve all of the above-mentioned effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0054] Figure 1 is a flow chart of a service configuration method shown in an exemplary embodiment of the present disclosure;

[0055] Figure 2 is a schematic diagram of a service configuration system shown in an exemplary embodiment of the present disclosure;

[0056] Figure 3 is another flow chart of a service configuration method shown in an exemplary embodiment of the present disclosure;

[0057] Figure 4 is a schematic diagram of a service configuration device shown in an exemplary embodiment of the present disclosure;

[0058] Figure 5 It is a schematic diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0060] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the present disclosure. The singular forms of "a", "the" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0061] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0062] In Internet applications, many business solutions will split the business into different parts, each part is responsible for a part of the service, such as order service, search service, etc. These split services are called microservices. A complete business service is usually composed of multiple microservices. This design not only reduces the coupling of the system, but also improves the efficiency of code reuse.

[0063] When adjusting the configuration (or parameters) of a microservice, the key-value method is usually used. For each configuration, a globally unique keyword and a corresponding configuration value (which can be a number, string, or other type) are created. Then, the above keyword is specified in the microservice code to obtain the configuration value corresponding to the keyword for parameter configuration.

[0064] In traditional solutions, different microservices can reference the same keyword in the code and share the same configuration, but the configurations in microservices are often related. For example, in a search microservice, the number of search results displayed per page is one configuration, and the number of pages of search results displayed is another configuration. These configurations are often related and need to be modified together when they are modified. In this case, the code needs to be modified one by one to modify the originally specified keywords, which is inefficient.

[0065] In order to solve this problem, the embodiments of the present disclosure provide a service configuration method and a service configuration system. The terms "microservice" and "service" are used interchangeably in this article. It is understood that although microservice is sometimes used to refer to service below, microservice is only one type of service and is not used to limit services.

[0066] First, the microservice configuration method provided by the embodiment of the present disclosure is introduced. The method can be applied to electronic devices such as servers and computer terminals. Figure 1 As shown, the method includes the following steps S101 to S102.

[0067] In step S101, a service to be configured is obtained, the service to be configured is bound to at least one configuration group, the configuration group includes at least one configuration item, the configuration item includes a correspondence between a keyword and a configuration value, wherein the namespace of the service to be configured is shared by the configuration group.

[0068] In step S102, a keyword referenced by the service to be configured in the business logic is obtained, a configuration item corresponding to the keyword is searched from the configuration group, and the service to be configured is configured based on the found configuration item.

[0069] The configuration item includes a correspondence between a keyword and a configuration value, and the keyword is a unique identifier of the configuration item in the configuration group, which can be called a local unique identifier. When configuring the service to be configured based on the found configuration item, the configuration value can be created in the configuration item, or the existing configuration value in the configuration item can be updated.

[0070] Take an example to illustrate the configuration process of configuration items: Service A uses the keyword page in the business logic to indicate the number of pages that need to be displayed for the search results. In the configuration group bound to service A, a configuration item with the keyword page is found. A configuration value 20 is created for the configuration item. Then the configuration is complete and the search results will be displayed as 20 pages. The configuration group is used as the smallest reuse unit. During the service configuration process, after the service references the keyword in the business logic, it will search for the configuration value corresponding to the keyword in the configuration group bound to itself for parameter configuration. Since the namespace of each service is shared by the configuration group bound to the service and is independent of the configuration groups of other services, there will be no keyword conflicts between different services.

[0071] See also Figure 2 As shown, the embodiment of the present disclosure designs a service configuration structure, which includes at least one configuration group, and the configuration group includes at least one configuration item, wherein:

[0072] The configuration group is set with a globally unique identifier, and the globally unique identifier is bound to the microservice. The microservice performs parameter configuration based on the configuration items in the bound configuration group;

[0073] Specifically, a configuration group is a collection of configuration items, each configuration item is a correspondence between a keyword and a configuration value (key-value pair), and each configuration group has a globally unique identifier, which is used to distinguish it from other configuration groups. The globally unique identifiers of any two configuration groups are different.

[0074] In one embodiment of the present disclosure, the globally unique identifier of the configuration group can be a sequentially assigned number. Each time a new configuration group is added, the globally unique identifier assigned last time is obtained, and an incremental calculation is performed on the basis of the globally unique identifier assigned last time, and the calculation result is determined as the globally unique identifier assigned this time.

[0075] In one embodiment of the present disclosure, the globally unique identifier of the configuration group may also be a number generated in real time based on the current time information. If a new configuration group is added at 2:00 on May 30, 2020, a globally unique identifier may be generated for the configuration group in real time based on the current time information. For example, the globally unique identifier may be B2020053002.

[0076] Each configuration group contains at least one configuration item. Generally, the configuration items contained in a single configuration group are configuration items with certain associations. For example, configuration item A in configuration group 1 is: how many search results are displayed per page; configuration item B is: how many pages of search results need to be displayed; configuration item C is: how many search results are returned in total. Configuration group 1 is related to search and is the configuration group bound to the search microservice. After the search microservice is bound to configuration group 1, the configuration items referenced by the subsequent search microservice are retrieved from configuration group 1 and no longer retrieved from the global configuration.

[0077] It should be noted that if other services involve search type configuration, they can also be bound to configuration group 1 at the same time. Unlike related technologies, the configuration group is the smallest reuse unit in the embodiment of the present disclosure. In this way, when the configuration of the microservice is subsequently modified, the bound old configuration group can be directly modified to the new configuration group, and the keywords of the configuration items in the new configuration group are the same as those of the old configuration group, so there is no need to modify the configuration items referenced by the microservice one by one.

[0078] The configuration item includes a correspondence between a keyword and a configuration value, configuration item=keyword+configuration value; the keyword is a unique identifier of the configuration item in the configuration group.

[0079] In an embodiment of the present disclosure, the namespace of the service to be configured is shared by the configuration group. That is, each service has an independent namespace, and the namespaces of different services are different. The effect that can be achieved is that even if the same keywords are configured between services, there will be no conflict. When configuring, you only need to pay attention to the different keywords configured in the service.

[0080] The service configures itself by referencing keywords in the business code. For example, if the search microservice is used in the business and the search microservice references keywords 001 and 002 in the business code, you can search for configuration values ​​1 and 2 corresponding to keywords 001 and 002 in the configuration group 1 bound to the search microservice, and make the configuration effective according to the found configuration values ​​1 and 2. For example, after configuration value 1 takes effect, 20 search results are displayed per page; after configuration value 2 takes effect, 10 pages of search results are displayed.

[0081] In an embodiment of the present disclosure, the service to be configured is bound to the globally unique identifier of the configuration group. Each service can be bound to several configuration groups. When the service to be configured references a keyword of a configuration item, the configuration item corresponding to the keyword will be searched in all the configuration groups to which it is bound.

[0082] In one embodiment of the present disclosure, the configuration groups bound to different services can all be different, that is, each configuration group acts on a service alone and will not be bound by other services. In this case, each service will not share a configuration group with other services. The advantage of this is that when a subsequent service modifies the configuration, since there is no shared configuration group with other services, the data in the current configuration group to which it is bound can be directly modified. The disadvantage is that more configuration groups need to be set.

[0083] In one embodiment of the present disclosure, different configuration groups have their own independent namespaces. By setting their own independent namespaces, it can be achieved that: the same keywords cannot exist in the same configuration group, and each keyword is unique; the same keywords can exist in different configuration groups, and the same keywords of different configuration groups are still unique, and no conflict will occur when the same keywords of different configuration groups are referenced.

[0084] As described above, each service can be bound to several configuration groups. When a service references a keyword of a configuration item, it will search for the configuration item corresponding to the keyword in all the configuration groups it is bound to. However, the same keyword may exist in different configuration groups. To solve this problem, in one embodiment of the present disclosure, searching for the configuration value corresponding to the keyword from the configuration group bound to the service includes:

[0085] If the keyword is included in all the different configuration groups bound to the service, a configuration group with the highest priority is selected from the different configuration groups, and a configuration value corresponding to the keyword is searched in the selected configuration group.

[0086] That is, the priorities of different configuration groups are set in advance. Specifically, after a service is bound to multiple configuration groups, priorities can be set for the multiple configuration groups to which it is bound. In one embodiment of the present disclosure, the configuration group with the highest priority includes: the configuration group with the earliest binding time bound to the service to be configured. In one example, the binding time of the different configuration groups with the service is determined, and the priority of the configuration groups is determined according to the order of the binding time. For example: the priority of the configuration group with the earliest binding time is determined to be the highest. For another example: the binding time of configuration group 1 and the service is January 1, 2020, the binding time of configuration group 2 and the service is January 2, 2020, and the binding time of configuration group 3 and the service is January 3, 2020, then the priority of the configuration group is determined as follows: configuration group 1> configuration group 2> configuration group 3.

[0087] In another embodiment of the present disclosure, a priority parameter may also be added to the configuration group when the configuration group is created. In this case, it is not necessary to set the priority level for the multiple configuration groups bound to the service after the service is bound to the multiple configuration groups.

[0088] Based on the service configuration method described above, the present disclosure also provides a service configuration update method. Figure 3 As shown, the method includes the following steps S301 to S303.

[0089] In step S301, a first configuration group to be updated and bound to the service to be configured is obtained.

[0090] In step S302, a second configuration group is determined, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and the configuration values ​​of the configuration items in the second configuration group are modified to updated values.

[0091] In an embodiment of the present disclosure, the method for determining the second configuration group includes:

[0092] The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

[0093] For example, the global unique identifier of the first configuration group is A001, which includes configuration item 1 [keyword = A1, configuration value = 001] and configuration item 2 [keyword = A2, configuration value = 002]. Copy configuration item 1 and configuration item 2 in the first configuration group to obtain a new configuration group with the same configuration items as the first configuration group. Then set a global unique identifier that has not been used by other configuration groups for the new configuration group, such as A099. The new configuration group is the second configuration group, and the global unique identifier of the second configuration item group is A099. The second configuration item group includes configuration item 1 [keyword = A1, configuration value = 001] and configuration item 2 [keyword = A2, configuration value = 002].

[0094] In step S303, the binding between the service to be configured and the first configuration group is released, and the service to be configured and the second configuration group are bound.

[0095] Since the same keyword can be configured in different configuration groups, if the configuration needs to be updated, you only need to replace the referenced set of configuration items with another set of configuration items with the same keyword. That is, the overall modification process is: set a new configuration group with the same keyword, modify the old configuration group bound in the microservice to the new configuration group (modify the global unique identifier of the bound configuration group), and update the configuration value of the bound new configuration group.

[0096] In another embodiment, the overall modification process may also be: setting a new configuration group with the same keyword, updating the configuration value of the new configuration group, and modifying the old configuration group bound in the microservice to the new configuration group (modifying the globally unique identifier of the bound configuration group).

[0097] Because the same configuration group may be bound and used by multiple microservices, when the configuration of one of the microservices needs to be updated, the configuration value in the configuration group should not be modified directly. Instead, you can create a new configuration group and modify the globally unique identifier of the configuration group bound to the microservice to conveniently implement batch modification of the configuration.

[0098] In one embodiment of the present disclosure, if each configuration group acts on a microservice alone and will not be bound by other microservices, that is, each microservice will not share a configuration group with other microservices, then the configuration value in the configuration group bound to the microservice can also be directly modified.

[0099] In one embodiment of the present disclosure, the binding state of the configuration group includes one of the following:

[0100] Not bound to the task service;

[0101] is bound to a service;

[0102] Bound by multiple services at the same time.

[0103] In Internet applications, many business solutions will split the business into different parts, each part is responsible for a part of the service, such as order service, search service, etc. These split services are called microservices. A complete business service is usually composed of multiple microservices. This design not only reduces the coupling of the system, but also improves the efficiency of code reuse.

[0104] When adjusting the configuration (or parameters) of a microservice, the key-value method is usually used. For each configuration, a globally unique keyword and a corresponding configuration value (which can be a number, string, or other type) are created. Then, the above keyword is specified in the microservice code to obtain the configuration value corresponding to the keyword for parameter configuration.

[0105] In traditional solutions, different microservices can reference the same keyword in the code and share the same configuration, but the configurations in microservices are often related. For example, in a search microservice, the number of search results displayed per page is one configuration, and the number of pages of search results displayed is another configuration. These configurations are often related and need to be modified together when they are modified. In this case, the keywords originally specified in each part of the code need to be modified one by one, which is inefficient.

[0106] In order to solve this problem, the embodiment of the present disclosure provides a microservice configuration method, which uses a configuration group as the smallest reuse unit, each configuration group includes at least one pre-set configuration item, and the service can bind one or more configuration groups based on the globally unique identifier of the configuration group. During the service configuration process, if the service references a keyword, it will search for the configuration value corresponding to the keyword from the configuration group to which it is bound to perform parameter configuration. Since the namespace of the service in the embodiment of the present disclosure is shared by the configuration group to which the service is bound and has nothing to do with the configuration groups of other services, there will be no keyword conflicts between different services. At the same time, since each configuration group has a globally unique identifier, when modifying the service configuration, it only needs to modify or replace the configuration group bound to the service, avoiding modifying the referenced configuration items one by one, which is more efficient.

[0107] Corresponding to the above method embodiment, the present disclosure embodiment also provides a service configuration device, see Figure 4 As shown, the apparatus may include: a configuration group determination module 410 and a service configuration module 420 .

[0108] The configuration group determination module 410 is configured to obtain a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein the namespace of the service to be configured is shared by the configuration group;

[0109] The service configuration module 420 is configured to obtain a keyword referenced by the service to be configured in the business logic, search for a configuration item corresponding to the keyword from the configuration group, and configure the service to be configured based on the found configuration item.

[0110] Optionally, the service to be configured is bound to a globally unique identifier of the configuration group.

[0111] Optionally, the configuration group determination module, when searching for the configuration item corresponding to the keyword from the service configuration group, is configured to:

[0112] The configuration item corresponding to the keyword is searched from the configuration group. If configuration items of multiple configuration groups are found to include the keyword, the configuration group with the highest priority is selected from the different configuration groups, and the configuration item corresponding to the keyword is searched in the selected configuration group.

[0113] Optionally, the configuration group determination module, when selecting the configuration group with the highest priority from the different configuration groups, is configured to:

[0114] The configuration group that is bound to the service to be configured with the earliest binding time.

[0115] Optionally, the device further includes a configuration update module configured to:

[0116] Obtaining a first configuration group to be updated and bound to the service to be configured;

[0117] Determine a second configuration group, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and modify the configuration value of each configuration item in the second configuration group to an updated value;

[0118] Unbind the service to be configured from the first configuration group, and bind the service to be configured to the second configuration group.

[0119] Optionally, the configuration updating module, when determining the second configuration group, is configured to:

[0120] The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

[0121] Optionally, the configuration update module, when releasing the binding of the service to be configured from the first configuration group and binding the service to be configured to the second configuration group, is configured to:

[0122] The globally unique identifier of the first configuration group referenced in the service is modified to the globally unique identifier of the second configuration group.

[0123] Optionally, the binding state of the configuration group includes one of the following:

[0124] Not bound to the task service;

[0125] is bound to a service;

[0126] Bound by multiple services at the same time.

[0127] The present disclosure also provides an electronic device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the aforementioned service configuration methods when executing the program. In one example, the method includes:

[0128] Acquire a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein a namespace of the service to be configured is shared by the configuration group;

[0129] Determine a keyword referenced by the service to be configured in the business logic, search for a configuration item corresponding to the keyword from the configuration group, and configure the service to be configured based on the found configuration item.

[0130] Figure 5A schematic structural diagram of an electronic device based on a master device side according to an exemplary embodiment of the present disclosure is shown. Figure 5 At the hardware level, the electronic device includes a processor 502, an internal bus 504, a network interface 505, a memory 503, and a non-volatile memory 510, and may also include hardware required for other services. The processor 502 reads the corresponding computer program from the non-volatile memory 510 into the memory 503 and then runs it, forming a device for executing the automatic setting method of the alarm threshold at the logical level. Of course, in addition to the software implementation, the present disclosure does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0131] The present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any of the aforementioned service configuration methods is implemented. In one example, the method includes:

[0132] Acquire a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein a namespace of the service to be configured is shared by the configuration group;

[0133] Determine a keyword referenced by the service to be configured in the business logic, search for a configuration item corresponding to the keyword from the configuration group, and configure the service to be configured based on the found configuration item.

[0134] The present disclosure also provides a computer program product, including a computer program. When the computer program is executed by a processor, any of the aforementioned service configuration methods is implemented. In one example, the method includes:

[0135] Acquire a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein a namespace of the service to be configured is shared by the configuration group;

[0136] A keyword referenced by the service to be configured in the business logic is obtained, a configuration item corresponding to the keyword is searched from the configuration group, and the service to be configured is configured based on the searched configuration item.

[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic storage devices such as magnetic tape storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0138] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0139] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0140] The above is only a specific implementation of the embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present disclosure. These improvements and modifications should also be regarded as the protection scope of the embodiment of the present disclosure.

Claims

1. A service configuration method, characterized in that: The method comprises: Acquire a service to be configured, the service to be configured is bound to at least one configuration group, the configuration group includes at least one configuration item, the configuration item includes a correspondence between a keyword and a configuration value, wherein the namespace of the service to be configured is shared by the configuration group to which the service to be configured is bound, and is independent of configuration groups of other services; the configuration groups have their own independent namespaces, and by setting the independent namespaces, it is achieved that: in the same configuration group, there are no identical keywords, and each keyword is unique; in different configuration groups, the same keywords can exist, and the same keywords in different configuration groups are still unique; A keyword referenced by the service to be configured in the business logic is obtained, a configuration item corresponding to the keyword is searched from the configuration group, and the service to be configured is configured based on the searched configuration item.

2. The service configuration method according to claim 1, characterized in that: The service to be configured is bound to the globally unique identifier of the configuration group.

3. The service configuration method according to claim 1, characterized in that: The searching the service configuration group for a configuration item corresponding to the keyword includes: The configuration item corresponding to the keyword is searched from the configuration group. If configuration items of multiple configuration groups are found to include the keyword, the configuration group with the highest priority is selected from different configuration groups, and the configuration item corresponding to the keyword is searched in the selected configuration group.

4. The service configuration method according to claim 3, characterized in that: The configuration group with the highest priority includes: The configuration group that is bound to the service to be configured with the earliest binding time.

5. The service configuration method according to claim 1, characterized in that: Also includes: Obtaining a first configuration group to be updated and bound to the service to be configured; Determine a second configuration group, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and modify the configuration value of each configuration item in the second configuration group to an updated value; Unbind the service to be configured from the first configuration group, and bind the service to be configured to the second configuration group.

6. The service configuration method according to claim 5, characterized in that: The determining of the second configuration group comprises: The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

7. The service configuration method according to claim 5, characterized in that: The unbinding the service to be configured from the first configuration group and binding the service to be configured to the second configuration group includes: The globally unique identifier of the first configuration group referenced in the service is modified to the globally unique identifier of the second configuration group.

8. The service configuration method according to claim 1, characterized in that: The binding state of the configuration group includes one of the following: Not bound by the task service; is bound to a service; Bound by multiple services at the same time.

9. A service configuration device, characterized in that: The device comprises: The configuration group determination module is configured to obtain a service to be configured, wherein the service to be configured is bound to at least one configuration group, wherein the configuration group includes at least one configuration item, wherein the configuration item includes a correspondence between a keyword and a configuration value, wherein the namespace of the service to be configured is shared by the configuration group to which the service to be configured is bound, and is independent of configuration groups of other services; the configuration groups have their own independent namespaces, and by setting the independent namespaces, it is achieved that: in the same configuration group, there are no identical keywords, and each keyword is unique; in different configuration groups, there can be identical keywords, and the identical keywords of different configuration groups are still unique; The service configuration module is configured to obtain a keyword referenced by the service to be configured in the business logic, search for a configuration item corresponding to the keyword from the configuration group, and configure the service to be configured based on the found configuration item.

10. The service configuration device according to claim 9, characterized in that: The service to be configured is bound to the globally unique identifier of the configuration group.

11. The service configuration device according to claim 9, characterized in that: The configuration group determination module, when searching for the configuration item corresponding to the keyword from the service configuration group, is configured to: The configuration item corresponding to the keyword is searched from the configuration group. If configuration items of multiple configuration groups are found to include the keyword, the configuration group with the highest priority is selected from different configuration groups, and the configuration item corresponding to the keyword is searched in the selected configuration group.

12. The service configuration device according to claim 11, characterized in that: The configuration group determination module, when selecting the configuration group with the highest priority among the different configuration groups, is configured to: The configuration group that is bound to the service to be configured with the earliest binding time.

13. The service configuration device according to claim 9, characterized in that: The device also includes a configuration update module, which is configured to: Obtaining a first configuration group to be updated and bound to the service to be configured; Determine a second configuration group, the keywords of the configuration items in the second configuration group are the same as the keywords of the configuration items in the first configuration group, and modify the configuration value of each configuration item in the second configuration group to an updated value; Unbind the service to be configured from the first configuration group, and bind the service to be configured to the second configuration group.

14. The service configuration device according to claim 13, characterized in that: The configuration updating module, when determining the second configuration group, is configured to: The first configuration group is copied, a new globally unique identifier is set for the copied new configuration group, and the new configuration group is determined as the second configuration group.

15. The service configuration device according to claim 13, characterized in that: The configuration update module, when releasing the binding between the service to be configured and the first configuration group and binding the service to be configured and the second configuration group, is configured to: The globally unique identifier of the first configuration group referenced in the service is modified to the globally unique identifier of the second configuration group.

16. The service configuration device according to claim 9, characterized in that: The binding state of the configuration group includes one of the following: Not bound by the task service; is bound to a service; Bound by multiple services at the same time.

17. A computer-readable electronic device, characterized in that: include: processor; A memory for storing the processor executable instructions; wherein the processor is configured to execute the instructions to implement the service configuration method according to any one of claims 1 to 8.

18. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the service configuration method as claimed in any one of claims 1 to 8.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the service configuration method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method for implementing HTTP (hyper text transport protocol) message caching mechanism based on keywords

    CN102075570A

  • Television system interface display method, device and computer readable storage medium

    CN107404669A