Data query method, device, medium and equipment

By storing the configuration data in hierarchical relationships and dynamically generating configuration result data, the cumbersome operation and data redundancy of configuration management solutions in the prior art are solved, and efficient reuse of configuration data and system adaptability are achieved.

CN117131239BActive Publication Date: 2025-08-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311073892.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2025-08-12
Estimated Expiration
2043-08-22

AI Technical Summary

Technical Problem

The existing configuration management solution requires tedious operations and data redundancy when adding query conditions, making it difficult to know all possible query conditions in advance, resulting in limited coverage.

Method used

By splitting the configuration result data into a preset configuration data structure, and defining query parameters for hierarchical relationships, dynamically generate configuration result data that meets query conditions, realizing the reusability and streamlined writing volume of configuration data.

Benefits of technology

Complete the definition of multiple configuration query conditions in a configuration file, which reduces data redundancy and improves the reusability of configuration data and system adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117131239B_ABST
    Figure CN117131239B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data query method, device, storage medium and electronic device, the method comprising receiving a configuration data query request; extracting target query parameters from the configuration data query request; obtaining a preset configuration data structure, wherein the configuration data structure comprises configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under a fixed parameter dimension; based on the target query parameters, determining all target configuration data nodes corresponding to the target query parameters in the configuration data structure; reading each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and performing inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data. The present application can improve the reusability of configuration data while streamlining the volume of configuration data writing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic communication technology, in particular to the field of data query technology, and more particularly to a data query method, device, medium and equipment. Background Art

[0002] In the process of developing application software systems, it is often necessary to compile configuration data for the application software systems based on different usage scenarios and query conditions. Due to the diversity and complexity of business needs, these configuration data must also be managed differently to achieve different configuration results under different query conditions.

[0003] Most existing configuration management solutions only support a one-to-one relationship between pre-existing configuration data blocks and specific query conditions. That is, one query condition corresponds to a configuration data block. If a new query condition is added, the corresponding configuration data block needs to be redefined for the new query condition. Conversely, when a new configuration data block is added, it is also necessary to clearly classify the data block under a specific query condition so that the configuration data block can be queried. Currently, there are also configuration management solutions that can support one-to-many relationships. That is, a configuration data block can be set to meet multiple query conditions simultaneously. As long as the current query condition is within the list of these pre-defined query conditions, the configuration data block can be returned as a query result.

[0004] However, whether it's a one-to-one or one-to-many relationship, each query condition satisfied by the target configuration data block must be explicitly listed. This allows the target configuration data block to be enabled and returned as a result when the current query condition meets one of these pre-set conditions. However, in practice, it's often difficult to pre-determine all possible query conditions. For example, a configuration data block may meet query conditions A and B, but when query condition C appears, because no matching relationship has been set for the configuration data block in advance, the default assumption is that query condition C does not match the configuration data block. However, from a practical perspective, the configuration data block is likely applicable to query condition C. In this case, either query condition C needs to be added to the list of query conditions matched by the configuration data block, or a corresponding configuration data block needs to be defined for query condition C, and the contents of the existing configuration data block copied to the newly created configuration data block. Similar operations will need to be repeated for query conditions D, E, and so on. Therefore, both approaches suffer from cumbersome operations, data redundancy, and limited coverage. Summary of the Invention

[0005] The embodiments of the present application provide a data query method, apparatus, medium, and device. These methods split each target configuration data constituting the configuration result data and store them in a preset configuration data structure. Furthermore, they define a data structure for a configuration data query request for writing query parameters. The arrangement of configuration data nodes in the configuration data structure is set according to the hierarchical relationship of the query parameters. This allows users to find multiple hierarchically related target configuration data that meet the query conditions through a configuration data query request, and performs inheritance and overwriting processing on each target configuration data according to the hierarchical relationship, dynamically generating complete configuration result data. This improves the reusability of configuration data while streamlining the volume of configuration data writing.

[0006] An embodiment of the present application provides a data query method, including:

[0007] receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0008] Extracting target query parameters under target parameter dimensions from the configuration data query request;

[0009] Obtaining a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0010] Based on the target query parameter extracted under the target parameter dimension, determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure;

[0011] The target configuration data corresponding to each target configuration data node is read according to the hierarchical relationship of each target configuration data node, and inheritance and coverage processing is performed on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0012] In the data query method described in the embodiment of the present application, determining all target configuration data nodes corresponding to the target query parameters in the configuration data structure based on the target query parameters extracted under the target parameter dimension includes:

[0013] First, based on the data search path composed of all target query parameters under the same target parameter dimension, query whether there is a corresponding child configuration data node in the configuration data structure. If there is no child configuration data node corresponding to the current data search path, delete the target query parameter corresponding to the lowest level in the current data search path, update the current data search path, and then query again in the configuration data structure whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

[0014] In the data query method described in the embodiment of the present application, performing inheritance and overwriting processing on the target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request includes:

[0015] Based on the hierarchical relationship of the target configuration data, taking the target configuration data of the next level of the top level as the current configuration data;

[0016] Inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data of the current level;

[0017] Take the target configuration data of the next level below the current level as the new current configuration data, return to execute the step of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain the new target configuration data of the current level, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

[0018] In the data query method described in the embodiment of the present application, the inheritance and overwriting processing of the current configuration data and the target configuration data of the previous level to obtain the new target configuration data of the current level includes:

[0019] Inherit the target configuration data of the previous level into the current configuration data;

[0020] Compare the configuration items in the current configuration data and the target configuration data of the previous level;

[0021] If the same configuration items exist, only one of the same configuration items corresponding to the current configuration data is retained.

[0022] In the data query method described in an embodiment of the present application, when the data query request carries target query parameters of multiple parameter dimensions, after determining all target configuration data nodes corresponding to the target query parameters in the configuration data structure, the method further includes:

[0023] Determining whether each of the target configuration data nodes contains a first preset condition, where the first preset condition is used to determine whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data;

[0024] If the first preset condition exists, the target query parameters under all parameter dimensions are judged according to the first preset condition to obtain a first judgment result;

[0025] It is determined, according to the first judgment result, whether the target configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0026] In the data query method described in the embodiment of the present application, the first preset condition is written based on a regular expression.

[0027] In the data query method described in the embodiment of the present application, before determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure, the method further includes:

[0028] Pre-configuring a specified configuration data node in the configuration data structure to include basic configuration data and special configuration data;

[0029] A corresponding second preset condition is added to the special configuration data, where the second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

[0030] In the data query method described in the embodiment of the present application, after determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure, the method further includes:

[0031] Determining whether each of the target configuration data nodes contains the second preset condition;

[0032] If the second preset condition exists, the target query parameters under all parameter dimensions are judged according to the second preset condition to obtain a second judgment result;

[0033] It is determined according to the second judgment result whether the special configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0034] Accordingly, another aspect of the present application further provides a data query device, the data query device comprising:

[0035] a request receiving module, configured to receive a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0036] A request parsing module, configured to extract target query parameters under a target parameter dimension from the configuration data query request;

[0037] a configuration acquisition module, configured to acquire a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0038] a configuration determination module, configured to determine, based on the target query parameters extracted under the target parameter dimension, all target configuration data nodes corresponding to the target query parameters in the configuration data structure;

[0039] The configuration processing module is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0040] Correspondingly, another aspect of the embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the data query method as described above.

[0041] Correspondingly, another aspect of an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the data query method as described above.

[0042] Embodiments of the present application provide a data query method, apparatus, medium, and device, which receive a configuration data query request, wherein the structure of the configuration data query request is configured to provide query parameters under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship; extract a target query parameter under a target parameter dimension from the configuration data query request; obtain a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension; based on the target query parameter extracted under the target parameter dimension, determine all target configuration data nodes corresponding to the target query parameter in the configuration data structure; read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request. The embodiment of the present application splits each target configuration data constituting the configuration result data and stores it into a preset configuration data structure. It also defines a data structure for a configuration data query request for writing query parameters. The arrangement of the configuration data nodes in the configuration data structure is set according to the hierarchical relationship of the query parameters. This allows users to find multiple hierarchically related target configuration data that meet the query conditions through the configuration data query request, and performs inheritance and overwriting processing on each target configuration data according to the hierarchical relationship, dynamically generating complete configuration result data. This streamlines the configuration data writing volume while improving the reusability of the configuration data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.

[0044] Figure 1 A flowchart of a data query method provided in an embodiment of the present application.

[0045] Figure 2 A schematic diagram of the structure of a data query device provided in an embodiment of the present application.

[0046] Figure 3 Another structural diagram of the data query device provided in an embodiment of the present application.

[0047] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0049] It should be noted that in the process of developing application software systems, it is often necessary to write configuration data for the application software systems based on different usage scenarios and query conditions. Due to the diversity and complexity of business needs, these configuration data must also be managed differently to achieve different configuration results under different query conditions.

[0050] Most existing configuration management solutions only support a one-to-one relationship between pre-existing configuration data blocks and specific query conditions. That is, one query condition corresponds to one configuration data block. If a new query condition is added, the corresponding configuration data block must be redefined for the new query condition. Conversely, when a new configuration data block is added, it must also be explicitly categorized under a specific query condition to ensure that it can be found.

[0051] Currently, there are also configuration management solutions that can support one-to-many relationships, that is, a configuration data block can be set to meet multiple query conditions at the same time. As long as the current query condition is within these predefined query condition lists, the configuration data block can be returned as a query result.

[0052] However, whether it's a one-to-one or one-to-many relationship, each query condition satisfied by the target configuration data block must be explicitly listed. This allows the target configuration data block to be enabled and returned as a result when the current query condition meets one of these pre-set conditions. However, in practice, it's often difficult to pre-determine all possible query conditions. For example, a configuration data block may meet query conditions A and B, but when query condition C appears, because no matching relationship has been set for the configuration data block in advance, the default assumption is that query condition C does not match the configuration data block. However, from a practical perspective, the configuration data block is likely applicable to query condition C. In this case, either query condition C needs to be added to the list of query conditions matched by the configuration data block, or a corresponding configuration data block needs to be defined for query condition C, and the contents of the existing configuration data block copied to the newly created configuration data block. Similar operations will need to be repeated for query conditions D, E, and so on. Therefore, both approaches suffer from cumbersome operations, data redundancy, and limited coverage.

[0053] In order to solve the above technical problems, an embodiment of the present application provides a data query method. Using the data query method provided by the embodiment of the present application, the target configuration data constituting the configuration result data are split and stored in a preset configuration data structure, and a data structure of a configuration data query request for writing query parameters is defined, and the arrangement of the configuration data nodes in the configuration data structure is set according to the hierarchical relationship of the query parameters, so that the user can find multiple target configuration data with a hierarchical relationship that meet the query conditions through the configuration data query request, and inherit and overwrite each target configuration data according to the hierarchical relationship to dynamically generate complete configuration result data. The embodiment of the present application can reduce the storage amount of configuration data as much as possible, and the definition of target configuration data corresponding to multiple configuration query conditions can be completed in only one configuration file, without the need to pre-store multiple copies of configuration result data in order to adapt to the query conditions. This scheme of dynamically generating configuration result data based on query requests and configuration structures improves the reusability of configuration data while streamlining the volume of configuration data writing.

[0054] See also Figure 1 , Figure 1 This is a flow chart of a data query method provided in an embodiment of the present application. The data query method, wherein the execution entities of each step in the data query method can be the same or different, can be electronic devices or servers. The electronic device can be a personal computer or other device. The method may include the following steps:

[0055] Step 101: Receive a configuration data query request, wherein the structure of the configuration data query request is configured to provide at least one query parameter under a fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship.

[0056] It should be noted that the data query method provided by this solution redefines the configuration data query request, divides the query parameters into several fixed parameter dimensions, and adds a hierarchical relationship between multiple query parameters under the same parameter dimension, so that each parameter dimension supports hierarchical segmentation. By combining the specific segmentation levels under each parameter dimension, the query conditions can be determined, so that any query condition can be defined with only a small number of query parameters. This method maintains the stability of the query interface, so that no matter how the business needs change and how the management needs of the configuration data change, the required configuration data can be hierarchically divided on these fixed dimensions, and accurate queries on these configuration data can be achieved without changing the parameter dimension list, thereby greatly improving the adaptability of the configuration system.

[0057] A hierarchical relationship is added between multiple query parameters under the same parameter dimension of the configuration data query request. For example, multiple query parameters under the same parameter dimension in the configuration data query request are expressed in the form of "query parameter A / query parameter B / query parameter C / query parameter D". As a specific implementation method, after substituting "query parameter A / query parameter B / query parameter C / query parameter D" into specific parameters, "A data center / B cluster / C service type / D server" is obtained, which means that the query purpose corresponding to the current dimension value in the configuration data query request is to find the target configuration data under the search path composed of "A data center / B cluster / C service type / D server".

[0058] It should be explained that the four different parameters in "query parameter A / query parameter B / query parameter C / query parameter D" are under the same parameter dimension, where specific separators, such as a forward slash " / ", can be used between different query parameters to describe a hierarchical relationship. A hierarchical relationship is a tree-structured relationship. "Query parameter A / query parameter B / query parameter C / query parameter D" means that query parameter D is part of query parameter C, and query parameter C is part of query parameter B, and query parameter B is part of query parameter A. It can also be understood that query parameter B is a special case of query parameter A, and query parameter C is a special case after further decomposition and refinement of query parameter B. Separators are optional. If a query parameter does not contain a separator, it represents the root node in the hierarchical division relationship of the parameter dimension; conversely, the more separators there are, the finer and more specific the hierarchical division corresponding to the parameter dimension.

[0059] Step 102: extract target query parameters under target parameter dimensions from the configuration data query request.

[0060] In this embodiment, when a configuration data query request includes query parameters from multiple different parameter dimensions, the target query parameters from one target parameter dimension are first retrieved for data query operations. It is understood that to increase data query speed, a parallel query approach can also be used to simultaneously retrieve query parameters from different parameter dimensions and perform data query operations simultaneously. However, the query results from different dimensions must be merged again in a predetermined order to obtain the final complete configuration result data.

[0061] Step 103: Obtain a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension.

[0062] In this embodiment, the configuration data structure can be either a database or a configuration file, both of which are suitable for use as data storage areas for configuration data query requests to perform data query operations. The configuration data structure includes configuration data nodes. The configuration data nodes can be stored in a variety of ways within the configuration data structure, including stand-alone or distributed storage. The hierarchical relationship between the different configuration data nodes within the configuration data structure is determined by the hierarchical relationship of the query parameters under a fixed parameter dimension. By splitting the target configuration data constituting the configuration result data and storing them in a preset configuration data structure, and configuring the arrangement of the configuration data nodes within the configuration data structure according to the hierarchical relationship of the query parameters, a user can dynamically generate complete configuration result data by finding multiple hierarchically related target configuration data that meet the query conditions through a configuration data query request. This solution can also minimize the amount of configuration data storage, allowing the definition of target configuration data corresponding to multiple configuration query conditions to be completed in a single configuration file, eliminating the need to pre-store multiple copies of the configuration result data to accommodate multiple query conditions.

[0063] Step 104 : Based on the target query parameter extracted under the target parameter dimension, determine all target configuration data nodes corresponding to the target query parameter in the configuration data structure.

[0064] In this embodiment, to find all target configuration data nodes that meet the requirements of a configuration data query request, a reverse query operation can be performed within the configuration data structure according to the hierarchical relationship of the query parameters. The reverse query method is used because sub-level configurations are specializations of the parent-level configuration. Prioritizing sub-level queries allows for faster access to the required configuration data. If sub-level configuration data does not exist, it indicates that the sub-level does not require specialized configuration. This means that the configurations of all sub-levels under the parent level are identical. This identical configuration can then be stored directly at the parent level, and any sub-level under the parent level will ultimately receive the parent-level configuration when querying configuration data. For example, for "Data Center A / Cluster B / Service Type C / Server D," the query first checks whether "Data Center A / Cluster B / Service Type C / Server D" has corresponding configuration data. If not, the query then checks whether "Data Center A / Cluster B / Service Type C" has corresponding configuration data. If not, the query continues backtracking to "Data Center A / Cluster B / Service Type C," and so on, until the configuration data corresponding to the current level is found, at which point the backtracking process ends.

[0065] If the reverse query operation is described from a technical perspective, it is to first query whether there is a corresponding child configuration data node in the configuration data structure based on the data search path composed of all target query parameters under the same target parameter dimension. If there is no child configuration data node corresponding to the current data search path, the target query parameter corresponding to the lowest level in the current data search path is deleted. After updating the current data search path, the configuration data structure is queried again to see whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

[0066] Step 105 : Read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0067] In this embodiment, in order to obtain configuration result data, based on the hierarchical relationship of the target configuration data, the target configuration data of the next level of the top level can be taken as the current configuration data; the current configuration data can be inherited and overwritten with the target configuration data of the previous level to obtain new target configuration data of the current level; the target configuration data of the next level of the current level can be taken as the new current configuration data, and the step of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data of the current level is returned to execute, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

[0068] After inheriting the target configuration data of the previous level into the current configuration data, the configuration items in the current configuration data and the target configuration data of the previous level are compared; if there are identical configuration items, only the one corresponding to the current configuration data is retained.

[0069] Specifically, when a data query operation is performed through a certain dimension value in the configuration data query request, such as "A Data Center / B Cluster / C Service Type", it is found that there is corresponding target configuration data. This means that the configuration data is stored at the "C Service Type" level, but since "C Service Type" is located under "A Data Center / B Cluster", it is necessary to first try to read the configuration data of the "A Data Center" level. If this level has configuration data, it will be used as the basis, otherwise empty data will be used as the basis; then see if there is configuration data at the "B Cluster" level. If not, it will inherit its parent, that is, the configuration of "A Data Center" (the "basis" mentioned in the previous sentence). If so, it depends on the result of the inheritance overlay operation of this part of the configuration data and the configuration data of "A Data Center"; finally, the configuration data of the "C Service Type" level and the above result will be inherited and overwritten again to obtain the final result, which is the configuration result data. In general, the configuration query process is a recursive process. Each parameter value in the query request is recursively checked in reverse order of the hierarchy, and whether there is configuration data corresponding to the current hierarchy. Once configuration data is found, it is necessary to recursively perform inheritance coverage operations in forward order starting from the root hierarchy where the configuration data is located. Each inheritance coverage is based on the result of the previous level until the current level is processed.

[0070] In some embodiments, the method further comprises the following steps:

[0071] Determining whether each of the target configuration data nodes contains a first preset condition, where the first preset condition is used to determine whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data;

[0072] If the first preset condition exists, the target query parameters under all parameter dimensions are judged according to the first preset condition to obtain a first judgment result;

[0073] It is determined, according to the first judgment result, whether the target configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0074] When a configuration data query request includes multiple query parameters of different parameter dimensions, the configuration result data ultimately matched by the query parameter combinations of different parameter dimensions may differ. For example, when the query parameter corresponding to parameter dimension 1 is "Data Center A / Cluster B / Service Type C," and the query parameter corresponding to parameter dimension 2 is "Software E." Assuming that both Dimensions 1 and 2 exist, and the configuration data matched by Dimension 1 is not compatible with the query parameter "Software E" in Dimension 2, to address this issue, in this embodiment, an enabling condition, namely a first preset condition, is defined for specific target configuration data. If all parameter dimensions included in the current configuration data query request are matched by the first preset condition corresponding to the target configuration data node, the current configuration data query request matches the first preset condition of the target configuration data, and the target configuration data can be returned for synthesizing the configuration result data. Otherwise, the target configuration data is rejected. It should be noted that when a configuration data query request includes multiple query parameters of different parameter dimensions, and each has corresponding target configuration data, the target configuration data obtained under different parameter dimensions must be merged to obtain the complete configuration result data.

[0075] The first preset condition can be written based on a regular expression or other conditional statements, and it is not required to define a first preset condition for every target configuration data. If it is not defined, the searched target configuration data will always be used to synthesize the final configuration result data. Multiple first preset conditions can also be defined for a specific configuration data. The current configuration data query request will obtain the configuration data block as long as it matches any first preset condition. This design provides more flexible definition of configuration data activation conditions, thereby reducing the difficulty of pre-exhaustive query conditions.

[0076] Different query conditions trigger different configuration data. Furthermore, due to the inheritance and overwriting properties of configuration data, configuration data can be dynamically generated in real time based on query conditions. This design simplifies the configuration writing and modification process, improving the system's usability and maintainability.

[0077] In some embodiments, the method further comprises the following steps:

[0078] Pre-configuring a specified configuration data node in the configuration data structure to include basic configuration data and special configuration data;

[0079] A corresponding second preset condition is added to the special configuration data, where the second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

[0080] In this embodiment, by configuring the specified configuration data node in the configuration data structure to include basic configuration data and special configuration data, a corresponding second preset condition is added to the special configuration data. The second preset condition can be written based on a regular expression or other conditional statement. After obtaining all target configuration data nodes, it is first determined whether each target configuration data node contains the second preset condition. If the second preset condition exists, the target query parameters under all parameter dimensions are judged using the second preset condition to obtain a second judgment result. Based on the second judgment result, it is determined whether the special configuration data in each target configuration data node can be used to synthesize the configuration result data.

[0081] In some embodiments, when both the first preset condition and the second preset condition exist, the first preset condition should be judged first. If the first preset condition can be matched but the second preset condition cannot be matched, it means that only the basic configuration data can be used to synthesize the configuration result data.

[0082] By combining the hierarchical writing of the above-mentioned configuration data, the query logic and the matching logic of the preset conditions, it is possible to determine whether the configuration data is enabled based on the query request and the preset conditions. When basic configuration data and special configuration data exist in the configuration data, the basic configuration data is controlled by the first preset condition, while the special configuration data is controlled by the second preset condition.

[0083] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.

[0084] During specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.

[0085] As can be seen from the above, the data query method provided by the embodiment of the present application receives a configuration data query request, and the structure of the configuration data query request is set to provide query parameters under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship; extracts the target query parameter under the target parameter dimension from the configuration data query request; obtains a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained according to the hierarchical relationship of the query parameters under the fixed parameter dimension; based on the target query parameter extracted under the target parameter dimension, determines all target configuration data nodes corresponding to the target query parameter in the configuration data structure; reads each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and performs inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request. The embodiment of the present application splits each target configuration data constituting the configuration result data and stores it into a preset configuration data structure. It also defines a data structure for a configuration data query request for writing query parameters. The arrangement of the configuration data nodes in the configuration data structure is set according to the hierarchical relationship of the query parameters. This allows users to find multiple hierarchically related target configuration data that meet the query conditions through the configuration data query request, and performs inheritance and overwriting processing on each target configuration data according to the hierarchical relationship, dynamically generating complete configuration result data. This streamlines the configuration data writing volume while improving the reusability of the configuration data.

[0086] An embodiment of the present application further provides a data query device, which can be integrated into an electronic device or a server.

[0087] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of the data query device provided in an embodiment of the present application. The data query device 30 may include:

[0088] a request receiving module 31 for receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0089] A request parsing module 32 is configured to extract target query parameters under a target parameter dimension from the configuration data query request;

[0090] A configuration acquisition module 33 is configured to acquire a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0091] A configuration determination module 34 is configured to determine, based on the target query parameter extracted under the target parameter dimension, all target configuration data nodes corresponding to the target query parameter in the configuration data structure;

[0092] The configuration processing module 35 is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and coverage processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0093] In some embodiments, the configuration determination module 34 is used to first query whether there is a corresponding child configuration data node in the configuration data structure based on the data search path composed of all target query parameters under the same target parameter dimension. If there is no child configuration data node corresponding to the current data search path, the target query parameter corresponding to the lowest level in the current data search path is deleted, and after updating the current data search path, the configuration data structure is queried again to see whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

[0094] In some embodiments, the configuration processing module 35 is used to take the target configuration data of the next level of the top level as the current configuration data based on the hierarchical relationship of the target configuration data; inherit and overwrite the current configuration data with the target configuration data of the previous level to obtain new target configuration data of the current level; take the target configuration data of the next level of the current level as the new current configuration data, return to execute the steps of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data of the current level, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

[0095] In some embodiments, the configuration processing module 35 is used to inherit the target configuration data of the previous level into the current configuration data; compare the configuration items in the current configuration data and the target configuration data of the previous level; if there are identical configuration items, only retain the one of the identical configuration items corresponding to the current configuration data; if the current configuration data contains a new configuration item that does not exist in the previous level, retain the new configuration item, otherwise retain the configuration item of the previous level.

[0096] In some embodiments, when the data query request carries target query parameters of multiple parameter dimensions, the device also includes a first judgment module for judging whether each target configuration data node contains a first preset condition, and the first preset condition is used to judge whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data; if the first preset condition exists, the target query parameters under all parameter dimensions are judged by the first preset condition to obtain a first judgment result; and according to the first judgment result, it is determined whether the target configuration data in each target configuration data node can be used to synthesize the configuration result data.

[0097] In some embodiments, the first preset condition is written based on a regular expression.

[0098] In some embodiments, the configuration data node specified in the configuration data structure is pre-configured to include basic configuration data and special configuration data, and a corresponding second preset condition is added to the special configuration data. The second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

[0099] In some embodiments, the device also includes a second judgment module for judging whether each of the target configuration data nodes contains the second preset condition; if the second preset condition exists, the target query parameters under all parameter dimensions are judged by the second preset condition to obtain a second judgment result; based on the second judgment result, it is determined whether the special configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0100] During specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same entity or several entities.

[0101] As can be seen from the above, the data query device 30 provided in the embodiment of the present application is used to receive a configuration data query request through a request receiving module 31, and the structure of the configuration data query request is set to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship; the request parsing module 32 is used to extract the target query parameter under the target parameter dimension from the configuration data query request; the configuration acquisition module 33 is used to obtain a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained according to the hierarchical relationship of the query parameters under the fixed parameter dimension; the configuration determination module 34 is used to determine all target configuration data nodes corresponding to the target query parameter in the configuration data structure based on the target query parameter extracted under the target parameter dimension; the configuration processing module 35 is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0102] See also Figure 3 , Figure 3 This is another structural diagram of a data query device provided in an embodiment of the present application. The data query device 30 includes a memory 120, one or more processors 180, and one or more applications, wherein the one or more applications are stored in the memory 120 and configured to be executed by the processor 180; the processor 180 may include a request receiving module 31, a request parsing module 32, a configuration acquisition module 33, a configuration determination module 34, and a configuration processing module 35. For example, the structure and connection relationship of the above components can be as follows:

[0103] The memory 120 can be used to store applications and data. The applications stored in the memory 120 include executable code. The applications can be composed of various functional modules. The processor 180 executes various functional applications and data processing by running the applications stored in the memory 120. In addition, the memory 120 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.

[0104] Processor 180 is the control center of the device, connecting all components of the terminal using various interfaces and circuits. It executes or runs applications stored in memory 120 and accesses data stored in memory 120 to perform various device functions and process data, thereby providing overall monitoring of the device. Optionally, processor 180 may include one or more processing cores; preferably, processor 180 may integrate an application processor and a modem processor, with the application processor primarily processing the operating system, user interface, and application programs.

[0105] Specifically, in this embodiment, the processor 180 loads the executable code corresponding to one or more application processes into the memory 120 according to the following instructions, and the processor 180 runs the application stored in the memory 120 to implement various functions:

[0106] a request receiving instruction for receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0107] A request parsing instruction, used to extract target query parameters under a target parameter dimension from the configuration data query request;

[0108] A configuration acquisition instruction is used to obtain a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0109] a configuration determination instruction, configured to determine, based on the target query parameter extracted under the target parameter dimension, all target configuration data nodes in the configuration data structure corresponding to the target query parameter;

[0110] The configuration processing instruction is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0111] In some embodiments, the configuration determination instruction is used to first query whether there is a corresponding child configuration data node in the configuration data structure based on the data search path composed of all target query parameters under the same target parameter dimension. If there is no child configuration data node corresponding to the current data search path, the target query parameter corresponding to the lowest level in the current data search path is deleted, and after updating the current data search path, the configuration data structure is queried again to see whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

[0112] In some embodiments, the configuration processing instruction is used to take the target configuration data of the next level of the top level as the current configuration data based on the hierarchical relationship of the target configuration data; inherit and overwrite the current configuration data with the target configuration data of the previous level to obtain new target configuration data for the current level; take the target configuration data of the next level of the current level as the new current configuration data, and return to execute the steps of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data for the current level, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

[0113] In some embodiments, the configuration processing instruction is used to inherit the target configuration data of the previous level into the current configuration data; compare the configuration items in the current configuration data and the target configuration data of the previous level; if there are identical configuration items, only retain the one of the identical configuration items corresponding to the current configuration data; if the current configuration parameters include a new configuration item that does not exist in the previous level, retain the new configuration item, otherwise retain the configuration item of the previous level.

[0114] In some embodiments, when the data query request carries target query parameters of multiple parameter dimensions, the program also includes a first judgment instruction for judging whether each target configuration data node contains a first preset condition, and the first preset condition is used to judge whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data; if the first preset condition exists, the target query parameters under all parameter dimensions are judged by the first preset condition to obtain a first judgment result; and based on the first judgment result, it is determined whether the target configuration data in each target configuration data node can be used to synthesize the configuration result data.

[0115] In some embodiments, the first preset condition is written based on a regular expression.

[0116] In some embodiments, the configuration data node specified in the configuration data structure is pre-configured to include basic configuration data and special configuration data, and a corresponding second preset condition is added to the special configuration data. The second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

[0117] In some embodiments, the program also includes a second judgment instruction for judging whether each of the target configuration data nodes contains the second preset condition; if the second preset condition exists, the target query parameters under all parameter dimensions are judged by the second preset condition to obtain a second judgment result; based on the second judgment result, it is determined whether the special configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0118] An embodiment of the present application further provides an electronic device, which may be an electronic device or a server.

[0119] See also Figure 4 , Figure 4 The electronic device 1200 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, which can be used to implement the data query method provided in the above embodiment. Taking the electronic device as an example, the electronic device 1200 can be a smart phone or a tablet computer.

[0120] like Figure 4 As shown, the electronic device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190. Those skilled in the art will understand that Figure 4 The structure of the electronic device 1200 shown in the figure does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0121] RF circuit 110 is used to receive and transmit electromagnetic waves, converting them into electrical signals, thereby enabling communication with a communications network or other devices. RF circuit 110 may include various existing circuit components for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a subscriber identity module (SIM) card, and memory. RF circuit 110 can communicate with various networks, such as the Internet, an intranet, or a wireless network, or with other devices via a wireless network.

[0122] The memory 120 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data query method in the above-mentioned embodiment. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. It can automatically select the vibration reminder mode to perform data query according to the current scene of the electronic device. This can not only ensure that scenes such as meetings are not disturbed, but also ensure that the user can be aware of incoming calls, thereby improving the intelligence of the electronic device. The memory 120 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 120 may further include a memory remotely located relative to the processor 180, and these remote memories can be connected to the electronic device 1200 via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof.

[0123] The input unit 130 can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display or touchpad, can detect user touch operations on or near it (for example, operations performed by a user using a finger, stylus, or any other suitable object or accessory on or near the touch-sensitive surface 131) and drive corresponding connected devices according to a pre-set program. Optionally, the touch-sensitive surface 131 may include a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects signals generated by the touch operation, transmitting the signals to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 180. It can also receive and execute commands from the processor 180. In addition, the touch-sensitive surface 131 can be implemented using various types, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the input unit 130 may further include other input devices 132. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.

[0124] The display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 1200. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 131 may cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. The processor 180 then provides corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 4 In the embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to implement input and output functions. However, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to implement input and output functions.

[0125] The electronic device 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the electronic device 1200 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the electronic device 1200 can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.

[0126] The audio circuit 160, speaker 161, and microphone 162 provide an audio interface between the user and the electronic device 1200. The audio circuit 160 can convert received audio data into electrical signals and transmit them to the speaker 161, which then converts the signals into sound signals for output. Furthermore, the microphone 162 converts the collected sound signals into electrical signals, which are then received by the audio circuit 160 and converted into audio data. The audio data is then processed by the processor 180 and transmitted to, for example, another terminal via the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earphone jack to allow communication between an external headset and the electronic device 1200.

[0127] The electronic device 1200 can help users send and receive emails, browse web pages, and access streaming media through the transmission module 170 (such as a Wi-Fi module), which provides users with wireless broadband Internet access. Figure 4 The transmission module 170 is shown, but it is understandable that it is not an essential component of the electronic device 1200 and can be omitted as needed without changing the essence of the invention.

[0128] Processor 180 is the control center of electronic device 1200. It connects all components of the phone using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 120 and accessing data stored in memory 120, it executes various functions of electronic device 1200 and processes data, thereby providing overall monitoring of the phone. Optionally, processor 180 may include one or more processing cores. In some embodiments, processor 180 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 180.

[0129] Electronic device 1200 also includes a power supply 190 for supplying power to various components. In some embodiments, the power supply can be logically connected to processor 180 via a power management system, thereby enabling the power management system to manage discharge and power consumption. Power supply 190 can also include any components such as one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0130] Although not shown, the electronic device 1200 may further include a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the display unit 140 of the electronic device 1200 is a touch screen display, and the electronic device 1200 further includes a memory 120 and one or more programs, wherein the one or more programs are stored in the memory 120 and are configured to be executed by the one or more processors 180. The one or more programs include instructions for performing the following operations:

[0131] a request receiving instruction for receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0132] A request parsing instruction, used to extract target query parameters under a target parameter dimension from the configuration data query request;

[0133] A configuration acquisition instruction is used to obtain a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0134] a configuration determination instruction, configured to determine, based on the target query parameter extracted under the target parameter dimension, all target configuration data nodes in the configuration data structure corresponding to the target query parameter;

[0135] The configuration processing instruction is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0136] In some embodiments, the configuration determination instruction is used to first query whether there is a corresponding child configuration data node in the configuration data structure based on the data search path composed of all target query parameters under the same target parameter dimension. If there is no child configuration data node corresponding to the current data search path, the target query parameter corresponding to the lowest level in the current data search path is deleted, and after updating the current data search path, the configuration data structure is queried again to see whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

[0137] In some embodiments, the configuration processing instruction is used to take the target configuration data of the next level of the top level as the current configuration data based on the hierarchical relationship of the target configuration data; inherit and overwrite the current configuration data with the target configuration data of the previous level to obtain new target configuration data for the current level; take the target configuration data of the next level of the current level as the new current configuration data, and return to execute the steps of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data for the current level, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

[0138] In some embodiments, the configuration processing instruction is used to inherit the target configuration data of the previous level into the current configuration data; compare the configuration items in the current configuration data and the target configuration data of the previous level; if there are identical configuration items, only retain the one of the identical configuration items corresponding to the current configuration data; if the current configuration parameters include a new configuration item that does not exist in the previous level, retain the new configuration item, otherwise retain the configuration item of the previous level.

[0139] In some embodiments, when the data query request carries target query parameters of multiple parameter dimensions, the program also includes a first judgment instruction for judging whether each target configuration data node contains a first preset condition, and the first preset condition is used to judge whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data; if the first preset condition exists, the target query parameters under all parameter dimensions are judged by the first preset condition to obtain a first judgment result; and based on the first judgment result, it is determined whether the target configuration data in each target configuration data node can be used to synthesize the configuration result data.

[0140] In some embodiments, the first preset condition is written based on a regular expression.

[0141] In some embodiments, the configuration data node specified in the configuration data structure is pre-configured to include basic configuration data and special configuration data, and a corresponding second preset condition is added to the special configuration data. The second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

[0142] In some embodiments, the program also includes a second judgment instruction for judging whether each of the target configuration data nodes contains the second preset condition; if the second preset condition exists, the target query parameters under all parameter dimensions are judged by the second preset condition to obtain a second judgment result; based on the second judgment result, it is determined whether the special configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

[0143] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed on a computer, the computer executes the data query method described in any one of the above embodiments:

[0144] receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship;

[0145] Extracting target query parameters under target parameter dimensions from the configuration data query request;

[0146] Obtaining a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension;

[0147] Based on the target query parameter extracted under the target parameter dimension, determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure;

[0148] The target configuration data corresponding to each target configuration data node is read according to the hierarchical relationship of each target configuration data node, and inheritance and coverage processing is performed on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

[0149] It should be noted that, for the data query method described in this application, ordinary testers in this field can understand that all or part of the process of implementing the data query method described in the embodiment of this application can be completed by controlling the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device. During the execution process, it may include the process of the embodiment of the data query method. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.

[0150] For the data query device of the embodiment of the present application, its various functional modules can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.

[0151] The above describes in detail the data query method, device, computer-readable storage medium, and electronic device provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. At the same time, for those skilled in the art, based on the concept of the present application, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present application.

Claims

1. A data query method, characterized in that: include: receiving a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship; Extracting target query parameters under target parameter dimensions from the configuration data query request; Obtaining a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension; Based on the target query parameter extracted under the target parameter dimension, determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure; The target configuration data corresponding to each target configuration data node is read according to the hierarchical relationship of each target configuration data node, and inheritance and coverage processing is performed on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

2. The data query method according to claim 1, wherein: The step of determining all target configuration data nodes corresponding to the target query parameters in the configuration data structure based on the target query parameters extracted under the target parameter dimension includes: First, based on the data search path composed of all target query parameters under the same target parameter dimension, query whether there is a corresponding child configuration data node in the configuration data structure. If there is no child configuration data node corresponding to the current data search path, delete the target query parameter corresponding to the lowest level in the current data search path, update the current data search path, and then query again in the configuration data structure whether there is a corresponding child configuration data node. Until the child configuration data node corresponding to the current data search path is queried, the child configuration data node and all its parent configuration data nodes are used as target configuration data nodes in the configuration data structure.

3. The data query method according to claim 1, wherein: The performing inheritance and overwriting processing on the target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request includes: Based on the hierarchical relationship of the target configuration data, taking the target configuration data of the next level of the top level as the current configuration data; Inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain new target configuration data of the current level; Take the target configuration data of the next level below the current level as the new current configuration data, return to execute the step of inheriting and overwriting the current configuration data with the target configuration data of the previous level to obtain the new target configuration data of the current level, until the inheritance and overwriting processing of the target configuration data of all levels is completed, and the new target configuration data of the last level is obtained as the configuration result data.

4. The data query method according to claim 3, wherein: The inheriting and overwriting processing of the current configuration data and the target configuration data of the previous level to obtain new target configuration data of the current level includes: Inherit the target configuration data of the previous level into the current configuration data; Compare the configuration items in the current configuration data and the target configuration data of the previous level; If the same configuration items exist, only the one corresponding to the current configuration data among the same configuration items is retained; otherwise, the configuration item of the previous level is retained.

5. The data query method according to claim 1, wherein: After determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure, the method further includes: Determining whether each of the target configuration data nodes contains a first preset condition, where the first preset condition is used to determine whether the target configuration data corresponding to the first preset condition can be used to synthesize the configuration result data; If the first preset condition exists, the target query parameters under all parameter dimensions are judged according to the first preset condition to obtain a first judgment result; It is determined, according to the first judgment result, whether the target configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

6. The data query method according to claim 5, wherein: The first preset condition is written based on a regular expression.

7. The data query method according to claim 1, wherein: Before determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure, the method further includes: Pre-configuring a specified configuration data node in the configuration data structure to include basic configuration data and special configuration data; A corresponding second preset condition is added to the special configuration data, where the second preset condition is used to determine whether the special configuration data corresponding to the second preset condition can be used to synthesize the configuration result data.

8. The data query method according to claim 7, wherein: After determining all target configuration data nodes corresponding to the target query parameter in the configuration data structure, the method further includes: Determining whether each of the target configuration data nodes contains the second preset condition; If the second preset condition exists, the target query parameters under all parameter dimensions are judged according to the second preset condition to obtain a second judgment result; It is determined according to the second judgment result whether the special configuration data in each of the target configuration data nodes can be used to synthesize the configuration result data.

9. A data query device, characterized in that: The data query device comprises: a request receiving module, configured to receive a configuration data query request, wherein the configuration data query request is structured to provide a query parameter under at least one fixed parameter dimension, wherein when there are multiple query parameters under the same parameter dimension, the multiple query parameters are in a hierarchical relationship; A request parsing module, configured to extract target query parameters under a target parameter dimension from the configuration data query request; a configuration acquisition module, configured to acquire a preset configuration data structure, wherein the configuration data structure includes configuration data nodes for storing configuration data, and the hierarchical relationship of the configuration data nodes in the configuration data structure is obtained by dividing the hierarchical relationship of the query parameters under the fixed parameter dimension; a configuration determination module, configured to determine, based on the target query parameters extracted under the target parameter dimension, all target configuration data nodes corresponding to the target query parameters in the configuration data structure; The configuration processing module is used to read each target configuration data corresponding to each target configuration data node according to the hierarchical relationship of each target configuration data node, and perform inheritance and overwriting processing on each target configuration data according to the hierarchical relationship to obtain configuration result data corresponding to the configuration data query request.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the data query method according to any one of claims 1 to 8.

11. A terminal device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the data query method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Configuration file determination method and device, storage medium and electronic equipment

    CN114461304A

  • Data query method and device, computer equipment and storage medium

    CN115292353A