Data query method and related device
By obtaining the group assignment fields corresponding to the calculated field formula in the data query method, and converting the calculated field formula into entity field filtering conditions, the problems of poor real-time and high maintenance costs caused by the fall of the calculated field results in the physical table in the prior art are solved, and more efficient real-time data query is achieved.
Patent Information
- Application Number
- CN202411815920.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art needs to put the results of the calculated fields into the physical table during the report query stage, resulting in the business data needing to maintain the latest value of the calculated fields in real time when changes, which has poor real-time performance and high maintenance costs.
In the data query method, by obtaining the grouped assignment fields corresponding to the calculated field formula, the filter conditions containing the calculated field formula are converted into filter conditions containing the entity fields, so as to directly filter and query the data in the target table to avoid falling into the physical table.
This method avoids the maintenance overhead caused by falling calculated field results into physical tables, and improves the real-time nature of the data query process.
Smart Images

Figure CN119719167A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data query method and related devices. Background Art
[0002] In report query and filtering applications, the use of calculated fields has become a common operation. The so-called calculated fields allow users to dynamically process and calculate the data in the physical table in memory through functions and expressions to generate the required result set.
[0003] However, in the report query stage, if the results of these calculated fields are to be called, the prior art generally places the calculation results of the calculated fields into a physical table and solves the filtering and querying problems through the fields in the physical table.
[0004] However, the existing technology of placing calculated fields into physical tables requires business personnel to maintain the latest values of calculated fields in real time when business data changes. This not only has poor real-time performance, but also generates certain maintenance costs. Summary of the invention
[0005] An embodiment of the present invention provides a data query method and related devices, which are used to obtain the group assignment field corresponding to the calculation field formula in a scenario of implementing data classification, thereby utilizing the similarity between the classification logic of the calculation field and the group assignment field logic to convert the first filtering condition containing the calculation field formula into a second filtering condition containing the entity field, and then utilize the second filtering condition to filter and query the data in the target table, thereby avoiding the maintenance overhead caused by placing the results of the calculation field into the physical table, while improving the real-time performance of the data query process.
[0006] A first aspect of an embodiment of the present application provides a data query method, including:
[0007] Receive input filter conditions;
[0008] If it is detected that the filtering condition is the first filtering condition including a calculation field formula, obtaining the grouping value assignment field corresponding to the calculation field formula;
[0009] According to the calculation field formula and the grouping rule of the grouping assignment field, converting the first filtering condition including the calculation field formula into a second filtering condition including the entity field and the value of the entity field, wherein the grouping assignment field depends on the entity field in the target table, the value of the grouping assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field;
[0010] According to the second filtering condition, the data in the target table is filtered and queried.
[0011] As an optional embodiment, converting the first filtering condition including the calculation field formula into the second filtering condition including the entity field and the value of the entity field according to the calculation field formula and the grouping rule of the grouping assignment field includes:
[0012] Acquire the first filtering condition, where the first filtering condition includes a calculated field and a value of the calculated field;
[0013] According to the value of the calculated field, reversely parse the first filtering condition to determine the grouping assignment field corresponding to the calculated field;
[0014] According to the grouping value assignment field, obtaining the entity field on which the grouping value assignment field depends;
[0015] According to the value of the grouping assignment field, obtaining the value of the entity field on which the value of the grouping assignment field depends;
[0016] The first filtering condition is converted into the second filtering condition according to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule.
[0017] As an optional embodiment, converting the first filtering condition into the second filtering condition according to the entity field on which the grouping assignment field depends, the value of the entity field on which the value of the grouping assignment field depends, and the grouping rule includes:
[0018] If it is determined according to the grouping rule that the value of the grouping assignment field includes a grouped field, then obtaining the value of the entity field on which the grouped field depends;
[0019] The first filtering condition is converted into the second filtering condition according to the grouped fields, the entity fields on which the grouping valued fields depend, and the values of the entity fields on which the values of the grouping valued fields depend.
[0020] As an optional embodiment, converting the first filtering condition into the second filtering condition according to the entity field on which the grouping assignment field depends, the value of the entity field on which the value of the grouping assignment field depends, and the grouping rule includes:
[0021] If it is determined according to the grouping rule that the value of the grouped valued field includes an ungrouped field, then obtaining the value of the entity field on which the ungrouped field depends;
[0022] The first filtering condition is converted into the second filtering condition according to the values of the ungrouped field, the entity field on which the grouped valued field depends, and the entity field on which the ungrouped field depends.
[0023] As an optional embodiment, obtaining the value of the entity field on which the ungrouped field depends includes:
[0024] Obtaining the grouped fields in the value of the grouped valued fields;
[0025] Get the value of the entity field on which the grouped field depends;
[0026] The value of the entity field on which the grouped field depends is inverted to obtain the value of the entity field on which the ungrouped field depends.
[0027] As an optional embodiment, before receiving the input filtering condition, the method further includes:
[0028] receiving a first configuration operation, wherein the first configuration operation is used to configure the type of the calculation field to be the group assignment field;
[0029] receiving a second configuration operation, the second configuration operation being used to configure the group-assignment field, the value of the group-assignment field, the entity field in the target table on which the group-assignment field depends, and the value of the entity field on which the value of the group-assignment field depends;
[0030] A third configuration operation is received, where the third configuration operation is used to configure the calculation field formula.
[0031] A second aspect of an embodiment of the present application provides a data query device, including:
[0032] A receiving unit, used for receiving input filtering conditions;
[0033] an acquiring unit, configured to acquire a grouping value assignment field corresponding to the calculation field formula if it is detected that the filtering condition is a first filtering condition including a calculation field formula;
[0034] a conversion unit, configured to convert a first filtering condition including the calculation field formula into a second filtering condition including an entity field and a value of the entity field according to a grouping rule of the calculation field formula and the grouping assignment field, wherein the grouping assignment field depends on an entity field in a target table, the value of the grouping assignment field depends on a value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field;
[0035] A filtering and querying unit is used to filter and query the data in the target table according to the second filtering condition.
[0036] As an optional embodiment, the conversion unit is specifically used for:
[0037] Acquire the first filtering condition, where the first filtering condition includes a calculated field and a value of the calculated field;
[0038] According to the value of the calculated field, reversely parse the first filtering condition to determine the grouping assignment field corresponding to the calculated field;
[0039] According to the grouping value assignment field, obtaining the entity field on which the grouping value assignment field depends;
[0040] According to the value of the grouping assignment field, obtaining the value of the entity field on which the value of the grouping assignment field depends;
[0041] The first filtering condition is converted into the second filtering condition according to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule.
[0042] As an optional embodiment, the conversion unit is specifically used for:
[0043] If it is determined according to the grouping rule that the value of the grouping assignment field includes a grouped field, then obtaining the value of the entity field on which the grouped field depends;
[0044] The first filtering condition is converted into the second filtering condition according to the grouped fields, the entity fields on which the grouping valued fields depend, and the values of the entity fields on which the values of the grouping valued fields depend.
[0045] As an optional embodiment, the conversion unit is specifically used for:
[0046] If it is determined according to the grouping rule that the value of the grouped valued field includes an ungrouped field, then obtaining the value of the entity field on which the ungrouped field depends;
[0047] The first filtering condition is converted into the second filtering condition according to the values of the ungrouped field, the entity field on which the grouped valued field depends, and the entity field on which the ungrouped field depends.
[0048] As an optional embodiment, the conversion unit is specifically used for:
[0049] Obtaining the grouped fields in the value of the grouped valued fields;
[0050] Get the value of the entity field on which the grouped field depends;
[0051] The value of the entity field on which the grouped field depends is inverted to obtain the value of the entity field on which the ungrouped field depends.
[0052] As an optional embodiment, the receiving unit is further used for:
[0053] receiving a first configuration operation, wherein the first configuration operation is used to configure the type of the calculation field to be the group assignment field;
[0054] receiving a second configuration operation, the second configuration operation being used to configure the group-assignment field, the value of the group-assignment field, the entity field in the target table on which the group-assignment field depends, and the value of the entity field on which the value of the group-assignment field depends;
[0055] A third configuration operation is received, where the third configuration operation is used to configure the calculation field formula.
[0056] A third aspect of an embodiment of the present application provides a computer device, including a processor, which is used to implement the data query method provided in the first aspect of the embodiment of the present application when executing a computer program stored in a memory.
[0057] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is used to implement the data query method provided in the first aspect of the embodiment of the present application.
[0058] A fourth aspect of an embodiment of the present application provides a computer program product, which, when executed by a processor, is used to implement the data query method provided in the first aspect of the embodiment of the present application.
[0059] It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
[0060] Receive input filtering conditions; if it is detected that the filtering condition is a first filtering condition containing a calculation field formula, obtain the grouping assignment field corresponding to the calculation field formula; according to the grouping rules of the calculation field formula and the grouping assignment field, convert the first filtering condition containing the calculation field formula into a second filtering condition containing an entity field and the value of the entity field, wherein the grouping assignment field depends on the entity field in the target table, the value of the grouping assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field; according to the second filtering condition, filter and query the data in the target table.
[0061] Because the embodiment of the present application converts the filtering condition containing the calculation field formula into a second filtering condition containing the entity field and the value of the entity field in the data classification scenario, it is possible to filter and query the data in the target table directly according to the second filtering condition, thereby avoiding the cost of subsequent maintenance of the physical table caused by the need to store the result of the calculation field in the physical table in the memory when calling the calculation field, and at the same time improving the real-time performance of the data query process. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 This is a schematic diagram of the architecture of the data query system in the embodiment of the present application;
[0063] Figure 2 This is a schematic diagram of an embodiment of a data query method in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of a configuration interface in an embodiment of the present application;
[0065] Figure 4 It is a detailed step of step 203 in the embodiment of the present application;
[0066] Figure 5 It is a detailed step of step 405 in the embodiment of the present application;
[0067] Figure 6 It is another detailed step of step 405 in the embodiment of the present application;
[0068] Figure 7 This is another schematic diagram of an embodiment of the data query method in the embodiment of the present application;
[0069] Figure 8 It is a schematic diagram of an embodiment of a data query device in an embodiment of the present application. DETAILED DESCRIPTION
[0070] An embodiment of the present invention provides a data query method and related devices, which are used to obtain the group assignment field corresponding to the calculation field formula in the scenario of implementing data classification, thereby utilizing the similarity between the classification logic of the calculation field and the group assignment field logic to convert the first filtering condition containing the calculation field formula into a second filtering condition containing the entity field, and then utilize the second filtering condition to filter and query the data in the target table, thereby avoiding the maintenance overhead caused by placing the results of the calculation field into the physical table, and at the same time improving the real-time performance of the data query process.
[0071] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0072] The terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0073] The embodiment of the present application provides a data query method, the general principle of which is: receiving an input filter condition; if it is detected that the filter condition is a first filter condition containing a calculation field formula, obtaining the grouping assignment field corresponding to the calculation field formula; according to the grouping rules of the calculation field formula and the grouping assignment field, converting the first filter condition containing the calculation field formula into a second filter condition containing an entity field and a value of the entity field, wherein the grouping assignment field depends on the entity field in the target table, the value of the grouping assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field; according to the second filter condition, filtering and querying the data in the target table. The data query method provided in the embodiment of the present application obtains the grouping assignment field corresponding to the calculation field formula, and utilizes the similarity between the classification logic of the calculation field and the grouping assignment field logic, thereby converting the first filter condition containing the calculation field formula into a second filter condition containing the entity field, and then using the second filter condition to filter and query the data in the target table, thereby avoiding the result of the calculation field from falling into the physical table, and correspondingly avoiding the maintenance overhead caused by maintaining the physical table, while improving the real-time performance of the data query process.
[0074] In order to better implement the above data query method, the present application embodiment provides a data query system. Figure 1 , Figure 1A schematic diagram of the architecture of a data query system provided for an embodiment of the present application. The data query system may include at least one terminal device 101 and a server 102; different types of applications may be installed on the terminal device 101, for example, an EXCEL spreadsheet application, a job search application, an instant messaging application, a live broadcast application, a conference communication application, etc. may be installed on the terminal device 101; the terminal device 101 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car, etc. The server 102 may be used to store table data, application data, and image data generated by different types of applications of the terminal device 101. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc.
[0075] In which, the above-mentioned data query method is executed by the terminal device 101 or the server 102. When the data query method is executed by the terminal device 101, the database table data generated by the terminal device 101 in different types of applications can be stored in the server. Then, when the terminal device 101 needs to query the data in the database table, the terminal device 101 receives the input filter conditions, and then detects the filter conditions. When it is detected that the filter conditions include the first filter condition of the calculated field formula, the group assignment field corresponding to the calculated field formula is obtained, and according to the grouping rules of the calculated field formula and the group assignment field, the first filter condition including the calculated field formula is converted into a second filter condition including the entity field and the value of the entity field, and according to the second filter condition, the database table data stored in the server 102 is filtered and queried.
[0076] For ease of understanding, the data query method in the embodiment of the present application is described below. Figure 2 , an embodiment of the data query method in the embodiment of the present application includes:
[0077] 201. Receive input filtering conditions;
[0078] Specifically, the terminal in the embodiment of the present application can receive the filtering condition input by the user, and detect the fields included in the filtering condition, and execute step 202 when it is detected that the filtering condition is the first filtering condition containing a calculation field formula.
[0079] Specifically, when receiving the filtering condition, the terminal may receive the filtering condition through a filter, and further determine whether the filtering condition includes a grouping value assignment field.
[0080] Specifically, the filter here can be a text input control or a dialog box, etc., and there is no specific limitation on the expression form of the filter here.
[0081] 202. If it is detected that the filtering condition is the first filtering condition including a calculation field formula, obtaining a grouping value assignment field corresponding to the calculation field formula;
[0082] After receiving the filtering condition, the terminal further detects whether the filtering condition contains a calculated field formula, and when it is detected that the filtering condition contains a calculated field formula, the terminal obtains the grouping value assignment field corresponding to the calculated field formula.
[0083] Specifically, the calculation field formula in the embodiment of the present application refers to a formula that performs calculations through fields. For example, the calculation field formula here can be "position type = personnel category, or position type = technical category". Further, after obtaining the calculation field formula, the group assignment field corresponding to the calculation field formula is obtained, wherein the group assignment field here refers to a pre-configured one. For example, when the calculation field formula is "position type = technical category", the "position type" can be pre-configured as a group assignment field. Then, after detecting the first filtering condition ("position type = technical category"), the embodiment of the present application obtains the group assignment field ("position type") corresponding to the calculation field formula in the first filtering condition, and executes step 203 according to the obtained group assignment field.
[0084] 203. According to the calculation field formula and the grouping rule of the grouping assignment field, convert the first filtering condition including the calculation field formula into a second filtering condition including the entity field and the value of the entity field, wherein the grouping assignment field depends on the entity field in the target table, the value of the grouping assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field;
[0085] Further, if a first filtering condition containing a calculated field formula is detected, the first filtering condition containing the calculated field formula is converted into a second filtering condition containing an entity field and a value of the entity field according to the grouping rules of the field formula and the grouping assignment field, wherein the grouping assignment field in the embodiment of the present application depends on the entity field in the target table, and the value of the grouping assignment field depends on the value of the entity field, and the calculated field formula in the embodiment of the present application is used to classify the value of the entity field according to the entity field and the value of the entity field. For ease of understanding, Figure 3A schematic diagram of an interface for configuring a group assignment field, the value of the group assignment field, the entity field on which the group assignment field depends, and the value of the entity field on which the value of the group assignment field depends is given.
[0086] Specifically, in Figure 3 In the example, "Position Type" is the grouping assignment field, "Technical Category" is the value of the grouping assignment field, and "Position Type" depends on the entity field "Position Level Name" in the target table, while "Technical Category" depends on the value of the entity field "Operator, Technician or Engineer" in the target table.
[0087] In the embodiment of the present application, after the first filtering condition is converted into the second filtering condition, because the second filtering condition includes the entity fields and the values of the entity fields in the target table, the data in the target table can be filtered and queried according to the second filtering condition.
[0088] Specifically, the process of how to convert the first filtering condition into the second filtering condition will be described in detail in the following embodiments and will not be repeated here.
[0089] 204. Filter and query the data in the target table according to the second filtering condition.
[0090] After the second filtering condition is obtained, because the second filtering condition includes the entity fields and the values of the entity fields in the target table, the data in the target table can be filtered and queried according to the second filtering condition.
[0091] In an embodiment of the present application, an input filter condition is received; if it is detected that the filter condition is a first filter condition containing a calculation field formula, the group assignment field corresponding to the calculation field formula is obtained; according to the grouping rules of the calculation field formula and the group assignment field, the first filter condition containing the calculation field formula is converted into a second filter condition containing an entity field and the value of the entity field, wherein the group assignment field depends on the entity field in the target table, the value of the group assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field; according to the second filter condition, the data in the target table is filtered and queried.
[0092] Because the embodiment of the present application converts the filtering condition containing the calculation field formula into a second filtering condition containing the entity field and the value of the entity field in the data classification scenario, it is possible to filter and query the data in the target table directly according to the second filtering condition, thereby avoiding the problem of later maintenance of the physical table caused by the need to store the result of the calculation field in the physical table in the memory when calling the calculation field, and at the same time improving the real-time performance of data query.
[0093] based on Figure 2 In the embodiment described above, step 203 is described in detail below. Figure 4 , Figure 4 The detailed steps of step 203 are as follows:
[0094] 401. Obtain the first filtering condition, where the first filtering condition includes a calculated field and a value of the calculated field;
[0095] In order to convert a first filter condition including a calculated field formula into a second filter condition including an entity field, an embodiment of the present application may obtain a first filter condition, where the first filter condition includes a calculated field and a value of the calculated field.
[0096] Specifically, in an embodiment of the present application, a method for obtaining the first filtering condition may be to directly receive the first filtering condition input by the user through a filter. For ease of understanding, an example of a first filtering condition including a calculated field and the value of the calculated field is given below. For example, the first filtering condition may be "position type = technical category", or "position type = personnel category", etc. In the above first filtering condition, the calculated field is "position type", and the value of the calculated field is "technical category". Of course, the above example is only an explanation of the first filtering condition and not a limitation thereof. No specific limitation is imposed on the calculated field and the value of the calculated field in the first filtering condition.
[0097] 402. According to the value of the calculated field, reversely parse the first filtering condition to determine the grouping value assignment field corresponding to the calculated field;
[0098] After the first filtering condition is obtained in step 401, the first filtering condition is reversely parsed according to the value of the calculated field to determine the grouping assignment field corresponding to the calculated field.
[0099] For example, when the first filtering condition is "Position Type = Technical Category", the group assignment field corresponding to the calculated field is determined in reverse based on the value of the calculated field "Technical Category", that is, the group assignment field "Position Type" corresponding to the calculated field "Position Type" is determined. It should be noted here that because the calculated field is pre-configured as a group assignment field, the calculated field in the embodiment of the present application is the group assignment field, that is, the calculated field "Position Type" is the group assignment field.
[0100] 403. According to the grouping value assignment field, obtain the entity field on which the grouping value assignment field depends;
[0101] After the grouping value assignment field in the first filtering condition is obtained, the entity field on which the grouping value assignment field depends is determined according to the pre-configured entity field on which the grouping value assignment field depends.
[0102] For ease of understanding, Figure 3 The configuration interface in is given as an example:
[0103] As in Figure 3 In the interface, because the grouping assignment field is "Position Type" and the entity field that the position type depends on is "Position Level Name", it can be further determined that the entity field that the grouping assignment field "Position Type" depends on is "Position Level Name".
[0104] 404. According to the value of the grouping valued field, obtain the value of the entity field on which the value of the grouping valued field depends;
[0105] After determining the entity field on which the grouping assignment field depends according to the grouping assignment field, the value of the entity field on which the value of the grouping assignment field depends is further obtained according to the value of the grouping assignment field.
[0106] As in Figure 3 In the interface shown, if the value of the group assignment field is "Technical Category", then the value of the entity field on which the "Technical Category" depends can be determined as "Operator", "Technician" and "Engineer". It is easy to understand that the value of the group assignment field here is also the value of the calculated field.
[0107] 405. Convert the first filtering condition into the second filtering condition according to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule.
[0108] After obtaining the entity field on which the grouping assignment field depends, the value of the entity field on which the value of the grouping assignment field depends, and the grouping rule, the first filtering condition is converted into the second filtering condition.
[0109] Specifically, in the process of converting the first filtering condition into the second filtering condition, it is also necessary to determine whether the grouping assignment field is a grouped field or an ungrouped field, and when the grouping assignment field is a grouped field, the process of converting the first filtering condition into the second filtering condition is different from the process of converting the first filtering condition into the second filtering condition when the grouping assignment field is an ungrouped field.
[0110] For ease of understanding, a detailed description will be given below and will not be repeated here.
[0111] In an embodiment of the present application, a detailed description is given of how to reversely parse the first filter condition based on the calculation field formula to determine the entity field on which the grouping assignment field depends, and the value of the entity field on which the value of the grouping assignment field depends, thereby improving the convenience of converting the first filter condition into the second filter condition.
[0112] based on Figure 4In the embodiment described above, step 405 is described in detail below:
[0113] 1. The value of the grouped assignment field includes the grouped field
[0114] See also Figure 5 , Figure 5 A refinement of step 405:
[0115] 501. If it is determined according to the grouping rule that the value of the grouping assignment field includes a grouped field, then the value of the entity field on which the grouped field depends is obtained;
[0116] Specifically, in Figure 3 In the configuration interface of , if the value of the grouped assignment field is determined to include the grouped field according to the grouping rule, the value of the entity field on which the grouped field depends is obtained, such as in Figure 3 If a specific field can be read from the grouping settings, it indicates that the grouping field is a grouped field. If a specific field cannot be read from the grouping settings, it indicates that the grouping field is an ungrouped field.
[0117] Further, when it is determined that the grouping assignment field is a grouped field, the value of the entity field on which the grouped field depends is obtained, that is, Figure 3 The value of the entity field that the "Technical Class" depends on is "Operator, Technician or Engineer".
[0118] 502. Convert the first filtering condition into the second filtering condition according to the grouped fields, the entity fields on which the grouping valued fields depend, and the values of the entity fields on which the values of the grouping valued fields depend.
[0119] After obtaining the grouped field "Technical Category", according to the entity field "Position Level Name" on which the grouping assignment field "Position Type" depends and the value of the entity field "Operator, Technician or Engineer" on which the value of the grouping assignment field "Technical Category" depends, "Position Type = Technical Category" is converted to "Position Level Name = Operator or Technician or Engineer", thereby completing the conversion from the first filtering condition to the second filtering condition.
[0120] Specifically, according to Figure 3 The converted formula is: if([Position Name]="Technician"or[Position Name]="Engineer"or[Position Name]="Operator","Technical Category",if([Position Name]="Supervisor"or[Position Name]="Manager","Human Resources Category")).
[0121] The embodiment of the present application provides a detailed description of the process of converting a first filtering condition into a second filtering condition when the value of the grouping assignment field includes a grouped field, thereby improving the convenience of the conversion process when the grouping assignment field includes a grouped field.
[0122] 2. The value of the grouped assignment field includes the ungrouped field
[0123] See also Figure 6 , Figure 6 Another refinement of step 502:
[0124] 601. If it is determined according to the grouping rule that the value of the grouped valued field includes an ungrouped field, then the value of the entity field on which the ungrouped field depends is obtained;
[0125] Specifically, as described in step 501, if a specific field cannot be read from the grouping setting, it indicates that the grouping field is an ungrouped field, then the value of the entity field on which the ungrouped field depends is obtained, such as in Figure 3 In the example, if "other classes" are determined to be ungrouped fields, the values of the entity fields on which "other classes" depend can be further obtained.
[0126] Furthermore, when obtaining the value of the entity field on which the "other classes" depend, you can first obtain the grouped field in the value of the grouped assignment field, then obtain the value of the entity on which the grouped field depends, and invert the value of the entity field on which the grouped field depends to obtain the value of the entity field on which the ungrouped field depends.
[0127] For easier understanding, the following example is given:
[0128] As in Figure 3 In the example, first get the values of the grouped fields "Technical Category" and "Human Resources Category" and the entity fields on which the grouped fields depend. For example, if the value of the entity field on which the "Technical Category" depends is "Operator or Technician or Engineer", and the value of the entity field on which the "Human Resources Category" depends is "Supervisor, Manager", then negate the values of the entity fields on which the grouped fields depend, and obtain the negated values of "Non-Operator, Non-Technician, Non-Engineer, Non-Supervisor, and Non-Manager".
[0129] 602. Convert the first filtering condition into the second filtering condition according to the values of the ungrouped field, the entity field on which the grouped valued field depends, and the entity field on which the ungrouped field depends.
[0130] After obtaining the values of the ungrouped fields, the entity fields on which the grouped valued fields depend, and the entity fields on which the ungrouped fields depend, the first filtering condition is converted into the second filtering condition according to the values of the ungrouped fields, the entity fields on which the grouped valued fields depend, and the entity fields on which the ungrouped fields depend.
[0131] Here are some examples:
[0132] As in Figure 3 In the example, the ungrouped field is "Other Classes", and the first filter condition is converted to the second filter condition based on the entity field on which the grouped value field depends, that is, the "Other Classes" on which the "Position Type" depends, and the value of the entity field on which the ungrouped value field depends, "Non-Operator, Non-Technician, Non-Engineer, Non-Supervisor, and Non-Manager".
[0133] That is, the first filter condition "Position type = other categories" is converted into the second filter condition "Position level name = non-operator, non-technician, non-engineer, non-supervisor and non-manager".
[0134] correspond Figure 3 , the calculation field formula after conversion is: if([Position Name] = "Technician" or [Position Name] = "Engineer" or [Position Name] = "Operator", "Technical Category", if([Position Name] = "Supervisor" or [Position Name] = "Manager", "Human Resources Category", "Other Category")).
[0135] The embodiment of the present application provides a detailed description of the process of converting a first filtering condition into a second filtering condition when the value of the grouped assignment field includes an ungrouped field, thereby improving the convenience of the conversion process when the grouped assignment field includes an ungrouped field.
[0136] It is easy to understand that before receiving the input filtering conditions, the type of the calculated field needs to be configured in advance. The following is a detailed description of the configuration process:
[0137] Specifically, before receiving the filtering conditions, the embodiment of the present application needs to receive a first configuration operation, wherein the first configuration operation is used to configure the type of the calculation field as a group assignment field, and then receive a second configuration operation, wherein the second configuration operation is used to configure the group assignment field, the value of the group assignment field, the entity field in the target table on which the group assignment field depends, and the value of the entity field on which the value of the group assignment field depends, and finally receive a third configuration operation, wherein the third configuration operation is used to configure the calculation field formula.
[0138] For ease of understanding, the following example illustrates: Assuming that the filtering condition is "Position Type = Technical Category", in this embodiment of the application, before receiving the filtering condition containing the calculation field formula, it is necessary to first configure "Position Type" as a "Grouping Value Field", and then Figure 3In the interface, configure the group assignment field as "Position Type", the value of the group assignment field as "Technical Category", and the entity field "Position Level Name" in the target table on which the group assignment field "Position Type" depends, and the value of the entity field in the target table on which the value of the group assignment field "Technical Category" depends as "Operator, Technician or Engineer". Finally, according to Figure 3 The logical relationship of the grouping in the interface configures the grouping assignment field as a calculation field formula: if ([Position Name] = "Technician" or [Position Name] = "Engineer" or [Position Name] = "Operator", "Technical Category") .
[0139] based on Figure 2 In the above embodiment, before the first filtering condition including the calculated field formula is detected, the following steps may be performed, see Figure 7 , Figure 7 Another embodiment of the data query method in the embodiment of the present application:
[0140] 701. Receive a first configuration operation, where the first configuration operation is used to configure the type of the calculation field to the group assignment field;
[0141] 702. Receive a second configuration operation, where the second configuration operation is used to configure the group assignment field, the value of the group assignment field, the entity field in the target table on which the group assignment field depends, and the value of the entity field on which the value of the group assignment field depends;
[0142] 703. Receive a third configuration operation, where the third configuration operation is used to configure the calculation field formula;
[0143] It should be noted that the description of steps 701 to 703 is the same as the configuration process described in the above embodiment and will not be repeated here.
[0144] 704. Receive input filtering conditions;
[0145] When receiving the input filtering condition, the filtering condition may be received through a filter, and further determining whether the filtering condition includes a grouping value assignment field.
[0146] Specifically, the filter here can be a text input control or a dialog box, etc., and there is no specific limitation on the expression form of the filter here.
[0147] 705. If it is detected that the filtering condition is the first filtering condition including a calculation field formula, obtaining a grouping value assignment field corresponding to the calculation field formula;
[0148] 706. According to the calculation field formula and the grouping rule of the grouping assignment field, convert the first filtering condition including the calculation field formula into a second filtering condition including an entity field and a value of the entity field, wherein the grouping assignment field depends on an entity field in a target table, the value of the grouping assignment field depends on a value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field;
[0149] 707. Filter and query the data in the target table according to the second filtering condition.
[0150] Among them, steps 704 to 707 are similar to the description of 201 and 204, and are not repeated here.
[0151] In an embodiment of the present application, a detailed description is given of the process of configuring the type of calculation field formula, the group assignment field, the value of the group assignment field, the entity field on which the group assignment field depends, and the value of the entity field on which the value of the group assignment field depends before receiving the filtering condition, thereby improving the convenience of the configuration process. In addition, an embodiment of the present application utilizes the similarity between the classification logic of the calculation field and the group assignment field logic to convert a first filtering condition containing a calculation field formula into a second filtering condition containing an entity field, thereby utilizing the second filtering condition to filter and query the data in the target table, thereby avoiding the maintenance overhead caused by placing the results of the calculation field into the physical table, while improving the real-time performance of the data query process.
[0152] It is understandable that, in various embodiments of the present invention, the sequence numbers of the above steps do not mean the order of execution. The order of execution of the steps should be determined by their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0153] The data query method in the embodiment of the present application is described in detail above. The data query device in the embodiment of the present application is described below. Figure 8 , an embodiment of the data query device in the embodiment of the present application includes:
[0154] The receiving unit 801 is further used to receive input filtering conditions;
[0155] The acquiring unit 802 is configured to acquire the grouping value assignment field corresponding to the calculation field formula if it is detected that the filtering condition is the first filtering condition including the calculation field formula;
[0156] A conversion unit 803, configured to convert a first filtering condition including the calculation field formula into a second filtering condition including an entity field and a value of the entity field according to the calculation field formula and the grouping rule of the grouping assignment field, wherein the grouping assignment field depends on an entity field in a target table, the value of the grouping assignment field depends on a value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field;
[0157] The filtering and querying unit 804 is configured to filter and query the data in the target table according to the second filtering condition.
[0158] As an optional embodiment, the conversion unit 803 is specifically configured to:
[0159] Acquire the first filtering condition, where the first filtering condition includes a calculated field and a value of the calculated field;
[0160] According to the value of the calculated field, reversely parse the first filtering condition to determine the grouping assignment field corresponding to the calculated field;
[0161] According to the grouping value assignment field, obtaining the entity field on which the grouping value assignment field depends;
[0162] According to the value of the grouping assignment field, obtaining the value of the entity field on which the value of the grouping assignment field depends;
[0163] The first filtering condition is converted into the second filtering condition according to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule.
[0164] As an optional embodiment, the conversion unit 803 is specifically configured to:
[0165] If it is determined according to the grouping rule that the value of the grouping assignment field includes a grouped field, then obtaining the value of the entity field on which the grouped field depends;
[0166] The first filtering condition is converted into the second filtering condition according to the grouped fields, the entity fields on which the grouping valued fields depend, and the values of the entity fields on which the values of the grouping valued fields depend.
[0167] As an optional embodiment, the conversion unit 803 is specifically configured to:
[0168] If it is determined according to the grouping rule that the value of the grouped valued field includes an ungrouped field, then obtaining the value of the entity field on which the ungrouped field depends;
[0169] The first filtering condition is converted into the second filtering condition according to the values of the ungrouped field, the entity field on which the grouped valued field depends, and the entity field on which the ungrouped field depends.
[0170] As an optional embodiment, the conversion unit 803 is specifically configured to:
[0171] Obtaining the grouped fields in the value of the grouped valued fields;
[0172] Get the value of the entity field on which the grouped field depends;
[0173] The value of the entity field on which the grouped field depends is inverted to obtain the value of the entity field on which the ungrouped field depends.
[0174] As an optional embodiment, the receiving unit 801 is further configured to:
[0175] receiving a first configuration operation, wherein the first configuration operation is used to configure the type of the calculation field to be the group assignment field;
[0176] receiving a second configuration operation, the second configuration operation being used to configure the group-assignment field, the value of the group-assignment field, the entity field in the target table on which the group-assignment field depends, and the value of the entity field on which the value of the group-assignment field depends;
[0177] A third configuration operation is received, where the third configuration operation is used to configure the calculation field formula.
[0178] For the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0179] Because the embodiment of the present application converts the filtering condition containing the calculation field formula into a second filtering condition containing the entity field and the value of the entity field in the data classification scenario, it is possible to filter and query the data in the target table directly according to the second filtering condition, thereby avoiding the problem of later maintenance of the physical table caused by the need to store the result of the calculation field in the physical table in the memory when calling the calculation field, and at the same time improving the real-time performance of data query.
[0180] The embodiment of the present application further provides a computer program product, on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the steps in the above method embodiment.
[0181] The data query device in the embodiment of the present invention is described above from the perspective of modular functional entities. The computer device in the embodiment of the present invention is described below from the perspective of hardware processing:
[0182] The computer device is used to implement the function of the data query device. In an embodiment of the present invention, an embodiment of the computer device includes:
[0183] Processor and memory;
[0184] When the memory is used to store a computer program and the processor is used to execute the computer program stored in the memory, the steps in the above method embodiment can be implemented.
[0185] It is understandable that when the processor in the computer device described above executes the computer program, it can also implement the functions of the various units in the corresponding device embodiments described above, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program in the data query device. For example, the computer program can be divided into the various units in the above-mentioned data query device, and each unit can implement the specific functions described in the above-mentioned corresponding data query device.
[0186] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that a processor and a memory are merely examples of computer devices and do not constitute a limitation of the computer device. The computer device may include more or fewer components, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, and the like.
[0187] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0188] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0189] The present invention also provides a computer-readable storage medium, which is used to implement the functions of the data query device, and stores a computer program. When the computer program is executed by a processor, the processor can be used to execute the steps in the above method embodiment.
[0190] It is understandable that if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a corresponding computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned corresponding embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0191] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0194] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data query method, characterized in that: include: Receive input filter conditions; If it is detected that the filtering condition is the first filtering condition including a calculation field formula, obtaining the grouping value assignment field corresponding to the calculation field formula; According to the calculation field formula and the grouping rule of the grouping assignment field, converting the first filtering condition including the calculation field formula into a second filtering condition including the entity field and the value of the entity field, wherein the grouping assignment field depends on the entity field in the target table, the value of the grouping assignment field depends on the value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field; According to the second filtering condition, the data in the target table is filtered and queried.
2. The method according to claim 1, characterized in that The step of converting the first filter condition including the calculation field formula into the second filter condition including the entity field and the value of the entity field according to the calculation field formula and the grouping rule of the grouping assignment field includes: Acquire the first filtering condition, where the first filtering condition includes a calculated field and a value of the calculated field; According to the value of the calculated field, reversely parse the first filtering condition to determine the grouping assignment field corresponding to the calculated field; According to the grouping value assignment field, obtaining the entity field on which the grouping value assignment field depends; According to the value of the grouping assignment field, obtaining the value of the entity field on which the value of the grouping assignment field depends; The first filtering condition is converted into the second filtering condition according to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule.
3. The method according to claim 2, characterized in that According to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule, converting the first filtering condition into the second filtering condition comprises: If it is determined according to the grouping rule that the value of the grouping assignment field includes a grouped field, then obtaining the value of the entity field on which the grouped field depends; The first filtering condition is converted into the second filtering condition according to the grouped fields, the entity fields on which the grouping valued fields depend, and the values of the entity fields on which the values of the grouping valued fields depend.
4. The method according to claim 2, characterized in that: According to the entity field on which the grouping value field depends, the value of the entity field on which the value of the grouping value field depends, and the grouping rule, converting the first filtering condition into the second filtering condition comprises: If it is determined according to the grouping rule that the value of the grouped valued field includes an ungrouped field, then obtaining the value of the entity field on which the ungrouped field depends; The first filtering condition is converted into the second filtering condition according to the ungrouped field, the entity field on which the grouped valued field depends, and the value of the entity field on which the ungrouped field depends.
5. The method according to claim 4, characterized in that The obtaining the value of the entity field on which the ungrouped field depends includes: Obtaining the grouped fields in the value of the grouped valued fields; Get the value of the entity field on which the grouped field depends; The value of the entity field on which the grouped field depends is inverted to obtain the value of the entity field on which the ungrouped field depends.
6. The method according to claim 1, characterized in that Before receiving the input filtering condition, the method further includes: receiving a first configuration operation, wherein the first configuration operation is used to configure the type of the calculation field to be the group assignment field; receiving a second configuration operation, the second configuration operation being used to configure the group-assignment field, the value of the group-assignment field, the entity field in the target table on which the group-assignment field depends, and the value of the entity field on which the value of the group-assignment field depends; A third configuration operation is received, where the third configuration operation is used to configure the calculation field formula.
7. A data query device, characterized in that: include: A receiving unit, used for receiving input filtering conditions; an acquiring unit, configured to acquire a grouping value assignment field corresponding to the calculation field formula if it is detected that the filtering condition is a first filtering condition including a calculation field formula; a conversion unit, configured to convert a first filtering condition including the calculation field formula into a second filtering condition including an entity field and a value of the entity field according to a grouping rule of the calculation field formula and the grouping assignment field, wherein the grouping assignment field depends on an entity field in a target table, the value of the grouping assignment field depends on a value of the entity field, and the calculation field formula is used to classify the value of the entity field according to the entity field and the value of the entity field; A filtering and querying unit is used to filter and query the data in the target table according to the second filtering condition.
8. A computer device comprising a processor, characterized in that: When executing the computer program stored in the memory, the processor is used to implement the data query method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the data query method according to any one of claims 1 to 6.
10. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the data query method according to any one of claims 1 to 6.