Switch setting method, device, equipment and medium based on structured data

By separating the switch dimension data and matching logic in the database, and reading and buffering switch information at the system startup, the problem of poor scalability of the switch table structure in the prior art is solved, and flexible configuration and efficient maintenance of switches are realized.

CN111666281BActive Publication Date: 2025-04-25CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010350321.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-28
Publication Date
2025-04-25
Estimated Expiration
2040-04-28

AI Technical Summary

Technical Problem

The existing system functions or module switches have poor scalability, inflexible use and poor maintenance efficiency, resulting in bloated, chaotic switches, and difficult to understand and use.

Method used

By logically separating the switch dimension data from the matching logic, a basic switch data table and a switch dimension data table are created in the database, so that the switch and its dimension information are structurally presented as a tree structure. When the system starts, the effective switch information is read from these tables and save it to the cache. The switch group code and dimension information to be matched are obtained according to the business scenario, the matching is performed according to the preset matching method, and the switching value of the target switch is set.

Benefits of technology

It improves the scalability and flexibility of switches, reduces maintenance complexity and code redundancy, and improves development, maintenance and deployment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111666281B_ABST
    Figure CN111666281B_ABST
Patent Text Reader

Abstract

The present invention discloses a switch setting method based on structured data, including: when the system starts, reading the effective switch information from the switch basic data table and the switch dimension data table according to the current time, and saving the switch information to the cache; obtaining the corresponding switch group code, the to-be-matched dimension information corresponding to the node to be matched, and the matching method according to the business scenario executed by the system; obtaining one or more switch information belonging to the group corresponding to the switch group code from the cached switch information; according to the matching method, matching the to-be-matched dimension information with each switch information in the group corresponding to the group code, and obtaining the target switch corresponding to the node to be matched according to the matching result; setting the switch value of the target switch on the node to be matched. In addition, the present invention also relates to blockchain technology, and the target switch information can be stored in the blockchain node. The present invention solves the problems of poor scalability, inflexible use, and poor maintenance efficiency of existing system function or module switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a switch setting method, device, equipment and medium based on structured data. Background Art

[0002] During the system development process, system function or module switches, such as calculation formula modification switches, associated system call environment switching switches, etc., are widely used in various systems. By applying switches, you can easily perform operations such as function switching, version risk control (quick rollback), grayscale release, and logic switching.

[0003] The existing technology is strongly associated with business logic when configuring switch dimensions and query logic, and can only be fixed in the code, which cannot meet the processing of complex business needs. The data structure design has poor scalability. If you want to increase the switch dimension, you must modify the table structure of the database switch table, change or add new codes about the switch. When the switch dimension increases too much, the switch table structure becomes bloated and chaotic, difficult to understand and use. What's worse, when the table structure changes frequently, the switch dimension is abused, and the switch data is chaotic, the retrieval and matching logic of various switches cannot be shared, resulting in a large amount of code with similar logic but cannot be reused, which affects the efficiency of development, maintenance, and deployment.

[0004] Therefore, finding a method to solve the problems of poor scalability, inflexible use, and poor maintenance efficiency of existing system functions or module switches has become a technical problem that technicians in this development field urgently need to solve. Summary of the invention

[0005] The embodiments of the present invention provide a switch setting method, device, equipment and medium based on structured data to solve the problems of poor scalability, inflexible use and poor maintenance efficiency of existing system function or module switches.

[0006] A switch setting method based on structured data, comprising:

[0007] When the system starts, the effective switch information is read from the switch basic data table and the switch dimension data table according to the current time, and the switch information is saved to the cache;

[0008] According to the business scenario executed by the system, the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node and the matching method are obtained;

[0009] Acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information;

[0010] According to the matching method, the dimension information to be matched is matched with each switch information in the group corresponding to the group code, and the target switch corresponding to the node to be matched is obtained according to the matching result;

[0011] The switch value of the target switch is set on the to-be-matched node.

[0012] Optionally, the switch basic data table is used to store basic information of the switch, the basic information including switch name, switch value, switch group code, and effective time;

[0013] The switch dimension data table is used to store the dimension information of the switch, and the dimension information includes the switch name and at least one applicable condition;

[0014] The switch name in the switch basic data table is used as a foreign key in the switch dimension data table.

[0015] Optionally, matching the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching mode, and acquiring the target switch corresponding to the node to be matched according to the matching result includes:

[0016] If the matching mode is single-dimensional matching, each of the dimension information to be matched is matched with each switch information in the group corresponding to the group code;

[0017] If any dimension information to be matched successfully matches any switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch.

[0018] Optionally, matching the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching mode, and acquiring the target switch corresponding to the node to be matched according to the matching result includes:

[0019] If the matching method is multi-dimensional matching, all the dimension information to be matched are matched with each switch information in the group corresponding to the group code;

[0020] If all the dimension information to be matched successfully matches any switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch.

[0021] Optionally, when the system is started, reading effective switch information from the switch basic data table and the switch dimension data table according to the current time, and saving the switch information to the cache includes:

[0022] When the system starts, the current time is compared with the effective time in the switch basic data table to obtain the switch name corresponding to the effective switch;

[0023] Acquire dimension information corresponding to each effective switch from the switch dimension data table according to the switch name;

[0024] The switch name and dimension information corresponding to each effective switch is taken as a complete switch information and saved in the cache.

[0025] A switch setting device based on structured data, comprising:

[0026] A first acquisition module is used to read effective switch information from the switch basic data table and the switch dimension data table according to the current time when the system is started, and save the switch information to a cache;

[0027] The second acquisition module is used to acquire the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node, and the matching method according to the business scenario executed by the system;

[0028] A third acquisition module, configured to acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information;

[0029] A matching module, used to match the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching method, and obtain the target switch corresponding to the node to be matched according to the matching result;

[0030] The setting module is used to set the switch value of the target switch on the node to be matched.

[0031] Optionally, the switch basic data table is used to store basic information of the switch, the basic information including switch name, switch value, switch group code, and effective time;

[0032] The switch dimension data table is used to store the dimension information of the switch, and the dimension information includes the switch name and at least one applicable condition;

[0033] The switch name in the switch basic data table is used as a foreign key in the switch dimension data table.

[0034] Optionally, the matching module includes:

[0035] A first matching unit, configured to match each piece of the to-be-matched dimension information with each piece of switch information in the group corresponding to the group code respectively if the matching mode is single-dimensional matching;

[0036] A first result unit is used for, if any to-be-matched dimension information successfully matches any switch information in the group corresponding to the group code, taking the switch corresponding to the successfully matched switch information as the target switch; and / or

[0037] A second matching unit, configured to match all dimensional information to be matched with each switch information in the group corresponding to the group code if the matching mode is multi-dimensional matching;

[0038] The second result unit is used to take the switch corresponding to the successfully matched switch information as the target switch if all the to-be-matched dimension information are successfully matched with any switch information in the group corresponding to the group code.

[0039] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the switch setting method based on structured data when executing the computer program.

[0040] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the switch setting method based on structured data is implemented.

[0041] The embodiment of the present invention separates the switch dimension data and the matching logic, and creates two structure tables in the database, namely the switch basic data table and the switch dimension data table, so that the switch and its basic dimension information present a tree structure in structure; when the system starts, the effective switch information is read from the switch basic data table and the switch dimension data table stored in the database according to the current time; then one or more switch information of the group corresponding to the switch group code belonging to the business scenario is obtained from the switch information; according to the preset matching method, the dimension information to be matched is matched with each switch information respectively; if the target switch corresponding to the node to be matched is matched from the group corresponding to the group code, the switch value of the target switch is set on the node to be matched, and the switch is started and closed, thereby solving the problems of poor scalability and inflexible use of the existing switch table structure and poor maintenance efficiency caused by the uncontrolled growth of switches or dimensions. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0043] Figure 1is a flow chart of a switch setting method based on structured data in one embodiment of the present invention;

[0044] Figure 2 is a flow chart of step S101 in a switch setting method based on structured data in one embodiment of the present invention;

[0045] Figure 3 is a flow chart of step S104 in a switch setting method based on structured data in one embodiment of the present invention;

[0046] Figure 4 is a flow chart of step S104 in a switch setting method based on structured data in another embodiment of the present invention;

[0047] Figure 5 is a principle block diagram of a switch setting device based on structured data in one embodiment of the present invention;

[0048] Figure 6 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] In order to solve the problems of poor scalability and inflexible use of the switch table structure in the prior art, and poor maintenance efficiency caused by the uncontrolled growth of switches or dimensions, the embodiment of the present invention separates the switch dimension data and matching logic, and creates two structure tables in the database, namely the switch basic data table and the switch dimension data table. Among them, the structure table refers to a database table storing switch data, and each column of the database table stores a field of a piece of data, such as the organization and product corresponding to the switch will have two columns. In this embodiment, the basic information of the switch is stored in the switch basic data table, including but not limited to the switch name, switch value, switch group code, effective time, etc.; and the dimension information of the switch is stored in the switch dimension data table, including but not limited to the switch name and at least one applicable condition, and the applicable condition is not limited to the applicable organization, the applicable market product, and the applicable technical product. The switch name in the switch basic data table is used as the foreign key of the switch dimension data table, so that the switch and its dimension information present a tree structure in structure, and each switch corresponds to the dimension data of one or more nodes. The switch matching logic separated from the switch dimension is applicable to all switches. When performing matching, the configuration data of the same group of switches are queried, and the final matching results are returned one by one, so as to complete the startup and shutdown of the switch.

[0051] The switch setting method based on structured data provided in this embodiment is described in detail below. Figure 1 As shown, the switch setting method includes:

[0052] In step S101, when the system starts, effective switch information is read from the switch basic data table and the switch dimension data table according to the current time, and the switch information is saved to the cache.

[0053] As mentioned above, the switch basic data table includes but is not limited to switch name, switch value, switch group code, and effective time. The switch name refers to the unique identifier of the switch. The switch value refers to the state represented by the switch. Exemplarily, the default switch value includes two states: open or closed; in some special cases, the switch value can be set to any string to meet the switch support of multi-branch services, such as any value of 10 state values ​​from 0 to 9. The effective time refers to the effective time of the switch corresponding to the switch name. The switch group code is related to the business scenario. Each business scenario corresponds to a switch code, and the switches applicable in the same business scenario have the same switch group code. According to the switch group code, all switches applicable in the business scenario can be obtained.

[0054] Here, in the embodiment of the present invention, when the system starts, the current time is compared with the effective time in the switch basic data table to obtain the switch name corresponding to the effective switch, and the switch information is read from the switch dimension data table according to the switch name and saved in the cache, so as to facilitate the subsequent introduction of specific switch values ​​according to the business scenario. Compared with reading the switch basic data table and the switch dimension data table in the database when introducing the switch value, the efficiency of reading the switch information is improved, and the development efficiency is improved.

[0055] Alternatively, if Figure 2 As shown, the step S101 also includes:

[0056] In step S201, when the system starts, the current time is compared with the effective time in the switch basic data table to obtain the switch name corresponding to the effective switch.

[0057] Here, the current time refers to the time when the system is started, and the effective time of each switch can be obtained according to the record in the switch basic data table. The embodiment of the present invention compares the current time with the effective time in the switch basic data table, selects switches whose effective time is before the current time as effective switches, and obtains the switch name corresponding to the effective switch.

[0058] In step S202, dimension information corresponding to each effective switch is obtained from the switch dimension data table according to the switch name.

[0059] The dimension information of each switch can be obtained according to the records in the switch dimension data table. The embodiment of the present invention matches the switch name of the effective switch obtained in step S201 with the switch name recorded in the switch dimension data table, thereby filtering out the dimension information corresponding to each effective switch.

[0060] In step S203, the switch name and dimension information corresponding to each effective switch is taken as a complete switch information and saved in the cache.

[0061] The switch name obtained in step S201 and the dimension information obtained in step S202 are integrated as a completed switch information and saved in the cache for subsequent introduction of specific switch values ​​according to business scenarios. Compared with reading the switch basic data table and the switch dimension data table from the database when introducing the switch value, the efficiency of reading the switch information is improved, and the development efficiency is improved. It should be emphasized that in order to further ensure the privacy and security of the above switch information, the above switch information can also be stored in a node of a blockchain.

[0062] In step S102, the corresponding switch grouping code, the to-be-matched dimension information corresponding to the to-be-matched node, and the matching method are obtained according to the business scenario executed by the system.

[0063] Here, the node to be matched refers to the system node that needs to be configured with a switch, and the dimension information to be matched refers to the attributes, environment, requirements, etc. of the system node that needs to be configured with a switch. The matching method refers to the matching logic of the dimension information to be matched, including a single-dimensional matching mode and a multi-dimensional matching mode.

[0064] In step S103, one or more pieces of switch information belonging to the group corresponding to the switch group code are obtained from the cached switch information.

[0065] Here, this embodiment obtains one or more switch information belonging to the group corresponding to the switch group code from the cache according to the switch group code, obtains all switch information applicable to the current business scenario, and implements preliminary filtering of the switch information in the cache, which is beneficial to improving the efficiency of switch matching.

[0066] In step S104, the dimension information to be matched is matched with each switch information in the group corresponding to the group code according to the matching method, and the target switch corresponding to the node to be matched is obtained according to the matching result.

[0067] Then, according to the matching method corresponding to the business scenario, the dimension information to be matched is matched with each switch information in the group corresponding to the group code. In the matching method, single-dimensional matching or multi-dimensional matching can be specified. For single-dimensional matching, as long as one dimension to be matched is successfully matched, the switch is determined to be a matching result. For multi-dimensional matching, all dimensions to be matched must be matched successfully before the switch is determined to be a matching result. By controlling the number of matching dimension parameters, switch matching that meets various conditions can be flexibly completed.

[0068] Optionally, as a preferred example of the present invention, Figure 3 As shown, the step S104 further includes:

[0069] In step S301, if the matching mode is single-dimensional matching, each piece of dimension information to be matched is matched with each piece of switch information in the group corresponding to the group code;

[0070] In single-dimensional matching, for each piece of dimensional information to be matched, this embodiment compares the dimensional information to be matched with each piece of dimensional information of each piece of switch information one by one.

[0071] In step S302, if any dimension information to be matched successfully matches any switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch.

[0072] If one dimension information in any switch information is the same as any dimension information to be matched, it is considered that the match is successful, and the switch corresponding to the successfully matched switch information is used as the target switch.

[0073] Optionally, as another preferred example of the present invention, Figure 4 As shown, the step S104 further includes:

[0074] In step S401, if the matching method is multi-dimensional matching, all dimensional information to be matched is matched with each switch information in the group corresponding to the group code.

[0075] In multi-dimensional matching, all the dimensional information to be matched is taken as a whole, and the information to be matched is synchronously compared one by one with the corresponding dimensional information of each switch information.

[0076] In step S402, if all the dimension information to be matched successfully matches any switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch.

[0077] If all dimension information in any switch information is the same as the corresponding dimension information to be matched, it is considered that the match is successful, and the switch corresponding to the successfully matched switch information is used as the target switch.

[0078] In step S105, the switch value of the target switch is set on the node to be matched.

[0079] Finally, if the target switch corresponding to the node to be configured is matched from the group corresponding to the group code, the switch value of the target switch is obtained from the switch basic data table, and the switch value of the target switch is set on the node to be configured, such as an open state or a closed state or an arbitrary string.

[0080] In the prior art, the switch table records basic switch data, such as switch name, switch value, effective time, etc., and dimensional data, such as applicable organization, applicable market product code, applicable technical product code, etc. Adding a dimension, such as product category, requires adding a column to the switch table, and the added column is unnecessary for other switch data. If the table structure is changed frequently, it will cause problems such as bloated and chaotic table structure and waste of database storage space.

[0081] The embodiment of the present invention separates the switch parameters from the matching logic and the switch basic information from the switch dimension by restructuring the switch data structure, stores the switch information in the switch basic data table, and stores the switch dimension in the switch dimension data table. When adding / deleting the switch dimension, only the switch dimension data table needs to be added / deleted without modifying the switch implementation code, which can more flexibly support the change of the switch dimension and improve the scalability of the switch and dimension configuration; and the switch function is realized through the universal matching logic, which can keep the data structure and code logic stable, making the maintenance efficiency of the switch higher and improving the overall implementation stability of the switch.

[0082] For example, assuming that the switch group code corresponding to business scenario A is A, the switches with the switch group code A include switch A1 and switch A2. Among them, the applicable conditions of switch A1 include: organization dimension 232, technical product dimension TP0500003. The applicable conditions of switch A2 include: organization dimension 211, technical product dimension TP0500003.

[0083] Assume that the switch group code corresponding to business scenario B is B, and the switches with the switch group code B include switch B1, switch B2, and switch B3. Among them, the applicable conditions of switch B1 include: organization dimension 232, market product dimension B003. The applicable conditions of switch B2 include: organization dimension 211, market product dimension B003. The applicable conditions of switch B3 include: organization dimension 201, market product dimension B003.

[0084] Assume that the switch group code corresponding to business scenario C is C, and the switches with the switch group code C include switch C1 and switch C2. The applicable conditions of switch C1 include: organization dimension 201, technical product code TP100001, and the applicable conditions of switch C2 include: organization dimension 202, technical product code TP100002.

[0085] Through the switch setting method provided by the embodiment of the present invention, the switch name, switch value, switch group code, and effective time of switch A1, switch A2, switch B1, switch B2, switch B3, switch C1, and switch C2 are stored in the switch basic data table, and the switch name and at least one applicable condition of switch A1, switch A2, switch B1, switch B2, switch B3, switch C1, and switch C2 are stored in the switch dimension data table. When the system starts, the effective switch information is read from the switch basic data table and the switch dimension data table according to the current time into the cache, such as the switch information of A1 and the switch information of A2, the switch information of B1 and the switch information of B2, the switch information of B3, the switch information of switch C1, and the switch information of switch C2.

[0086] If the switch group code obtained according to the business scenario X executed by the system is A, the dimension information to be matched corresponding to the node to be configured is organization 211, technical product TP0500003, and the matching method is multi-dimensional matching, then according to the switch group code A, the switch information belonging to the group corresponding to the switch group code A is obtained from the plurality of switch information in the cache, that is, the switch information corresponding to switches A1 and A2. According to the multi-dimensional matching, the dimension information to be matched is matched with the switch information of switches A1 and A2 respectively. Through the multi-matching mode, the dimension information to be matched corresponding to the current business scenario (technical product TP0500003 under organization 211) can be obtained in one-to-one correspondence with the applicable conditions of switch A2 (organization dimension 211, technical product dimension TP0500003), so that switch A2 is obtained as the target switch, and the node to be configured is set to the switch value of switch A2.

[0087] If the switch group code obtained according to the business scenario Y executed by the system is C, the dimension information to be matched corresponding to the node to be configured is organization 202 and technical product TP0500003, and the matching method is single-dimensional matching, then according to the switch group code C, the switch information belonging to the group corresponding to the switch group code C is obtained from the plurality of switch information in the cache, that is, the switch information corresponding to switches C1 and C2. According to the single-dimensional matching, the dimension information to be matched is matched with the C1 switch information and the C2 switch information respectively. Through the single-dimensional matching, it can be obtained that the dimension information to be matched corresponding to the current business scenario (technical product TP0500003 under organization 202) is the same as the organization dimension 202 in the applicable conditions of switch C2, so that switch C2 is the target switch, and the node to be configured is set to the switch value of switch C2.

[0088] After setting the switch value of the target switch on the node to be configured through this embodiment, it is only necessary to introduce the matching tool of the target switch, obtain the parameter list in the business process and give it to the matching tool. In summary, the present invention can flexibly realize the switch requirements of various scenarios by controlling the number of dimensions that need to be matched, and due to the universal matching logic, there is no need to modify the code when the dimensions and parameters change.

[0089] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0090] In one embodiment, a switch setting device based on structured data is provided, and the switch setting device based on structured data corresponds one-to-one to the switch setting method based on structured data in the above embodiment. Figure 5As shown, the switch setting based on structured data includes a first acquisition module 51, a second acquisition module 52, a third acquisition module 53, a matching module 54, and a setting module 55. The detailed description of each functional module is as follows:

[0091] A first acquisition module 51 is used to read effective switch information from the switch basic data table and the switch dimension data table according to the current time when the system is started, and save the switch information to a cache;

[0092] The second acquisition module 52 is used to acquire the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node, and the matching method according to the business scenario executed by the system;

[0093] A third acquisition module 53, configured to acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information;

[0094] A matching module 54 is used to match the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching method, and obtain the target switch corresponding to the node to be matched according to the matching result;

[0095] The setting module 55 is used to set the switch value of the target switch on the node to be matched.

[0096] Optionally, the switch basic data table is used to store basic information of the switch, the basic information including switch name, switch value, switch group code, and effective time;

[0097] The switch dimension data table is used to store the dimension information of the switch, and the dimension information includes the switch name and at least one applicable condition;

[0098] The switch name in the switch basic data table is used as a foreign key in the switch dimension data table.

[0099] Optionally, the matching module 54 includes:

[0100] A first matching unit, configured to match each piece of the to-be-matched dimension information with each piece of switch information in the group corresponding to the group code respectively if the matching mode is single-dimensional matching;

[0101] A first result unit is used for, if any to-be-matched dimension information successfully matches any switch information in the group corresponding to the group code, taking the switch corresponding to the successfully matched switch information as the target switch; and / or

[0102] A second matching unit, configured to match all dimensional information to be matched with each switch information in the group corresponding to the group code if the matching mode is multi-dimensional matching;

[0103] The second result unit is used to take the switch corresponding to the successfully matched switch information as the target switch if all the to-be-matched dimension information are successfully matched with any switch information in the group corresponding to the group code.

[0104] Optionally, the first acquisition module 51 includes:

[0105] A comparison unit, used to compare the current time with the effective time in the switch basic data table when the system is started, to obtain the switch name corresponding to the effective switch;

[0106] an acquisition unit, configured to acquire dimension information corresponding to each effective switch from the switch dimension data table according to the switch name;

[0107] The cache unit is used to store the switch name and dimension information corresponding to each effective switch as a complete switch information in the cache.

[0108] For the specific definition of the switch setting device based on structured data, please refer to the definition of the switch setting method based on structured data above, which will not be repeated here. Each module in the switch setting device based on structured data can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0109] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a switch setting method based on structured data is implemented. Further, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0110] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0111] When the system starts, the effective switch information is read from the switch basic data table and the switch dimension data table according to the current time, and the switch information is saved to the cache;

[0112] According to the business scenario executed by the system, the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node and the matching method are obtained;

[0113] Acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information;

[0114] According to the matching method, the dimension information to be matched is matched with each switch information in the group corresponding to the group code, and the target switch corresponding to the node to be matched is obtained according to the matching result;

[0115] The switch value of the target switch is set on the to-be-matched node.

[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0117] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0118] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0119] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A switch setting method based on structured data, characterized in that: include: When the system starts, the effective switch information is read from the switch basic data table and the switch dimension data table according to the current time, and the switch information is saved to the cache; The switch basic data table is used to store basic information of the switch, including switch name, switch value, switch group code, and effective time; the switch dimension data table is used to store dimensional information of the switch, including switch name and at least one applicable condition; wherein the switch name in the switch basic data table serves as a foreign key of the switch dimension data table; According to the business scenario executed by the system, the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node and the matching method are obtained; Acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information; According to the matching method, the dimension information to be matched is matched with each switch information in the group corresponding to the group code, and the target switch corresponding to the node to be matched is obtained according to the matching result; Setting the switch value of the target switch on the node to be matched; Wherein, matching the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching mode, and acquiring the target switch corresponding to the node to be matched according to the matching result includes: If the matching mode is single-dimensional matching, each of the dimension information to be matched is matched with each switch information in the group corresponding to the group code; if any of the dimension information to be matched is successfully matched with any of the switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch; If the matching method is multi-dimensional matching, all the dimension information to be matched are matched with each switch information in the group corresponding to the group code; if all the dimension information to be matched are successfully matched with any switch information in the group corresponding to the group code, the switch corresponding to the successfully matched switch information is used as the target switch.

2. The switch setting method based on structured data according to claim 1, characterized in that: When the system starts, reading the effective switch information from the switch basic data table and the switch dimension data table according to the current time, and saving the switch information to the cache includes: When the system starts, the current time is compared with the effective time in the switch basic data table to obtain the switch name corresponding to the effective switch; Acquire dimension information corresponding to each effective switch from the switch dimension data table according to the switch name; The switch name and dimension information corresponding to each effective switch is taken as a complete switch information and saved in the cache.

3. A switch setting device based on structured data, characterized in that: The switch implementation device comprises: The first acquisition module is used to read the effective switch information from the switch basic data table and the switch dimension data table according to the current time when the system is started, and save the switch information to the cache; the switch basic data table is used to store the basic information of the switch, and the basic information includes the switch name, switch value, switch group code, and effective time; the switch dimension data table is used to store the dimensional information of the switch, and the dimensional information includes the switch name and at least one applicable condition; wherein the switch name in the switch basic data table is used as the foreign key of the switch dimension data table; The second acquisition module is used to acquire the corresponding switch group code, the to-be-matched dimension information corresponding to the to-be-matched node, and the matching method according to the business scenario executed by the system; A third acquisition module, configured to acquire one or more pieces of switch information belonging to the group corresponding to the switch group code from the cached switch information; A matching module, used to match the dimension information to be matched with each switch information in the group corresponding to the group code according to the matching method, and obtain the target switch corresponding to the node to be matched according to the matching result; A setting module, used for setting the switch value of the target switch on the node to be matched; The matching module comprises: A first matching unit, configured to match each piece of the to-be-matched dimension information with each piece of switch information in the group corresponding to the group code respectively if the matching mode is single-dimensional matching; A first result unit is used for, if any to-be-matched dimension information successfully matches any switch information in the group corresponding to the group code, taking the switch corresponding to the successfully matched switch information as the target switch; and / or A second matching unit, configured to match all dimensional information to be matched with each switch information in the group corresponding to the group code if the matching mode is multi-dimensional matching; The second result unit is used to use the switch corresponding to the successfully matched switch information as the target switch if all the to-be-matched dimension information successfully matches any switch information in the group corresponding to the group code.

4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the switch setting method based on structured data according to any one of claims 1 to 2 is implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the switch setting method based on structured data according to any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Switch control method, device and equipment and computer readable storage medium

    CN109729132A

  • Data sending method and related device

    CN110222107A