Business Query Method, Device, Equipment, Medium and Product Based on Q&A Model

By adopting a business query method based on a question-and-answer model in the management business system, using the knowledge retrieval model and public question-and-answer model for component page rendering, the problem of low efficiency and accuracy of business query in the existing technology is solved, efficient and accurate business query is achieved, and hardware resource consumption is reduced.

CN119691138BActive Publication Date: 2025-06-13HANGZHOU NEWGRAND TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510207422.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-13
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

The existing management business system has low efficiency and accuracy when handling complex queries or retrieval logic, and model training requires high server hardware resources, and as the amount of data increases, it is inefficient.

Method used

The business query method based on the question and answer model is adopted, and the business query results are generated by obtaining the target user's question and answer statements, inputting them into the pre-trained knowledge search model for search, outputting component names and interface variable tables, and inputting them into the public question and answer model to generate interactive results, and finally rendering the business query results through the rendering engine of the management business system.

Benefits of technology

It improves the efficiency and accuracy of business queries, reduces the consumption of server hardware resources, and improves the operation experience of user queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691138B_ABST
    Figure CN119691138B_ABST
Patent Text Reader

Abstract

The present invention discloses a business query method, device, equipment, medium and product based on a question-and-answer model. The method includes: obtaining a question-and-answer statement generated by a target user based on a management business system, and inputting the question-and-answer statement into a pre-trained knowledge retrieval model, retrieving a knowledge database through the knowledge retrieval model, and outputting a component name and an interface variable associated with the question-and-answer statement; inputting the question-and-answer statement and an interface variable table into a public question-and-answer model to generate a question-and-answer interaction result; generating a business query result based on the component name and the question-and-answer interaction result, and rendering a target component page through a rendering engine of the management business system to display the business query result. The above technical solution improves the business query efficiency and query accuracy, and improves the operation experience of user queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly to a business query method, device, equipment, medium and product based on a question-and-answer model. Background Art

[0002] With the wide application of intelligent question-and-answer models, intelligent question-and-answer models are gradually widely used in the business processing of all walks of life. For a management business system, it usually manages a large amount of business data. When there is a retrieval or query requirement, it is usually impossible to quickly and conveniently locate the data expected by the operator.

[0003] Existing management business systems usually can only perform some simple retrievals. For complex query or retrieval logics, it is usually necessary to manually retrieve and organize them in advance and store them for subsequent queries, or pre-train a large model suitable for the business scenario for business queries. However, the business query efficiency and query accuracy of the semi-artificial and semi-automatic query method are relatively low, and the model training method has relatively high requirements for server hardware resources. Moreover, as the amount of business data increases, the model needs to be repeatedly trained, resulting in low efficiency. Summary of the Invention

[0004] The present invention provides a business query method, device, equipment, medium and product based on a question-and-answer model to improve business query efficiency and query accuracy, and improve the operation experience of user queries.

[0005] According to one aspect of the present invention, a business query method based on a question-and-answer model is provided. The method includes:

[0006] Obtain a question-and-answer statement generated by a target user based on a management business system, and input the question-and-answer statement into a pre-trained knowledge retrieval model. Retrieve a knowledge database through the knowledge retrieval model, and output a component name and an interface variable table associated with the question-and-answer statement;

[0007] Input the question-and-answer statement and the interface variable table into a public question-and-answer model to generate a question-and-answer interaction result;

[0008] Generate a business query result based on the component name and the question-and-answer interaction result, and render a target component page through a rendering engine of the management business system to display the business query result.

[0009] According to another aspect of the present invention, a business query device based on a question-and-answer model is provided. The device includes:

[0010] A knowledge retrieval module, configured to obtain a question-and-answer statement generated by a target user based on a management business system, and input the question-and-answer statement into a pre-trained knowledge retrieval model. The knowledge database is retrieved through the knowledge retrieval model, and a component name and an interface variable table associated with the question-and-answer statement are output;

[0011] A statement interaction module, configured to input the question-and-answer statement and the interface variable table into a public question-and-answer model to generate a question-and-answer interaction result;

[0012] A page rendering module, configured to generate a service query result based on the component name and the question-and-answer interaction result, and render a target component page through a rendering engine of the management business system to display the service query result.

[0013] According to another aspect of the present invention, there is provided an electronic device, including:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the service query method based on a question-and-answer model according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the service query method based on a question-and-answer model according to any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, there is provided a computer program product including a computer program, which implements the above-mentioned service query method based on a question-and-answer model when executed by a processor.

[0019] In the technical solution of the embodiment of the present invention, by obtaining the Q&A statements generated by the target user based on the management business system, and inputting the Q&A statements into the knowledge retrieval model, the knowledge retrieval model outputs the component name and the interface variable table after content retrieval based on the knowledge database; inputting the Q&A statements and the interface variable table into the public Q&A model to generate the Q&A interaction result; generating the business query result according to the component name and the Q&A interaction result, and rendering in the management business system to obtain the target component page to display the business query result. The above technical solution retrieves relevant component information from the knowledge database by using the knowledge retrieval model and inputs it to the public Q&A model, so as to render the component page based on the output result of the public Q&A model, without the need for complex business query large model training, reducing the server hardware resource cost. By deeply integrating and fusing the lightweight knowledge retrieval model and the existing public Q&A model with the management business system, it cooperates with the management business system to realize the retrieval and query of business resources, improving the business query efficiency and query accuracy, as well as improving the operation experience of user query.

[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 is a flowchart of a business query method based on a Q&A model according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of a business query method based on a Q&A model according to Embodiment 2 of the present invention;

[0024] Figure 3 is a schematic structural diagram of a business query device based on a Q&A model according to Embodiment 3 of the present invention;

[0025] Figure 4 is a schematic structural diagram of an electronic device for implementing the business query method based on a Q&A model of the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. 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 scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data used in appropriate cases can be interchanged so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1 FIG. 10 is a flowchart of a business query method based on a question-and-answer model provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of quickly and accurately querying or retrieving business-related data managed in a management business system scenario. This method can be executed by a business query device based on a question-and-answer model. The business query device based on the question-and-answer model can be implemented in the form of hardware and / or software, and the business query device based on the question-and-answer model can be configured in an electronic device. As Figure 1 shown, the method includes:

[0030] S110. Obtain a question-and-answer statement generated by a target user based on a management business system, and input the question-and-answer statement into a pre-trained knowledge retrieval model. Retrieve a knowledge database through the knowledge retrieval model, and output a component name and an interface variable table associated with the question-and-answer statement.

[0031] S120. Input the question-and-answer statement and the interface variable table into a public question-and-answer model to generate a question-and-answer interaction result.

[0032] S130. Generate a business query result based on the component name and the question-and-answer interaction result, and render a target component page through a rendering engine of the management business system to display the business query result.

[0033] Among them, the target user can be relevant operators who have the query permission and query requirements for the management business system. The management business system can be a system that has precise classification management of a large amount of business-related data of different types. For example, taking the management business system of an enterprise for R & D tasks as an example, this management business system can include at least one menu item, such as R & D task filling, R & D resource plan, R & D task weekly report, and exception management task, etc. Different menu items correspond to different display pages, and the same or different business-related information is displayed under different display pages; for example, the display page of R & D task filling can include business-related information such as task code, filler, total time, and filling date. This embodiment will not elaborate on this anymore.

[0034] Among them, the question-and-answer statement can be generated by the target user based on their own needs. For example, the question-and-answer statement can be "Please output the number of R & D tasks of Zhang San in 2024."

[0035] Among them, the knowledge retrieval model can be a network model used to perform content retrieval on the question-and-answer statement based on the knowledge database, and can be pre-trained by relevant technical personnel. The knowledge retrieval model has an interaction function and a retrieval function. Among them, the interaction function is specifically capable of receiving the user's question-and-answer statement and feedbacking the corresponding question-and-answer result; the retrieval function is specifically capable of identifying the statement intention of the user's question-and-answer statement and retrieving the corresponding retrieval result from the knowledge database.

[0036] Specifically, after receiving the question-and-answer statement of the target user, the knowledge retrieval model performs statement intention understanding on the question-and-answer statement, extracts keywords or key phrases, and performs content retrieval from the knowledge database according to the extracted keywords to obtain the component name and the interface variable table.

[0037] Among them, at least one knowledge record, that is, the dynamic parameters corresponding to the knowledge record, is stored in the knowledge database. The knowledge record includes menu name, operation name, component name, etc.; the knowledge type is a dynamic function type, and the dynamic parameters of the knowledge record are the component address and the interface variable table. The knowledge retrieval model can retrieve the corresponding component name from the knowledge database by identifying the intention of the question-and-answer statement and obtain the interface variable table corresponding to the corresponding component name.

[0038] Among them, the component name can be the name of the page component related to the input question-and-answer statement, and the interface variable table can be the variables related to the page component. For example, if the question-and-answer statement can be "Please output the number of R & D tasks of Zhang San in 2024", then the knowledge retrieval model outputs the component name of the page component, and this page component can be the page component of the R & D task. The corresponding interface variable table can be the content displayed after the page component of the R & D task is loaded, such as the task name of the R & D task, task filling time, task approver, and task application date, etc.

[0039] This embodiment also provides a model training method for a knowledge retrieval model. Specifically, the knowledge retrieval model can include two parts of model training, namely retrieval part training and generation part training. The purpose of training for the retrieval part is to enable the model to learn to find the parts relevant to the question in a large amount of text. A sample data set including positive and negative samples is constructed. Among them, the positive samples include relevant questions and their corresponding accurate answers, and the negative samples include relevant questions and their corresponding irrelevant answers. The model maximizes the similarity of positive samples and minimizes the similarity of negative samples to learn how to distinguish relevant and irrelevant information. The purpose of training for the generation part is to enable the model to find accurate answers in a given document or paragraph. It can be trained by supervised learning on question-and-answer samples with labels. The model is trained using the labeled question-and-answer data set. For example, the model can be a BERT (Bidirectional Encoder Representations from Transformers) model.

[0040] To ensure the accuracy of model training, the retrieval part and the generation part are jointly trained. Specifically, an end-to-end training method can be adopted. In the joint training, the retrieval part and the generation part share an encoder (such as BERT) and are optimized through a unified objective. During the model training process, the common loss function of the retrieval and generation parts is jointly trained. For example, a loss function combining retrieval relevance and answer generation is used.

[0041] It should be noted that since the knowledge retrieval model retrieves from the knowledge database during the retrieval process, when training the retrieval part, data is obtained from the knowledge database and corresponding labeled sample data is generated to meet the business retrieval scenario of this embodiment.

[0042] Among them, the public question-and-answer model can be an open-source intelligent question-and-answer model. The interface variable table can be used as a prompt word for the question-and-answer statement and input into the public question-and-answer model. The public question-and-answer model parses the question-and-answer statement based on the interface variable table to obtain the question-and-answer interaction result. For the question-and-answer statement "The number of R & D tasks of Zhang San in 2024" in the above case, the public question-and-answer model can parse the key information concerned by this question-and-answer statement, namely "2024" and "Zhang San", according to the interface variable table.

[0043] It can be understood that in a scenario where there is no interface variable table as a prompt word, if only the "number of R & D tasks of Zhang San in 2024" is input into the public Q&A model, the output result of the public question model may be an answer that is completely irrelevant to the Q&A statement. After the interface variable table is input to the public large model as a prompt word, the public large model can determine the key intent information of the Q&A statement as the year and name based on the content in the interface variable table. The use of the public large model can directly obtain the Q&A interaction result without being trained in combination with the scenario, improving the Q&A efficiency.

[0044] According to the component name, the target component to be page-rendered can be determined. Based on the target component and the Q&A interaction result, the rendering engine of the management business system is controlled to render the target component page to display the business query result. Continuing from the previous time, the business query result is the output result of "the number of R & D tasks of Zhang San in 2024", and the target component page is the page used to display this output result.

[0045] The technical solution of the embodiment of the present invention obtains the Q&A statement generated by the target user based on the management business system, and inputs the Q&A statement into the knowledge retrieval model. The knowledge retrieval model outputs the component name and the interface variable table after content retrieval based on the knowledge database; inputs the Q&A statement and the interface variable table into the public Q&A model to generate the Q&A interaction result; generates the business query result according to the component name and the Q&A interaction result, and renders the target component page in the management business system to display the business query result. The above technical solution retrieves relevant component information from the knowledge database by using the knowledge retrieval model and inputs it to the public Q&A model, thereby rendering the component page based on the output result of the public Q&A model, without the need for complex business query large model training, reducing the server hardware resource cost. By deeply integrating and fusing the lightweight knowledge retrieval model and the existing public Q&A model with the management business system, it cooperates with the management business system to realize the retrieval and query of business resources, improving the business query efficiency and query accuracy, as well as improving the user query operation experience.

[0046] This embodiment also provides a specific implementation method for rendering the target component page of the management business system to display the business query result. In an optional embodiment, generating the business query result according to the component name and the Q&A interaction result, and rendering the target component page in the management business system to display the business query result includes:

[0047] Step a1: Based on the component name, locate the target component and extract the component address of the target component, and load the component running code of the target component through the component address.

[0048] Among them, the component address of the target component can be obtained from the knowledge database. Or, it can also be the component address output after content retrieval by the knowledge retrieval model. According to the component address, obtain the component running code of the target component.

[0049] Step a2: Parse the content of the component running code to obtain the two-way bound variables of the target component, and determine the processing code for successful request of the data usage source for the two-way bound variables.

[0050] Parse the content of the component running code of the target component to obtain the two-way bound variables of the target component, that is, external parameters. For example, in a case of starting a case management list, the requirement is to query the details of a certain case, and the case number in the case details is the external parameter, that is, the variable parameter bound to the target component two-way.

[0051] Determine the processing code for making a request to the data usage source of the two-way bound variables and successfully requesting. Among them, the data usage source is the variable acquisition source, such as file reading or backend service reading, etc. The processing code can specifically be obtained by extracting code from the component running code.

[0052] Step a3: Generate a function slot in the rendering engine of the management business system, and insert the component address and processing code of the target component into the function slot to obtain the target function slot.

[0053] Among them, the function slot is used for inserting dynamic content. Specifically, a function is passed through the slot, and the function dynamically processes or generates the inserted content. Each function slot corresponds to corresponding function code for processing and rendering the content of the slot, and can specifically be dynamically generated through variables in the global data object.

[0054] Specifically, insert the component address and processing code of the target component into the function slot to obtain the target function slot.

[0055] Step a4: According to the Q&A interaction result, establish a global data object, and use the global data object as the function parameter of the target function code corresponding to the target function slot.

[0056] Step a5: Use the target function code as the business query result and run the target function code to render the target component page through the rendering engine of the management business system to display the business query result.

[0057] Playback the target function code to trigger the running of the target function code to render the target component page in the management business system to display the business query result.

[0058] The technical solution of this embodiment renders the target component page by extracting the processing agent and combining function slots, which can adaptively adjust the component page to be rendered according to the output result of the large model, improving the flexibility and reliability of component page rendering.

[0059] This embodiment also provides a method for constructing a knowledge database. In an alternative embodiment, the method for constructing the knowledge database is as follows:

[0060] Step b1: Obtain the component names in the pre-constructed menu information container; the menu information container stores at least one piece of relevant information including menu information, operation name, component name, and component address.

[0061] Step b2: Parse the component code of the menu component corresponding to the component name to determine the two-way binding variables for the Hypertext Transfer Protocol request during component initialization of the menu component.

[0062] Step b3: Determine the Chinese name of the form corresponding to the two-way binding variable, and establish a mapping relationship between the two-way binding variable and the Chinese name of the form, and use the mapping relationship as the interface variable table.

[0063] Step b4: Generate a knowledge record including menu information and operation name, and use the corresponding component address and interface variable table as the dynamic parameters of the knowledge record.

[0064] Step b5: Generate a knowledge database storing at least one knowledge record and its corresponding dynamic parameters.

[0065] In an alternative embodiment, the construction of the knowledge database is before obtaining the question-and-answer statements generated by the target user based on the management business system and inputting the question-and-answer statements into the knowledge retrieval model, and after the knowledge retrieval model performs content retrieval based on the knowledge database and outputs the component name and the interface variable table.

[0066] In the above alternative embodiments, the menu information container can be pre-constructed by relevant technicians for storing menu information and component information of the management business system, etc. For example, the menu information can include menu name and menu identifier, etc., and the menu identifier is used to represent the uniqueness of the menu. For example, the menu name can be "Task Management List", "Task Exception List", "Task R & D List", etc., and the menus are different under different management business scenarios.

[0067] The operation can specifically be operations such as adding, deleting, modifying, and viewing components under a certain menu. The component name can be the page components included under the corresponding menu. Specifically, components can be created by the addition method, and component deletion, modification, and viewing can also be performed. For example, you can choose to add a task R & D list, and what is obtained is the page component or menu component of the newly added "Task R & D List".

[0068] Code analysis is performed on the component code of the menu component corresponding to the component name to obtain the two-way binding variables requested by HTTP (HyperText Transfer Protocol) during component initialization of the menu component, and the Chinese name of the form corresponding to the two-way binding variable is determined. For example, the two-way binding variables under the task R & D list include R & D number, R & D project name, R & D task creation time, etc. "R & D number", "R & D project name", and "R & D task creation time" are the Chinese names of the form corresponding to the two-way binding variables. It should be noted that in the component code, the two-way binding variables are custom-named and assigned by developers. Therefore, it is necessary to determine the actual Chinese name of the form corresponding to the two-way binding variables.

[0069] A mapping relationship is established between the two-way binding variables and the Chinese names of the forms, and the mapping relationship is used as the interface variable table. The menu information and the operation name are used as a knowledge record, and the corresponding component address and interface variable table are used as the dynamic parameters of the knowledge record. A knowledge database is generated that stores at least one knowledge record and its corresponding dynamic parameters.

[0070] This embodiment also provides a method for constructing a menu information container. In an alternative embodiment, before obtaining the menu components in the pre-constructed menu information container, it further includes:

[0071] Step c1: When it is detected that the system program of the management business system is running, read the database connection configuration information, connect to the business database according to the database connection configuration information, and obtain at least one database table in the business database.

[0072] Step c2: Perform menu field retrieval on each database table to generate a target menu database table and determine the menu information in the target menu database table.

[0073] Step c3: Generate a menu information container including at least one piece of menu information.

[0074] Among them, the database connection configuration information is the connection configuration information of the database corresponding to the management business system, and specifically may include a series of parameters such as the name, address, and port for connecting to the database.

[0075] Specifically, taking a management business system developed based on the Spring development framework as an example, by adding a post-interceptor in Spring, when the container corresponding to the management business system is instantiated, the database connection configuration information is automatically read. Through the database connection configuration information, the business database of the management business system can be connected, and at least one database table in the business database can be obtained. Menu field retrieval is performed on each database table, that is, the target menu database table with menu fields in the database table is retrieved. At the same time, the menu information in the target menu database table is obtained. A menu information container including at least one piece of menu information is generated. Among them, the menu information may include the menu name, menu identifier, and the URL (Uniform Resource Locator) address of the menu component, etc.

[0076] This embodiment also provides a content update method for the menu information container. In an alternative embodiment, after generating the menu information container including at least one piece of menu information, it further includes:

[0077] Step d1, when it is detected that a compilation operation is performed on the front-end code of the management business system, obtain the menu information container and determine the loading address for loading the front-end code; the menu information includes the component address.

[0078] Step d2, if the loading address is in the menu information container, perform content parsing on the front-end code to determine whether there is an action event in the front-end code that performs a preset operation behavior.

[0079] Step d3, if there is an action event in the front-end code that performs a preset operation behavior, determine the operation component, and update the menu information container according to the operation component and its corresponding operation name.

[0080] Among them, the compilation operation on the front-end code may be operations such as code modification, deletion, or update of the front-end code. Among them, by developing a front-end code loader component, when it is detected that the front-end code is compiled, the front-end code loader component is automatically triggered to run, and the menu information container is automatically obtained.

[0081] Specifically, if the loading address for loading the front-end code is in the menu information container, perform content parsing on the front-end code to determine whether there is an action event in the front-end code that performs a preset operation behavior. Among them, the preset operation behavior can be preset by relevant technical personnel according to actual needs. Specifically, the preset operation behavior can specifically be an add operation behavior, a modify operation behavior, a delete operation behavior, and a view details operation behavior. The corresponding action events can be an add action event, a modify action event, a delete action event, and a view details action event.

[0082] If there is an action event in the front-end code that executes a preset operation behavior, determine the operation component. Among them, the operation component can be the component that executes the operation behavior. According to the operation component and its corresponding operation name, update the menu information container. Exemplarily, the operation component and its operation name can be bound to the corresponding menu information and stored in the menu information container to update the menu information container.

[0083] It should be noted that the above-mentioned execution of the operation behavior may be an action of adding a component to a certain component. For example, the action of "adding a task R & D list" will open the corresponding menu component and pop up the corresponding page. In addition, the above-mentioned operation behavior may also be deleting a certain component. For example, "deleting a task R & D list" does not have the action of popping up the component page of the corresponding menu component at this time. Therefore, for the two different situations, different processing methods are adopted to generate the corresponding operation components.

[0084] In an alternative embodiment, if there is an action event in the front-end code that executes a preset operation behavior, determine the operation component, and according to the operation component and its corresponding operation name, update the menu information container, including:

[0085] Step e1: If there is an action event in the front-end code that executes a preset operation behavior, and it is determined that the action event of the operation is a front-end code component, parse the content of the front-end code to determine the operation name of the action event of the operation and its associated operation component, and update the menu information container according to the operation component and its corresponding operation name.

[0086] Among them, the action event of the front-end code component is an action event that is controlled to open by an operation component and will pop up the corresponding component page, that is, a sensitive action event.

[0087] Step e21: If there is an action event in the front-end code that executes a preset operation behavior, and it is determined that the action event of the operation is page hard-coding, parse the content of the front-end code to determine the event trigger function and operation identifier associated with the action event of the operation.

[0088] Step e22: Determine the HTML (HyperText Markup Language) element code associated with the two-way binding variable corresponding to the event trigger function.

[0089] Step e23: Generate an operation component based on the operation identifier and the menu identifier in the menu information, based on the HTML element code, and update the menu information container according to the operation component and its corresponding operation name.

[0090] Among them, the action event of page hard-coding is an action event that does not have an action of being controlled to open or start by an operation component, nor does it have an action of popping up the corresponding component page, that is, a non-sensitive action event.

[0091] Specifically, if it is determined that the action event of the operation is page hard coding, the front-end code is parsed for content to determine the event trigger function and operation identifier associated with the action event of the operation. Among them, the event trigger function is the function triggered by the current operation. The HTML element code associated with the two-way binding variable corresponding to the event trigger function is extracted.

[0092] The HTML element code is automatically generated into an operation component according to the operation identifier and menu identifier, and the menu information container is updated according to the operation component and its corresponding operation name. At the same time, the current component code corresponding to the operation component is placed in the same-level directory of the front-end code.

[0093] The technical solution of the above embodiment realizes the precise creation of the menu information container, and by identifying the action event of the front-end code and parsing the code content, different types of action events are recognized and different methods are used to update the content in the menu information container, realizing the accurate update of the menu information container. Since the knowledge database is built based on the menu information container, when the accuracy of the menu information container is significantly improved, the accuracy of building the knowledge database is also improved accordingly, thus ensuring the retrieval accuracy of subsequent knowledge retrieval based on the knowledge database.

[0094] Embodiment 2

[0095] Figure 2 The flowchart of a business query method based on a question-and-answer model provided by Embodiment 2 of the present invention. This embodiment provides a preferred example on the basis of the above embodiment.

[0096] As Figure 2 shown, the method includes the following specific steps:

[0097] S201. When it is detected that the system program of the management business system is running, read the database connection configuration information, connect to the business database according to the database connection configuration information, and obtain at least one database table in the business database.

[0098] S202. Perform menu field retrieval on each database table to generate a target menu database table, and determine the menu information in the target menu database table.

[0099] S203. Generate a menu information container including at least one piece of menu information.

[0100] S204. When it is detected that the front-end code of the management business system is compiled, obtain the menu information container and determine the loading address for loading the front-end code; the menu information includes the component address.

[0101] S205. If the loading address is in the menu information container, perform content parsing on the front-end code to determine whether there is an action event in the front-end code that executes a preset operation behavior. If there is an action event in the front-end code that executes a preset operation behavior and it is determined that the action event of the operation is a front-end code component, then execute S206A. If there is an action event in the front-end code that executes a preset operation behavior and it is determined that the action event of the operation is page hard coding, then execute S206B - S206D.

[0102] S206A. Perform content parsing on the front-end code to determine the operation name of the action event of the operation and its associated operation component, and update the menu information container according to the operation component and its corresponding operation name.

[0103] S206B. Perform content parsing on the front-end code to determine the event trigger function and operation identifier associated with the action event of the operation; determine the HTML element code associated with the two-way binding variable corresponding to the event trigger function; generate an operation component based on the operation identifier and the menu identifier in the menu information and the HTML element code, and update the menu information container according to the operation component and its corresponding operation name.

[0104] S207. Create a knowledge database according to the content of the menu information container.

[0105] Specifically, obtain the component name in the pre-built menu information container; the menu information container stores at least one piece of relevant information including menu information, operation name, component name, and component address; perform code parsing on the component code of the menu component corresponding to the component name to determine the two-way binding variable for the HTTP request during component initialization of the menu component; determine the Chinese name of the form corresponding to the two-way binding variable, and establish a mapping relationship between the two-way binding variable and the Chinese name of the form, and use the mapping relationship as the interface variable table; generate a knowledge record including menu information and operation name, and use the corresponding component address and interface variable table as dynamic parameters of the knowledge record; generate a knowledge database storing at least one knowledge record and its corresponding dynamic parameters.

[0106] S208. Obtain the question-and-answer statement generated by the target user based on the management business system, and input the question-and-answer statement into the pre-trained knowledge retrieval model. Retrieve the knowledge database through the knowledge retrieval model, and output the component name and interface variable table associated with the question-and-answer statement.

[0107] S209. Input the question-and-answer statement and the interface variable table into the public question-and-answer model to generate a question-and-answer interaction result.

[0108] S210. Generate a business query result based on the component name and the question-and-answer interaction result, and render the target component page through the rendering engine of the management business system to display the business query result.

[0109] Specifically, based on the component name, locate the target component and extract the component address of the target component. Load the component running code of the target component through the component address; perform content parsing on the component running code to obtain the two-way binding variables of the target component, and determine the processing code for successful request of the data usage source for the two-way binding variables; generate a function slot in the rendering engine of the management business system, and insert the component address and the processing code of the target component into the function slot to obtain the target function slot; establish a global data object according to the question-and-answer interaction result, and use the global data object as the function parameter of the target function code corresponding to the target function slot; use the target function code as the business query result and run the target function code to render the target component page in the management business system to display the business query result.

[0110] Embodiment III

[0111] Figure 3 The following is a schematic structural diagram of a business query device based on a question-and-answer model provided in Embodiment III of the present invention. The business query device based on a question-and-answer model provided in the embodiments of the present invention is applicable to the situation of quickly and accurately querying or retrieving business-related data managed in the management business system scenario. The business query device based on a question-and-answer model can be implemented in the form of hardware and / or software, such as Figure 3 shown, the device specifically includes: a knowledge retrieval module 301, a statement interaction module 302, and a page rendering module 303. Among them,

[0112] The knowledge retrieval module 301 is configured to obtain a question-and-answer statement generated by a target user based on the management business system, input the question-and-answer statement into a pre-trained knowledge retrieval model, and retrieve the knowledge database through the knowledge retrieval model to output a component name and an interface variable table associated with the question-and-answer statement;

[0113] The statement interaction module 302 is configured to input the question-and-answer statement and the interface variable table into a public question-and-answer model to generate a question-and-answer interaction result;

[0114] The page rendering module 303 is configured to generate a business query result based on the component name and the question-and-answer interaction result, and render a target component page through the rendering engine of the management business system to display the business query result.

[0115] In the technical solution of the embodiment of the present invention, by obtaining the Q&A statement generated by the target user based on the management business system, and inputting the Q&A statement into the knowledge retrieval model, the knowledge retrieval model outputs the component name and the interface variable table after content retrieval based on the knowledge database; inputting the Q&A statement and the interface variable table into the public Q&A model to generate a Q&A interaction result; generating a business query result according to the component name and the Q&A interaction result, and rendering in the management business system to obtain the target component page to display the business query result. The above technical solution retrieves relevant component information from the knowledge database by using the knowledge retrieval model and inputs it to the public Q&A model, so as to render the component page based on the output result of the public Q&A model, without the need for complex business query large model training, reducing the server hardware resource cost. Instead, a lightweight knowledge retrieval model and the existing public Q&A model are deeply integrated and fused with the management business system, and cooperate with the management business system to realize the retrieval and query of business resources, improving the business query efficiency and query accuracy, and improving the operation experience of user query.

[0116] Optionally, the page rendering module 303 is specifically configured to:

[0117] Based on the component name, locate the target component and extract the component address of the target component, and load the component running code of the target component through the component address;

[0118] Parse the content of the component running code to obtain the two-way binding variables of the target component, and determine the processing code for successfully requesting the data usage source of the two-way binding variables;

[0119] Generate a function slot in the rendering engine of the management business system, and insert the component address of the target component and the processing code into the function slot to obtain a target function slot;

[0120] According to the Q&A interaction result, establish a global data object, and use the global data object as the function parameter of the target function code corresponding to the target function slot;

[0121] Use the target function code as the business query result and run the target function code to render the target component page through the rendering engine of the management business system to display the business query result.

[0122] Optionally, the device further includes:

[0123] A data acquisition module, configured to obtain the component names in a pre-constructed menu information container before obtaining the Q&A statements generated by the target user based on the management business system, inputting the Q&A statements into a knowledge retrieval model, and after the knowledge retrieval model performs content retrieval based on a knowledge database and outputs the component names and an interface variable table; at least one piece of relevant information including menu information, operation names, component names, and component addresses is stored in the menu information container;

[0124] A code parsing module, configured to perform code parsing on the component code of the menu component corresponding to the component name, and determine the two-way binding variables for the Hypertext Transfer Protocol request during component initialization of the menu component;

[0125] A relationship establishment module, configured to determine the Chinese name of the form corresponding to the two-way binding variable, establish a mapping relationship between the two-way binding variable and the Chinese name of the form, and use the mapping relationship as the interface variable table;

[0126] A record generation module, configured to generate a knowledge record including the menu information and the operation name, and use the corresponding component address and interface variable table as the dynamic parameters of the knowledge record;

[0127] A database generation module, configured to generate a knowledge database storing at least one knowledge record and its corresponding dynamic parameters.

[0128] Optionally, the device further includes:

[0129] A table acquisition module, configured to read database connection configuration information and connect to a business database according to the database connection configuration information to obtain at least one database table in the business database before obtaining the menu components in the pre-constructed menu information container when detecting that the system program of the management business system is running;

[0130] A field retrieval module, configured to perform menu field retrieval on each database table, generate a target menu database table, and determine the menu information in the target menu database table;

[0131] An information container generation module, configured to generate a menu information container including at least one piece of menu information.

[0132] Optionally, the device further includes:

[0133] A compilation detection module, configured to obtain the menu information container and determine the loading address for loading the front-end code when detecting a compilation operation on the front-end code of the management business system after generating the menu information container including at least one piece of menu information; the menu information includes the component address;

[0134] A content parsing module, configured to, if the loading address is in the menu information container, parse the content of the front-end code to determine whether there is an action event in the front-end code that performs a preset operation behavior;

[0135] An information container update module, configured to, if there is an action event in the front-end code that performs a preset operation behavior, determine an operation component, and update the menu information container according to the operation component and its corresponding operation name.

[0136] Optionally, the information container update module is specifically configured to:

[0137] If there is an action event in the front-end code that performs a preset operation behavior, and it is determined that the action event of the operation is a front-end code component, parse the content of the front-end code to determine the operation name of the action event of the operation and its associated operation component, and update the menu information container according to the operation component and its corresponding operation name;

[0138] If there is an action event in the front-end code that performs a preset operation behavior, and it is determined that the action event of the operation is a page hard code, parse the content of the front-end code to determine the event trigger function and operation identifier associated with the action event of the operation;

[0139] Determine the HTML element code associated with the two-way binding variable corresponding to the event trigger function;

[0140] Generate an operation component based on the HTML element code according to the operation identifier and the menu identifier in the menu information, and update the menu information container according to the operation component and its corresponding operation name.

[0141] The business query device based on the question-and-answer model provided by the embodiments of the present invention can execute the business query method based on the question-and-answer model provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0142] Embodiment 4

[0143] Figure 4 FIG. shows a schematic structural diagram of an electronic device 40 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described herein and / or claimed.

[0144] As shown Figure 4 in FIG. 40, the electronic device 40 includes at least one processor 41 and a memory communicatively connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc. The memory stores a computer program executable by the at least one processor. The processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0145] Multiple components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disc, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0146] The processor 41 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as the business query method based on a question-and-answer model.

[0147] In some embodiments, the business query method based on a question-and-answer model can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the business query method based on a question-and-answer model described above can be executed. Alternatively, in other embodiments, the processor 41 can be configured to execute the business query method based on a question-and-answer model by any other appropriate means (e.g., by means of firmware).

[0148] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0149] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

[0150] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0151] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0152] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0153] A computing system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0154] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0155] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A business query method based on a question-answering model, characterized in that: include: Obtaining a question and answer statement generated by a target user based on a management business system, and inputting the question and answer statement into a pre-trained knowledge retrieval model, searching a knowledge database through the knowledge retrieval model, and outputting a component name and an interface variable table associated with the question and answer statement; Inputting the question-answering sentence and the interface variable table into a public question-answering model to generate a question-answering interaction result; Based on the component name and the question-answer interaction result, a business query result is generated, and a target component page is rendered by a rendering engine of the business management system to display the business query result; The step of generating the knowledge database comprises: Obtaining a component name in a pre-built menu information container; the menu information container stores at least one piece of related information including menu information, operation name, component name and component address; Parsing the component code of the menu component corresponding to the component name to determine the bidirectional binding variable requested by the hypertext transfer protocol when the menu component performs component initialization; Determine the Chinese name of the form corresponding to the two-way binding variable, and establish a mapping relationship between the two-way binding variable and the Chinese name of the form, and use the mapping relationship as the interface variable table; Generate a knowledge record including the menu information and the operation name, and use the corresponding component address and interface variable table as dynamic parameters of the knowledge record; A knowledge database storing at least one knowledge record and its corresponding dynamic parameters is generated.

2. The method according to claim 1, characterized in that The generating of a business query result based on the component name and the question-answer interaction result, and rendering a target component page through a rendering engine of the management business system to display the business query result, includes: Based on the component name, locate the target component and extract the component address of the target component, and load the component execution code of the target component through the component address; Parsing the content of the component running code to obtain the two-way binding variable of the target component, and determining the processing code for successfully requesting the data usage source of the two-way binding variable; Generate a function slot in the rendering engine of the management business system, and insert the component address of the target component and the processing code into the function slot to obtain a target function slot; According to the question-answer interaction result, a global data object is established, and the global data object is used as a function parameter of the target function code corresponding to the target function slot; The target function code is used as the business query result and is run to render the target component page through the rendering engine of the management business system to display the business query result.

3. The method according to claim 1, characterized in that Before obtaining the menu component in the pre-built menu information container, the method further includes: When it is detected that the system program of the business management system is running, the database connection configuration information is read, and the business database is connected according to the database connection configuration information to obtain at least one database table in the business database; Performing menu field retrieval on each of the database tables to generate a target menu database table, and determining menu information in the target menu database table; A menu information container including at least one item of menu information is generated.

4. The method according to claim 3, characterized in that After generating the menu information container including at least one menu information, the method further includes: When it is detected that the front-end code of the management business system is compiled, a menu information container is obtained, and a loading address for loading the front-end code is determined; the menu information includes a component address; If the loading address is in the menu information container, the front-end code is parsed to determine whether the front-end code has an action event for executing a preset operation behavior; If the front-end code has an action event for executing a preset operation behavior, the operation component is determined, and the menu information container is updated according to the operation component and its corresponding operation name.

5. The method according to claim 4, characterized in that If the front-end code has an action event for executing a preset operation behavior, determining an operation component, and updating the menu information container according to the operation component and its corresponding operation name, including: If the front-end code has an action event for executing a preset operation behavior, and it is determined that the action event for the operation is a front-end code component, the front-end code is parsed to determine the operation name of the action event for the operation and its associated operation component, and the menu information container is updated according to the operation component and its corresponding operation name; If the front-end code has an action event for executing a preset operation behavior, and the action event for the operation is determined to be hard-coded on the page, the front-end code is parsed to determine the event trigger function and operation identifier associated with the action event for the operation; Determine the HTML element code associated with the two-way binding variable corresponding to the event triggering function; According to the operation identifier and the menu identifier in the menu information, an operation component is generated based on the HTML element code, and according to the operation component and its corresponding operation name, the menu information container is updated.

6. A business query device based on a question-answer model, characterized in that: include: A knowledge retrieval module is used to obtain question and answer statements generated by target users based on the management business system, and input the question and answer statements into a pre-trained knowledge retrieval model, search the knowledge database through the knowledge retrieval model, and output the component names and interface variable tables associated with the question and answer statements; A sentence interaction module, used for inputting the question and answer sentence and the interface variable table into a public question and answer model to generate a question and answer interaction result; A page rendering module, used to generate a business query result based on the component name and the question-answer interaction result, and render a target component page through a rendering engine of the management business system to display the business query result; The device also includes: A data acquisition module is used to obtain the component name in a pre-built menu information container before the question and answer statement generated by the target user based on the management business system is input into the knowledge retrieval model and the knowledge retrieval model outputs the component name and the interface variable table after performing content retrieval based on the knowledge database; the menu information container stores at least one piece of relevant information including menu information, operation name, component name and component address; A code parsing module, used for parsing the component code of the menu component corresponding to the component name, and determining the two-way binding variable requested by the hypertext transfer protocol when the menu component performs component initialization; A relationship establishment module, used for determining the Chinese name of the form corresponding to the two-way binding variable, and establishing a mapping relationship between the two-way binding variable and the Chinese name of the form, and using the mapping relationship as an interface variable table; A record generation module, used to generate a knowledge record including the menu information and the operation name, and use the corresponding component address and interface variable table as dynamic parameters of the knowledge record; The database generation module is used to generate a knowledge database storing at least one knowledge record and its corresponding dynamic parameters.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the business query method based on the question-answer model according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the business query method based on a question-answer model according to any one of claims 1 to 5 when executed.

9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the business query method based on the question-answer model according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Intelligent question and answer implementation method and system fusing large model and knowledge base, and medium

    CN117313857A

  • Question answering method and device based on business, electronic equipment and storage medium

    CN117786071A