Data filtering method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510471094.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2045-04-15
AI Technical Summary
[0004]有鉴于此,有必要提供一种数据过滤方法、装置、电子设备及存储介质,用以解决业务数据库的查询过滤工作难度较大、不易操作的技术问题
[0015] The beneficial effects of adopting the above implementation method are as follows: The data filtering method, device, electronic device, and storage medium provided by the present invention are directly based on the mapping relationship between and within each table in the business database. Based on this mapping relationship, the user selects the required comparison columns and corresponding comparison operators and comparison values to determine the data filtering conditions. In this way, the user can determine the data in the target table of the business database that meets the user's needs. At this time, the user does not need to consider the syntax and performance issues of the query statement of the business database, nor does the user need to consider the differences between different types of databases. The user can directly select the data. The process of selecting comparison columns, comparison operators, and comparison values does not require writing database query statements. Even for ordinary users who are not technical personnel, the operation is relatively simple, thereby solving the technical problem that the query filtering work of the business database is difficult and not easy to operate.
Smart Images

Figure CN120448380B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software information system technology, and specifically to a data filtering method, apparatus, electronic device, and storage medium. Background Technology
[0002] Most software systems rely on relational databases to maintain business data. In daily work, the need to query business data is very common, such as to compile some report data or to track and query the detailed status based on a certain business document.
[0003] Querying business data typically requires writing a professional database query statement, such as an SQL statement. However, database query statements are quite complex for ordinary system end users. Furthermore, different business databases differ, and there are syntax and performance issues, making query filtering in business databases difficult and challenging for ordinary users. Summary of the Invention
[0004] In view of this, it is necessary to provide a data filtering method, apparatus, electronic device and storage medium to solve the technical problem that the query filtering work of business database is difficult and not easy to operate.
[0005] To address the aforementioned problems, in a first aspect, the present invention provides a data filtering method, comprising: Establish mapping relationships between tables in the business database and within each table; After displaying the mapping relationship, the input comparison column, comparison operator, and comparison value are received; Based on the comparison column, the comparison operator, and the comparison value, the data filtering conditions are determined; Based on the data filtering conditions, data that meets the user's needs is determined in the target table of the business database.
[0006] In one possible implementation, determining data filtering conditions based on the comparison column, the comparison operator, and the comparison value includes: Based on the comparison columns, comparison operators, and comparison values required to construct data filtering conditions, determine at least one data filtering sub-condition; When there are at least two data filtering sub-conditions, the at least two different data filtering sub-conditions are combined according to the set combination relationship to obtain the data filtering conditions; The combination relationship includes: AND / OR.
[0007] In one possible implementation, determining the data filtering conditions based on the comparison column, the comparison operator, and the comparison value further includes: If there is only one data filter sub-condition, then the data filter sub-condition is determined as the data filter condition.
[0008] In one possible implementation, based on the data filtering conditions, determining the data in the target table of the business database that meets the user's requirements includes: Based on the data filtering conditions, a condition matcher is generated; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements.
[0009] In one possible implementation, the data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements, including: Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's needs is determined based on the comparison result.
[0010] In one possible implementation, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's requirements is determined based on the comparison result, including: When the condition matcher corresponds to at least two different data filtering sub-conditions, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to each data filtering sub-condition based on the condition matcher. Perform logical OR / logical AND operations on the comparison results corresponding to each data filtering sub-condition, and determine the data that meets the user's requirements based on the operation results.
[0011] In one possible implementation, the comparison values corresponding to the column data in the target table of the business database are either static comparison values or dynamic comparison values.
[0012] Secondly, the present invention also provides a data filtering device, comprising: The mapping relationship building module is used to build the mapping relationships between tables in the business database and within each table; The comparison data determination module is used to receive the input comparison column, comparison operator, and comparison value after displaying the mapping relationship; A condition construction module is used to determine data filtering conditions based on the comparison column, the comparison operator, and the comparison value; The data filtering module is used to determine, based on the data filtering conditions, the data in the target table of the business database that meets the user's requirements.
[0013] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the data filtering method as described in any of the preceding claims.
[0014] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the data filtering method as described in any of the preceding claims.
[0015] The beneficial effects of adopting the above implementation method are as follows: The data filtering method, device, electronic device, and storage medium provided by the present invention are directly based on the mapping relationship between and within each table in the business database. Based on this mapping relationship, the user selects the required comparison columns and corresponding comparison operators and comparison values to determine the data filtering conditions. In this way, the user can determine the data in the target table of the business database that meets the user's needs. At this time, the user does not need to consider the syntax and performance issues of the query statement of the business database, nor does the user need to consider the differences between different types of databases. The user can directly select the data. The process of selecting comparison columns, comparison operators, and comparison values does not require writing database query statements. Even for ordinary users who are not technical personnel, the operation is relatively simple, thereby solving the technical problem that the query filtering work of the business database is difficult and not easy to operate. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of an embodiment of the data filtering method provided by the present invention; Figure 2 A flowchart for generating data filtering conditions provided by the present invention; Figure 3 A schematic block diagram of an embodiment of the data filtering device provided by the present invention; Figure 4 A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0019] In the description of the embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0020] In this embodiment of the invention, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, apparatus, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product or device.
[0021] The naming or numbering of steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effect can be achieved.
[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0023] This invention provides a data filtering method, apparatus, electronic device, and storage medium, which are described below.
[0024] like Figure 1 As shown, the present invention provides a data filtering method, including: S101. Construct the mapping relationships between tables in the business database and within each table.
[0025] It is understandable that the system's business data is stored in a structured relational database. This invention maps out all the tables, columns in the tables, and the relationships between the tables (the relationship between primary keys and foreign keys, such as the relationship between the order table, the order details table, and the product table; an order has multiple order details, and each order detail contains a product) in the business database. At this time, the user does not need to care about the structure and design of the database.
[0026] S102. After displaying the mapping relationship, receive the input comparison column, comparison operator, and comparison value.
[0027] Understandably, each participating condition must include a comparison column, a comparison operator, and a comparison value. The comparison column is selected based on the mapped database columns, supporting columns from the main table and columns from the tables establishing the relationship. When constructing conditions, there is no limitation to setting only one condition for a single column; for example, the order details amount can be set as two filter conditions: "order details.amount>10000" and "order details.amount<50000".
[0028] For example, consider two business database tables. The first table contains columns for order number, order name, and order date. The second table contains columns for order number and order amount. Each table contains multiple order numbers. Based on the unique order number for each order, a mapping relationship can be constructed between the two tables, as well as within each table itself. Specifically, the order number, order name, order date, and order amount from the two tables are mapped to form a one-to-one correspondence. In other words, this mapping relationship includes the correspondence between different columns within the same business database table, and also the correspondence between columns in different business database tables.
[0029] The mapping relationship, along with the corresponding selectable comparison operators and comparison values, is displayed on the screen. Users can interact with the system through this display. The mapping relationship can list multiple selectable comparison columns. For example, if the data in the comparison column is a date, the corresponding comparison operator can be "earlier than," "later than," or "equal to." Users can select one or more comparison columns and their corresponding comparison operators, and then select or enter the corresponding comparison values. For instance, if the first comparison column selected by the user is the order date, with a corresponding comparison value of "1 month" and a comparison operator of "earlier than," and the second comparison column is the order amount, with a corresponding comparison value of 5000 and a comparison operator of ">," then the final data filtering condition will be "order details that are earlier than 1 month and have an order amount > 5000."
[0030] S103. Determine data filtering conditions based on the comparison column, the comparison operator, and the comparison value.
[0031] Understandably, the column and comparison operator for the participating conditions can be the amount in the order details, the comparison operator is ">", the comparison value is 10000, and the resulting data filtering condition is "order details.amount>10000".
[0032] S104. Based on the data filtering conditions, determine the data in the target table of the business database that meets the user's needs.
[0033] It is understandable that the data filtered out according to the data filtering conditions is the data in the target table of the business database that meets the user's needs.
[0034] The method provided by this invention can be implemented based on an application on a terminal or server. The terminal can be a mobile phone or a computer, and the server can be a cloud server or an edge server. User input of data selection instructions can be done through the terminal's interactive screen or through the server's keyboard.
[0035] This invention maps all tables, columns, and relationships between tables in the system's database (e.g., the relationship between the order table, order details table, and product table; an order may have multiple order details, and each order detail may contain a product). Using a specific business table as the core, it supports selecting columns (and also columns from tables with relationships, i.e., join queries), comparison operators, and comparison values to construct filtering conditions. In other words, it constructs a specification in the format of "column, comparison operator, comparison value," and then reads data to verify whether the data conforms to this specification. For example, "person's age > 50" is a filtering condition.
[0036] Conventional data filtering involves generating a SQL statement based on a series of complex operations and then querying the database. This approach requires consideration of database differences, syntax issues, and performance problems. The solution provided by this invention takes the opposite approach, judging whether conditions are met based on the data itself. Furthermore, the data can be sourced from various sources (database reads, interface transmission), significantly improving usability.
[0037] In some embodiments, determining data filtering conditions based on the comparison column, the comparison operator, and the comparison value includes: Based on the comparison columns, comparison operators, and comparison values required to construct data filtering conditions, determine at least one data filtering sub-condition; When there are at least two data filtering sub-conditions, the at least two different data filtering sub-conditions are combined according to the set combination relationship to obtain the data filtering conditions; The combination relationship includes: AND / OR.
[0038] It is understandable that each data filtering sub-condition can be used as a minimum unit. Multiple minimum units can be combined to form a condition group, which constitutes a data filtering condition. Multiple condition groups can also be combined to form a large group, where the combination relationship is AND and OR.
[0039] An example of a data filtering process is as follows: Figure 2As shown, for example, the two filter conditions "Order Details.Amount>10000" and "Order Details.Amount<50000" can be combined into a filter condition for amounts between 10000 and 50000. These two conditions can also be combined into a group A, and further combined with group B (Order Details.Operator=Current User). Figure 2 The selection column in the comparison column is the same as the comparison column.
[0040] In some embodiments, determining data filtering conditions based on the comparison column, the comparison operator, and the comparison value further includes: If there is only one data filter sub-condition, then the data filter sub-condition is determined as the data filter condition.
[0041] Understandably, when there is only one data filtering sub-condition, data filtering can be performed directly based on this sub-condition without further combination.
[0042] In some embodiments, based on the data filtering conditions, determining the data in the target table of the business database that meets user requirements includes: Based on the data filtering conditions, a condition matcher is generated; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements.
[0043] Understandably, after users set conditions according to the rules, this data is stored as a filtering rule in a specific format (JSON format). These stored filtering rules are then processed by the condition filtering module to generate a condition matcher. The condition matcher provides an interface to verify whether the input data meets the requirements of the matcher.
[0044] In some embodiments, the data in the target table of the business database is validated based on the condition matcher to obtain data that meets user requirements, including: Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's needs is determined based on the comparison result.
[0045] Understandably, the condition matcher internally parses all the set conditions, then reads the status of the input data column according to the comparison column of the conditions, compares the values based on the comparison operator, and finally outputs a Boolean conclusion. The comparison rule is to convert them into constant values for comparison. For example, "Order Details.Amount>10000" reads the amount data from the order details and performs a numerical comparison, and so on. Combinations will perform logical OR and logical AND calculations according to the combination logic.
[0046] In some embodiments, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's requirements is determined based on the comparison result, including: When the condition matcher corresponds to at least two different data filtering sub-conditions, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to each data filtering sub-condition based on the condition matcher. Perform logical OR / logical AND operations on the comparison results corresponding to each data filtering sub-condition, and determine the data that meets the user's requirements based on the operation results.
[0047] Understandably, when the condition matcher is generated based on at least two different data filter sub-conditions, it is necessary to compare the data corresponding to the comparison column in the target table with the comparison operator and comparison value of each data filter sub-condition.
[0048] For example, the comparison operator for the first data filter sub-condition is ">", and the comparison value is 10000. The comparison operator for the second data filter sub-condition is "<", and the comparison value is 50000. The data corresponding to the comparison column is order details and amount data. The comparison results are subjected to a logical AND operation, and the data that finally meets the user's needs is the order details and amount data between 10000 and 50000.
[0049] In some embodiments, the comparison values corresponding to the column data in the target table of the business database are either static comparison values or dynamic comparison values.
[0050] Understandably, comparison values can be static or dynamic. Static comparison values can be manually entered, such as fixed numerical values (100), dates (January 21, 2025), or characters (P0001). Dynamic comparison values record a business reference, such as today (each time the date is read at the current moment), last Friday, the next 7 days, or a certain status of the current table (planned amount or actual amount of order details).
[0051] The comparison operator and comparison value input will change dynamically according to the data type of the selected column. For example, date type can be selected as today or yesterday, and numeric type can be selected as within a set range.
[0052] In some embodiments, the method provided by the present invention comprises five steps: constructing filtering conditions and then matching data that meets the conditions. Specifically, it includes: 1. Build database mapping: The system's business data is all stored in a structured relational database. This invention maps out all the tables, columns in the tables, and the relationships between the tables (primary key and foreign key relationships, such as the relationship between the order table, order details table, and product table; an order has multiple order details, and each order detail contains a product) in the business database. At this time, the user does not need to care about the structure and design of the database.
[0053] Mapping primarily allows for the selection of more conditions based on a main business table. For example, in an order details table that links order and product information, conditions can be constructed using the order details table as the main table, selecting certain order statuses or product statuses for setting conditions. For instance, `order details.order.order number = P0001` or `order details.product.quantity > 10000`. Theoretically, this can be extended indefinitely as long as the relationship exists.
[0054] 2. Select the columns, comparison operators, and comparison values for the participating conditions (i.e., data filtering conditions): Each condition must include a comparison column, a comparison operator, and a comparison value.
[0055] The comparison column is selected based on the mapped database column, supporting columns from the main table and columns from the tables with which the relationship is established. When constructing conditions, it is not limited to setting only one condition for a certain column. For example, the amount of order details can be set as two filter conditions: "order details.amount>10000" and "order details.amount<50000".
[0056] The comparison operator varies depending on the data type of the column, as shown in Table 1 below.
[0057] Table 1: Data Types and Comparison Methods
[0058] Comparison values can be static or dynamic. Static comparison values can be manually entered, such as fixed numerical values (100), dates (January 21, 2025), characters (P0001), etc. Dynamic comparison values record a business reference, such as: today (each time the date is read at the current moment), last Friday, the next 7 days, a certain status of the current table (planned amount or actual amount of order details), or a runtime variable (currently logged-in user).
[0059] The comparison operator and comparison value input will change dynamically according to the data type of the selected column. For example, date type can be selected as today or yesterday, and numeric type can be selected as within the set range.
[0060] 3. Combining various conditions: Each condition can be a minimum unit, equivalent to a data filtering sub-condition. Multiple minimum units can be combined to form a condition group, and multiple condition groups can also be combined to form a large group, equivalent to a data filtering condition. The combination relationship is AND and OR.
[0061] For example, the two filter conditions "Order Details.Amount>10000" and "Order Details.Amount<50000" can be combined into a filter condition for amounts between 10000 and 50000. These two conditions can also be combined into a group A, and further combined with group B (Order Details.Operator=Current User).
[0062] The combined feature supports conditional filtering settings in all scenarios.
[0063] 4. Storage and retrieval filtering conditions: After users set conditions according to the rules, this data is stored as a filtering rule in a specific format (JSON format). These stored filtering rules are then processed by the condition filtering module to generate a condition matcher. The condition matcher provides an interface to verify whether the input data meets the requirements of the matcher.
[0064] 5. Compare and draw conclusions: If you need to verify whether certain data meets a certain filtering rule, you only need to convert the filtering rule into a condition matcher and call the interface.
[0065] Internally, the condition matcher parses out all the set filter conditions, then reads the status of that column of the input data according to the comparison column of the filter conditions, and compares it according to the comparison operator and the comparison value, finally outputting a Boolean conclusion. The comparison rule is to convert it into constant values for comparison. For example, "Order Details.Amount>10000" reads the amount data from the order details and performs a numerical comparison, and so on. The combination will perform logical OR and logical AND calculations according to the combination logic.
[0066] The method provided by this invention centers on a main table and extends to other related business tables, thereby expanding the scope of matching conditions. This expanded matching scope significantly improves usability.
[0067] Uncertainty in comparison values is a common requirement. Usually, comparison values are calculated based on actual business needs before comparison. The dynamic comparison value provided by the present invention is just a business pointer. The specific comparison value is generated based on this pointer when performing condition verification.
[0068] The combination of filtering conditions provided by this invention can greatly enrich the possibilities of condition settings, and theoretically can cover all scenarios that require such filtering.
[0069] like Figure 3 As shown, the present invention also provides a data filtering device 300, comprising: The mapping relationship construction module 301 is used to construct the mapping relationships between tables in the business database and within each table. The comparison data determination module 302 is used to receive the input comparison column, comparison operator, and comparison value after displaying the mapping relationship; Condition construction module 303 is used to determine data filtering conditions based on the comparison column, the comparison operator, and the comparison value; The data filtering module 304 is used to determine, based on the data filtering conditions, the data in the target table of the business database that meets the user's requirements.
[0070] The data filtering device provided in the above embodiments can implement the technical solutions described in the above data filtering method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above data filtering method embodiments, and will not be repeated here.
[0071] like Figure 4 As shown, the present invention also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402, and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0072] In some embodiments, memory 402 may be an internal storage unit of electronic device 400, such as a hard disk or memory of electronic device 400. In other embodiments, memory 402 may also be an external storage device of electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 400.
[0073] Furthermore, the memory 402 may include both internal storage units of the electronic device 400 and external storage devices. The memory 402 is used to store application software and various types of data installed on the electronic device 400.
[0074] In some embodiments, processor 401 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 402 or process data, such as the data filtering method of the present invention.
[0075] In some embodiments, display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 403 is used to display information from electronic device 400 and to display a visual user interface. Components 401-403 of electronic device 400 communicate with each other via a system bus.
[0076] In some embodiments of the present invention, when the processor 401 executes the data filtering program in the memory 402, the following steps can be implemented: Establish mapping relationships between tables in the business database and within each table; After displaying the mapping relationship, the input comparison column, comparison operator, and comparison value are received; Based on the comparison column, the comparison operator, and the comparison value, the data filtering conditions are determined; Based on the data filtering conditions, data that meets the user's needs is determined in the target table of the business database.
[0077] It should be understood that when the processor 401 executes the data filtering program in the memory 402, in addition to the functions mentioned above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.
[0078] Furthermore, the embodiments of the present invention do not specifically limit the type of electronic device 400 mentioned. Electronic device 400 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, electronic device 400 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0079] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the data filtering methods provided by the methods described above, the method comprising: Establish mapping relationships between tables in the business database and within each table; After displaying the mapping relationship, the input comparison column, comparison operator, and comparison value are received; Based on the comparison column, the comparison operator, and the comparison value, the data filtering conditions are determined; Based on the data filtering conditions, data that meets the user's needs is determined in the target table of the business database.
[0080] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0081] The data filtering method, apparatus, electronic device, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data filtering method, characterized in that, include: Establish mapping relationships between tables in the business database and within each table; After displaying the mapping relationship, the input comparison column, comparison operator, and comparison value are received; Based on the comparison column, the comparison operator, and the comparison value, the data filtering conditions are determined; Based on the data filtering conditions, determine the data in the target table of the business database that meets the user's needs; Based on the comparison column, the comparison operator, and the comparison value, data filtering conditions are determined, including: Based on the comparison column, the comparison operator, and the comparison value, at least one data filtering sub-condition is determined; When there are at least two data filtering sub-conditions, the at least two different data filtering sub-conditions are combined according to the set combination relationship to obtain the data filtering conditions; The combination relationship includes: AND / OR; Determining data filtering conditions based on the comparison column, the comparison operator, and the comparison value further includes: When there is only one data filter sub-condition, the data filter sub-condition is determined as the data filter condition. Based on the data filtering conditions, the data in the target table of the business database that meets the user's requirements is determined, including: Based on the data filtering conditions, a condition matcher is generated; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements, including: Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's needs is determined based on the comparison result; Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher. Based on the comparison result, data that meets the user's requirements is determined, including: When the condition matcher corresponds to at least two different data filtering sub-conditions, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to each data filtering sub-condition based on the condition matcher. Perform logical OR / logical AND operations on the comparison results corresponding to each data filtering sub-condition, and determine the data that meets the user's requirements based on the operation results.
2. The data filtering method according to claim 1, characterized in that, The comparison values corresponding to the column data in the target table of the business database are either static comparison values or dynamic comparison values.
3. A data filtering device, characterized in that, include: The mapping relationship building module is used to build the mapping relationships between tables in the business database and within each table; The comparison data determination module is used to receive the input comparison column, comparison operator, and comparison value after displaying the mapping relationship; A condition construction module is used to determine data filtering conditions based on the comparison column, the comparison operator, and the comparison value; The data filtering module is used to determine, based on the data filtering conditions, the data in the target table of the business database that meets the user's requirements. Based on the comparison column, the comparison operator, and the comparison value, data filtering conditions are determined, including: Based on the comparison column, the comparison operator, and the comparison value, at least one data filtering sub-condition is determined; When there are at least two data filtering sub-conditions, the at least two different data filtering sub-conditions are combined according to the set combination relationship to obtain the data filtering conditions; The combination relationship includes: AND / OR; Determining data filtering conditions based on the comparison column, the comparison operator, and the comparison value further includes: When there is only one data filter sub-condition, the data filter sub-condition is determined as the data filter condition. Based on the data filtering conditions, the data in the target table of the business database that meets the user's requirements is determined, including: Based on the data filtering conditions, a condition matcher is generated; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements; The data in the target table of the business database is validated based on the condition matcher to obtain data that meets the user's requirements, including: Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher, and the data that meets the user's needs is determined based on the comparison result; Based on the condition matcher, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to the condition matcher. Based on the comparison result, data that meets the user's requirements is determined, including: When the condition matcher corresponds to at least two different data filtering sub-conditions, the data corresponding to the comparison column in the target table of the business database is compared with the comparison operator and comparison value corresponding to each data filtering sub-condition based on the condition matcher. Perform logical OR / logical AND operations on the comparison results corresponding to each data filtering sub-condition, and determine the data that meets the user's requirements based on the operation results.
4. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the data filtering method as described in any one of claims 1 to 2.
5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data filtering method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Method and device for high-performance query based on Hbase row keys
CN106528674A
Generating Filters Automatically From Data Processing Jobs
US20130152088A1