CN110825358B - Multi-level system configuration service design method based on preamble priority matching rule - Google Patents
Multi-level system configuration service design method based on preamble priority matching rule Download PDFInfo
- Publication number
- CN110825358B CN110825358B CN201911156528.7A CN201911156528A CN110825358B CN 110825358 B CN110825358 B CN 110825358B CN 201911156528 A CN201911156528 A CN 201911156528A CN 110825358 B CN110825358 B CN 110825358B
- Authority
- CN
- China
- Prior art keywords
- configuration
- value
- path
- service
- level
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a method for designing a multi-level system configuration service based on a preamble priority matching rule, which comprises the following steps: according to the service levels of the configuration items, each level is used as a configuration unit, the name of the level is the name of the configuration unit, and the value of the level is the value of the configuration item of the configuration unit; storing a Hash value of a configuration path formed by names of a plurality of configuration units as a Key value of the configuration item; and acquiring the configuration of the maximum matching degree with the application scene by adopting a uniform Restful style service interface based on the Http protocol. The embodiment of the invention can support one configuration to adapt to multiple scenes, also support the situation of multiple configurations of multiple scenes, is based on the multi-level system configuration of the preface priority matching rule, performs personalized customization on a business system developed by a user through unified configuration of a personalized system, and can meet the personalized requirements of multiple tenants on various aspects of data, business functions, presentation styles and the like of the business system.
Description
Technical Field
The embodiment of the invention relates to the technical field of computer information, in particular to a multi-level system configuration service design method based on a preamble priority matching rule.
Background
In an application scenario mainly comprising SaaS, a client has high requirements on personalized customization requirements and updating frequency of a business application system, and the existing configuration service has the following two configuration management modes:
one traditional configuration file mode, which stores configuration items in configuration files, has low efficiency for configuration reading, writing and inquiring, and is basically not used in the cloud computing era.
The other is to use a database configuration table to store configuration, comprising a relational database and a Nosql database, and provide a simple key/value matching mode, wherein the mode improves the query modification efficiency compared with a file mode, but is single, only can process configuration items with fixed values, has insufficient supporting capability for personalized configuration of the service, has more complex scene for the service, and has higher management cost for the key.
Disclosure of Invention
Therefore, the embodiment of the invention provides a multi-level system configuration service design method based on a preamble priority matching rule, which aims to solve the problems that configuration service in the prior art can only process configuration items of fixed values, the personalized configuration requirement of service is insufficient in supporting capacity, the service is complex, and the management cost of keys is high.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
in one aspect of the embodiment of the invention, a method for designing a multi-level system configuration service based on a preamble priority matching rule is provided, which comprises the following steps:
according to the service levels of the configuration items, each level is used as a configuration unit, the name of the level is the name of the configuration unit, and the value of the level is the value of the configuration item of the configuration unit;
storing a Hash value of a configuration path formed by names of a plurality of configuration units as a Key value of the configuration item;
and acquiring the configuration of the maximum matching degree with the application scene by adopting a uniform Restful style service interface based on the Http protocol.
As a preferable scheme of the present invention, a configuration item is configured by a configuration path formed by a group of configuration units corresponding to a plurality of configuration levels.
As a preferred embodiment of the present invention, the value of the configuration item is any Json data.
As a preferable mode of the present invention, the name value of the configuration unit includes: tenant, application system, module, user and component, and support custom extensions.
As a preferred embodiment of the present invention, the configuration path is composed of key-value pairs composed of names and values of a series of ordered configuration units, and matches preferentially the preamble path items.
As a preferred aspect of the present invention, each path item of the configuration path uses a wild card to represent matching all values.
As a preferable scheme of the invention, the multi-level system configuration service adopts a unified configuration parameter access interface, stores data by using a Redis database, and starts persistence.
As a preferable scheme of the invention, the matching rule of the configuration item adopts a maximum matching degree algorithm under the preamble priority principle, namely, the configuration unit which is positioned in front of the configuration path is matched preferentially.
As a preferable scheme of the present invention, the number of matches of the longest match of the preamble priority longest match recursion algorithm is:
wherein p is the matching frequency of the most matching;
n is the number of configuration units in the configuration path.
As a preferable mode of the present invention, the Key value is formed by adding a Hash value of each value of the configuration path to each name of the configuration path.
Embodiments of the present invention have the following advantages:
the embodiment of the invention can support the conditions of one configuration and multiple configurations of multiple scenes, and also support the multi-level system configuration of the multiple scenes, and based on the preface priority matching rule, the personalized requirements of multiple tenants on the multiple aspects of data, service functions, presentation styles and the like of the service system are met by carrying out personalized customization through unified configuration of the personalized system under the condition of not modifying codes, not reconstructing and deploying even for one service system, module and even service assembly developed by a user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those of ordinary skill in the art that the drawings in the following description are exemplary only and that other implementations can be obtained from the extensions of the drawings provided without inventive effort.
Fig. 1 is a flowchart of a method for designing a multi-level system configuration service based on a preamble priority matching rule according to an embodiment of the present invention.
Fig. 2 is a schematic configuration diagram of a multi-level system configuration service according to an embodiment of the present invention in various scenarios.
Detailed Description
Other advantages and advantages of the present invention will become apparent to those skilled in the art from the following detailed description, which, by way of illustration, is to be read in connection with certain specific embodiments, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the existing configuration management, each configuration item needs to maintain a fixed Key value, and as the business complexity increases, the configuration items are more and more, the management of the configuration items is more and more complicated, and even special records are needed to maintain relevant keys.
And the unified configuration of different scenes can not be flexibly supported by using a mode of matching the universal configuration, and the personalized requirements of different configurations exist in different scenes.
In this regard, as shown in fig. 1, the present invention provides a method for designing a multi-level system configuration service based on a preamble priority matching rule, and a storage method, a configuration matching algorithm and a service interface design for multi-level configuration, which comprise the following steps:
according to the service levels of the configuration items, each level is used as a configuration unit, the name of the level is the name of the configuration unit, and the value of the level is the value of the configuration item of the configuration unit;
storing a Hash value of a configuration path formed by names of a plurality of configuration units as a Key value of the configuration item;
the configuration of the maximum matching degree with the application scene is obtained by adopting a uniform Restful style service interface based on the Http protocol, so that the configuration adaptation of one configuration to multiple scenes is supported, and the situation of multiple configurations of multiple scenes is also supported.
The multi-level system configuration based on the preamble priority matching rule is characterized in that personalized customization is carried out through unified configuration of a personalized system under the condition that codes are not modified, reconstruction and deployment are not carried out on a service system, a module and even a service assembly developed by a user, and the multi-level system configuration comprises modification of multi-level configuration parameters of tenants, application systems, modules, service assemblies and users, so that the multi-tenant personalized requirements on the data, service functions, presentation styles and the like of the service system are met.
The user can customize the business rules according to business requirements and store the related business configuration, but the optimal configuration of quick matching can be very convenient. The system has the advantages that personalized customization is carried out through unified configuration, the flexibility of service system development is improved, the personalized demands of multiple tenants on multiple aspects of the service system are met to the greatest extent, the development efficiency of the service application system is greatly improved, the development period is shortened, and the development cost is saved.
In this embodiment, the multi-level configuration is configured for a configuration path in which one configuration item is composed of a group of configuration units corresponding to a plurality of configuration levels, and the value of the configuration item is arbitrary Json data.
The name (unit) value of the configuration unit includes: tenant (tenant)/application system (app)/module (app_module)/user/component (widget) and supports custom extensions.
The configuration path (routing) consists of a series of ordered key-value pairs of configuration unit names and values, and matches the preamble path entries preferentially.
Each path entry of the configuration path (routing) may use a wildcard "×" to indicate that all values are matched.
The multi-level system configuration service adopts a unified configuration parameter access interface, stores data by using a Redis database, and starts persistence.
The basic design goal of the multi-level system configuration service is for configurations in various scenarios, using the values of the personalized configurations when they exist, and using the values of the generic configurations when there are no personalized configurations.
For example, as shown in fig. 2, the component interface color of one weather environment adopts a blue background (such as background of fig. 2), tenant T1 wants to use a red background (such as background of fig. 2), tenant T1 can configure a personalized configuration for T1, while this configuration only effectively uses the red background for T1, other tenants are not affected by the setting of T1 tenant, tenant T2 does not configure personalized parameters, and when T2 accesses the system, general configuration is adopted to take the blue background.
In this embodiment, the design of the matching algorithm is as follows:
the matching rule of the configuration item adopts a maximum matching degree algorithm under the preamble priority principle, namely the configuration unit which is positioned in front of the configuration path is matched preferentially.
For example: the sequence of each configuration unit of the component (Widget) is as follows: the tense/app/app_module/user/widget, assuming matching conditions are: t1|a1|m1|u1|w1, then the order of their matching possible values is in turn:
·t1|a1|m1|u1|w1
·t1|a1|m1|*|w1
·t1|a1|*|u1|w1
·t1|a1|*|*|w1
·t1|*|m1|u1|w1
·t1|*|m1|*|w1
·t1|*|*|u1|w1
·t1|*|*|*|w1
·*|a1|m1|u1|w1
·*|a1|m1|*|w1
·*|a1|*|u1|w1
·*|a1|*|*|w1
·*|*|m1|u1|w1
·*|*|m1|*|w1
·*|*|*|u1|w1
·*|*|*|*|w1
the number of matches of the maximum matches of the preamble priority longest match recursion algorithm is:
wherein p is the matching frequency of the most matching;
n is the number of configuration units in the configuration path.
In order to improve the search performance, the Key value is formed by adding the Hash value of each value of the configuration path to each name of the configuration path:
Key=Hash(join(routing*key+,’|’)|unit-type)|join(routing[value],’|’)|unit-type;
the shape is as follows: "95d232ac5fc495f4ced3d6df56096af4|t1|a1|m1|u1|widget.
The multi-level system configuration service interface of this embodiment is designed as follows:
1. setting a configuration item interface:
interface definition: PUT/api/v1/profile/;
request BODY: { type: "configuration item type", routing: [ configuration Path ] };
return value: { code:200, message: "success", data: "Json Format configuration value" };
when setting the configuration, the values of the configuration elements for the generic configuration item are set using the wildcard "×".
The configuration path is composed of a set of Key-Value pairs, such as: { key: "tent", value: "tenant ID" }, { key: "app ID", value: "app ID" }, { key: "app_module", value: "module ID" }, { key: "userid", value: "user ID" };
2. querying a maximum matching degree configuration item interface:
interface definition: POST/api/v1/profile/;
request BODY: { type: "configuration item type", routing: [ configuration path ], data: { Json Format configuration value };
return value: { code:200, message: "success", data: "}.
While the invention has been described in detail in the foregoing general description and specific examples, it will be apparent to those skilled in the art that modifications and improvements can be made thereto. Accordingly, such modifications or improvements may be made without departing from the spirit of the invention and are intended to be within the scope of the invention as claimed.
Claims (6)
1. The method for designing the configuration service of the multilevel system based on the preamble priority matching rule is characterized by comprising the following steps:
according to the service levels of the configuration items, each level is used as a configuration unit, the name of the level is the name of the configuration unit, and the value of the level is the value of the configuration item of the configuration unit;
storing a Hash value of a configuration path formed by names of a plurality of configuration units as a Key value of the configuration item;
a uniform Restful style service interface based on an Http protocol is adopted to obtain the configuration of the maximum matching degree with the application scene;
the configuration path is composed of key-value pairs formed by names and values of a series of ordered configuration units, and is preferentially matched with a preamble path item, each path item of the configuration path uses a wildcard to represent matching of all values, a maximum matching degree algorithm under a preamble priority principle is adopted by a matching rule of the configuration item, namely the configuration unit which is positioned in front of the configuration path is preferentially matched, and the maximum matching times of the maximum matching degree algorithm under the preamble priority principle are as follows:
wherein p is the matching times of the most matching, and n is the number of configuration units in the configuration path.
2. The method for designing a configuration service for a multilevel system based on a preamble priority matching rule according to claim 1, wherein a configuration item is configured by a configuration path composed of a set of configuration units corresponding to a plurality of configuration levels.
3. The method for designing a multilevel system configuration service based on a preamble priority matching rule according to claim 2, wherein the value of the configuration item is arbitrary Json data.
4. The method for designing a multi-level system configuration service based on a preamble priority matching rule according to claim 1, wherein the name value of the configuration unit comprises: tenant, application system, module, user and component, and support custom extensions.
5. The method for designing the multilevel system configuration service based on the preamble priority matching rule according to claim 1, wherein the multilevel system configuration service adopts a unified configuration parameter access interface, stores data by using a Redis database, and starts persistence.
6. The method of claim 1, wherein the Key value is formed by adding a Hash value of each value of the configuration path to each name of the configuration path.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911156528.7A CN110825358B (en) | 2019-11-22 | 2019-11-22 | Multi-level system configuration service design method based on preamble priority matching rule |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911156528.7A CN110825358B (en) | 2019-11-22 | 2019-11-22 | Multi-level system configuration service design method based on preamble priority matching rule |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110825358A CN110825358A (en) | 2020-02-21 |
CN110825358B true CN110825358B (en) | 2023-07-21 |
Family
ID=69558253
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911156528.7A Active CN110825358B (en) | 2019-11-22 | 2019-11-22 | Multi-level system configuration service design method based on preamble priority matching rule |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110825358B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113326264A (en) * | 2021-06-11 | 2021-08-31 | 深圳前海微众银行股份有限公司 | Data processing method, server and storage medium |
CN118689494A (en) * | 2023-03-23 | 2024-09-24 | 华为技术有限公司 | Method, device, system and related equipment for constructing software package |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103955384A (en) * | 2014-04-15 | 2014-07-30 | 南威软件股份有限公司 | Individual customization supporting method based on multi-tenant mode |
CN105631019A (en) * | 2015-12-29 | 2016-06-01 | 畅捷通信息技术股份有限公司 | Metadata extension method and device |
CN106371832A (en) * | 2016-08-29 | 2017-02-01 | 石化盈科信息技术有限责任公司 | SaaS (Software As A Service) function customization system and method based on metadata driving |
CN108696372A (en) * | 2017-04-06 | 2018-10-23 | 阿里巴巴集团控股有限公司 | A kind of method and system keeping system configuration consistency |
CN108932121A (en) * | 2018-05-22 | 2018-12-04 | 哈尔滨工业大学(威海) | A kind of module and method towards multi-tenant Distributed Services component |
CN109901817A (en) * | 2017-12-11 | 2019-06-18 | 镇江共远软件开发有限公司 | A kind of software architecture system |
CN109951530A (en) * | 2019-02-27 | 2019-06-28 | 上海浪潮云计算服务有限公司 | A kind of Implementation Technology of multi-tenant mode |
CN110321183A (en) * | 2018-03-29 | 2019-10-11 | 优酷网络技术(北京)有限公司 | A kind of configuration system and method at the interface common component UI |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8869099B2 (en) * | 2008-07-28 | 2014-10-21 | Infosys Limited | System and method of enabling multi-tenancy for software as a service application |
US10476760B2 (en) * | 2013-10-30 | 2019-11-12 | Oracle International Corporation | System and method for placement logic in a cloud platform environment |
-
2019
- 2019-11-22 CN CN201911156528.7A patent/CN110825358B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103955384A (en) * | 2014-04-15 | 2014-07-30 | 南威软件股份有限公司 | Individual customization supporting method based on multi-tenant mode |
CN105631019A (en) * | 2015-12-29 | 2016-06-01 | 畅捷通信息技术股份有限公司 | Metadata extension method and device |
CN106371832A (en) * | 2016-08-29 | 2017-02-01 | 石化盈科信息技术有限责任公司 | SaaS (Software As A Service) function customization system and method based on metadata driving |
CN108696372A (en) * | 2017-04-06 | 2018-10-23 | 阿里巴巴集团控股有限公司 | A kind of method and system keeping system configuration consistency |
CN109901817A (en) * | 2017-12-11 | 2019-06-18 | 镇江共远软件开发有限公司 | A kind of software architecture system |
CN110321183A (en) * | 2018-03-29 | 2019-10-11 | 优酷网络技术(北京)有限公司 | A kind of configuration system and method at the interface common component UI |
CN108932121A (en) * | 2018-05-22 | 2018-12-04 | 哈尔滨工业大学(威海) | A kind of module and method towards multi-tenant Distributed Services component |
CN109951530A (en) * | 2019-02-27 | 2019-06-28 | 上海浪潮云计算服务有限公司 | A kind of Implementation Technology of multi-tenant mode |
Non-Patent Citations (1)
Title |
---|
张一川.基于交互的多租约SaaS中个性化租约定制关键技术研究.《中国博士学位论文电子期刊》.2015,(第undefined期),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN110825358A (en) | 2020-02-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110321344B (en) | Information query method and device for associated data, computer equipment and storage medium | |
US8700560B2 (en) | Populating a multi-relational enterprise social network with disparate source data | |
US10042875B2 (en) | Bloom filter index for device discovery | |
WO2022257390A1 (en) | Data processing method, server, and storage medium | |
CN110275861A (en) | Date storage method and device, storage medium, electronic device | |
CN107807932B (en) | Hierarchical data management method and system based on path enumeration | |
US20140122422A1 (en) | Data synchronization | |
CN110825358B (en) | Multi-level system configuration service design method based on preamble priority matching rule | |
EP3136261A1 (en) | Method and device for data search | |
CN106649602B (en) | Business object data processing method, device and server | |
CN107391506A (en) | Method and apparatus for inquiring about data | |
CN110716965B (en) | Query method, device and equipment in block chain type account book | |
CN111767144A (en) | Transaction routing determination method, device, equipment and system for transaction data | |
CN116521956A (en) | Graph database query method and device, electronic equipment and storage medium | |
CN109460406B (en) | Data processing method and device | |
US12032557B2 (en) | Method, device, and computer program product for data management | |
US11531706B2 (en) | Graph search using index vertices | |
CN113590144A (en) | Dependency processing method and device | |
CN111124883B (en) | Test case library introduction method, system and equipment based on tree form | |
CN111858609A (en) | Fuzzy query method and device for block chain | |
US8005844B2 (en) | On-line organization of data sets | |
CN112835638A (en) | Configuration information management method and device based on embedded application program | |
CN111814020A (en) | Data acquisition method and device | |
US10402391B2 (en) | Processing method, device and system for data of distributed storage system | |
CN113779068A (en) | Data query method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |