Data query method, device, apparatus, and storage medium
By setting filtering input rules and mapping parameter tables in the column-based database management system, the target distributed large table can be quickly located and a query template that does not require association is formed. This solves the problems of high computing resource usage and low query efficiency when distributing large tables, and achieves efficient query.
Patent Information
- Application Number
- CN202311000718.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-08-09
AI Technical Summary
When large distributed tables are linked, computing resource usage is high and query efficiency is low. Existing technologies cannot effectively utilize the performance advantages of column-based database management systems.
By setting filtering input rules and using the mapping parameter table to quickly locate the target distributed large table, combined with the filtering condition logic parsing rules and statement generation rules, a query template that does not require association is formed, avoiding data transmission and saving computing resources.
It improves query efficiency, reduces computing resource usage, and optimizes resource utilization of column-based database management systems.
Smart Images

Figure CN117076501B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of database technology, and in particular to a data query method, apparatus, device, and storage medium. Background Art
[0002] The distributed large tables in a column-based database management system have the same association key, and the association key is one of the filter results. At the same time, the granularity of other filter results remains consistent with the association key. Users want to filter results by fields belonging to different tables.
[0003] Currently, it is necessary to link large distributed tables and then filter them according to conditions. Due to the characteristics of components, linking large distributed tables will consume a lot of data transmission, occupy a high computing resource rate, and have low query efficiency. Summary of the Invention
[0004] The present disclosure provides a data query method, apparatus, device, and storage medium to at least solve the problems of high computing resource occupancy and low query efficiency in existing systems.
[0005] The technical solutions disclosed in this disclosure are as follows:
[0006] The present disclosure provides a data query method, including:
[0007] Obtaining a target screening condition, wherein the target screening condition satisfies a screening input rule;
[0008] According to the target screening condition, query the mapping parameter table between the screening condition and the distributed large table to obtain the target distributed large table associated with the screening condition;
[0009] Determine the query relationship between the target distributed large table and the target screening condition according to the screening condition logic parsing rule;
[0010] Generate a query statement according to the statement generation rule and the query relationship;
[0011] Performing data query according to the query statement;
[0012] The statement generation rules include:
[0013] The number of fields to be filtered is determined based on the relationship between the fields of the target distributed large table and the target filtering conditions after analysis. The same field distributed in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group that appears multiple times is calculated once.
[0014] Each query logic corresponds to a distributed large table. The filter field satisfies the filter condition logic parsing rule. The query field includes the target field and all tag identification fields. When the target query field satisfies the target filter condition, the tag identification of the target query field is assigned a first value. When the target query field does not satisfy the target filter condition, the tag identification of the target query field is assigned a second value. The target query field is any field of the query field.
[0015] Merge multiple query logics to obtain merged query logic;
[0016] The merged query logic is grouped according to the query target field and the tag identifiers are summarized;
[0017] The target screening conditions are equivalently transformed.
[0018] Optionally, the screening input rule includes: logical relationships between screening conditions including AND relationships and OR relationships;
[0019] The filter condition group consists of filter conditions;
[0020] The filtering logic relationship in the same filtering condition group remains consistent;
[0021] The logical relationships between the filter condition groups include AND and OR relationships;
[0022] Filter condition groups are separated by brackets.
[0023] Optionally, the mapping parameter table includes: field number, field name, table where the field is located and field English name.
[0024] Optionally, the screening condition logic parsing rules include:
[0025] In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query;
[0026] In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to;
[0027] Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
[0028] Optionally, performing equivalent conversion on the target screening conditions includes:
[0029] When a target screening field in the same screening group satisfies multiple target screening conditions, the label identifier corresponding to the target screening field is set to be greater than or equal to a set value;
[0030] In the case that the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
[0031] The present disclosure also provides a data query device, including:
[0032] An acquisition module, configured to acquire a target screening condition, wherein the target screening condition satisfies a screening input rule;
[0033] A first query module is configured to query a mapping parameter table between the screening conditions and the distributed large table according to the target screening conditions, and obtain a target distributed large table associated with the screening conditions;
[0034] A determination module, configured to determine a query relationship between the target distributed large table and the target screening condition according to a screening condition logic analysis rule;
[0035] A generation module is used to generate a query statement according to a statement generation rule and the query relationship; the statement generation rule includes: determining the number of fields to be filtered according to the relationship between the fields and the target filtering conditions of the target distributed large table after analysis; wherein, the same field distributed in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group appears multiple times and is calculated once; each query logic corresponds to a distributed large table, the filtering field meets the filtering condition logic parsing rule, and the query field includes the target field and all label identification fields, wherein, when the target query field meets the target filtering condition, the label identification of the target query field is assigned to a first value, and when the target query field does not meet the target filtering condition, the label identification of the target query field is assigned to a second value, and the target query field is any field of the query field; multiple query logics are merged to obtain a merged query logic; the merged query logic is grouped according to the query target field and the label identification is summarized; the target filtering condition is equivalently converted;
[0036] The second query module is used to perform data query according to the query statement.
[0037] Optionally, the screening input rule includes: logical relationships between screening conditions including AND relationships and OR relationships;
[0038] The filter condition group consists of filter conditions;
[0039] The filtering logic relationship in the same filtering condition group remains consistent;
[0040] The logical relationships between the filter condition groups include AND and OR relationships;
[0041] Filter condition groups are separated by brackets.
[0042] Optionally, the mapping parameter table includes: field number, field name, table where the field is located and field English name.
[0043] Optionally, the screening condition logic parsing rules include:
[0044] In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query;
[0045] In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to;
[0046] Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
[0047] Optionally, performing equivalent conversion on the target screening conditions includes:
[0048] When a target screening field in the same screening group satisfies multiple target screening conditions, the label identifier corresponding to the target screening field is set to be greater than or equal to a set value;
[0049] In the case that the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
[0050] The present disclosure also provides an electronic device, including:
[0051] processor;
[0052] a memory for storing instructions executable by the processor;
[0053] The processor is configured to execute the instructions to implement the steps in the above method.
[0054] The embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the above method is implemented.
[0055] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which implements the steps in the above method when executed by a processor.
[0056] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0057] In some embodiments of the present disclosure, by setting filtering input rules, ambiguity in filtering logic condition parsing can be avoided as much as possible while ensuring that the filtering logic has sufficient freedom; by setting a mapping parameter table, the target distributed large table can be quickly located according to the field, avoiding scanning all large tables; the query relationship between the table and the filtering condition is determined by the filtering condition logic parsing rules, and combined with the statement generation rules, a query template that does not require association is finally formed. Assuming that the distribution field of all distributed large tables is one of the query target fields, or one of the fields is the primary key, the query template does not require data transmission before data query, saving computing resources and improving query efficiency.
[0058] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0060] Figure 1 A flowchart of a data query method provided by an exemplary embodiment of the present disclosure;
[0061] Figure 2 A flowchart of a data query method provided by an embodiment of the present disclosure;
[0062] Figure 3 A schematic structural diagram of a data query device provided by an exemplary embodiment of the present disclosure;
[0063] Figure 4 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0064] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0065] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0066] It should be noted that the user information involved in this disclosure includes but is not limited to: user device information and user personal information; the collection, storage, use, processing, transmission, provision and disclosure of user information in this disclosure comply with the relevant laws and regulations and do not violate public order and good morals.
[0067] Column-based database management systems have become a mainstream online analytical processing tool in recent years. They focus on data throughput, offering advantages over traditional relational databases, such as the ability to handle extremely large amounts of data and high query efficiency. Furthermore, compared to the vast ecosystem of traditional big data technologies, column-based database management systems integrate storage and query functions, making them more independent. However, column-based database management systems consume a lot of computer resources and are not well-suited for high-concurrency queries. Joining large distributed tables involves a large amount of data transfer, which is a significant challenge for server resources and can easily lead to memory overflows. In scenarios where querying multiple distributed large tables is unavoidable, how to leverage the performance advantages of column-based database management systems while avoiding the resource drain associated with large table joins has become a pressing issue.
[0068] Large distributed tables in a column-based database management system share the same association key, which is part of the filter results. The granularity of other filter results remains consistent with the association key. Users want to filter results by fields belonging to different tables. Currently, this requires linking large distributed tables before filtering based on conditions. Due to component characteristics, linking large distributed tables consumes a large amount of data transmission, occupies a high computing resource usage, and reduces query efficiency.
[0069] In response to the above technical problems, in some embodiments of the present disclosure, by setting filtering input rules, ambiguity in the filtering logic condition parsing can be avoided as much as possible while ensuring that the filtering logic has sufficient freedom; by setting a mapping parameter table, the target distributed large table can be quickly located according to the field, avoiding scanning all large tables; the query relationship between the table and the filtering condition is determined by the filtering condition logic parsing rules, and combined with the statement generation rules, a query template that does not require association is finally formed. Assuming that the distribution field of all distributed large tables is one of the query target fields, or one of the fields is the primary key, the query template does not require data transmission before data query, saving computing resources and improving query efficiency.
[0070] The technical solutions provided by various embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0071] Figure 1 A flow chart of a data query method provided by an exemplary embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0072] S101: Obtain target screening conditions, wherein the target screening conditions meet the screening input rules;
[0073] S102: According to the target screening condition, query the mapping parameter table between the screening condition and the distributed large table to obtain the target distributed large table associated with the screening condition;
[0074] S103: Determine the query relationship between the target distributed large table and the target screening condition according to the screening condition logic parsing rule;
[0075] S104: Generate a query statement according to the statement generation rules and the query relationship;
[0076] S105: Perform data query according to the query statement.
[0077] In this embodiment, the execution subject of the above method may be a server or a terminal device.
[0078] When the execution subject of the above method is a terminal device, the terminal device includes but is not limited to any one of the following: a mobile phone, a personal desktop computer, a laptop computer, a tablet computer, a smart TV and a smart speaker.
[0079] When the execution subject of the above method is a server, the implementation form of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, or other server devices. The server is mainly composed of a processor, a hard disk, memory, a system bus, etc., and a common computer architecture type.
[0080] Figure 2This is a flow chart of a data query method provided by an embodiment of the present disclosure. Figure 2 As shown, when the user inputs the filtering conditions, they must comply with the filtering input rules set by the present invention; read the mapping parameter table to obtain the filtering fields and corresponding table information; analyze the logical relationship of the filtering conditions to meet the analysis rules; and finally generate a query statement. By setting the filtering input rules, while ensuring that the filtering logic has sufficient freedom, ambiguity in the analysis of the filtering logic conditions can be avoided as much as possible; by setting the mapping parameter table, the target distributed large table can be quickly located according to the field, avoiding scanning all large tables; the query relationship between the table and the filtering conditions is determined by the filtering condition logic analysis rules, and combined with the statement generation rules, a query template that does not require association is finally formed. Assuming that the distribution fields of all distributed large tables are one of the query target fields, or one of the fields is the primary key, the query template does not need to transmit data before data query, saving computing resources and improving query efficiency.
[0081] In some embodiments of the present disclosure, screening input rules include:
[0082] The logical relationships between the filter conditions include AND and OR relationships;
[0083] The filter condition group consists of filter conditions;
[0084] The filtering logic relationship in the same filtering condition group remains consistent;
[0085] The logical relationships between the filter condition groups include AND and OR relationships;
[0086] Filter condition groups are separated by brackets.
[0087] In some embodiments of the present disclosure, the mapping parameter table includes: field number, field name, table where the field is located, and field English name. According to the filter condition field input by the user, the corresponding table and field English name are obtained and returned.
[0088] In some embodiments of the present disclosure, the screening condition logic parsing rules include:
[0089] In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query;
[0090] In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to;
[0091] Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
[0092] In some embodiments of the present disclosure, the statement generation rules include:
[0093] Determine the number of fields to be filtered based on the relationship between the fields and the target filtering conditions in the parsed target distributed large table. The same field in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group that appears multiple times is calculated only once.
[0094] Each query logic corresponds to a distributed large table. The filter field meets the filter condition logic parsing rules. The query field includes the target field and all tag identification fields. When the target query field meets the target filter condition, the tag identification of the target query field is assigned a first value. When the target query field does not meet the target filter condition, the tag identification of the target query field is assigned a second value. The target query field is any field in the query field. It should be noted that the first value can be 1 and the second value can be 0.
[0095] Merge multiple query logics to obtain merged query logic;
[0096] The merged query logic is grouped according to the query target field and summarized with label identifiers;
[0097] Perform equivalent conversion on the target filter conditions. The field filter conditions are converted to aggregated label flags greater than or equal to 1, indicating that the filter conditions are met.
[0098] In the above embodiment, the target screening conditions are equivalently transformed. One possible implementation is that, when a target screening field in the same screening group meets multiple target screening conditions, the label identifier corresponding to the target screening field is set to be greater than or equal to a set value; when the target screening field belongs to different screening condition groups, the label identifier corresponding to each target screening field is set to be greater than or equal to a set value. The set value can be 1.
[0099] In the above method embodiment of the present disclosure, by setting the screening input rules, ambiguity in the screening logic condition parsing is avoided as much as possible under the premise of ensuring that the screening logic has sufficient freedom; by setting the mapping parameter table, the target distributed large table can be quickly located according to the field, avoiding scanning all the large tables; the query relationship between the table and the screening condition is determined by the screening condition logic parsing rules, and combined with the statement generation rules, a query template that does not require association is finally formed. Assuming that the distribution field of all distributed large tables is one of the query target fields, or one of the fields is the primary key, the query template does not require data transmission before data query, saving computing resources and improving query efficiency.
[0100] Figure 3FIG. 3 is a structural diagram of a data query device 30 provided by an exemplary embodiment of the present disclosure. Figure 3 As shown, the data query device 30 includes: an acquisition module 31 , a first query module 32 , a determination module 33 , a generation module 34 and a second query module 35 .
[0101] The acquisition module 31 is used to acquire target screening conditions, wherein the target screening conditions meet the screening input rules;
[0102] The first query module 32 is used to query the mapping parameter table between the screening conditions and the distributed large table according to the target screening conditions, and obtain the target distributed large table associated with the screening conditions;
[0103] Determination module 33, used to determine the query relationship between the target distributed large table and the target screening condition according to the screening condition logic analysis rule;
[0104] A generation module 34 is used to generate a query statement based on the statement generation rules and the query relationship;
[0105] The second query module 35 is used to perform data query according to the query statement.
[0106] Optionally, the screening input rule includes: the logical relationship between the screening conditions includes an AND relationship and an OR relationship;
[0107] The filter condition group consists of filter conditions;
[0108] The filtering logic relationship in the same filtering condition group remains consistent;
[0109] The logical relationships between the filter condition groups include AND and OR relationships;
[0110] Filter condition groups are separated by brackets.
[0111] Optionally, a mapping parameter table includes: field number, field name, table where the field is located, and field English name.
[0112] Optionally, filter condition logic parsing rules include:
[0113] In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query;
[0114] In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to;
[0115] Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
[0116] Optionally, statement generation rules include:
[0117] Determine the number of fields to be filtered based on the relationship between the fields and the target filtering conditions in the parsed target distributed large table. The same field in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group that appears multiple times is calculated only once.
[0118] Each query logic corresponds to a distributed large table. The filter field meets the filter condition logic parsing rules. The query field includes the target field and all tag identification fields. When the target query field meets the target filter condition, the tag identification of the target query field is assigned a first value. When the target query field does not meet the target filter condition, the tag identification of the target query field is assigned a second value. The target query field is any field in the query field.
[0119] Merge multiple query logics to obtain merged query logic;
[0120] The merged query logic is grouped according to the query target field and summarized with label identifiers;
[0121] Perform equivalent transformation on the target screening conditions.
[0122] Optionally, the target screening conditions are converted to equivalent conditions, including:
[0123] If the target filter field in the same filter group meets multiple target filter conditions, the label identifier corresponding to the target filter field is set to be greater than or equal to the set value;
[0124] In the case where the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
[0125] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0126] Figure 4 FIG. 1 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. Figure 4 As shown, the electronic device includes: a memory 41 and a processor 42. In addition, the electronic device also includes a power supply component 43 and a communication component 44.
[0127] The memory 41 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device.
[0128] The memory 41 can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0129] The communication component 44 is used for data transmission with other devices.
[0130] The processor 42 can execute computer instructions stored in the memory 41 to: obtain a target screening condition, wherein the target screening condition satisfies a screening input rule;
[0131] Based on the target filtering conditions, query the mapping parameter table between the filtering conditions and the distributed large table to obtain the target distributed large table associated with the filtering conditions;
[0132] Determine the query relationship between the target distributed large table and the target filtering conditions based on the filtering condition logic parsing rules;
[0133] Generate query statements based on statement generation rules and query relationships;
[0134] Query data based on query statements.
[0135] Optionally, the screening input rule includes: the logical relationship between the screening conditions includes an AND relationship and an OR relationship;
[0136] The filter condition group consists of filter conditions;
[0137] The filtering logic relationship in the same filtering condition group remains consistent;
[0138] The logical relationships between the filter condition groups include AND and OR relationships;
[0139] Filter condition groups are separated by brackets.
[0140] Optionally, a mapping parameter table includes: field number, field name, table where the field is located, and field English name.
[0141] Optionally, filter condition logic parsing rules include:
[0142] In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query;
[0143] In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to;
[0144] Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
[0145] Optionally, statement generation rules include:
[0146] Determine the number of fields to be filtered based on the relationship between the fields and the target filtering conditions in the parsed target distributed large table. The same field in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group that appears multiple times is calculated only once.
[0147] Each query logic corresponds to a distributed large table. The filter field meets the filter condition logic parsing rules. The query field includes the target field and all tag identification fields. When the target query field meets the target filter condition, the tag identification of the target query field is assigned a first value. When the target query field does not meet the target filter condition, the tag identification of the target query field is assigned a second value. The target query field is any field in the query field.
[0148] Merge multiple query logics to obtain merged query logic;
[0149] The merged query logic is grouped according to the query target field and summarized with label identifiers;
[0150] Perform equivalent transformation on the target screening conditions.
[0151] Optionally, the target screening conditions are converted to equivalent conditions, including:
[0152] If the target filter field in the same filter group meets multiple target filter conditions, the label identifier corresponding to the target filter field is set to be greater than or equal to the set value;
[0153] In the case where the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
[0154] Accordingly, the present disclosure also provides a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores the computer program and the computer program is executed by one or more processors, the one or more processors execute Figure 1 Each step in the method embodiment.
[0155] Accordingly, the present disclosure also provides a computer program product, which includes a computer program / instruction, and the computer program / instruction is executed by a processor. Figure 1 Each step in the method embodiment.
[0156] above Figure 4The communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0157] above Figure 4 The power supply component in a device provides power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.
[0158] The electronic device also includes a display screen and an audio component.
[0159] The display screen includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can detect not only the boundaries of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.
[0160] The audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signal can be further stored in a memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0161] In the embodiments of the above-mentioned devices, equipment, storage media and computer program products disclosed in the present invention, by setting filtering input rules, ambiguity in the filtering logic condition parsing is avoided as much as possible while ensuring that the filtering logic has sufficient freedom; by setting a mapping parameter table, the target distributed large table can be quickly located according to the field, avoiding scanning all large tables; the query relationship between the table and the filtering condition is determined by the filtering condition logic parsing rules, and combined with the statement generation rules, a query template that does not require association is finally formed. Assuming that the distribution field of all distributed large tables is one of the query target fields, or one of the fields is the primary key, the query template does not require data transmission before data query, saving computing resources and improving query efficiency.
[0162] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0163] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0164] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0166] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0167] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0168] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0169] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0170] The above are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to these embodiments, but is to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A data query method, characterized in that: include: Obtaining a target screening condition, wherein the target screening condition satisfies a screening input rule; According to the target screening condition, query the mapping parameter table between the screening condition and the distributed large table to obtain the target distributed large table associated with the screening condition; Determine the query relationship between the target distributed large table and the target screening condition according to the screening condition logic parsing rule; Generate a query statement according to the statement generation rule and the query relationship; Performing data query according to the query statement; The statement generation rules include: The number of fields to be filtered is determined based on the relationship between the fields of the target distributed large table and the target filtering conditions after analysis. The same field distributed in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group that appears multiple times is calculated once. Each query logic corresponds to a distributed large table. The filter field satisfies the filter condition logic parsing rule. The query field includes the target field and all tag identification fields. When the target query field satisfies the target filter condition, the tag identification of the target query field is assigned a first value. When the target query field does not satisfy the target filter condition, the tag identification of the target query field is assigned a second value. The target query field is any field of the query field. Merge multiple query logics to obtain merged query logic; The merged query logic is grouped according to the query target field and the tag identifiers are summarized; The target screening conditions are equivalently transformed.
2. The method according to claim 1, characterized in that The screening input rules include: logical relationships between screening conditions including AND relationships and OR relationships; The filter condition group consists of filter conditions; The filtering logic relationship in the same filtering condition group remains consistent; The logical relationships between the filter condition groups include AND and OR relationships; Filter condition groups are separated by brackets.
3. The method according to claim 1, characterized in that The mapping parameter table includes: field number, field name, table where the field is located and field English name.
4. The method according to claim 1, wherein The screening condition logic parsing rules include: In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query; In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to; Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
5. The method according to claim 1, wherein The equivalent transformation of the target screening conditions includes: When a target screening field in the same screening group satisfies multiple target screening conditions, the label identifier corresponding to the target screening field is set to be greater than or equal to a set value; In the case that the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
6. A data query device, characterized in that: include: An acquisition module, configured to acquire a target screening condition, wherein the target screening condition satisfies a screening input rule; A first query module is configured to query a mapping parameter table between the screening conditions and the distributed large table according to the target screening conditions, and obtain a target distributed large table associated with the screening conditions; A determination module, configured to determine a query relationship between the target distributed large table and the target screening condition according to a screening condition logic analysis rule; A generation module is used to generate a query statement according to a statement generation rule and the query relationship; the statement generation rule includes: determining the number of fields to be filtered according to the relationship between the fields and the target filtering conditions of the target distributed large table after analysis; wherein, the same field distributed in different filtering condition groups needs to be calculated multiple times, and the same field in the same filtering group appears multiple times and is calculated once; each query logic corresponds to a distributed large table, the filtering field meets the filtering condition logic parsing rule, and the query field includes the target field and all label identification fields, wherein, when the target query field meets the target filtering condition, the label identification of the target query field is assigned to a first value, and when the target query field does not meet the target filtering condition, the label identification of the target query field is assigned to a second value, and the target query field is any field of the query field; multiple query logics are merged to obtain a merged query logic; the merged query logic is grouped according to the query target field and the label identification is summarized; the target filtering condition is equivalently converted; The second query module is used to perform data query according to the query statement.
7. The device according to claim 6, characterized in that The screening input rules include: logical relationships between screening conditions including AND relationships and OR relationships; The filter condition group consists of filter conditions; The filtering logic relationship in the same filtering condition group remains consistent; The logical relationships between the filter condition groups include AND and OR relationships; Filter condition groups are separated by brackets.
8. The device according to claim 6, characterized in that The mapping parameter table includes: field number, field name, table where the field is located and field English name.
9. The device according to claim 6, characterized in that The screening condition logic parsing rules include: In the same filter condition group, if different fields belong to the same table, the table must meet the filter conditions of all related fields in the same filter group in one query; In different filter condition groups, regardless of whether the related fields belong to the same table, they must meet the corresponding filter conditions in multiple queries according to the number of filter groups they belong to; Regardless of whether the filter fields belonging to different tables are in the same filter condition group, they must meet the conditions in the corresponding table query.
10. The device according to claim 6, characterized in that The equivalent transformation of the target screening conditions includes: When a target screening field in the same screening group satisfies multiple target screening conditions, the label identifier corresponding to the target screening field is set to be greater than or equal to a set value; In the case that the target screening fields belong to different screening condition groups, the label identifiers corresponding to the target screening fields are set to be greater than or equal to the set value.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement each step in the method according to any one of claims 1 to 5.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data query method and device of database and electronic equipment
CN115878672A
Electronic apparatus and method for providing search result related to query sentence
US20230134852A1