Data query method, device and computer-readable storage medium

By separating data filtering and querying, the combination of attribute filter chain and data query chain is adopted to solve the problem of degradation in query efficiency caused by the increase in data tables and filtering conditions, and efficient and flexible data query and system maintenance are achieved.

CN116701721BActive Publication Date: 2025-07-29CHINA MERCHANTS BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310678891.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-08
Publication Date
2025-07-29
Estimated Expiration
2043-06-08

AI Technical Summary

Technical Problem

With the increase of data tables and filtering conditions, the overall query efficiency in the prior art has decreased, and the existing solutions have shortcomings in real-time and maintenance costs.

Method used

By separating data filtering and data query, the combination of attribute filter chain and data query chain is adopted to process filtering and query separately, reducing data association and backup, and only determine the filter result class through the attribute filter chain, and then query specific data through the data query chain.

Benefits of technology

It realizes efficient query, reduces the need for modification of the original components, improves query efficiency and system scalability, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116701721B_ABST
    Figure CN116701721B_ABST
Patent Text Reader

Abstract

The present invention discloses a data query method, device and computer-readable storage medium, belonging to the technical field of databases. The method includes: determining, according to the received query condition, the search parameter class required by the query condition; inputting the search parameter class into an attribute filter chain to filter out the filter result class corresponding to the search parameter class; and inputting the filter result class into a data query chain to query the specific data corresponding to the filter result class. The present invention aims to improve the query efficiency through the attribute filter chain and the data query chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, and particularly to a data query method, device, and computer-readable storage medium. Background Art

[0002] A comprehensive ledger is to comprehensively register various relevant indicators in a ledger according to the time sequence, which can be used to record information such as the financial statements, inventory status, production progress, and customer data of an enterprise for data analysis and monitoring.

[0003] The comprehensive ledger involves different application scenarios and data types. Usually, a single table only stores the relevant information of one entity. Therefore, it is necessary to first associate multiple data tables in the database, and then query the associated data tables according to multiple set filtering conditions and return the required field set to summarize and generate a comprehensive ledger.

[0004] However, with the increase in the number of data tables and filtering conditions, the complexity of the query will increase exponentially by using the method of associating data tables, thereby resulting in a decline in the overall query efficiency.

[0005] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The main purpose of the present invention is to provide a data query method, device, and computer-readable storage medium, aiming to solve the technical problem of the decline in the overall query efficiency with the increase in the number of data tables and filtering conditions.

[0007] To achieve the above object, the present invention provides a data query method, which includes the following steps:

[0008] According to the received query condition, determine the search parameter class required by the query condition;

[0009] Input the search parameter class into an attribute filter chain to filter out the filter result class corresponding to the search parameter class;

[0010] Input the filter result class into a data query chain to query the specific data corresponding to the filter result class.

[0011] Optionally, the filter result class includes a primary key and a sorting field. The step of inputting the search parameter class into an attribute filter chain to filter out the filter result class corresponding to the search parameter class includes:

[0012] Input the search parameter class into an attribute filter chain, filter out the attribute information that meets the search parameter class from the original data, and determine the primary key corresponding to the attribute information;

[0013] Determine the sorting field corresponding to the attribute information according to the preset overall sorting table;

[0014] The step of querying the specific data corresponding to the filtered result class by inputting the filtered result class into the data query chain includes:

[0015] Input the primary key into the data query chain to query the candidate data that meets the primary key;

[0016] Sort the candidate data according to the sorting field to generate the specific data.

[0017] Optionally, before the step of inputting the search parameter class into the attribute filter chain to filter out the filtered result class corresponding to the search parameter class, it further includes:

[0018] Determine several specific attribute features corresponding to the search parameter class;

[0019] Based on the specific attribute features, determine the attribute filters that need to be closed in the attribute filter chain and the data query filters that need to be closed in the data query chain;

[0020] Switch the enabled state of the attribute filter to the closed state and switch the enabled state of the data query filter to the closed state.

[0021] Optionally, the step of inputting the search parameter class into the attribute filter chain to filter out the filtered result class corresponding to the search parameter class includes:

[0022] Input the search parameter class into the initial attribute filter of the attribute filter chain to generate an initial filtered result class;

[0023] Input the search parameter class and the initial filtered result class into the next attribute filter to generate the filtered result class corresponding to the next attribute filter;

[0024] When the next attribute filter is a non-terminal attribute filter, jump to execute the step of inputting the search parameter class and the initial filtered result class into the next attribute filter to generate the filtered result class corresponding to the next attribute filter;

[0025] When the next attribute filter is a terminal attribute filter, generate the final filtered result class.

[0026] Optionally, the step of inputting the filtered result class into the data query chain to query the specific data corresponding to the filtered result class includes:

[0027] Input the filtered result class into the initial data query of the data query chain to generate initial specific data;

[0028] Input the filtered result class and the initial specific data into the next data query tool to generate the specific data corresponding to the next data query tool;

[0029] When the next data query tool is a non-terminal data query tool, jump to execute the step of inputting the filtered result class and the initial specific data into the next data query tool to generate the specific data corresponding to the next data query tool;

[0030] When the next data query tool is a terminal data query tool, generate the final specific data.

[0031] Optionally, before the step of determining the search parameter class required by the query condition according to the received query condition, the following steps are further included:

[0032] Set a number of filtering conditions according to the business logic, and define the search parameter class according to all the filtering conditions;

[0033] Set a number of filtered results according to the business logic, and define the filtered result class according to all the filtered results;

[0034] Define an abstract filter according to the filtering logic between the search parameter class and the filtered result class, where the abstract filter takes the search parameter class as the input and the filtered result class as the output;

[0035] Divide the search parameter class into different groups according to the attributes or data tables to which the filtering conditions belong, specifically set attribute filters in each group according to the abstract filter, and summarize to generate an attribute filter chain.

[0036] Optionally, after the step of dividing the search parameter class into different groups according to the attributes or data tables to which the filtering conditions belong, specifically setting attribute filters in each group according to the abstract filter, and summarizing to generate an attribute filter chain, the following steps are further included:

[0037] Set a number of query results according to the business logic, and define a data carrier class according to all the query results;

[0038] Define an abstract query tool according to the query logic between the filtered result class and the data carrier class, where the abstract query tool takes the filtered result class as the input and the data carrier class as the output;

[0039] Divide the data carrier class into different groups according to the attributes or data tables to which the data carrier class belongs, specifically set data query tools in each group according to the abstract query tool, and summarize to generate a data query tool chain.

[0040] Optionally, the step of querying the specific data corresponding to the filtered result class by inputting the filtered result class into the data query chain includes:

[0041] Filter out the target filtered result class from the filtered result classes;

[0042] Input the target filtered result class into the data query chain to query the target data corresponding to the target filtered result class.

[0043] In addition, to achieve the above object, the present invention also provides a data query device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the above data query method.

[0044] In addition, to achieve the above object, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the above data query method.

[0045] In a technical solution provided by the present invention, first determine the search parameter class required by the query condition, then input the search parameter class into the attribute filter chain to filter out the filtered result class corresponding to the search parameter class, and then input the filtered result class into the data query chain to query the specific data corresponding to the filtered result class. Compared with the query method of associating data tables, the present application does not need to associate all data tables. Only need to determine the filtered result class that meets the filtering conditions through the attribute filter chain, and then conduct a detailed query on the filtered result class through the data query chain to obtain the specific data that meets the filtering conditions. In this way, data filtering and data query are separated, and only the logical implementation of each needs to be concerned during data filtering and data query, thereby achieving efficient query. Moreover, even if new data tables and filtering conditions are added, only new attribute filters and data queryers need to be established, without any modification to the original components, to further improve the query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a schematic flowchart of the first embodiment of the data query method of the present invention;

[0047] Figure 2 It is a schematic flowchart of the second embodiment of the data query method of the present invention;

[0048] Figure 3 It is a schematic flowchart of the third embodiment of the data query method of the present invention;

[0049] Figure 4 It is a schematic flowchart of the fourth embodiment of the data query method of the present invention;

[0050] Figure 5 It is a schematic flowchart of the fifth embodiment of the data query method of the present invention;

[0051] Figure 6 It is a schematic flowchart of the sixth embodiment of the data query method of the present invention;

[0052] Figure 7 It is a schematic structural diagram of a data query device for the hardware operating environment involved in the solution of the embodiment of the present invention.

[0053] The realization, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Specific embodiments

[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0055] Data query is a basic function in an application system. When querying a comprehensive ledger in the system, since the comprehensive ledger involves different application scenarios and data types, it is necessary to first associate multiple data tables in the database, and then query the associated data tables according to multiple set screening conditions and return the required field set to summarize and generate a comprehensive ledger.

[0056] The above-mentioned scheme for associating data tables can meet the system function requirements when the screening conditions are few and the data tables to be associated are few. However, as the screening conditions and the data tables to be associated increase, the complexity of the association will increase exponentially, thereby causing the overall query efficiency to decline. Moreover, if new screening conditions need to be added, the query SQL needs to be modified, making the query SQL become more and more bloated and difficult to expand and maintain.

[0057] Another alternative solution is to introduce a middleware ElasticSearch (abbreviation: ES, a distributed search and analysis engine), first back up all the data in the database to ES, and then utilize the query advantages of ES to greatly improve the query performance.

[0058] The above-mentioned ES solution can solve the problem of low query efficiency in complex scenarios. However, since all the data needs to be synchronized to ES before querying, there is a certain latency in data query, which is not applicable to scenarios with real-time requirements for data query. Moreover, a data synchronization program needs to be maintained separately all the time, increasing the maintenance cost of the system.

[0059] Accordingly, the present application separates data screening and data querying, and respectively sets up corresponding screening components and querying components. During the actual data querying process, first use the screening component to screen all the data, and then use the querying component to conduct a detailed query on the screened results, and finally obtain the specific data that meets the screening conditions. In this way, there is no need to perform data association or data backup. Only by performing screening and querying operations in sequence can the data required by the user be obtained, ensuring the overall query efficiency.

[0060] To better understand the above technical solution, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0061] An embodiment of the present invention provides a data query method, referring to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of a data query method of the present invention.

[0062] In this embodiment, the data query method includes:

[0063] Step S11: According to the received query condition, determine the search parameter class required by the query condition;

[0064] It can be understood that the query condition refers to the content entered by the user in the text box or the selection of the condition options, such as "educational experience is a bachelor's degree" and "work experience is more than three years". The search parameter class refers to all the attribute features in the query condition, such as "educational experience" and "work experience".

[0065] Optionally, after receiving the query condition input or selected by the user, analyze the query condition, such as comparing the query condition with the preset keywords, and then screen out the search parameter class required for screening from the query condition. Among them, the keywords are preset by technical personnel according to the application scenario, and they can be the same words as the search parameter class or derivative words based on the search parameter class, such as "educational experience", "university experience", "undergraduate experience", etc.

[0066] Step S12: Input the search parameter class into the attribute filter chain to screen out the corresponding screening result class of the search parameter class;

[0067] It can be understood that for a piece of data, the content it carries includes specific data content and corresponding attribute information.

[0068] It can be understood that the attribute filter chain is a chained structure composed of attribute filters, such as Attribute Filter 1 - Attribute Filter 2 - Attribute Filter 3. Among them, the attribute filter has a built-in data filtering method, and through the data filtering method, the original data is filtered by the input parameters, and only the data that meets specific attribute characteristics can pass and be output.

[0069] Moreover, the filtering conditions of each attribute filter are different, that is, they correspond to different specific attribute characteristics, and different data filtering methods are used to screen out the data that meets a certain specific attribute characteristic. For example, Attribute Filter 1 is for screening educational experience, Attribute Filter 2 is for screening work experience, and so on. In this way, the attribute filter chain can perform multiple attribute screenings on the data.

[0070] This solution adopts a component-based screening implementation, designs each attribute filter as an independent component, and can be flexibly combined to meet the needs of different application scenarios, effectively improving the reusability of the code.

[0071] It can be understood that the screening result class includes the data whose attribute information meets specific attribute characteristics. It should be noted that the screening result class can represent whether the current data has specific attribute characteristics, but does not include the specific data content. For example, it can only be determined that the current resume has the "educational experience" attribute, but the specific data content of the "educational experience" is not determined.

[0072] Optionally, after the search parameter class is input into the attribute filter chain, according to several specific attribute characteristics of the search parameter class, several corresponding attribute filters are determined from the attribute filter chain, and then through these attribute filters, the data that meets all specific attribute characteristics is screened out from the original data, that is, the screening result class corresponding to the search parameter class.

[0073] Among them, the process of screening through several attribute filters can be that all attribute filters screen the original data, and then take the intersection of all screening results to finally obtain the data that meets all specific attribute characteristics; it can also be that according to the arrangement order of the attribute filter chain, the processing order of several attribute filters is determined, and the output of the previous attribute filter is used as the input of the next attribute filter, and so on. The output result of the outermost attribute filter is the data that meets all specific attribute characteristics. This embodiment does not make specific limitations.

[0074] Step S13: Input the screening result class into the data query chain to query the data content corresponding to the screening result class.

[0075] It can be understood that since the screening result class can only represent the existence or non-existence of specific attribute characteristics and cannot determine the specific data content corresponding to the specific attribute characteristics, it is necessary to perform query processing to obtain the data content required by the user.

[0076] It is understandable that the data query chain is a chain structure composed of data queryers, such as Data Queryer 1 - Data Queryer 2 - Data Queryer 3. Among them, the data queryer is built-in with a data query method. Through the data query method, with the input parameter as the identification information, the corresponding specific data content is queried in the original data and output. It should be noted that each data queryer corresponds to different query conditions, that is, different specific attribute characteristics, and different data query methods are adopted to filter out the specific data corresponding to a certain specific attribute characteristic. For example, Data Queryer 1 is used to query specific educational experiences, and Data Queryer 2 is used to query specific work experiences, and so on. The data query chain can query the specific data of multiple specific attribute characteristics.

[0077] Optionally, after inputting the filtered result class into the data query chain, according to several specific attribute characteristics of the filtered result class, several corresponding data queryers are determined from the data query chain, and then through these data queryers, the specific data corresponding to the filtered result class is queried from the original data.

[0078] Among them, the process of querying through several data queryers can be executed in parallel. For example, Data Queryer 1 queries educational experiences, and at the same time, Data Queryer 2 queries work experiences. Finally, the union of all query results is obtained, and the specific data that meets all specific attribute characteristics, that is, the data content corresponding to the filtered result class, is finally obtained; it can also be that according to the arrangement order of the data query chain, the processing order of several data queryers is determined. After obtaining the query result of the current data queryer, the query result of the previous data queryer is merged and then output, and so on. The output result of the last attribute filter is the specific data that meets all specific attribute characteristics. This embodiment does not make specific limitations.

[0079] In a technical solution provided by this embodiment, first, the search parameter class required by the query condition is determined, and then the search parameter class is input into the attribute filter chain to filter out the filtered result class corresponding to the search parameter class. Then, the filtered result class is input into the data query chain to query the specific data corresponding to the filtered result class. Compared with the query method of associated data tables, this application does not need to associate all data tables. Only the filtered result class that meets the filtering conditions needs to be determined through the attribute filter chain, and then the filtered result class is detailedly queried through the data query chain to obtain the specific data that meets the filtering conditions. In this way, data filtering and data query are separated, and only the logical implementation of each needs to be concerned about during data filtering and data query, thereby achieving efficient query. Moreover, even if new data tables and filtering conditions are added, only new attribute filters and data queryers need to be established, and no modification to the original components is required to further improve the query efficiency.

[0080] Further, referring to Figure 2 , a second embodiment of the data query method of the present invention is proposed. Based on the above Figure 1 illustrated embodiment, the screening result class includes a primary key and a sorting field. The step of inputting the search parameter class into the attribute filter chain to screen out the screening result class corresponding to the search parameter class includes:

[0081] Step S21: Input the search parameter class into the attribute filter chain, screen out the attribute information that meets the search parameter class from the original data, and determine the primary key corresponding to the attribute information;

[0082] It can be understood that the primary key refers to the identifier of the data and has uniqueness. Also, since each data carries both specific data content and corresponding attribute information, there is a corresponding relationship between the primary key, the specific data content, and the attribute information. For example, primary key 1 corresponds to specific data A and attribute information a, and primary key 2 corresponds to specific data B and attribute information b.

[0083] Optionally, after inputting the search parameter class into the attribute filter chain, according to several specific attribute characteristics of the search parameter class, determine the corresponding several attribute filters from the attribute filter chain. Then, through these attribute filters, compare the attribute information of all the original data with the search parameter class and screen out the attribute information that meets the search parameter class. Further, according to the preset corresponding relationship, determine the primary key corresponding to the attribute information.

[0084] Step S22: Determine the sorting field corresponding to the attribute information according to the preset sorting master table;

[0085] It can be understood that the sorting master table is a sorting table of all attribute characteristics preset by technicians according to application scenarios, business logics, etc. For example, for educational experience, set the sorting field of 985 - 211 - Double First-Class, and for work experience, set the sorting field of over 3 years - 1 to 3 years - less than 1 year - no work experience.

[0086] Optionally, determine the sorting field of the screened attribute information from the preset sorting master table to sort the query results subsequently and feedback the ordered specific data to the user.

[0087] The step of inputting the screening result class into the data query chain to query the data content corresponding to the screening result class includes:

[0088] Step S23: Input the primary key into the data query chain to query the candidate data that meets the primary key;

[0089] Step S24: Sort the candidate data according to the sorting field to generate the specific data.

[0090] Optionally, after inputting the primary key into the data query chain, based on the pre-set correspondence between the primary key and the specific data content, determine the specific data content corresponding to the input primary key, i.e., the candidate data. Further, sort the candidate data based on the sorting field, and finally generate the specific data.

[0091] Exemplarily, through the data query chain, it is queried that the candidate data A for the primary key 1 is a certain 985 university, and the candidate data B for the primary key 2 is a certain 211 university. Based on the sorting field of 985-211-Double First-Class, generate the specific data candidate data A - candidate data B.

[0092] In a technical solution provided by this embodiment, first screen out the attribute information that meets the search parameter class from the original data, then determine the primary key and the sorting field corresponding to the attribute information. Further, query the candidate data corresponding to the primary key through the data query chain, and finally sort all the candidate data according to the sorting field. With such a setting, the orderliness of the finally output specific data can be ensured, the visibility of the data can be enhanced, and thus the user experience can be improved.

[0093] Further, referring to Figure 3 , a third embodiment of the data query method of the present invention is proposed. Before the step of inputting the search parameter class into the attribute filter chain and screening out the filter result class corresponding to the search parameter class based on the above Figure 1 shown embodiment, it further includes:

[0094] Step S31: Determine several specific attribute features corresponding to the search parameter class;

[0095] Step S32: Based on the specific attribute features, determine the attribute filters that need to be closed in the attribute filter chain, and the data query filters that need to be closed in the data query chain;

[0096] Step S33: Switch the enabled state of the attribute filter to the closed state, and switch the enabled state of the data query filter to the closed state.

[0097] Optionally, the search parameter class refers to all the attribute features in the query condition. Therefore, specific characteristic attribute features can be obtained based on the search parameter class.

[0098] It can be understood that since the attribute filter chain is a chain structure composed of attribute filters, and the filter conditions of each attribute filter are different, that is, they correspond to different specific attribute features. Therefore, in actual application, not all filters and query filters may be used.

[0099] Optionally, based on specific attribute features, perform attribute matching, select the attribute filters to be used from the attribute filter chain, and the remaining ones are the attribute filters to be closed. Similarly, determine the data query filters to be closed in the data query filter chain.

[0100] Furthermore, the enabled states of the attribute filters include the closed state and the off state. By default, they are in the enabled state. Therefore, switch the enabled states of the attribute filters to be closed to the closed state. Similarly, switch the enabled states of the data query filters to be closed to the closed state.

[0101] In a technical solution provided by this embodiment, based on several specific attribute features corresponding to the search parameter class, determine the attribute filters and data query filters to be closed, and then switch the enabled states of the foregoing components to the closed state. With such a setting, during the actual filtering process, only the data to be filtered needs to be input into the relevant attribute filters for filtering, rather than passing through all the attribute filters, avoiding waste of time in irrelevant data filters. The same applies to the actual query process, thereby improving the overall query rate. Moreover, when new or deleted filtering conditions or query conditions are needed, only the enabled states of the corresponding components need to be switched, enhancing the scalability of function implementation, flexibly coping with changes in requirements, effectively reducing the later maintenance cost, and further improving the maintainability of the system.

[0102] Further, referring to Figure 4 , a fourth embodiment of the data query method of the present invention is proposed. Based on the foregoing Figure 1 illustrated embodiment, the step of inputting the search parameter class into the attribute filter chain and filtering out the filter result class corresponding to the search parameter class includes:

[0103] Step S41: Input the search parameter class into the initial attribute filter of the attribute filter chain to generate an initial filter result class;

[0104] Step S42: Input the search parameter class and the initial filter result class into the next attribute filter to generate the filter result class corresponding to the next attribute filter;

[0105] Step S43: When the next attribute filter is a non-terminal attribute filter, jump to execute the step of inputting the search parameter class and the initial filter result class into the next attribute filter to generate the filter result class corresponding to the next attribute filter;

[0106] Step S44: When the next attribute filter is a terminal attribute filter, generate the final filter result class.

[0107] It can be understood that the attribute filter chain is a chain structure composed of attribute filters, so the processing flow of the attribute filter chain is actually a sub-processing flow of multiple attribute filters. In this embodiment, the processing order of several attribute filters is determined according to the arrangement order of the attribute filter chain, and the output of the previous attribute filter is used as the input of the next attribute filter.

[0108] Optionally, the search parameter class is input into the initial attribute filter, ie, the first attribute filter, to generate an initial screening result class. For example, the specific attribute feature corresponding to the initial attribute filter is educational experience, and thus the screening of educational experience is completed.

[0109] Furthermore, the search parameter class and the initial screening result class are input into the next attribute filter to generate the screening result class corresponding to the next attribute filter. For example, if the specific attribute feature corresponding to the second attribute filter is work experience, the screening of education experience and work experience is completed.

[0110] Furthermore, if the next attribute filter is a non-terminal attribute filter, it means that there are at least two more attribute filters. Therefore, the step of inputting the search parameter class and the initial screening result class into the next attribute filter to generate the screening result class corresponding to the next attribute filter is jumped to. If the next attribute filter is a terminal attribute filter, it means that only the last screening is required, so the screening result of this time can be used as the final screening result class, and the screening of all specific attribute features is completed.

[0111] The step of inputting the screening result class into a data query chain and querying specific data corresponding to the screening result class includes:

[0112] Step S45: inputting the screening result class into the initial data query of the data query chain to generate initial specific data;

[0113] Step S46: inputting the screening result class and the initial specific data into the next data query device to generate specific data corresponding to the next data query device;

[0114] Step S47: When the next data query unit is a non-terminal data query unit, the process jumps to the step of inputting the screening result class and the initial specific data into the next data query unit to generate specific data corresponding to the next data query unit;

[0115] Step S48: When the next data queryer is a terminal data queryer, the final specific data is generated.

[0116] It can be understood that the data query chain is a chain structure composed of data queryers. Therefore, the processing flow of the data queryer is actually the sub-processing flows of multiple data queryers. In this embodiment, according to the arrangement order of the data queryers, the processing order of several data queryers is determined. After obtaining the query result of the current data queryer, the query result of the previous data queryer is merged and then output.

[0117] The specific processing flow is similar to S41 - S44 and will not be elaborated here.

[0118] In a technical solution provided by this embodiment, first, according to the arrangement order of the attribute filter chain, the processing order of each attribute filter is determined. In the specific processing process, the output of the previous attribute filter is used as the input of the next attribute filter. Different from processing the original data in each processing flow, the processing flow in this solution is actually a continuation of the previous processing flow, gradually reducing the data processing volume, so as to achieve the effect of gradually narrowing the scope, and thus accelerating the screening and query processes.

[0119] Further, referring to Figure 5 a fifth embodiment of the data query method of the present invention is proposed. Based on the above Figure 1 shown embodiment, before the step of determining the search parameter class required by the query condition according to the received query condition, the following steps are further included:

[0120] Step S51: Set several screening conditions according to the business logic, and define the search parameter class according to all the screening conditions;

[0121] Step S52: Set several screening results according to the business logic, and define the screening result class according to all the screening results;

[0122] Step S53: Define an abstract filter according to the screening logic between the search parameter class and the screening result class. The abstract filter takes the search parameter class as the input and the screening result class as the output;

[0123] Step S54: Divide the search parameter class into different groups according to the attributes or data tables to which the screening conditions belong. In each group, set the attribute filters specifically according to the abstract filter, and summarize to generate an attribute filter chain.

[0124] It can be understood that the business logic is all possible query requirements and feedback results preset by technical personnel based on the application scenario.

[0125] On the one hand, set the screening conditions according to the business logic, and define the search parameter class based on all the screening conditions, that is, the attribute characteristics of the data queried by the user; on the other hand, set the screening results according to the business logic, and define the search parameter class based on all the screening results, that is, the data whose attribute information meets specific attribute characteristics.

[0126] Optionally, based on the screening logic between the screening conditions and the screening results, define an abstract filter for characterizing the mapping relationship between all the screening conditions and the screening results.

[0127] Furthermore, divide the search parameter class into different groups according to the attributes or data tables to which the screening conditions belong, then in each group, specifically set the attribute filters according to the abstract filter, and finally generate an attribute filter chain according to the preset screening order.

[0128] Step S55: Set a number of query results according to the business logic, and define a data carrier class based on all the query results;

[0129] Step S55: Define an abstract queryer according to the query logic between the screening result class and the data carrier class, where the abstract queryer takes the screening result class as input and the data carrier class as output;

[0130] Step S56: Divide the data carrier class into different groups according to the attributes or data tables to which the data carrier class belongs, specifically set data queryers in each group according to the abstract queryer, and summarize to generate a data queryer chain.

[0131] The specific processing flow is similar to S51 - S54 and will not be elaborated here.

[0132] In a technical solution provided in this embodiment, the specific generation processes of the attribute filter chain and the data queryer chain are given, providing components for subsequent actual screening and query steps.

[0133] Further, referring to Figure 6 , a sixth embodiment of the data query method of the present invention is proposed. Based on the above Figure 1 shown embodiment, the step of inputting the screening result class into the data queryer chain to query the specific data corresponding to the screening result class includes:

[0134] Step S61: Screen out the target screening result class from the screening result class;

[0135] Step S62: Input the target screening result class into the data queryer chain to query the target data corresponding to the target screening result class.

[0136] It is understandable that after obtaining the filtered result class through the attribute filter chain, query processing can be selectively performed.

[0137] Optionally, according to business requirements or confidentiality agreements, the target filtered result class is filtered out from the filtered result class, and then the target filtered result class is input into the data query chain to query the target data corresponding to the target filtered result class.

[0138] In a technical solution provided in this embodiment, after obtaining the filtered result class, detailed queries are not provided for all filtered result classes. Instead, based on considerations of pertinence or confidentiality, the target data corresponding to the target filtered result class is selectively queried, making the entire process more flexible.

[0139] Refer to Figure 7 , Figure 7 which is a schematic structural diagram of a data query device for the hardware operating environment involved in the solution of the embodiment of the present invention.

[0140] As Figure 7 shown, the data query device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (WI-FI) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable Non-Volatile Memory (NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0141] Those skilled in the art can understand that Figure 7 the structure shown in

[0142] As Figure 7 shown, the memory 1005, as a storage medium, may include an operating system, data storage attributes, network communication attributes, user interface attributes, and a computer program.

[0143] InFigure 7 In the data query device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with users; the processor 1001 and the memory 1005 in the data query device of the present invention can be arranged in the data query device. The data query device calls the computer program stored in the memory 1005 through the processor 1001 and executes the data query method provided by the embodiments of the present invention.

[0144] The embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it implements the steps in any one of the above data query method embodiments.

[0145] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the method part, for the descriptions of the embodiments of the computer-readable storage medium part, please refer to the descriptions of the embodiments of the method part, and will not be elaborated here for the time being.

[0146] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0147] The above serial numbers of the embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.

[0148] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) as described above and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0149] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A data query method, characterized in that, The data query method includes the following steps: Based on the received query conditions, determine the search parameter class required by the query conditions; Input the search parameter class into the attribute filter chain to filter out the corresponding filter result class of the search parameter class. Among them, the filter result class includes a primary key and a sorting field. The step of inputting the search parameter class into the attribute filter chain to filter out the corresponding filter result class of the search parameter class includes: inputting the search parameter class into the attribute filter chain, filtering out the attribute information that meets the search parameter class from the original data, and determining the primary key corresponding to the attribute information; according to the preset total sorting table, determine the sorting field corresponding to the attribute information; Input the filter result class into the data query chain to query the specific data corresponding to the filter result class, including: inputting the primary key into the data query chain to query the candidate data that meets the primary key; sorting the candidate data according to the sorting field to generate the specific data.

2. The data query method according to claim 1, wherein Before the step of inputting the search parameter class into the attribute filter chain to filter out the corresponding filter result class of the search parameter class, it further includes: Determine several specific attribute features corresponding to the search parameter class; Based on the specific attribute features, determine the attribute filters that need to be closed in the attribute filter chain and the data query filters that need to be closed in the data query chain; Switch the enabled state of the attribute filter to the closed state and switch the enabled state of the data query filter to the closed state.

3. The data query method according to claim 1, wherein The step of inputting the search parameter class into the attribute filter chain to filter out the corresponding filter result class of the search parameter class includes: Input the search parameter class into the initial attribute filter of the attribute filter chain to generate an initial filter result class; Input the search parameter class and the initial filter result class into the next attribute filter to generate the filter result class corresponding to the next attribute filter; When the next attribute filter is a non-terminal attribute filter, jump to execute the step of inputting the search parameter class and the initial filter result class into the next attribute filter to generate the filter result class corresponding to the next attribute filter; When the next attribute filter is a terminal attribute filter, generate the final filter result class.

4. The data query method according to claim 3, wherein The step of inputting the filter result class into the data query chain to query the specific data corresponding to the filter result class includes: Input the filter result class into the initial data query of the data query chain to generate initial specific data; Input the filter result class and the initial specific data into the next data query to generate the specific data corresponding to the next data query; When the next data query is a non-terminal data query, jump to execute the step of inputting the filter result class and the initial specific data into the next data query to generate the specific data corresponding to the next data query; When the next data query is a terminal data query, generate the final specific data.

5. The data query method according to claim 1, wherein Before the step of determining the search parameter class required by the query conditions based on the received query conditions, it further includes: Set several filtering conditions according to business logic, and define search parameter classes based on all filtering conditions; Set a number of screening results according to the business logic, and define a screening result class based on all the screening results; According to the screening logic between the search parameter class and the screening result class, an abstract filter is defined, wherein the abstract filter takes the search parameter class as input and takes the screening result class as output; According to the attributes or data tables to which the filtering conditions belong, the search parameter classes are divided into different groups. In each group, attribute filters are specifically set according to the abstract filter, and attribute filter chains are generated in aggregate.

6. The data query method according to claim 5, wherein After the steps of dividing the search parameter classes into different groups according to the attributes or data tables to which the filtering conditions belong, specifically setting attribute filters in each group according to the abstract filter, and summarizing and generating an attribute filter chain, the method further includes: Set a number of query results according to the business logic, and define a data carrying class based on all query results; According to the query logic between the screening result class and the data carrying class, an abstract query is defined, wherein the abstract query takes the screening result class as input and takes the data carrying class as output; According to the attributes or data tables to which the data bearing classes belong, the data bearing classes are divided into different groups. In each group, a data query is specifically set according to the abstract query, and a data query chain is generated in a summarized manner.

7. The data query method according to claim 1, wherein The step of inputting the screening result class into a data query chain and querying specific data corresponding to the screening result class includes: Filtering out a target screening result class from the screening result class; The target screening result class is input into the data query chain to query the target data corresponding to the target screening result class.

8. A data query device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data query method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data query method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for realizing switching during network fault and finders

    CN101674199A

  • Method of building and searching a multi-dimensional cross-linked distributed ledger

    US11531649B1