Data table data query screening method and device, equipment and program product
Through the combination of quasi-natural language architecture and data table virtual filters, the problems of high difficulty in data table query screening and high resource consumption are solved, efficient and accurate data table data query is achieved, technical threshold is lowered, and user needs are met.
Patent Information
- Application Number
- CN202510560085.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-01
AI Technical Summary
The existing data tables have problems such as high technical thresholds and high back-end network traffic and computing power consumption when filtering query. Traditional query methods are difficult to accurately understand user intentions, resulting in inefficient query.
Using a quasi-natural language architecture, by obtaining the initial query command text, performing syntax compliance checks and model construction, combining data table characteristics and computing resources, a data table virtual filter is built to realize efficient query and filtering of data table data.
It lowers the technical threshold, so that non-professional personnel can also facilitate data querying, improves the accuracy and efficiency of query, reduces the consumption of back-end network traffic and computing power, and meets users' needs for data timeliness.
Smart Images

Figure CN120407568A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data query and screening, and particularly relates to a method, device, equipment and program product for querying and screening data in a data table. Background Art
[0002] A data table is an important form of data set visualization and is often seen in front-end and back-end applications. In addition to centrally displaying business data characteristics in the form of display boards, a data table is also an important tool for business supervisors, data analysts, system maintenance engineers, etc. to carry out business data supervision and risk control, and is used for dynamically supervising daily business data changes, mining potential data value, exploring potential business risks and hidden dangers, etc.
[0003] A data table should not be limited to beautifully displaying data, but should also be an important tool for real-time data analysis. Most of the data tables used in the current front-end and back-end focus on the data display function, ignoring the rediscovering of data value, which greatly affects the creative thinking and initiative of business supervisors, data analysts, etc. Expressing dynamic and variable business data in a static and fixed data form greatly reduces the application performance and iterative upgrade progress of the information system. Individually, although some provide calculation and analysis functions similar to Excel, data needs to be imported into Excel for analysis, which greatly reduces the timeliness of data analysis and increases the complexity of data permission settings. There are also some that provide a filtering mechanism with columns as units, and filtering can only be completed through successive operations column by column, which destroys the basic logic of users' data screening, greatly affects the efficiency of users to efficiently focus on key data, interferes with the original intention of users to query and screen data, and greatly affects the continuous analysis and tracking of abnormal data as well as the mining of potential data value, business risks and hidden dangers. Some data tables provide filtering functions, but the construction of their filtering functions is relatively complex, with high technical difficulty, and there are significant differences in the construction forms of different data table components, which greatly increases the difficulty for users to query, screen and focus on key data, especially for data tables with a large amount of data.
[0004] Data table data analysis requires frequent querying and screening of data, as well as frequent data calculation and conversion. If all are calculated at the back-end, it will increase the consumption of back-end network traffic and computing power.
[0005] Therefore, there is an urgent need to propose a new method for querying and screening data in a data table based on traditional query analysis logic and environmental resources such as front-end and back-end computing power and network speed. Summary of the Invention
[0006] In view of this, the present invention provides a method, device, equipment and program product for querying and screening data in a data table to solve the problems of high difficulty in querying and screening data in a large-scale data table and high consumption of back-end network traffic and computing power.
[0007] In a first aspect, the present invention provides a method for querying and filtering data in a data table, which is used for a control system based on a quasi-natural language architecture. The quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command. The method includes:
[0008] Obtain an initial query command text; use the quasi-natural language architecture to perform syntax compliance checking on the initial query command text and construct a first instantiated query data model; according to the first instantiated query data model, through the processing of a preset first mapping relationship, construct an instantiated filtering data model, and the preset first mapping relationship is used to represent the mapping relationship between the query data model and the filtering data model; according to the instantiated filtering data model, the data table feature set, and the computing power resource set, construct a data table virtual filter; use the data table virtual filter to perform query and filtering on the data in the data table to obtain the query and filtering result of the data in the data table.
[0009] The method for querying and filtering data in a data table provided by the present invention is based on a quasi-natural language architecture. Users only need to provide an initial query command text without mastering complex database query languages, enabling non-professionals to conveniently query and filter data in a data table, greatly reducing the technical threshold. Further, through the syntax compliance checking of the initial query command text by the quasi-natural language architecture, syntax errors can be detected and corrected in a timely manner, and then an accurate and standardized target query command text and a first instantiated query data model can be constructed, avoiding query result deviations caused by inaccurate query commands. Further, by combining the first instantiated query data model and the preset first mapping relationship to construct an instantiated filtering data model, the query command in quasi-natural language can be converted into a format suitable for database operations, solving the problem that it is difficult to interface natural language with database instructions in traditional queries, enabling the system to accurately understand the user's intention and perform corresponding operations in the database, improving the accuracy and efficiency of the query. Further, by combining the instantiated filtering data model, the data table feature set, and the computing power resource set to construct a data table virtual filter, the system can select a suitable processing method according to different data table scales, data types, and available computing power resources, reducing the consumption of backend network traffic and computing power, and improving the system's adaptability to different scenarios. Finally, directly using the data table virtual filter for query and filtering can quickly obtain data that meets the conditions from the data table, improving the query efficiency and meeting the user's demand for data timeliness.
[0010] In an optional implementation manner, using the quasi-natural language architecture to perform syntax compliance checking on the initial query command text and construct a first instantiated query data model includes:
[0011] Decompose the initial query command text to obtain a preset number of first query command clauses; use the quasi-natural language architecture to check and correct the grammatical compliance of each first query command clause until the grammar of each first query command clause is compliant, obtaining multiple keyword sequences, multiple natural language action objects, and a target query command paradigm; input the multiple keyword sequences, multiple natural language action objects, and the target query command paradigm into a preset query data model to obtain a first instantiated query data model, where the storage space of the preset query data model is greater than or equal to the preset number.
[0012] The data table data query and screening method provided by the present invention decomposes the initial query command text into first query command clauses, which helps to perform accurate compliance checks and corrections on each clause, improving the analysis accuracy of the query command. Further, by using the quasi-natural language architecture to check and correct the compliance of each first query command clause, multiple keyword sequences, multiple natural language action objects, and a target query command paradigm are obtained, which can accurately reflect the user's query intention. At the same time, the storage space of the preset query data model is greater than or equal to the preset number, ensuring that all the information related to the decomposed query command clauses can be accommodated, providing sufficient space for subsequent processing.
[0013] In an alternative embodiment, using the quasi-natural language architecture to check and correct the grammatical compliance of each first query command clause until the grammar of each first query command clause is compliant, obtaining multiple keyword sequences, multiple natural language action objects, and a target query command paradigm, includes:
[0014] Use the quasi-natural language architecture to separately check the compliance of the grammar and word usage of each first query command clause to obtain multiple non-compliant second query command clauses; use the quasi-natural language architecture to analyze the combination characteristics between different first query command clauses and determine the initial query command paradigm; use the initial query command paradigm to check the compliance of the matching relationship of each first query command clause to obtain multiple non-compliant third query command clauses; after correcting the multiple second query command clauses and multiple third query command clauses and generating a new initial query command text, return to the step of decomposing the initial query command text, and repeatedly iterate for compliance checks until the grammar of each first query command clause is compliant, obtaining multiple keyword sequences, multiple natural language action objects, and a target query command paradigm.
[0015] The data table data query and screening method provided by the present invention, through a quasi-natural language architecture, checks the compliance of the syntax and word usage of each first query command clause respectively and corrects the non-compliant query command clauses, ensuring the accuracy of the syntax and word usage of each clause and avoiding the deviation of query results caused by syntax and word usage errors. Further, through the quasi-natural language architecture, the combination characteristics between different first query command clauses are analyzed, and the compliance of the matching relationship of each first query command clause is checked according to the determined initial query command paradigm, and the non-compliant query command clauses are corrected, ensuring the clarity and reasonableness of the structure and logic of the query command. Further, through the accurate target query command paradigm, the system can be guided to understand and execute the query command more accurately, improving the logic and accuracy of the query, and thus ensuring that the query results meet the user's expectations.
[0016] In an alternative embodiment, according to the first instantiated query data model, after being processed by a preset first mapping relationship, an instantiated filtered data model is constructed, including:
[0017] Extract query information from the first instantiated query data model and construct a filtered data model; according to the preset first mapping relationship, translate the semantic data of the filtered data model and obtain the instantiated filtered data model.
[0018] The data table data query and screening method provided by the present invention, according to the preset first mapping relationship, translates the semantic data of the filtered data model into a standard SQL query clause, realizing the conversion from a quasi-natural language query command to a database executable command, solving the docking problem between natural language and database language, and thus helping to improve the accuracy and efficiency of data screening.
[0019] In an alternative embodiment, according to the instantiated filtered data model, the data table feature set and the computing power resource set, a data table virtual filter is constructed, including:
[0020] According to the instantiated filtered data model, the data table feature set and the computing power resource set, determine whether the conversion mode adopts an array mode; when the conversion mode is an array mode, according to the preset second mapping relationship, convert the instantiated filtered data model into an array calculation process, and the preset second mapping relationship is used to represent the mapping relationship between the query paradigm and the array calculation function; construct a data table virtual filter according to the array calculation process.
[0021] The data table data query and screening method provided by the present invention determines whether to adopt the array mode according to the instantiated filtering data model, the data table feature set, and the computing power resource set, and can select the most suitable processing method according to the actual situation, improving the processing efficiency and resource utilization rate of the system. Further, when the array mode is adopted, the instantiated filtering data model is converted into an array calculation process according to the preset second mapping relationship, and then, by utilizing the high efficiency of array calculation, data screening can be quickly completed, which is particularly suitable for the case of a small-scale data table and sufficient front-end computing power. Finally, a data table virtual filter is constructed according to the array calculation process, enabling the virtual filter to be adjusted according to different calculation processes, and improving the flexibility and adaptability of the virtual filter.
[0022] In an alternative embodiment, the method further includes:
[0023] When the conversion mode is not the array mode, according to the preset third mapping relationship, the instantiated filtering data model is converted into a database standard SQL query process, and the preset third mapping relationship is used to represent the mapping relationship between the query paradigm and the database standard SQL command; a data table virtual filter is constructed according to the database standard SQL query process.
[0024] The data table data query and screening method provided by the present invention, when the conversion mode is not the array mode, converts the instantiated filtering data model into a database standard SQL query process, providing another effective processing method for different data table characteristics and computing power resources, and ensuring that the system can perform efficient query and screening in various situations. Further, the database standard SQL query process has powerful query and processing capabilities and can handle large-scale data tables and complex query requirements. Therefore, by converting the instantiated filtering data model into an SQL query process, the advantages of the database are fully utilized, and the processing capacity and stability of the system are improved. Finally, a data table virtual filter is constructed according to the database standard SQL query process, enabling the virtual filter to uniformly process different conversion modes, and improving the overall coordination and consistency of the system.
[0025] In a second aspect, the present invention provides a data table data query and screening device for a control system based on a quasi-natural language architecture, and the quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command; the device includes:
[0026] An acquisition module for acquiring an initial query command text; an inspection and construction module for performing syntax compliance inspection on the initial query command text and constructing a first instantiated query data model by using a quasi-natural language architecture; a processing and construction module for constructing an instantiated filtering data model according to the first instantiated query data model through processing by a preset first mapping relationship, where the preset first mapping relationship is used to represent the mapping relationship between the query data model and the filtering data model; a construction module for constructing a data table virtual filter according to the instantiated filtering data model, a data table feature set, and a computing power resource set; a query and screening module for performing query screening on data table data by using the data table virtual filter to obtain a query screening result of the data table data.
[0027] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the data table data query and screening method according to the first aspect or any corresponding embodiment thereof.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the data table data query and screening method according to the first aspect or any corresponding embodiment thereof.
[0029] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the data table data query and screening method according to the first aspect or any corresponding embodiment thereof. Description of the Drawings
[0030] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0031] Figure 1 is a flowchart of the data table data query and screening method according to an embodiment of the present invention;
[0032] Figure 2 is a flowchart of another data table data query and screening method according to an embodiment of the present invention;
[0033] Figure 3 is a flowchart of yet another data table data query and screening method according to an embodiment of the present invention;
[0034] Figure 4Schematic diagram of the quasi-natural language command query and screening process according to an embodiment of the present invention;
[0035] Figure 5 Schematic diagram of the compliance check process for quasi-natural language query commands according to an embodiment of the present invention;
[0036] Figure 6 Schematic diagram of the translation process for quasi-natural language query commands according to an embodiment of the present invention;
[0037] Figure 7 Schematic diagram of the conversion process for quasi-natural language query commands according to an embodiment of the present invention;
[0038] Figure 8 Schematic diagram of the query command text editor according to an embodiment of the present invention;
[0039] Figure 9 Schematic diagram of the query result display window according to an embodiment of the present invention;
[0040] Figure 10 Block diagram of the structure of the data table data query and screening device according to an embodiment of the present invention;
[0041] Figure 11 Schematic diagram of the hardware structure of the computer device according to an embodiment of the present invention. Detailed implementation manners
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] The embodiments of the present invention provide a method for querying and screening data in a data table. By using a quasi-natural language architecture and comprehensively considering different data table scales, data types, and available computing power resources, a data table virtual filter is constructed to query and screen the data in the data table, so as to achieve the effects of reducing the technical threshold, reducing the consumption of backend network traffic and computing power, improving the query efficiency, and meeting the user's demand for data timeliness.
[0044] A data table is a collection of fields. Data is stored in the table in a row - and - column format. Each row represents a record, and each column represents the value of a field in the record. Similar data representation forms include database data tables, web table Table - class controls, Excel worksheets, two - dimensional data returned by database queries, Table controls in high - level languages, etc. These can be called data similar to data tables, and in the following embodiments of the present invention, such data is simply referred to as data - table data.
[0045] According to an embodiment of the present invention, an embodiment of a method for querying and filtering data - table data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer - executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0046] In this embodiment, a method for querying and filtering data - table data is provided, which is used for a control system based on a quasi - natural language architecture. Among them, the quasi - natural language architecture consists of the following constituent factors:
[0047] (1) A relatively fixed set of query keywords, which can include the keyword terms used in the query command, used to describe the command type, operation object, scope, direction, etc., such as find, display, between..., greater than..., group by..., sort in ascending order, meet the conditions..., etc. As shown in the following Table 1 for the synonym list of sub - paradigm keywords and Table 2 for the synonym list of object keywords.
[0048] Table 1. Quasi - natural language query command architecture - query clause paradigm table
[0049]
[0050]
[0051] Table 2. Quasi - natural language query command architecture - object paradigm table
[0052]
[0053]
[0054]
[0055] (2) A dynamic set of names related to the data table, which can include data - table field names and alias names, data - table names, and newly created temporary aliases, etc. Which specific field names and aliases are included depends on the data table used.
[0056] (3) The quasi-natural language query filtering command paradigm set, abbreviated as the query command paradigm set, is a set of quasi-natural language query command paradigms, which may include query command paradigms, query clause paradigms, and action object paradigms. Specifically as follows:
[0057] (a) Query command paradigm: Each query command consists of N query clauses. Each query clause corresponds to a type of query paradigm, and a unique code is assigned to each type of query sub-paradigm, such as the clause code column shown in Table 1 above. Depending on the composition of the query sub-paradigms, multiple query command paradigms can be formed, such as the SFW query command paradigm, the SFWG query command paradigm, etc. Query rule one: The query command must conform to one of the query command paradigms.
[0058] (b) Query clause paradigm: Each query command consists of N query clauses. The query clauses are separated by semicolons (";"), and the last clause ends with a period ("."). The order of the clauses can be swapped. Each clause consists of a keyword sequence and an action object. Query rule two: Each query clause must conform to one of the query clause paradigms corresponding to the query command paradigm, such as the clause paradigm column shown in Table 1 above.
[0059] (c) Action object paradigm: Each query sub-command has a unique action object sequence (abbreviated as action object). The action object consists of a keyword sequence and sub-objects. The sub-objects consist of field names, field aliases, table names, new aliases, expressions, etc. Query rule three: The action object sequence must conform to the action object paradigm corresponding to the query clause, such as the action object paradigm shown in Table 2 above.
[0060] (4) Query command: It represents a specific query command instance constructed based on the quasi-natural language syntax framework and conforming to the quasi-natural language query filtering command paradigm. This query command can consist of several query clauses, separated by semicolons, and the last clause ends with a period. The clauses consist of keyword sequences, specific data table names, instance objects such as relevant field names of the data table, etc.
[0061] Figure 1 It is a flowchart of the data table data query filtering method according to the embodiment of the present invention, as Figure 1 shown, and this process includes the following steps:
[0062] Step S101, obtain the initial query command text.
[0063] Among them, the query command text represents the instructional text input by the user based on the quasi-natural language framework of the control system for obtaining the required data from the data table.
[0064] Specifically, the user can input the corresponding initial query command text to the control system in any of the following ways according to their actual query and filtering requirements:
[0065] (1) Directly call the existing query command text from the control system. Among them, the existing query command text can be the one previously edited and saved by the user, or some common query commands preset by the control system.
[0066] (2) The user can, according to their actual query and filtering requirements, use a text editor to construct the initial query command text based on the quasi-natural language architecture and input the query command text into the control system based on the quasi-natural language architecture.
[0067] Among them, the text editor can be an ordinary text editor or a special query command editor based on the quasi-natural language. In this embodiment, an ordinary text editor is used to edit the initial query command text and input it into the control system.
[0068] Step S102, use the quasi-natural language architecture to perform a syntax compliance check on the initial query command text and construct the first instantiated query data model.
[0069] Among them, the syntax compliance check means checking whether the syntax and word usage of the query command and its clauses conform to the specifications, which can include local compliance checks and overall compliance checks.
[0070] The local compliance check means that after the overall editing of the initial query command text is completed, a syntax compliance check is performed on the query command clauses, or during the editing of the initial query command text, a timely and dynamic compliance check is performed on the local commands.
[0071] The overall compliance check means that after the local compliance check is completed, an overall compliance check is performed on all clauses of the initial query command text and the clause matching relationship.
[0072] Furthermore, the first instantiated query data model represents a data model that structurally stores the key information extracted from the initial query command text.
[0073] Specifically, the control system can analyze the initial query command text input by the user and check the syntax compliance according to the architecture of the quasi-natural language architecture. If it does not conform to the rules, it will be adjusted, avoiding the deviation of the query results caused by inaccurate query commands.
[0074] Further, during the process of checking the syntactic compliance of the initial query command text input by the user, the control system can also extract relevant information from the initial query command text. Therefore, when the syntax of the initial query command text is compliant, a corresponding first instantiated query data model can be constructed based on the extracted relevant information.
[0075] Step S103, according to the first instantiated query data model, through the processing of a preset first mapping relationship, construct an instantiated filtering data model.
[0076] Among them, the preset first mapping relationship is used to represent the mapping relationship between the query data model and the filtering data model. Specifically, a query model and a filtering model are used to store the key information of natural language queries and SQL query key information respectively. The form of change of the query key information is small. Based on the key information and query paradigms, the relationship between the two can be established. That is, the essence of the preset first mapping relationship is to represent the mapping relationship between natural language queries and SQL commands.
[0077] The instantiated filtering data model represents a data structure model based on the first instantiated query data model, which is used to clarify the data filtering rules and scope.
[0078] Specifically, the key information extracted from the initial query command text is stored in the instantiated filtering data model. Therefore, based on the information stored in the first instantiated query data model, the preset first mapping relationship can be used to process the information stored in the instantiated query data model, making it in a form that the computer can understand and process, solving the problem that it is difficult to dock natural language and database instructions in traditional queries, enabling the system to accurately understand the user's intention and perform corresponding operations in the database, and improving the accuracy and efficiency of queries.
[0079] At the same time, the corresponding query screening conditions and data filtering information can be determined through analysis and processing.
[0080] Further, by organizing the query screening conditions and data filtering information in a certain structure, a corresponding instantiated filtering data model can be formed.
[0081] Step S104, according to the instantiated filtering data model, the data table feature set and the computing power resource set, construct a data table virtual filter.
[0082] Among them, the data table feature set represents a set of attribute collections used to describe various features of the data table, which can include attribute information such as the number of records, the number of fields, data types, and data distribution.
[0083] The computing power resource set represents a set of various computing capabilities for data processing, calculation, and analysis, which can include the front-end and back-end computing power resources of the control system, network traffic resources, etc.
[0084] Specifically, by combining the instantiated filtering data model, the data table feature set and the computing power resource set, the system can select an appropriate processing method to construct a data table virtual filter according to different data table scales, data types, and available computing power resources, reducing the consumption of backend network traffic and computing power, and improving the adaptability of the system to different scenarios.
[0085] Step S105: Use the data table virtual filter to query and filter the data in the data table to obtain the query and filter result of the data in the data table.
[0086] Specifically, controlling the data table virtual filter to start and execute the corresponding data table filtering calculation process can quickly obtain the data that meets the conditions from the data table, improving the query efficiency and meeting the user's need for data timeliness.
[0087] Furthermore, the obtained query and filter result can be converted into a specific format, saved in the cache, or put into the VUE data model or the local virtual interface, and then loaded into the display window for display.
[0088] The method for querying and filtering data in a data table provided in this embodiment is based on a quasi-natural language architecture. The user only needs to provide the initial query command text without mastering complex database query languages, enabling non-professionals to conveniently query and filter data in a data table, greatly reducing the technical threshold. Further, through the quasi-natural language architecture, the syntax compliance of the initial query command text is checked, and syntax errors can be detected and corrected in a timely manner. Furthermore, an accurate and standardized target query command text and the first instantiated query data model can be constructed, avoiding query result deviations caused by inaccurate query commands. Further, by combining the first instantiated query data model and the preset first mapping relationship to construct the instantiated filtering data model, the query command in quasi-natural language can be converted into a format suitable for database operations, solving the problem that it is difficult to interface natural language with database instructions in traditional queries, enabling the system to accurately understand the user's intention and execute corresponding operations in the database, improving the accuracy and efficiency of the query. Further, by combining the instantiated filtering data model, the data table feature set and the computing power resource set to construct a data table virtual filter, the system can select an appropriate processing method according to different data table scales, data types, and available computing power resources, reducing the consumption of backend network traffic and computing power, and improving the adaptability of the system to different scenarios. Finally, directly using the data table virtual filter for query and filter can quickly obtain the data that meets the conditions from the data table, improving the query efficiency and meeting the user's need for data timeliness.
[0089] In this embodiment, a method for querying and filtering data in a data table is provided for a control system based on a quasi-natural language architecture. The quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command.
[0090] Figure 2 It is a flowchart of the method for querying and filtering data in a data table according to an embodiment of the present invention. As Figure 2 shown, the process includes the following steps:
[0091] Step S201, obtain the initial query command text. For details, please refer to Figure 1 step S101 of the embodiment shown, which will not be elaborated here.
[0092] Step S202, use the quasi-natural language architecture to perform syntax compliance checking on the initial query command text and construct the first instantiated query data model.
[0093] Specifically, the above step S202 includes:
[0094] Step S2021, decompose the initial query command text to obtain a preset number of first query command clauses.
[0095] Specifically, after the control system receives the initial query command text input by the user, it can decompose the initial query command text into a preset number (N) of first query command clauses according to preset rules. Decomposition helps to analyze and process each first query command clause separately, and then can more carefully check the syntax and semantics of each clause, improving the accuracy and efficiency of query command processing.
[0096] Wherein, N is a non-zero natural number.
[0097] Step S2022, use the quasi-natural language architecture to perform syntax compliance checking and correction on each first query command clause until the syntax of each first query command clause is compliant, to obtain a plurality of keyword sequences, a plurality of natural language action objects, and a target query command paradigm.
[0098] Among them, syntax compliance checking means checking whether the keyword sequence, name sequence, and their matching relationships adopted by each query command clause in the initial query command text meet the paradigm requirements based on the query logic and keyword set of the quasi-natural language architecture, with reference to the query paradigm, query clause paradigm, and action object paradigm.
[0099] Specifically, according to the description of query commands in the above alignment natural language architecture, each query command clause is composed of instance objects such as a keyword sequence, a specific data table name, and a relevant field name of the data table. Therefore, through the query keyword set, data table name set, and query command paradigm set included in the quasi-natural language architecture, compliance checking and correction are performed on each first query command clause.
[0100] Furthermore, when the keyword sequence, name sequence, and their matching relationships of each first query command clause all meet the paradigm requirements, multiple corresponding keyword sequences, multiple natural language action objects, and target query command paradigms are identified and extracted, thereby being able to accurately reflect the user's query intention.
[0101] In some alternative embodiments, the above step S2022 includes:
[0102] Step a1, using the quasi-natural language architecture, respectively check the compliance of the grammar and word usage of each first query command clause to obtain multiple non-compliant second query command clauses.
[0103] Specifically, among the preset number of first query command clauses obtained by decomposing the initial query command text, select an unexamined first query command clause as the current processing object.
[0104] First, according to the type of the current first query command clause and the logical relationship therein, determine the clause paradigm of the current first query command clause.
[0105] Furthermore, compare the determined clause paradigm of the first query command clause with the query command paradigm set in the quasi-natural language architecture one by one and check whether there is a matching clause paradigm, thereby being able to determine whether the grammatical structure of the current first query command clause conforms to the specification.
[0106] Second, continue to check whether the keyword sequence used in the current query command clause conforms to the query keyword set in the quasi-natural language architecture. At the same time, it is also possible to check whether the logical relationship of the current query command clause is reasonable.
[0107] Then, the current first query command clause can be identified and the corresponding action objects, such as data table names, field names, etc., can be extracted. Further, according to the type of the action object and its usage mode in the first query command clause, determine the clause action object paradigm.
[0108] Furthermore, compare the determined clause action object paradigm of each clause with the query command paradigm set in the quasi-natural language architecture one by one and check whether there is a matching clause action object paradigm.
[0109] Furthermore, it is possible to check the names, field names, etc. of the objects corresponding to the compliant clause object paradigms according to the set of data table names in the quasi-natural language architecture.
[0110] Furthermore, the first query command clauses that do not conform to the clause paradigm, keyword sequence, clause object norm, name of the object corresponding to the clause object paradigm, and field name in the above process are used as the second query command clauses.
[0111] Step a2: Use the quasi-natural language architecture to analyze the combination characteristics between different first query command clauses and determine the initial query command paradigm.
[0112] Specifically, it is possible to analyze the logical sequence relationship, dependency relationship, and connection method between different first query command clauses.
[0113] Furthermore, it is possible to match the analysis results of the combination characteristics between different obtained first query command clauses with the query command paradigm set in the quasi-natural language architecture and use the existing paradigm that best conforms to the clause combination characteristics as the corresponding initial query command paradigm.
[0114] Step a3: According to the initial query command paradigm, perform compliance checks on the matching relationships of each first query command clause to obtain multiple non-compliant third query command clauses.
[0115] Specifically, according to the determined initial query command paradigm, it is possible to check whether the matching relationship of each first query command clause is compliant. Among them, the compliance check of the matching relationship can include clause order check, logical relationship check between conditional clauses, matching situation check of keywords between different clauses, association situation check between natural language objects involved in each clause (such as data table names, field names, etc.), etc.
[0116] Furthermore, the first query command clauses with non-compliant matching relationships are used as the third query command clauses.
[0117] Step a4: After correcting multiple second query command clauses and multiple third query command clauses and generating a new initial query command text, return to the step of decomposing the initial query command text and repeatedly perform compliance checks until the syntax of each first query command clause is compliant, obtaining multiple keyword sequences, multiple natural language objects, and the target query command paradigm.
[0118] Specifically, after the compliance check of each first query command clause is completed, return to step S201 above, and correct the corresponding first query command clauses (i.e., multiple non-compliant second query command clauses and multiple third query command clauses) in the initial query command text constructed according to the text editor to form a new initial query command text.
[0119] Further, repeat steps S2021 to S2022 above until each first query command clause obtained by decomposition passes the compliance check. At this time, multiple keyword sequences, multiple natural language action objects, and the target query command paradigm corresponding to the initial query command text that passes the compliance check can be extracted.
[0120] Step S2023, input the multiple keyword sequences, multiple natural language action objects, and the target query command paradigm into the preset query data model to obtain the first instantiated query data model.
[0121] Among them, in order to ensure that the storage space of the constructed initial query data model can accommodate the relevant information of the preset number of first query command clauses obtained by decomposition, the storage space of the constructed initial query data model can be set to be greater than or equal to the preset number.
[0122] Specifically, input the multiple keyword sequences, multiple natural language action objects, and the target query command paradigm extracted into the preset query data model constructed in advance for storage and form the corresponding first instantiated query data model.
[0123] Step S203, according to the first instantiated query data model, after being processed by the preset first mapping relationship, construct the instantiated filtering data model.
[0124] Specifically, step S203 above includes:
[0125] Step S2031, extract query information from the first instantiated query data model and construct the filtering data model.
[0126] Specifically, the first instantiated query data model stores the keyword sequences, natural language action objects of each compliant second query command clause, and the target query command paradigm corresponding to the preset number of second query command clauses.
[0127] [[ID=
[27] ]Therefore, the keyword sequences, natural language action objects, and query command paradigms of the query command clauses in the first instantiated query data model can be extracted to construct a new filtering data model.
[0128] Step S2032, according to the preset first mapping relationship, translate the semantic data of the filtering data model to obtain the instantiated filtering data model.
[0129] Specifically, according to the preset first mapping relationship, after translating the keyword sequence and natural language object of each query command clause in the filtering data model into the keyword sequence corresponding to the standard SQL query clause and the object corresponding to the standard SQL query clause, an instantiated filtering data model is formed. That is, the instantiated filtering data model stores the keyword sequence corresponding to the standard SQL query clause, the object corresponding to the standard SQL query clause, and the query command paradigm extracted in step S2031.
[0130] Step S204: Construct a data table virtual filter according to the instantiated filtering data model, the data table feature set, and the computing power resource set. For details, please refer to Figure 1 Step S104 of the embodiment shown, which will not be elaborated here.
[0131] Step S205: Use the data table virtual filter to query and filter the data in the data table to obtain the query and filter result of the data in the data table. For details, please refer to Figure 1 Step S105 of the embodiment shown, which will not be elaborated here.
[0132] The data table data query and filter method provided in this embodiment decomposes the initial query command text into the first query command clauses, which helps to perform detailed compliance checks and corrections on each clause, improving the analysis accuracy of the query command. Further, through the quasi-natural language architecture, the compliance of the syntax and word usage of each first query command clause is checked respectively, and the non-compliant query command clauses are corrected, ensuring that the syntax and word usage of each clause are accurate and error-free, and avoiding query result deviations caused by syntax and word usage errors. Further, through the quasi-natural language architecture, the combination characteristics between different first query command clauses are analyzed, and the compliance of the matching relationship of each first query command clause is checked according to the determined initial query command paradigm, as well as the correction of non-compliant query command clauses, ensuring the clear and reasonable structure and logic of the query command. Further, through the accurate target query command paradigm, the system can be guided to understand and execute the query command more accurately, improving the logic and accuracy of the query, and thus ensuring that the query result meets the user's expectations. Further, according to the preset first mapping relationship, the semantic data of the filtering data model is translated into a standard SQL query clause, realizing the conversion from the quasi-natural language query command to the database executable command, solving the docking problem between the natural language and the database language, and thus helping to improve the accuracy and efficiency of data filtering.
[0133] In this embodiment, a data table data query and filter method is provided for a control system based on a quasi-natural language architecture, where the quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command.
[0134] Figure 3 is a flowchart of the method for querying and filtering data table data according to an embodiment of the present invention. As Figure 3 shown, the process includes the following steps:
[0135] Step S301, obtain the initial query command text. For details, please refer to Figure 1 step S101 of the embodiment shown, which will not be elaborated here.
[0136] Step S302, use the quasi-natural language architecture to perform syntactic compliance checking on the initial query command text and construct the first instantiated query data model. For details, please refer to Figure 2 step S202 of the embodiment shown, which will not be elaborated here.
[0137] Step S303, according to the first instantiated query data model, through the preset first mapping relationship processing, construct the instantiated filtering data model. For details, please refer to Figure 2 step S203 of the embodiment shown, which will not be elaborated here.
[0138] Step S304, according to the instantiated filtering data model, the data table feature set and the computing power resource set, construct a data table virtual filter.
[0139] Specifically, the above step S304 includes:
[0140] Step S3041, according to the instantiated filtering data model, the data table feature set and the computing power resource set, determine whether the conversion mode adopts the array mode.
[0141] Specifically, information such as the keyword sequence, natural language action object, and query command paradigm that have been translated into the standard SQL form can be extracted from the instantiated filtering data model to determine the filtering complexity. At the same time, according to the data table feature set, data table scale information such as the number of records, the number of fields, and the data type distribution of the data table can be extracted.
[0142] Furthermore, the resource environment conditions available for implementation of the filtering can be extracted according to the computing power resource set.
[0143] Furthermore, according to the above three types of information extracted, a data table filtering feature and resource environment data model can be constructed.
[0144] Furthermore, based on the data table filtering feature and resource environment data model, a comprehensive decision can be made on whether to use the front-end array mode for conversion. For example, if the data table scale is small, the query filtering logic is relatively simple, and the front-end computing power resources are sufficient, the array mode can be preferred; conversely, if the data table scale is large, the query is complex, or there are specific requirements for database management operations, the array mode is not adopted.
[0145] Step S3042, when the conversion mode is the array mode, convert the instantiated filtered data model into an array calculation process according to a preset second mapping relationship.
[0146] The preset second mapping relationship is used to represent the mapping relationship between the query paradigm and the array calculation function.
[0147] Specifically, if the conversion mode is the array mode, according to the mapping relationship between the query paradigm and the array calculation function, the data in the instantiated filtered data model can be converted into the corresponding array calculation function and parameters, that is, the instantiated filtered data model is converted into an executable data calculation logic, that is, an array calculation process.
[0148] Step S3043, construct a data table virtual filter according to the array calculation process.
[0149] Specifically, the array calculation process can be parsed and combined with a specific programming or calculation framework to construct a data table virtual filter.
[0150] Exemplarily, by encapsulating the array calculation process into a callable virtual filter object or module, the constructed data table virtual filter can filter the input data table data according to a predetermined logic.
[0151] In some alternative embodiments, the above step S304 further includes:
[0152] Step S3044, when the conversion mode is not the array mode, convert the instantiated filtered data model into a database standard SQL query process according to a preset third mapping relationship.
[0153] The preset third mapping relationship is used to represent the mapping relationship between the query paradigm and the database standard SQL commands.
[0154] Specifically, if the conversion mode is not the array mode, according to the mapping relationship between the query paradigm and the database standard SQL commands, the information such as query conditions, query fields, and data sources in the instantiated filtered data model can be accurately converted into the standard SQL statement structure and form the corresponding database standard SQL query process.
[0155] Step S3045, construct a data table virtual filter according to the database standard SQL query process.
[0156] Specifically, the database standard SQL query process can be parsed and combined with a specific programming or calculation framework to construct a data table virtual filter.
[0157] Exemplarily, by encapsulating the database standard SQL query process into a callable virtual filter object or module, the constructed virtual filter for the data table can send a query request to the database when needed, and perform preliminary processing and filtering on the returned data, achieving a virtual filtering function similar to that in the array mode.
[0158] Step S305: Use the virtual filter for the data table to query and filter the data in the data table, and obtain the query and filter result of the data in the data table. For details, please refer to Figure 1 Step S105 of the embodiment shown, which will not be elaborated here.
[0159] The method for querying and filtering data in a data table provided in this embodiment determines whether to adopt the array mode according to the instantiated filtered data model, the data table feature set, and the computing power resource set, and can select the most suitable processing method according to the actual situation, improving the processing efficiency and resource utilization rate of the system. Further, when the array mode is adopted, the instantiated filtered data model is converted into an array calculation process according to the preset second mapping relationship, and then, by utilizing the high efficiency of array calculation, data screening can be quickly completed, especially suitable for the case of small-scale data tables and sufficient front-end computing power. Further, when the conversion mode is not the array mode, the instantiated filtered data model is converted into a database standard SQL query process, providing another effective processing method for different data table features and computing power resources, ensuring that the system can perform efficient query and filtering in various situations. Further, the database standard SQL query process has powerful query and processing capabilities and can handle large-scale data tables and complex query requirements. Therefore, by converting the instantiated filtered data model into an SQL query process, the advantages of the database are fully utilized, and the processing ability and stability of the system are improved. Finally, a virtual filter for the data table is constructed according to the array calculation process or the database standard SQL query process, enabling the virtual filter to uniformly process different conversion modes, improving the overall coordination and consistency of the system.
[0160] In one example, a method for querying and filtering data in a data table based on quasi-natural language is provided, such as Figure 4As shown in the figure, the query screening process specifically includes 6 steps. The system first loads the quasi-natural language query screening command text
[1001] ; then decomposes the quasi-natural language command text into N query clauses, and checks the paradigm matching of the command keyword sequence, the position and type of the action object, etc. against the command paradigm, and performs local and overall syntax compliance checks, that is, syntax compliance checks
[1002] ; the third step is the translation of the quasi-natural language query command
[1003] . Against the command paradigm, parse the semantics of the command clauses, extract the keyword sequence and the command action object, and construct a data table query data model. Based on the mapping relationship between the query paradigm and the query filtering function, use the data table query data model to construct a data table filtering data model; the fourth step is the conversion of the quasi-natural language query command
[1004] . Based on the mapping relationship between the query paradigm and the data table calculation function, convert the instantiated filtering data model into a data table filtering calculation process, and construct a virtual filter; the fifth step is the execution of the quasi-natural language query command
[1005] . Start the data table virtual filter execution method, execute its data table screening calculation process, and obtain the data table data query screening result; the sixth step is the output of the query screening result
[1006] . Convert the query result into a specific format and save it to the cache or display it on the display device. The following further describes the process and each key technology.
[0161] (1) Loading or editing of the query command text
[1001] . Specifically, the loading of the command text refers to directly calling the query command text in the system. The editing of the query command text refers to using a text editor to construct the query command text based on the quasi-natural language architecture. This is the first step in querying data in a data table based on quasi-natural language. The editing of the command text can be performed using a common text editor, but the automation degree and efficiency are relatively low. It is best to use a dedicated query command editor based on quasi-natural language, and its automation degree and efficiency will be greatly improved. For the already edited command, it can be directly loaded and executed. This technical solution assumes that the query command text has been edited using a common text editor.
[0162] (2) Syntax compliance check of the query command
[1002] . The syntax compliance check refers to checking whether the syntax and word usage of the query command and its clauses conform to the specifications, as Figure 5 shown.
[0163] Compliance checking, also known as query command syntax compliance checking, is based on the query logic and keyword set of the quasi-natural language architecture. Referring to the query paradigm, query clause paradigm, and action object paradigm, it checks whether the keyword sequence, name sequence, and their matching relationships adopted in the command text comply with the paradigm requirements, as shown in
[2006] . Compliance checking includes local compliance checking and overall compliance checking. The former refers to checking the syntax compliance of query command clauses after the overall editing of the query command is completed, or performing timely and dynamic compliance checking on local commands during the editing of the query command; the latter refers to performing an overall compliance check on all clauses of the command and their clause matching relationships after local compliance checking is completed, as shown in
[2005] . If compliant, the checking and editing of the command clause or the entire query command are terminated, as shown in
[2008] ,
[2009] ,
[2010] . Otherwise, the clauses with problems or the clauses that need to be added or deleted are prompted, so that the user can return to the editor to revise the command text. After the command text is corrected, syntax compliance checking will be performed again until the query command text is compliant, as shown in
[2007] ,
[2001] . These checks include: field name errors, ambiguous relationship expressions, command logic errors, missing action objects, action object connection errors, etc. If a quasi-natural language dedicated editor is used, most problems can be automatically repaired. For the remaining problems, prompts are issued to assist the user in manual modification.
[0164] (3) Query command translation
[1003] . Specifically, as Figure 6 shown, after loading the quasi-natural language query command
[3002] , the query command translator first decomposes the query command into N query clauses
[3003] , where N is a non-zero natural number and its value ranges from 1 to m, and m is the maximum allowable number of clauses for the query command. Based on the natural language architecture, namely the query command paradigm, query clause paradigm, action object paradigm, etc.
[3005] , each clause is parsed to extract the keyword sequence of the clause and the natural language action object (ANL Object), and a query data model is constructed, as shown in [http: / / www.example.com / 3004],
[3006] . Then, based on the mapping relationship between the query data model and the filtered data model
[3008] , the keyword sequence and natural language action object of the instantiated query data model are translated into the keywords of the standard SQL query and the standard SQL action object (SQL Object), and a data table filtered data model is constructed, as shown in
[3008] ,
[3009] , specifically including:
[0165] (a) Query command text decomposition
[3003] , decomposing the query command to generate N command query clauses.
[0166] (b) Construct a query data model
[3004] . Refer to the keyword words, keyword sequences, query paradigms, clause paradigms, object paradigms, etc. of the quasi-natural language architecture
[3005] , parse the quasi-natural language query command text, and instantiate the query data model
[3006] . The specific steps are as follows: 1) Create a query data model containing N command clauses; 2) Refer to the natural language architecture and loop to parse the N query clauses of the command text, which includes two steps. First, perform clause paradigm matching, and after determination, extract the keyword sequence of the clause and store it in the query data model. Then perform clause object paradigm matching, and after determination, extract the natural language object of the clause and store it in the query data model; 3) After the clause loop parsing is completed, perform query command paradigm matching, and after determination, extract the command paradigm and store it in the query data model; 4) Output the instantiated query data model.
[0167] (c) Filter data model construction
[3007] . Refer to the mapping relationship between the query data model and the filter data model
[3008] , translate the keyword sequence and natural language object of the instantiated query data model into the keywords of the standard SQL query and the standard SQL object (SQL Object), and construct a data table filter data model
[3009] . The specific steps are as follows: 1) Create a filter data model containing N command clauses; 2) Refer to the mapping relationship between the query paradigm and the standard SQL query clause, and loop to translate the N query clauses of the command text, which includes two steps. First, translate the keyword sequence of the clause into the keyword of the SQL query clause and store it in the filter data model. Then translate the natural language object of the clause into the object of SQL and store it in the filter data model; 3) After the clause loop translation is completed, translate the query command and store it in the filter data model; 4) Output the instantiated filter data model.
[0168] (4) Query command conversion
[1004] . Specifically, such as Figure 7As shown, based on the data table scale
[4001] , the complexity of query filtering
[4003] , and the available front-end and back-end computing power resources
[4002] , a data model of the data table filtering characteristics and resource environment
[4004] is constructed. This data model is used to determine whether to adopt the array mode for the conversion mode
[4005] . If the array model is adopted, the filtered data model is converted into an array calculation process
[4006] ; otherwise, it is converted into a database standard SQL query process
[4007] . The virtual filter
[4011] is constructed using the array calculation process and the virtual filter is output
[4012] . Generally, the array calculation process is adopted. When processing database data tables, if the permissions allow, or when it is necessary to process the data table based on database management, the standard SQL query process is used. Therefore, the database standard SQL query process
[4007] is retained. The conversion process specifically includes the following steps:
[0169] (a) Construct a data model of the data table filtering characteristics and resource environment
[4004] . Based on the data table characteristics such as the number of records and the number of fields
[4001] , the data table scale information is extracted. Based on the front-end and back-end computing resources and network traffic resources
[4002] , the resource environment conditions available for filtering are extracted. Based on the instantiated data table query filtering model
[4003] , the filtering complexity information is extracted. Combining these three types of information, a data model of the data table filtering characteristics and resource environment
[4004] is constructed.
[0170] (b) Filter mode selection
[4005] . Based on the data model of the data table filtering characteristics and resource environment, a comprehensive decision is made on whether to adopt the front-end array mode for conversion.
[0171] (c) Array filtering calculation process conversion
[4007] . If the conversion mode is the front-end array data filtering mode
[4005] , then, combining the mapping relationship between the query paradigm and the array calculation process
[4008] , the filtered data model is converted into an array filtering calculation process
[4007] .
[0172] (d) Construction of the data table virtual filter
[4011] . Based on the array filtering calculation process
[4007] , combining the execution commands of the array calculation process, a virtual filter
[4011] is constructed, and the virtual filter is output
[4012] for startup and execution. Among them, the key technologies involved in the query command conversion include: the quasi-natural language command conversion of the quasi-natural language command query filtering process
[1004] ; the construction of the data model of the data table filtering characteristics and resource environment
[4004] , filter mode selection
[4005] , array filtering calculation process conversion
[4007] , mapping relationship between the query paradigm and the data calculation process
[4008] , mapping relationship between the query paradigm and the database standard SQL command
[4009] , construction of the data table virtual filter
[4011] , and other key technologies in the quasi-natural language command conversion process.
[0173] (5) Command execution
[1005] , start the data table virtual filter execution method, execute its data table filtering calculation process, and obtain the data query and screening result of the data table.
[0174] (6) Output of the query and screening result
[1006] . Convert the query result into a specific format, save it to the cache or put it into the VUE data model or the local virtual interface, and then load it into the display window for display.
[0175] The method for querying and screening data in a data table based on quasi-natural language provided in this example has the following effects:
[0176] (1) Users can quickly and conveniently edit the quasi-natural language query commands for the data in the data table through a text editor. As long as users have basic natural language knowledge, they can complete the command construction without having to study the command rules too much. The system can automatically complete the syntax check, translation, conversion, and execution of the query commands and feedback the query results. Users do not need to care about the specific execution process of the system. The system greatly reduces the difficulty and complexity of users' manipulation of the data in the data table, enabling users to focus more on tasks such as data screening and analysis and data potential mining. Through repeated use and combined use of query commands, business queries, complex queries, tracking analysis, etc. can be conveniently carried out.
[0177] (2) It provides a key new technology for screening data in a data table based on traditional query logic, and also greatly reduces the complexity and difficulty of the data screening operation in the data table. This technology opens up a new path for promoting the mining of potential data value. The technology can be used to mine abnormal behaviors of compliant data, explore potential business risks and hidden dangers, lock in the target areas of concerned data, verify new ideas for data analysis, etc. It provides a new experience for users to use data, restores and expands the potential of the main body of the information system, that is, the personnel element; expands the depth and breadth of users' use of data; improves the convenience, timeliness, and accuracy of users' focusing on key data and abnormal data; improves the efficiency of users' abnormal repeated queries, quasi-abnormal business monitoring, exploration of compliance data anomalies and security hazards, etc.
[0178] (3) It opens up a new space for data analysis and provides necessary new tools. Based on this technology, it is convenient to mine the potential value of data, timely discover the potential risks of compliant data, etc.; conduct timely, continuous, efficient, and dynamic monitoring and analysis of important data in complex business systems; mine and predict business risks and security hazards to ensure the safe and efficient operation of the system. It provides a necessary research basis for the improvement and upgrade of complex systems.
[0179] (4) Fully utilizing the front-end and back-end computing power for query analysis greatly reduces network traffic consumption and back-end computing power consumption. General computing terminals can meet the system's computing power requirements. This example provides a new direction for the development of low-configuration smart terminals.
[0180] In some optional embodiments, with the background of "a city's gas management information center monitors and manages the gas usage of users in various communities in the city. On its monitoring display screen, it can display information such as the total gas intake of each community and the total gas usage of residents by year, month, and day, and can display the basic information and gas usage information of all residents in the community in detail. The center manager observes the total gas intake, total usage of residents, and gas usage of each household in the community through the large screen to monitor and manage the safe and compliant use of gas in the city." Taking "a community A in the city as an example," the method for querying and filtering data table data based on quasi-natural language provided by the above example is described.
[0181] Among them, Community A has 3,000 households, and the community has 3,000 monthly gas usage data and 90,000 daily gas usage data. The center director observed the data anomaly through the large screen. With the help of the above method provided in this example, the information of 37 households that may cause abnormal gas usage in the community was efficiently and conveniently locked from a large number of gas usage records, greatly reducing the actual verification workload. After actual verification, the cause of the data anomaly was discovered, and the safety hazards and illegal gas usage problems in Community A were dealt with in a timely manner; then the anomaly solution was temporarily commercialized to solve similar problems in other communities across the city; then the temporary commercialization method was upgraded through the city gas management information system, added to the upgraded information system, and provided normal intelligent monitoring services. Through the multi-level and multi-directional application of the above method provided by this example, the volatile nature of data was deeply revealed, the proactive creativity of data analysts was stimulated, the potential value of data was discovered, the service performance of the system was improved, and buffer space and improvement direction for system iterative upgrades were provided. The details are as follows:
[0182] (1) The center manager discovered through the large screen that there was a discrepancy between the total gas usage of residents in Community A and the total gas intake in May and June. Although within the normal range, there was a trend of total usage being less than total gas intake. In March and April, the two were basically the same, but in May and June, they decreased by 18,600 cubic meters and 16,900 cubic meters respectively. This may be due to the fact that some residents had significantly less gas usage in these two months. To this end, it was necessary to filter out the information of residents whose gas usage was significantly less from a large number of residents, so a quasi-natural language query and filtering command was edited in the command editor.
[0183] (2) Enter the first command in the command editor, referred to as command number 1, such as Figure 8 As shown, the details are as follows:
[0184] a. Command Name: Query information of households with significantly low gas usage in Xiangyang Community in June;
[0185] b. Command Entities: In the gas usage table of A Xiangyang Community; query the household head's name, the number of permanent residents, the house number, per capita gas usage in March = gas usage in March / number of permanent residents, per capita gas usage in April = gas usage in April / number of permanent residents, per capita gas usage in May = gas usage in May / number of permanent residents, per capita gas usage in June = gas usage in June / number of permanent residents;
[0186] c. Condition to be satisfied: ((per capita gas usage in June / (average(per capita gas usage in June)))) * 100 < 70; The results are stored in the temporary table Household Information Table with Significantly Low Gas Usage in June in the community.
[0187] Among them, the three keywords "household head's name", "number of permanent residents", and "house number" in the second clause above are the field name keywords of the data table used for query. The per capita gas usage in March is a newly created alias keyword, which is the alias of the expression "gas usage in March / number of permanent residents", and they are associated with "=". Similarly, there are newly created alias keywords for "per capita gas usage in April", "per capita gas usage in May", and "per capita gas usage in June"; The third clause "(per capita gas usage in June / (average(per capita gas usage in June)))) * 100 < 70" is a nested expression. Among them, the per capita gas usage in June has become a dynamic keyword in the third clause because it was defined in the second clause earlier, and it is marked in regular font.
[0188] Furthermore, the conditional expression uses multiple nested parentheses to strengthen the calculation priority and logic. The expression follows the conventional calculation priority rules, and some parentheses of the expression can be omitted. "Average" is the keyword symbol for aggregate calculation, and it is necessary to calculate the average value of the "per capita gas usage in June" field after it first. "100" and "30" are numerical constants.
[0189] (3) Load the quasi-natural language query command. Edit and load the query command, and it is necessary to execute the relevant content related to
[1001] in the above example. The command needs to conform to the quasi-natural language command specification and is a command constructed based on the quasi-natural language architecture, including command keyword words, table field name keywords, query paradigms, query sub-command paradigms, action object paradigms, etc. The query command can be completed in the quasi-natural language command editor or in other text editors. Special command editing can provide auxiliary editing tools to speed up the construction of the command.
[0190] (4) Compliance check of quasi-natural language query commands. Before executing the query after the query command is edited, a syntax compliance check is required. This process involves the relevant content of
[1002] in the above example. The system needs to perform a syntax compliance check on the command to check whether the command is complete, whether it needs to be supplemented, and whether it meets the normal form requirements, etc. The check includes two parts: local compliance check and overall compliance check.
[0191] (5) Translation of quasi-natural language query commands. After the syntax of the query command is compliant, execute the command translation
[1003] content in the above example to translate the command and construct a data table filtering data model.
[0192] (6) Conversion of quasi-natural language query commands. After generating the filtering data model, execute the command conversion
[1004] step in the above example. The system determines the conversion method based on the scale of the data table and the computing power resource conditions of the front end. In this embodiment, the array conversion mode is used for conversion, and the command is converted into an array calculation process and a virtual query filter is constructed.
[0193] (7) Execution of quasi-natural language query commands. Execute the command execution
[1005] step in the above example, start the virtual query filter execution method, execute the query filtering calculation process, and obtain the query result.
[0194] (8) Output and display the query result. Execute the command conversion
[1006] step in the above example, convert the query result into the required format, save it as a temporary file, and display the query result in the display window, as Figure 9 shown.
[0195] (9) Each query command generally needs to go through steps such as editing, syntax checking, interpretive translation, execution, result document generation, and result document display, that is, go through the steps from
[1001] to
[1006] in the above example. To highlight the problem-solving logic of the embodiment, the following description of the embodiment process will no longer repeat the details of command editing and execution. For details, see the above (2) to (8).
[0196] (10) Preliminary analysis of the query result of Command No. 1. Edit and execute Command No. 1 to obtain the information of households with significantly low gas usage in Community A in June, that is, the user information with the per capita gas consumption in June lower than 70% of the average per capita gas consumption in June. There are a total of 76 records, and each record includes 7 pieces of information such as the head of household's name, the number of permanent residents, the house number, the per capita gas consumption in March, the per capita gas consumption in April, the per capita gas consumption in May, and the per capita gas consumption in June.
[0197] (11) Further screen for abnormal households. It is found that some of these households have relatively low per capita gas consumption in March and April, indicating that the abnormality is not caused by these households. To further narrow down the scope of households with abnormal gas consumption, the abnormal households obtained from Query Command No. 1 are screened again, so the second query command is edited in the command editor.
[0198] (12) Edit the second query command, abbreviated as Command No. 2, as follows:
[0199] a. Command name: Query the information of households with significantly reduced gas consumption in May and June compared to March and April;
[0200] b. Command entity: In the household information table of households with significantly low gas consumption in June in the community; query the household head's name, number of permanent residents, house number, per capita gas consumption in March, per capita gas consumption in April, per capita gas consumption in May, and per capita gas consumption in June;
[0201] c. Condition to be met: (((Per capita gas consumption in May + Per capita gas consumption in June) - (Per capita gas consumption in March + Per capita gas consumption in April)) / (Per capita gas consumption in March + Per capita gas consumption in April)) * 100 < -30; The results are stored in the temporary table Household Information Table of Households with Significantly Reduced Gas Consumption in May and June Compared to March and April in the Community.
[0202] (13) Analysis of the abnormality of significantly reduced gas consumption in the community. Edit and execute Command No. 2 to obtain the information of 37 households with significantly reduced gas consumption, that is, the information of households with a per capita gas consumption in May and June on average reduced by more than 30% compared to the per capita consumption in March and April. Each record includes 7 items of information such as the household head's name, number of permanent residents, house number, per capita gas consumption in March, per capita gas consumption in April, per capita gas consumption in May, and per capita gas consumption in June. These households may have caused the abnormal gas consumption.
[0203] (14) Abnormal household verification. Personnel were organized to conduct on-site inspections of the above 37 households. It was found that there was air leakage at the front inlet of the gas meters of 10 of them, resulting in a small gas consumption. Fortunately, the environment had good ventilation and no accidents occurred. Among them, there were 17 households with too many takeout orders and a small gas consumption. For the remaining 9 households, the gas meters were abnormal, showing that the intake volume was significantly lower than the actual intake volume, there were problems with the gas meter sensors, and the gas meter measurement was distorted. Repairs were carried out for the air leakage, and the potential safety hazards caused by the air leakage were eliminated in a timely manner. The gas meters with measurement distortion were replaced to ensure accurate collection of the intake volume of relevant households. After the implementation of the two measures, the total intake volume and the total consumption of households in Xiangyang Community were basically balanced and returned to the normal fluctuation range. The abnormal gas consumption this time was caused by non-regular reasons, and the reasons for the anomalies were different in different communities. This explanation does not mean that this example can only be used for such data analysis. This example can be fully used for other data analysis. This case is only used to show that based on this example, it is possible to quickly screen out the data concerned by users from a large number of data records, focus the actual verification on a limited number of abnormal households, greatly reduce the workload of the actual verification, and improve the management efficiency.
[0204] (15) Analysis of the advantages compared with traditional data tables. Traditional data tables are mainly used to display the visual effects of data and ignore the data analysis requirements. Although there are individual data filtering tools, they are carried out one column at a time in column units, which destroys the basic query logic. Using the method of this example, it is possible to query and screen the data in the data table in a way close to natural language, that is, the quasi-natural language method, according to the conventional logic. Traditional data tables provide tools for browsing records by row or by page, but it is very difficult to screen the concerned data from 3,000 records and 27,000 data according to the provided method, and it is difficult to quickly lock the information of households with abnormal gas consumption. Using the method provided by this example, by editing and executing two query commands, the results can be obtained quickly. There is no need to first import the data into other systems, such as EXCELL, and then perform complex processes such as query modeling, screening and extraction.
[0205] (16)Advantages of repeated application of query commands. The central supervisor further analyzed that if there is a situation where the increase and decrease in the gas consumption of households basically offset each other, even if the large screen shows that the total intake gas volume is balanced with the gas consumption in the community, there may still be potential safety hazards and problematic gas meters in (16). However, by checking the households with low gas consumption, it is possible to effectively discover potential safety hazards and inaccurate gas meters in the gas consumption of the community. Therefore, the central supervisor combined the above two query commands into a batch command, constructed a temporary patch for the system for temporary business application, and applied it to other communities in turn, solving similar potential safety hazards and problematic gas meters existing in other communities in the city. Among them, this case only shows that the method provided in this example can save and reuse commands, that is, carry out business applications. Simple quasi-natural language query commands can be combined into complex query commands to complete complex data screening tasks, which is one of the great application potentials of the method technology provided in this example. The method provided in this example is not necessary, and users can make a choice according to the specific situation.
[0206] (17)Provide a basis for system upgrade. After the information system transformation and upgrade of the city's gas management information center was approved, the new technology methods for investigating potential safety hazards in gas use and investigating inaccurate gas meters discovered above were incorporated into the system as one of the system upgrade functions, greatly enhancing the system's functions. Based on the method provided in this example, it is not necessary to incorporate it into the system upgrade. This case only shows that based on the method provided in this example, it is possible to reveal the essence of data variability, conduct data exploration research from multiple directions, and provide an important theoretical basis for system development and upgrade; it can stimulate the initiative of data managers, discover the potential value of data and expose more potential safety hazards, and promptly realize their data observation inspiration in research and put innovative methods into implementation in a timely manner; before the system upgrade, a temporary data analysis patch for the system can be constructed to quickly enhance the system service function, and reserve as much time and space as possible for research demonstration, application approval, construction implementation, etc. for system iterative upgrade.
[0207] (20)Advantages of the quasi-natural language professional editor. Quasi-natural language query commands screen data in a data table with a logic close to natural language, greatly reducing the professional technical threshold required for constructing queries. At the same time, it perfectly reflects the user's query needs and completes the query with the accuracy similar to SQL queries. Although quasi-natural language commands are not as concise as standard SQL, they are relatively more recognizable for ordinary users. Through the assisted editing technology of the professional editor, the construction speed of quasi-natural language query commands can be effectively accelerated, and different parts of the command can be classified and rendered in the editing area to clarify the command structure, effectively improving the user experience. Based on the professional editor, the advantages of quasi-natural language queries can be exerted, and their deficiencies can be made up for.
[0208] In this embodiment, a data table data query and filtering device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" may be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0209] This embodiment provides a data table data query and filtering device for a control system based on a quasi-natural language architecture. The quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command. As Figure 10 shown, the device includes:
[0210] An acquisition module 501, configured to acquire an initial query command text.
[0211] An inspection and construction module 502, configured to perform syntax compliance inspection on the initial query command text and construct a first instantiated query data model by using the quasi-natural language architecture.
[0212] A processing and construction module 503, configured to construct an instantiated filtering data model according to the first instantiated query data model through processing by a preset first mapping relationship.
[0213] A construction module 504, configured to construct a data table virtual filter according to the instantiated filtering data model, a data table feature set, and a computing power resource set.
[0214] A query and filtering module 505, configured to perform query and filtering on the data table data by using the data table virtual filter to obtain a query and filtering result of the data table data.
[0215] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and will not be repeated here.
[0216] The data table data query and filtering device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0217] This embodiment of the present invention further provides a computer device having the above-mentioned Figure 10 shown data table data query and filtering device.
[0218] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. AsFigure 11 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 11 In FIG., a processor 10 is taken as an example.
[0219] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a general array logic, or any combination thereof.
[0220] Among them, the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiments.
[0221] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0222] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memories.
[0223] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
[0224] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0225] A part of the present invention can be applied as a computer program product, such as computer program instructions, which can, when executed by a computer, call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0226] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for querying and filtering data in a data table, characterized in that, A control system for a quasi-natural language architecture, where the quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command; the method includes: Obtain an initial query command text; Use the quasi-natural language architecture to perform syntax compliance checking on the initial query command text and construct a first instantiated query data model; According to the first instantiated query data model, through processing of a preset first mapping relationship, construct an instantiated filtering data model, where the preset first mapping relationship is used to represent the mapping relationship between the query data model and the filtering data model; According to the instantiated filtering data model, a data table feature set, and a computing power resource set, construct a data table virtual filter; Use the data table virtual filter to perform query screening on the data table data to obtain a query screening result of the data table data.
2. The method according to claim 1, wherein Using the quasi-natural language architecture to perform syntax compliance checking on the initial query command text and construct a first instantiated query data model includes: Decompose the initial query command text to obtain a preset number of first query command clauses; Use the quasi-natural language architecture to perform syntax compliance checking and correction on each first query command clause until the syntax of each first query command clause is compliant, obtaining a plurality of keyword sequences, a plurality of natural language action objects, and a target query command paradigm; Input the plurality of keyword sequences, the plurality of natural language action objects, and the target query command paradigm into a preset query data model to obtain the first instantiated query data model, where the storage space of the preset query data model is greater than or equal to the preset number.
3. The method according to claim 2, characterized in that, Using the quasi-natural language architecture to perform syntax compliance checking and correction on each first query command clause until the syntax of each first query command clause is compliant, obtaining a plurality of keyword sequences, a plurality of natural language action objects, and a target query command paradigm includes: Use the quasi-natural language architecture to separately check the syntax and word usage compliance of each first query command clause to obtain multiple non-compliant second query command clauses; Use the quasi-natural language architecture to analyze the combination characteristics between different first query command clauses and determine an initial query command paradigm; Use the initial query command paradigm to perform compliance checking on the matching relationship of each first query command clause to obtain multiple non-compliant third query command clauses; After correcting the multiple second query command clauses and the multiple third query command clauses and generating a new initial query command text, return to the step of decomposing the initial query command text, and repeatedly perform compliance checking iteratively until the syntax of each first query command clause is compliant, obtaining the plurality of keyword sequences, the plurality of natural language action objects, and the target query command paradigm.
4. The method according to claim 1, characterized in that According to the first instantiated query data model, through processing of a preset first mapping relationship, construct an instantiated filtering data model, including: Extract query information from the first instantiated query data model and construct a filtered data model; Translate the semantic data of the filtered data model according to the preset first mapping relationship to obtain the instantiated filtered data model.
5. The method according to claim 1, wherein Construct a data table virtual filter according to the instantiated filtered data model, the data table feature set, and the computing power resource set, including: Judge whether the conversion mode adopts the array mode according to the instantiated filtered data model, the data table feature set, and the computing power resource set; When the conversion mode is the array mode, convert the instantiated filtered data model into an array calculation process according to the preset second mapping relationship, where the preset second mapping relationship is used to represent the mapping relationship between the query paradigm and the array calculation function; Construct the data table virtual filter according to the array calculation process.
6. The method according to claim 5, characterized in that The method further includes: When the conversion mode is not the array mode, convert the instantiated filtered data model into a database standard SQL query process according to the preset third mapping relationship, where the preset third mapping relationship is used to represent the mapping relationship between the query paradigm and the database standard SQL command; Construct the data table virtual filter according to the database standard SQL query process.
7. A data table data query and screening device, characterized in that, For a control system based on a quasi-natural language architecture, the quasi-natural language architecture consists of a query keyword set, a data table name set, a query command paradigm set, and a query command; the device includes: An acquisition module for acquiring an initial query command text; An inspection and construction module for performing syntax compliance inspection on the initial query command text using the quasi-natural language architecture and constructing a first instantiated query data model; A processing and construction module for constructing an instantiated filtered data model according to the first instantiated query data model through the processing of the preset first mapping relationship, where the preset first mapping relationship is used to represent the mapping relationship between the query data model and the filtered data model; A construction module for constructing a data table virtual filter according to the instantiated filtered data model, the data table feature set, and the computing power resource set; A query and screening module for querying and screening the data table data using the data table virtual filter to obtain a query and screening result of the data table data.
8. A computer device, characterized in that, Including: A memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the data table data query and screening method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the data table data query and screening method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, Including computer instructions, and the computer instructions are used to cause a computer to execute the data table data query and screening method according to any one of claims 1 to 6.