Data query method, device, electronic device and medium based on artificial intelligence

By identifying and processing natural language query content input by users, identifying necessary query conditions and expanding the cropping business plane, the problem of data illusion and interpretation difficulties in the artificial intelligence data query system is solved, and the accuracy and efficiency of data query are improved.

CN119783822APending Publication Date: 2025-04-08WINNING HEALTH TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411868366.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When processing natural language queries from non-professional users, data queries based on artificial intelligence are prone to data hallucinations and difficult to interpret results.

Method used

By obtaining the query content entered by the user, identifying whether the necessary query conditions exist, and inputting the predefined data field names and prompt words into the AI ​​system to identify the target field and the main service plane. The main business plane is expanded and cropped based on the target field and business model, and finally data query and result aggregation is carried out.

Benefits of technology

It improves the accuracy and efficiency of data queries, so that users who do not have professional data queries can also obtain the required data independently, reducing the problem of data illusion and difficulty in interpreting results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783822A_ABST
    Figure CN119783822A_ABST
Patent Text Reader

Abstract

The present invention provides a data query method, device, electronic device and medium based on artificial intelligence, including: obtaining the query content input by the user, and inputting the query content into the AI ​​system, identifying whether there is a necessary query condition in the query content; if so, inputting the predefined data field name, the prompt word corresponding to the field and the query content into the AI ​​system, identifying the target field corresponding to the query content and determining the main business plane of the query; expanding the main business plane based on the target field and the predefined business model, and cutting the expanded main business plane; performing data query based on the cut main business plane, and aggregating the queried data results to obtain the query results corresponding to the query content. The present invention improves the accuracy of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based data query method, device, electronic equipment and medium. Background Art

[0002] Currently, when performing data queries based on artificial intelligence (AI) systems, users who do not have professional data query knowledge usually use business vocabulary and terminology in natural language to describe data, which can cause hallucinations when the artificial intelligence (AI) system acquires data and the output results are difficult to explain. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a data query method, device, electronic device and medium based on artificial intelligence to improve the accuracy of data query.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] In a first aspect, the present invention provides a data query method based on artificial intelligence, comprising: obtaining query content input by a user, and inputting the query content into an AI system, identifying whether necessary query conditions exist in the query content; if so, inputting a predefined data field name, a prompt word corresponding to the field, and the query content into the AI ​​system, identifying a target field corresponding to the query content and determining a main business plane for the query; expanding the main business plane based on the target field and a predefined business model, and trimming the expanded main business plane; wherein the business model includes one or more business planes, the business plane is multi-layered, each layer includes at least one business plane fragment, each business plane fragment includes multiple data fields, and the business plane fragment of the lower layer is expanded based on the associated fields existing in the upper layer; performing data query based on the trimmed main business plane, and aggregating the queried data results to obtain query results corresponding to the query content.

[0006] Optionally, the query content is input into the AI ​​system to identify whether there are necessary query conditions in the query content, including: generating prompt words for the AI ​​system according to the pre-set necessary query conditions; judging whether there are necessary query conditions in the query content according to the prompt words; if not, feeding back prompt information to the user through the AI ​​system to prompt the user to input query conditions; obtaining the query conditions input by the user, and inputting the query conditions and query content into the AI ​​system to identify whether there are necessary query conditions in the query conditions and query content; if not, repeating the aforementioned steps to feed back prompt information to the user through the AI ​​system to prompt the user to input query conditions.

[0007] Optionally, the main business plane is expanded based on the target field and a predefined business model, and the expanded main business plane is trimmed, including: obtaining a first business plane fragment corresponding to the target field; determining a second business plane fragment corresponding to the target field according to an associated field on which the first business plane fragment depends; recursively searching for a third business plane fragment corresponding to the target field according to an associated field on which the second business plane fragment depends; determining a sub-business plane and a parent business plane based on a relationship between the business plane fragment on which the target field depends and the main business plane; wherein the business plane fragment on which the target field depends includes: a first business plane fragment, a second business plane fragment, and a third business plane fragment; the main business plane is expanded based on the sub-business plane and the parent business plane, and the expanded main business plane is trimmed.

[0008] Optionally, the main business plane is expanded based on the sub-business plane and the parent business plane, including: according to the hierarchy of the business plane fragments where all data fields associated with the sub-business plane and the parent business plane are located, all business plane fragments of the parent business plane are added to the main business plane, and all business plane fragments of the sub-business plane are added to the main business plane, and the data fields of the sub-business plane are identified for aggregation.

[0009] Optionally, the expanded main business plane is trimmed, including: removing business plane segments not depended on by the target field in the main business plane, and removing data fields not depended on by the target field in the business plane segments depended on by the target field.

[0010] Optionally, data query is performed based on the cropped main business plane, and the queried data results are aggregated to obtain query results corresponding to the query content, including: according to the level of the cropped main business plane, data query is performed layer by layer starting from the first layer of the cropped main business plane to obtain data results of the corresponding business plane fragment; according to the target field, corresponding data results are obtained from the data results of the business plane fragment for aggregation to obtain query results corresponding to the query content.

[0011] Optionally, the method further includes: determining a business plane segment according to an association relationship between data fields of the business data; and generating a business plane according to the association fields on which the business plane segments depend.

[0012] In a second aspect, the present invention provides a data query device based on artificial intelligence, comprising: a query condition determination module, used to obtain the query content input by the user, and input the query content into the AI ​​system to identify whether there are necessary query conditions in the query content; a field determination module, used to input the pre-defined data field name, the prompt word corresponding to the field and the query content into the AI ​​system if it exists, identify the target field corresponding to the query content and determine the main business plane of the query; a business plane extension module, used to expand the main business plane based on the target field and a pre-defined business model, and trim the extended main business plane; wherein the business model includes one or more business planes, the business plane is multi-layer, each layer includes at least one business plane fragment, each business plane fragment includes multiple data fields, and the business plane fragment of the lower layer is expanded based on the associated fields existing in the upper layer; a query module, used to perform data query based on the trimmed main business plane, and aggregate the queried data results to obtain the query results corresponding to the query content.

[0013] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of any one of the methods provided in the first aspect above.

[0014] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods provided in the first aspect are executed.

[0015] The present invention brings the following beneficial effects:

[0016] The data query method, device, electronic device and medium based on artificial intelligence provided by the present invention first obtain the query content input by the user, and input the query content into the AI ​​system to identify whether there are necessary query conditions in the query content; if there are, the predefined data field name, the prompt word corresponding to the field and the query content are input into the AI ​​system to identify the target field corresponding to the query content and determine the main business plane of the query; then the main business plane is expanded based on the target field and the predefined business model, and the expanded main business plane is clipped; finally, data query is performed based on the clipped main business plane, and the queried data results are aggregated to obtain the query results corresponding to the query content. In the above data query method, the query content input by the user can be identified by AI, and the target field, query condition and main business plane to be queried can be determined, thereby simplifying the data description process, enabling personnel who do not have professional data query knowledge to independently obtain the required data, and improving the availability of data; in addition, in the above method, the main business plane of the query can be expanded and clipped by the predefined business model, and data query is performed based on the clipped main business plane, and the queried data is aggregated to obtain the final query result, thereby improving the accuracy and efficiency of data query.

[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the preferred embodiments are specifically mentioned below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic diagram of a service plane provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of a sales business plane provided by an embodiment of the present invention;

[0022] Figure 3A flowchart of a data query method based on artificial intelligence provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of an artificial intelligence-based data query device provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] At present, when performing data queries based on artificial intelligence (AI) systems, professionals are required to write query statements, business departments need to report the fields to be obtained in advance, and wait for professionals to reply to data or report programs. Field changes require program updates, which is inflexible. Secondly, the AI ​​system needs to learn the structure based on the data dictionary and then generate statements autonomously. When the database structure itself cannot clearly indicate the direct relationship between the data, it is difficult for the AI ​​system to learn, the generated statements are poorly targeted, and it is difficult to verify the logical correctness of the statements generated by AI. Finally, AI needs to learn the data content and directly answer the data. This method is difficult to cope with the incremental data that is constantly generated, and it is difficult to manually annotate and adjust the data relationship. It is difficult to strictly verify the accuracy of the generated data, and it is easy to have AI hallucinations and difficult to explain the output results.

[0027] Based on this, an artificial intelligence-based data query method, device, electronic device and medium provided in an embodiment of the present invention can improve the accuracy of data query.

[0028] To facilitate understanding of this embodiment, the business model disclosed in the embodiment of the present invention is first introduced. The business model includes one or more business planes. The business plane is multi-layered, each layer includes at least one business plane fragment, each business plane fragment includes multiple data fields, and the business plane fragment of the lower layer is expanded based on the associated fields existing in the upper layer. Specifically, there may be a one-to-one or many-to-one relationship between the data fields of the business plane fragments. The business plane fragments of the lower layer can be expanded based on the associated fields already existing in the upper layer, thereby supporting a more complex data item structure. The construction of the business model includes the following steps:

[0029] (1) Define business plane segments based on the association relationship of business data.

[0030] In one implementation, based on the association relationship of business data, data fields with business relevance are identified as business plane fragments, and the data source for obtaining this group of data and the associated fields relied on for acquisition are identified. In specific implementation, business plane fragments can be defined based on existing reports in the business system, or any data that is considered to be business-related. For example, a business plane fragment can be a record table of a specific event in a business process, such as a sales operation. A warehouse outbound event table in a warehouse management system can be used as a business plane fragment in the sales business plane. Among them, the data field that constitutes the business plane fragment is a value, not a group of values.

[0031] In an embodiment of the present invention, a data field with business relevance (i.e., an associated field) can be an identifier of a business process in different systems. For example: in an order system, for a goods sales operation, there is a corresponding warehouse outbound operation. The warehouse management system and the sales system are two independent systems, but for each outbound operation generated by sales, the corresponding sales order number is recorded in the warehouse management system. At this time, for the goods sales business, the first layer is the sales-related records, including the sales order number, and the second layer is the outbound information. The associated field is the sales order number of the sales record and the sales order number of the outbound record of the warehouse management system. At this time, the sales record is expanded to the inbound and outbound systems and the related fields become queryable and statistically available.

[0032] In this embodiment, after determining the business plane, it is also necessary to identify the name, data type and supported aggregation method of the data field contained in the business plane segment. In specific implementation, the name and data type of the data field are assigned by the original data source, for example, a sales record table of a sales system, the data field for recording sales events is the name and data type.

[0033] The aggregation method supported by a field means that some fields can be summarized. For example: Sales business plane: The first-level business plane fragments come from the sales system, including: sales serial number, sales store code, sales time, product code, sales amount; The second-level business plane fragments come from the inventory system inbound and outbound table, including: outbound serial number, sales code, product code, product inbound price; Store business plane: Source ERP system: including: store code, store name. When you want to query the total sales of each store and the average inbound price of the goods sold, you need to indicate that the sales amount in the sales business plane can be summed (aggregated), the product inbound price in the sales business plane can be averaged (aggregated), and the product inbound price can also be marked as supporting summation (aggregation). The aggregation method mainly depends on the specific business. For example: You cannot sum or average all numbers, but you can count the transaction sequence number (i.e. Count in SQL), and you can count (aggregate) the transaction sequence number to get the number of sales in the store.

[0034] Field aggregation is the key to business identification by the AI ​​system. The same field may have multiple business terms through different aggregation methods. For example, total revenue is the sum of revenue, and average revenue is the avg of revenue field. The basis is the sales amount field of the sales business plane.

[0035] (2) Define the business plane based on the association relationship between business plane fragments.

[0036] In one implementation, the association between business planes is set by code or configuration. For example, the sales business plane and the store business plane can be associated by the store code shared by the two business planes. This association is determined based on the specific business or can be determined subjectively. Figure 1 As shown, a group of related business plane fragments are hierarchically constructed according to the relationship on which the data is obtained. Business plane fragments without dependent fields (i.e., associated fields) are in the first layer, and the second layer can rely on the fields given by the business plane fragments in the first layer. Multiple business plane fragments can be set in the same layer, and the same business plane fragment can exist in different business planes. The associated fields of the upper-level business plane fragment can only belong to any one or a group of fields in any business plane fragment in all upper layers. Figure 1 As shown, the data of the lower layer can be clearly queried through the upper layer business plane fragment. The lower layer business plane fragment can rely on the fields of the upper layer, but not only on the fields of the immediate upper layer, nor on only one field, but can rely on multiple fields. Usually, when obtaining the lower layer data, all the upper layer data is in a known state.

[0037] In the embodiment of the present invention, a group of associated service plane fragments can describe a group of associated events. Figure 2 The schematic diagram of a sales business plane shown in the figure can be associated with the sales system, the warehouse management system, the procurement system and the approval system. The association relationship of each subsystem is: the sales system is used as the first layer of the sales business plane, the warehouse management system is used as the second layer of the sales business plane, the 1-2 layers are associated through the sales serial number, the third layer procurement system is associated with the second layer through the item number, and the fourth layer approval system is associated with the procurement system through the purchase application number.

[0038] like Figure 2 As shown, it can be understood that a virtual data table including the following fields is assembled: sales serial number, store code, sales time, salesperson, sales amount, inbound and outbound serial number, outbound time, goods code, warehouse shelf number, purchase serial number, goods code, purchase application number, purchase applicant, approval serial number, purchase application sequence number, approver, and approval time. Based on this, any field in this virtual table can be queried and summarized in the embodiment of the present invention.

[0039] (3) Define aliases based on the nouns of the data fields in the data query usage scenario and adjust the recognition rate through the AI ​​system.

[0040] In one implementation, after determining the business plane, the query conditions and commonly used query conditions that must be clear in the query of the data fields of this group of business planes are defined, and the description of a field that may be involved in the business is added to the business description word array of the field.

[0041] In the embodiment of the present invention, the calculation method of the influence of a service description word on the overall recognition rate is as follows:

[0042] Before adding the business description word T to the data field F, the number of correctly identified fields in all query conditions is S1, and the number of incorrectly identified fields is E1. After adding the business description word T to the data field F, the number of correctly identified fields in all query conditions is S2, and the number of incorrectly identified fields is E2. The degree of influence of the business description word on the overall recognition rate = (S2-S1) / (E2-E1).

[0043] By adjusting the service description words and calculating the influence of each service description word on the overall recognition rate, a group of service description words with the highest correct recognition rate for each field is found. The same service field can contain multiple service description words.

[0044] In the specific implementation, for the "salesperson" field, the query personnel of the report may write: salesperson's name, salesperson's name, consignee's name, consignee, etc., but these business descriptors all identify the same field "salesperson", that is, a business field has many standardized and non-standard aliases. For example, the "amount" field can refer to the selling (sales) amount, purchase amount, etc. depending on the context. When summarized according to the sales store, the "amount" field refers to the sales amount summary (aggregation), that is, the same field may have different meanings in related contexts.

[0045] Based on this, to correctly identify the fields input by the queryer, the AI ​​system needs to identify them based on the alias (i.e., business description words) and context, and directly output detailed values ​​for specific fields, or identify them by summing operations such as summing, averaging, and counting. In the embodiment of the present invention, by defining aliases for nouns in the data query usage scenario and adjusting the recognition rate through the AI ​​system, the AI ​​system can correctly identify the data fields that the user wants to query during data query, thereby improving the accuracy of the query.

[0046] Based on the above business model, a data query method based on artificial intelligence provided by an embodiment of the present invention is described in detail below. The method can be executed by an electronic device, such as a smart phone, a computer, a tablet computer, etc. Figure 3 The flowchart of a data query method based on artificial intelligence is shown, which illustrates that the method mainly includes the following steps S301 to S304:

[0047] Step S301: Obtain the query content input by the user, and input the query content into the AI ​​system to identify whether the query content contains necessary query conditions.

[0048] In one embodiment, a user initiates a data query, enters the query content, and uses the AI ​​system to identify whether there are necessary query conditions in the query content, wherein the necessary query conditions can be pre-set according to specific business needs. For example, in a sales business scenario, a date range can be a set of necessary query conditions.

[0049] Step S302: If it exists, the predefined data field name, the prompt word corresponding to the field and the query content are input into the AI ​​system to identify the target field corresponding to the query content and determine the main business plane of the query.

[0050] In one implementation, if the query content contains necessary query conditions, the AI ​​system can identify the target field corresponding to the query content and determine the main business plane of the query based on the predefined data field name, the prompt word corresponding to the field, and the query content. Specifically, after identifying the necessary query conditions required to complete the query, all predefined data field names and prompt words of the corresponding fields and all the aforementioned description information entered by the user are sent to the AI ​​system to allow it to identify the target field corresponding to the content entered by the user and determine the main business plane to be queried by the target field.

[0051] In the specific implementation, the business terms in the query content may be different from the field names defined in the business plane, which is not completely accurate, and there are problems such as non-standard terms and typos. Based on this, in this implementation, standard data field names and corresponding prompt words are set in advance for different business planes, so that the AI ​​system can correctly identify the corresponding target fields through appropriate prompt words.

[0052] When entering the query content, the user can upload an Excel with only a header, read the Excel header, and read the fields in the header as the filtering conditions for the query data. For example: the first row in Excel contains two groups of text, "Department Name" and "Outpatient Number of Patients". The AI ​​system can identify the query content "Department Name" and "Outpatient Number of Patients" based on the standard data field names and corresponding prompt words, which are for the "Department Name" and "Outpatient Number of Patients" fields in the department business plane, that is, the target fields are "Department Name" and "Outpatient Number of Patients", and the main business plane for the query is the department business plane.

[0053] Step S303: Expand the main business plane based on the target field and the predefined business model, and cut the expanded main business plane.

[0054] The business model includes one or more business planes, the business plane is multi-layered, each layer includes at least one business plane fragment, each business plane fragment includes multiple data fields, and the business plane fragment of the lower layer is expanded based on the associated fields existing in the upper layer.

[0055] In one implementation, after the AI ​​system identifies the main business plane and the target field, the main business plane can be expanded according to the association between each business plane and the target field in the predefined business model. The expanded main business plane may include business plane segments and data fields that are not associated with the target field, and the business plane segments and data fields that are not associated can be trimmed.

[0056] Step S304: perform data query based on the clipped main business plane, and aggregate the queried data results to obtain query results corresponding to the query content.

[0057] In one implementation, after obtaining the trimmed main business plane, a query may be performed starting from the first layer according to the hierarchy of the main business plane, and the queried data results may be aggregated to obtain a query result corresponding to the query content.

[0058] The above-mentioned artificial intelligence-based data query method provided in the embodiment of the present invention can identify the query content input by the user through AI, determine the target field, query conditions and main business plane to be queried, etc., thereby simplifying the data description process, and enabling personnel who do not have professional data query knowledge to independently obtain the required data, thereby improving the availability of data; in addition, in the above-mentioned method, the main business plane of the query can be expanded and trimmed through a pre-defined business model, and data query can be performed based on the trimmed main business plane, and the queried data can be aggregated to obtain the final query result, thereby improving the accuracy and efficiency of data query.

[0059] In one embodiment, for the aforementioned step S301, that is, when inputting the query content into the AI ​​system and identifying whether there are necessary query conditions in the query content, the following methods may be adopted, including but not limited to: first, generating prompt words for the AI ​​system according to the pre-set necessary query conditions; judging whether there are necessary query conditions in the query content according to the prompt words; if not, feeding back prompt information to the user through the AI ​​system to prompt the user to input the query conditions; then, obtaining the query conditions input by the user, and inputting the query conditions and the query content into the AI ​​system to identify whether there are necessary query conditions in the query conditions and the query content; if not, repeating the aforementioned steps to feed back prompt information to the user through the AI ​​system to prompt the user to input the query conditions.

[0060] In the specific implementation, all query contents are input into the AI ​​system, and prompt words are generated according to the necessary query conditions in the business plane, requiring the AI ​​system to determine whether there is a corresponding description in the input query content, that is, whether there are necessary query conditions.

[0061] When the result returned by the AI ​​system indicates that the necessary query conditions required for the query do not exist in the input query content, prompt information is fed back to the user based on the necessary query conditions required for the query, requiring the user to clarify the query conditions.

[0062] After the user re-enters the query conditions, the query conditions entered by the user are combined with all the query content previously entered by the user and input into the AI ​​system, so that the AI ​​system can identify whether the necessary query conditions are clearly defined in all the information entered by the user. If the necessary query conditions still do not exist, the previous steps are repeated to continue to provide feedback to the user and require the user to clarify the query conditions until the AI ​​system can identify the necessary query conditions.

[0063] In one implementation, for the aforementioned step S303, that is, when the main business plane is expanded based on the target field and the predefined business model, and the expanded main business plane is tailored, the following methods may be adopted, including but not limited to the following steps 1 to 5:

[0064] Step 1: Obtain the first service plane fragment corresponding to the target field.

[0065] In specific implementation, all target fields directly involved in the query are identified, and the corresponding directly involved business plane fragments, that is, the first business plane fragments, are identified according to the directly involved target fields.

[0066] Step 2: Determine the second service plane segment corresponding to the target field according to the associated field on which the first service plane segment depends.

[0067] In a specific implementation, all indirectly dependent service plane segments of the target field, ie, the second service plane segments, are identified according to the associated fields on which the directly involved first service plane segment depends.

[0068] Step 3: recursively search for the third service plane fragment corresponding to the target field according to the associated field on which the second service plane fragment depends.

[0069] In a specific implementation, according to the associated field on which the indirectly dependent second service plane fragment depends, other indirectly dependent service plane fragments, that is, the third service plane fragment, are recursively searched.

[0070] Step 4: Based on the relationship between the business plane fragment on which the target field depends and the main business plane, determine the sub-business plane and the parent business plane.

[0071] In specific implementation, the first business plane fragment, the second business plane fragment and the third business plane fragment are uniformly determined as the business plane fragments on which the target field depends, and the sub-business plane and the parent business plane are determined according to the relationship between the business plane fragment on which the target field depends and the main business plane. Specifically, when multiple rows of data in the associated B business plane can be determined based on the fields in a row of data in the A business plane, it means that the A business plane is the parent business plane of the B business plane, and the B business plane is the sub-business plane of the A business plane. The parent-child business plane relationship is transitive, that is, if A is the parent business plane of B, and B is the parent business plane of C, then A is the parent business plane of C. The sub-business plane relationship is also transitive.

[0072] Step 5: Expand the main business plane based on the sub-business plane and the parent business plane, and trim the expanded main business plane.

[0073] In specific implementation, when the main business plane is expanded based on the sub-business plane and the parent business plane, the following methods can be used, including but not limited to: according to the hierarchy of the business plane fragments where all data fields associated with the sub-business plane and the parent business plane are located, all business plane fragments of the parent business plane are added to the main business plane, and all business plane fragments of the sub-business plane are added to the main business plane, and the data fields of the sub-business plane are identified for aggregation.

[0074] Specifically, according to the next higher level of the highest level of the business plane fragment hierarchy where all fields associated with the parent business plane and the child business plane are located, all business plane fragments involved in the parent business plane are added to the main business plane. For example, if field A associated with the parent business plane and the child business plane is at level 3 in the business plane fragment of the parent business plane and at level 2 in the business plane fragment of the parent business plane, then the business plane fragments of levels 1 and 2 of the parent business plane are added to the main business plane.

[0075] According to the highest level of the business plane fragment hierarchy where all associated fields associated with the sub-business planes are located, all business plane fragments involved in the sub-business planes are added to the main business plane, and the data fields of all sub-business planes are identified for aggregation. For example, if the associated field B between sub-business plane 1 and sub-business plane 2 is at the second level in the business plane fragment of sub-business plane 1 and at the third level in the business plane fragment of sub-business plane 2, the business plane fragment of the first level of sub-business plane 1 is added to the main business plane, the business plane fragments of the first and second levels of sub-business plane 2 are added to the main business plane, and the data fields of sub-business plane 1 and sub-business plane 2 are aggregated.

[0076] In specific implementation, when the expanded main business plane is trimmed, the following methods may be used, including but not limited to: removing the business plane segments in the main business plane that are not relied upon by the target field, and removing the data fields in the business plane segments relied upon by the target field that are not relied upon by the target field.

[0077] Remove all business plane fragments that are not directly or indirectly dependent from the main business plane, and remove all fields that are not directly or indirectly dependent from the business plane fragments. Specifically, the expanded business plane may include business plane fragments that have no dependency on the target field to be queried, which can be removed; at the same time, the business plane fragments that the target field depends on may include data fields that have no association with the target field, which can remove data fields of this type. The pruned main business plane only includes data fields associated with the target field, thereby improving data query efficiency.

[0078] In one embodiment, for the aforementioned step S305, that is, when performing data query based on the cropped main business plane and aggregating the queried data results to obtain query results corresponding to the query content, methods including but not limited to the following can be adopted: first, according to the level of the cropped main business plane, data query is performed layer by layer starting from the first layer of the cropped main business plane to obtain data results corresponding to the business plane fragment; then, according to the target field, the corresponding data results are obtained from the data results of the business plane fragment for aggregation to obtain query results corresponding to the query content.

[0079] In the specific implementation, according to the level of the clipped main business plane, the query starts from the first layer and stores the data results of the corresponding business plane fragments. When querying the high-level business plane fragments, all the data results of the low-level business plane fragment queries can be obtained. For the results directly required by the query, they are obtained from the query results of the business plane fragments according to the target field to obtain the final query results.

[0080] For ease of understanding, a specific embodiment is provided in the embodiments of the present invention. Taking the example of a user querying the amount of maintenance expenses generated by goods sold by various stores within a period of time, the business planes involved include: the sales business plane (see the aforementioned embodiment), the maintenance business plane (including the maintenance information of the equipment sold), including the following fields: maintenance business serial number, goods code (associated with the goods code in the sales business plane), maintenance time and maintenance cost amount.

[0081] When users query the amount of repair expenses generated by goods sold by various stores within a period of time, they need to associate the above two business planes through the goods code. At this time, the maintenance expense amount needs to be summarized (aggregated) and extended to the sales business plane, that is, the sales business plane is expanded from the original 16 independent fields to 17 independent fields, and a virtual new table is generated. This table contains all the relevant fields, including the filter field "sales time", the grouping field "store name", and the aggregation field "repair expense amount". The parent-child plane expansion allows the fields in multiple business planes to be integrated into a report required by customers.

[0082] The virtual new table generated after expansion has 17 fields, but only 3 fields are needed to complete the business operation. The remaining 14 fields are meaningless and do not affect the final result generation. According to the dependency relationship, the sales business plane only needs to query the second layer to obtain the cargo code field associated with the maintenance record table. All fields in the third and fourth layers are irrelevant to the query results. For query efficiency considerations, it is not necessary to query these unused fields, that is, query pruning is performed. Finally, data query is performed based on the pruned business plane to obtain the final data query result.

[0083] In one embodiment, the method further includes: first determining the business plane segments according to the association relationship between the data fields of the business data; and then generating the business plane according to the association fields that the business plane segments depend on. For details, please refer to the specific method of constructing the business model mentioned above, which will not be repeated here.

[0084] The above method provided by the embodiment of the present invention uses an AI system to identify business vocabulary and terms in natural language used in daily life, thereby simplifying the data description process, allowing personnel who do not have professional data query knowledge to independently obtain the required data, while avoiding the data illusion phenomenon and difficulty in interpreting results in traditional methods. In addition, the prompt word optimization method provided by the present invention, which can be used without professional data training, can further improve the understanding and response capabilities of the AI ​​system.

[0085] More specifically, in the above method provided by the present invention, when the information input by the user is not sufficient to clarify all the query conditions, the AI ​​system can help the user clarify his needs by further asking questions to ensure the accuracy of the query results. The business model representation method adopted by the present invention is composed of one or more business planes, each of which contains several business plane fragments. There is a one-to-one or many-to-one relationship between these fragments. The lower-level business plane fragments can be expanded based on the existing associated fields at the higher level to support more complex data item structures, thereby reducing the difficulty of autonomous data acquisition, allowing specific business position personnel to autonomously obtain corresponding data, improving the availability of data, and reducing the workload of information department and data operation and maintenance personnel.

[0086] For the data query method based on artificial intelligence provided in the above embodiment, the embodiment of the present invention also provides a data query device based on artificial intelligence, see Figure 4 The schematic diagram of the structure of a data query device based on artificial intelligence is shown, indicating that the device mainly includes:

[0087] The query condition determination module 401 is used to obtain the query content input by the user, input the query content into the AI ​​system, and identify whether there is a necessary query condition in the query content;

[0088] A field determination module 402 is used to input the predefined data field name, the prompt word corresponding to the field and the query content into the AI ​​system if it exists, identify the target field corresponding to the query content and determine the main business plane of the query;

[0089] The business plane extension module 403 is used to extend the main business plane based on the target field and the predefined business model, and to cut the extended main business plane; wherein the business model includes one or more business planes, the business plane is multi-layered, each layer includes at least one business plane segment, each business plane segment includes multiple data fields, and the business plane segment of the lower layer is extended based on the associated fields existing in the upper layer;

[0090] The query module 404 is used to perform data query based on the clipped main business plane, and aggregate the queried data results to obtain query results corresponding to the query content.

[0091] The above-mentioned artificial intelligence-based data query device provided in the embodiment of the present invention can identify the query content input by the user through AI, determine the target field, query conditions and main business plane to be queried, etc., thereby simplifying the data description process, enabling personnel who do not have professional data query knowledge to independently obtain the required data, and improving the availability of data; in addition, the above-mentioned device can expand and trim the main business plane of the query through a pre-defined business model, and perform data query based on the trimmed main business plane, and aggregate the queried data to obtain the final query result, thereby improving the accuracy and efficiency of data query.

[0092] It should be noted that the implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0093] An embodiment of the present invention further provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above implementation methods.

[0094] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected via the bus 52; the processor 50 is used to execute an executable module stored in the memory 51, such as a computer program.

[0095] The memory 51 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0096] The bus 52 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0097] Among them, the memory 51 is used to store programs, and the processor 50 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 50 or implemented by the processor 50.

[0098] The processor 50 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 50. The above processor 50 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 51, and the processor 50 reads the information in the memory 51 and completes the steps of the above method in combination with its hardware.

[0099] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.

[0100] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0101] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A data query method based on artificial intelligence, characterized in that: include: Obtain the query content input by the user, and input the query content into the AI ​​system to identify whether the query content contains necessary query conditions; If it exists, the predefined data field name, the prompt word corresponding to the field and the query content are input into the AI ​​system, the target field corresponding to the query content is identified and the main business plane of the query is determined; The main business plane is extended based on the target field and a predefined business model, and the extended main business plane is trimmed; wherein the business model includes one or more business planes, the business plane is multi-layered, each layer includes at least one business plane fragment, each business plane fragment includes multiple data fields, and the business plane fragment of the lower layer is extended based on the associated fields existing in the upper layer; Data query is performed based on the clipped main business plane, and the queried data results are aggregated to obtain query results corresponding to the query content.

2. The method according to claim 1, characterized in that Input the query content into the AI ​​system and identify whether the query content contains necessary query conditions, including: Generate prompt words for the AI ​​system based on the necessary pre-set query conditions; Determining whether necessary query conditions exist in the query content according to the prompt word; If not, the AI ​​system feeds back prompt information to the user to prompt the user to input query conditions; Acquire the query condition input by the user, and input the query condition and the query content into the AI ​​system, and identify whether there is a necessary query condition in the query condition and the query content; If not, repeat the above steps to feed back prompt information to the user through the AI ​​system to prompt the user to input query conditions.

3. The method according to claim 1, characterized in that The main business plane is extended based on the target field and a predefined business model, and the extended main business plane is tailored, including: Obtaining a first service plane fragment corresponding to the target field; Determining a second service plane fragment corresponding to the target field according to an associated field on which the first service plane fragment depends; recursively searching for a third service plane fragment corresponding to the target field according to the associated field on which the second service plane fragment depends; Determine a sub-business plane and a parent business plane based on the relationship between the business plane fragment on which the target field depends and the main business plane; wherein the business plane fragment on which the target field depends includes: the first business plane fragment, the second business plane fragment and the third business plane fragment; The main service plane is expanded based on the sub-service plane and the parent service plane, and the expanded main service plane is trimmed.

4. The method according to claim 3, characterized in that Expanding the main service plane based on the sub-service plane and the parent service plane includes: According to the hierarchy of the business plane fragments where all data fields associated with the sub-business plane and the parent business plane are located, all business plane fragments of the parent business plane are added to the main business plane, and all business plane fragments of the sub-business plane are added to the main business plane, and the data fields of the sub-business plane are identified for aggregation.

5. The method according to claim 3, characterized in that: Tailor the expanded main business plane, including: The service plane segments in the main service plane that are not depended on by the target field are removed, and the data fields in the service plane segments depended on by the target field that are not depended on by the target field are removed.

6. The method according to claim 1, characterized in that Performing data query based on the clipped main business plane and aggregating the queried data results to obtain query results corresponding to the query content includes: According to the level of the clipped main business plane, data is queried layer by layer starting from the first layer of the clipped main business plane to obtain data results of the corresponding business plane fragments; According to the target field, corresponding data results are obtained from the data results of the business plane fragments for aggregation to obtain query results corresponding to the query content.

7. The method according to claim 1, characterized in that Also includes: Determine the business plane segment according to the association relationship between the data fields of the business data; A service plane is generated according to the associated fields on which the service plane fragments depend.

8. A data query device based on artificial intelligence, characterized in that: include: A query condition determination module is used to obtain the query content input by the user, input the query content into the AI ​​system, and identify whether there is a necessary query condition in the query content; A field determination module, for inputting the predefined data field name, the prompt word corresponding to the field and the query content into the AI ​​system if it exists, identifying the target field corresponding to the query content and determining the main business plane of the query; A business plane extension module, used to extend the main business plane based on the target field and a predefined business model, and to tailor the extended main business plane; wherein the business model includes one or more business planes, the business plane is multi-layered, each layer includes at least one business plane segment, each business plane segment includes multiple data fields, and the business plane segment of the lower layer is extended based on the associated fields existing in the upper layer; The query module is used to perform data query based on the clipped main business plane, and aggregate the queried data results to obtain the query results corresponding to the query content.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are performed.