Question and answer model-based business query method, apparatus and device, medium and product
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 requirements are reduced.
Patent Information
- Application Number
- CN202510207422.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-02-25
AI Technical Summary
The existing management business system has low efficiency and accuracy when conducting complex business queries, and has high requirements for server hardware resources. As the amount of data increases, the model training efficiency is inefficient.
The business query method based on the question and answer model is adopted, and the target user's question and answer statements are obtained, and the target component name and interface variable table are input to the public question and answer model to generate question and answer interaction results. Finally, the business query results are generated based on the component name and interaction results, and the target component page is rendered through the rendering engine of the management business system.
It improves the efficiency and accuracy of business query, reduces the demand for server hardware resources, and improves the operation experience of user query.
Smart Images

Figure CN119691138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a business query method, device, equipment, medium and product based on a question-answer model. Background Art
[0002] With the widespread application of intelligent question-answering models, intelligent question-answering models are gradually being widely used in business processing in various industries. For management business systems, they usually manage a large amount of business data. When there is a need for retrieval or query, it is usually impossible to quickly and conveniently locate the data that operators expect.
[0003] Existing management business systems can usually only perform some simple searches. For complex queries or search logic, they usually need to be manually searched in advance and stored after sorting for subsequent queries, or large models suitable for business scenarios need to be pre-trained for business queries. However, the business query efficiency and query accuracy of the semi-manual and semi-automatic query method are low, and the model training method has high requirements for server hardware resources. As the amount of business data increases, the model needs to be trained repeatedly, which is inefficient. Summary of the invention
[0004] The present invention provides a business query method, device, equipment, medium and product based on a question-answering model to improve business query efficiency and query accuracy, and improve the user query operation experience.
[0005] According to one aspect of the present invention, a business query method based on a question-answer model is provided, the method comprising:
[0006] 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;
[0007] Inputting the question-answering sentence and the interface variable table into a public question-answering model to generate a question-answering interaction result;
[0008] Based on the component name and the question-and-answer interaction result, a business query result is generated, and a target component page is rendered through the 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-answer model is provided, the device comprising:
[0010] 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;
[0011] 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;
[0012] A page rendering module is used to generate business query results based on the component name and the question-and-answer interaction results, and render the target component page through the rendering engine of the management business system to display the business query results.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[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 that can be executed 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 described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein 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 the question-answer model described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the business query method based on the question-answer model is implemented.
[0019] The technical solution of the embodiment of the present invention obtains the question and answer statements generated by the target user based on the management business system, and inputs the question and answer statements into the knowledge retrieval model, and the knowledge retrieval model outputs the component name and interface variable table after performing content retrieval based on the knowledge database; the question and answer statements and the interface variable table are input into the public question and answer model to generate the question and answer interaction results; the business query results are generated according to the component name and the question and answer interaction results, and the target component page is rendered in the management business system to display the business query results. The above technical solution uses the knowledge retrieval model to retrieve the relevant component information based on the knowledge database, and inputs it into the public question and answer model, so as to render the component page based on the output result of the public question and answer model, without the need for complex business query large model training, reducing the server hardware resource cost, and using the lightweight knowledge retrieval model and the existing public question and answer model to be deeply integrated and merged with the management business system, and cooperates with the management business system to realize the retrieval and query of business resources, improve the business query efficiency and query accuracy, and improve the user query operation experience.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended 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 briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of a business query method based on a question-answer model provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a business query method based on a question-answer model provided according to Embodiment 2 of the present invention;
[0024] Figure 3 2 is a schematic diagram of the structure of a business query device based on a question-answer model provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a structural schematic diagram of an electronic device for implementing the business query method based on the question-answer model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should 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 are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 This is a flowchart of a business query method based on a question-answer model provided in the first embodiment of the present invention. This embodiment can be applied to the situation of quickly and accurately querying or retrieving business-related data managed in the management business system scenario. The method can be executed by a business query device based on a question-answer model. The business query device based on a question-answer model can be implemented in the form of hardware and / or software. The business query device based on a question-answer model can be configured in an electronic device. Figure 1 As shown, the method includes:
[0030] S110, 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 pre-trained knowledge retrieval model, searching the knowledge database through the knowledge retrieval model, and outputting the component names and interface variable table associated with the question and answer statements.
[0031] S120: Input the question and answer statements and the interface variable table into the 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-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 may be a relevant operator who has query authority and query needs for the management business system. The management business system may be a system that has the ability to accurately manage a large number of different types of business-related data by classification. For example, taking a certain company's management business system for R&D tasks as an example, the management business system may include at least one menu item, such as R&D task reporting, R&D resource planning, R&D task weekly report, and abnormal management tasks, etc. Different menu items correspond to different display pages, and different display pages display the same or different business-related information; for example, the display page for R&D task reporting may include business-related information such as task code, reporter, total time, and reporting date, which will not be repeated in this embodiment.
[0034] Among them, the question and answer statement can be generated by the target user based on his own needs. For example, the question and answer statement can be "Please output and display the number of Zhang San's R&D tasks in 2024."
[0035] The knowledge retrieval model can be a network model for content retrieval of question and answer sentences based on a knowledge database, and can be pre-trained by relevant technical personnel. The knowledge retrieval model has an interactive function and a retrieval function, wherein the interactive function is specifically capable of receiving the user's question and answer sentences and feeding back the corresponding question and answer results; the retrieval function is specifically capable of identifying the sentence intent of the user's question and answer sentences and retrieving the corresponding retrieval results from the knowledge database.
[0036] Specifically, after receiving the question and answer sentences from the target user, the knowledge retrieval model understands the sentence intent of the question and answer sentences, extracts keywords or key words, and performs content retrieval from the knowledge database based on the extracted keywords to obtain component names and interface variable tables.
[0037] Among them, the knowledge database stores at least one knowledge record, that is, the dynamic parameters corresponding to the knowledge record. The knowledge record includes menu name, operation name and component name, etc.; the knowledge type is a dynamic function type, and the dynamic parameters of the knowledge record are component address and 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 and display the number of Zhang San's R&D tasks in 2024", the knowledge retrieval model outputs the component name of the page component, and the page component can be the page component of the R&D task. The corresponding interface variable table can be the content displayed by the page component of the R&D task after loading, such as the task name of the R&D task, the task reporting time, the task approver, and the task application date.
[0039] This embodiment also provides a model training method for a knowledge retrieval model. Specifically, the knowledge retrieval model may 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 part related to the question in a large amount of text. Construct a sample data set including positive and negative samples, wherein 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, and learns 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, and the labeled question and answer samples can be trained by supervised learning. The model is trained using a 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 goal. During the model training process, the common loss function of the retrieval and generation parts is trained together, for example, the loss function combining retrieval relevance and answer generation.
[0041] It should be noted that since the knowledge retrieval model retrieves from the knowledge database during the retrieval process, when performing the retrieval part training, 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 input into the public question-and-answer model as the prompt word of the question-and-answer sentence, and the public question-and-answer model parses the question-and-answer sentence based on the interface variable table to obtain the question-and-answer interaction result. For the question-and-answer sentence "the number of research and development tasks of Zhang San in 2024" in the above case, the public question-and-answer model can parse the key information concerned by the question-and-answer sentence based on the interface variable table, namely "2024" and "Zhang San".
[0043] It is understandable that in the scenario where there is no interface variable table as a prompt word, if only "the number of Zhang San's R&D tasks in 2024" is input into the public question-answering model, the public question model may output an answer result that is completely irrelevant to the question-answering sentence. However, when the interface variable table is input into the public big model as a prompt word, the public big model can determine that the key intent information of the question-answering sentence is the year and name based on the content in the interface variable table, and the use of the public big model can directly obtain the question-answering interaction results without combining the scene for training, thereby improving the efficiency of question-answering.
[0044] According to the component name, the target component that needs to be rendered can be determined. According to the target component and the question-answer 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 last time, the business query result is the output result of "the number of research and development tasks of Zhang San in 2024", and the target component page is the page used to display the output result.
[0045] The technical solution of the embodiment of the present invention obtains the question and answer statements generated by the target user based on the management business system, and inputs the question and answer statements into the knowledge retrieval model, and the knowledge retrieval model outputs the component name and interface variable table after performing content retrieval based on the knowledge database; the question and answer statements and the interface variable table are input into the public question and answer model to generate the question and answer interaction results; the business query results are generated according to the component name and the question and answer interaction results, and the target component page is rendered in the management business system to display the business query results. The above technical solution uses the knowledge retrieval model to retrieve the relevant component information based on the knowledge database, and inputs it into the public question and answer model, so as to render the component page based on the output result of the public question and answer model, without the need for complex business query large model training, reducing the server hardware resource cost, and using the lightweight knowledge retrieval model and the existing public question and answer model to be deeply integrated and merged with the management business system, and cooperates with the management business system to realize the retrieval and query of business resources, improve the business query efficiency and query accuracy, and improve the user query operation experience.
[0046] This embodiment also provides a specific implementation method for rendering a target component page in a management business system to display business query results. In an optional embodiment, a business query result is generated according to the component name and the question-answer interaction result, and a target component page is rendered in the management business system to display the business query result, including:
[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] The component address of the target component can be obtained from the knowledge database. Alternatively, the component address can be outputted by the knowledge retrieval model after content retrieval. According to the component address, the component running code of the target component is obtained.
[0049] Step a2: parse the content of the component running code to obtain the two-way binding variable of the target component, and determine the processing code for successfully requesting the data usage source of the two-way binding variable.
[0050] Parse the content of the target component's component running code to obtain the target component's two-way binding variables, that is, external parameters. For example, in a case of starting a case management list, the requirement is to query a certain case detail. The case number in the case detail is the external parameter, that is, the variable parameter that is two-way bound to the target component.
[0051] Determine the processing code for requesting the data usage source of the two-way binding variable and requesting successfully. The data usage source is the source of variable acquisition, such as file reading or backend service reading. The processing code can be specifically extracted 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 to insert 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 a corresponding function code, which is used to process and render the content of the slot, which can be dynamically generated through variables in the global data object.
[0054] Specifically, the component address and processing code of the target component are inserted into the function slot to obtain the target function slot.
[0055] Step a4: Create a global data object based on the question-answer interaction results, and use the global data object as a 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] The target function code is replayed to trigger the running of the target function code, so as to render the target component page in the management business system to display the business query results.
[0058] The technical solution of this embodiment extracts the processing agent and renders the target component page in combination with the function slot method. It can adaptively adjust the component page to be rendered according to the output result of the large model, thereby improving the flexibility and reliability of component page rendering.
[0059] This embodiment also provides a method for constructing a knowledge database. In an optional embodiment, the method for constructing the knowledge database is as follows:
[0060] Step b1, obtaining the component name in the 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.
[0061] Step b2: parsing the component code of the menu component corresponding to the component name to determine the two-way binding variables requested by the hypertext transfer protocol when the menu component is initialized.
[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 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 optional embodiment, the knowledge database is constructed after 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 the knowledge retrieval model performs content retrieval based on the knowledge database and outputs the component name and interface variable table.
[0066] In the above optional embodiments, the menu information container can be pre-constructed by relevant technical personnel to store menu information and component information of the management business system. For example, the menu information may include a menu name and a menu identifier, and the menu identifier is used to characterize the uniqueness of the menu. For example, the menu name may be "task management list", "task exception list" and "task research and development list", and the menus in different management business scenarios are different.
[0067] The operation can be to add, delete, modify, and view components under a certain menu. The component name can be the page component contained in the corresponding menu. Specifically, you can create components by adding them, and you can also delete, modify, and view them. For example, you can choose to add a task development list, and the result is the page component or menu component of the newly added "task development list".
[0068] The component code of the menu component corresponding to the component name is parsed to obtain the two-way binding variable requested by HTTP (HyperText Transfer Protocol) when the menu component is initialized, and the form Chinese name corresponding to the two-way binding variable is determined. For example, the two-way binding variables under the task R&D list include the R&D number, R&D project name, and R&D task creation time. "R&D number", "R&D project name" and "R&D task creation time" are the form Chinese names of 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 the development technicians, so it is necessary to determine the form Chinese name that the two-way binding variables actually correspond to.
[0069] A mapping relationship between a two-way binding variable and the Chinese name of the form is established, and the mapping relationship is used as an interface variable table. The menu information and the operation name are used as a knowledge record, and the corresponding component address and the interface variable table are used as 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 optional embodiment, before obtaining the menu component in the pre-constructed menu information container, it also includes:
[0071] Step c1: 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.
[0072] Step c2: perform menu field search on each database table, 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] The database connection configuration information is the connection configuration information of the database corresponding to the management business system, which may specifically include a series of parameters such as the name, address and port used to connect to the database.
[0075] Specifically, taking the 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, you can connect to the business database of the management business system and obtain at least one database table in the business database. Perform menu field retrieval on each database table, that is, retrieve the target menu database table where the menu field exists in the database table. At the same time, obtain the menu information in the target menu database table. Generate a menu information container that includes at least one menu information. Among them, the menu information may include the menu name, menu identifier, and URL (Uniform Resource Locator) address of the menu component, etc.
[0076] This embodiment also provides a method for updating the content of a menu information container. In an optional embodiment, after generating a menu information container including at least one menu information, it also includes:
[0077] Step d1: 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.
[0078] Step d2: 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.
[0079] Step d3: If there is an action event for executing a preset operation behavior in the front-end code, the operation component is determined, and the menu information container is updated according to the operation component and its corresponding operation name.
[0080] The front-end code compilation operation may be code modification, deletion or update operations on the front-end code. A front-end code loader (Loader) component may be developed, and when the front-end code compilation is detected, the front-end code loader (Loader) component is automatically triggered to run, and the menu information container is automatically obtained.
[0081] Specifically, if the loading address of the front-end code 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. The preset operation behavior can be pre-set by relevant technical personnel according to actual needs. Specifically, the preset operation behavior can be a new operation behavior, a modification operation behavior, a deletion operation behavior, and a view details operation behavior. The corresponding action events can be a new action event, a modification action time, a deletion action event, and a view details action event.
[0082] If the front-end code has an action event for executing a preset operation behavior, the operation component is determined. The operation component may be a component that executes the operation behavior. According to the operation component and its corresponding operation name, the menu information container is updated. Exemplarily, the operation component and its operation name may be bound to the corresponding menu information and stored in the menu information container to implement the update of the menu information container.
[0083] It should be noted that the above-mentioned execution operation behavior may be to add a new action to a component, such as the action of "adding a task development list", which will open the corresponding menu component and pop up the corresponding page; in addition, the above-mentioned operation behavior may also be to delete a component, such as "deleting a task development list", in which case there is no pop-up action of the component page of the corresponding menu component. Therefore, for the two different situations, different processing methods are used to generate the corresponding operation components.
[0084] In an optional embodiment, 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, including:
[0085] Step e1: If there is an action event in the front-end code that executes a preset operation behavior, and the action event of the operation is determined to be a front-end code component, the front-end code is parsed to determine the operation name of the action event and its associated operation component, and the menu information container is updated 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 in which the operation component control is opened and the corresponding component page pops up, that is, a sensible action event.
[0087] Step e21: If there is an action event for executing a preset operation behavior in the front-end code, and the action event for the operation is determined to be hard-coded on the page, the front-end code is content parsed to determine the event trigger function and operation identifier associated with the action event for the operation.
[0088] Step e22: Determine the HTML (HyperTextMarkup Language) element code associated with the two-way binding variable corresponding to the event triggering function.
[0089] Step e23: Generate an operation component according to 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 hard-coded in the page is an action event in which there is no action such as opening or starting the operating component control, and there is no pop-up action of the corresponding component page, that is, a senseless action event.
[0091] Specifically, if it is determined that the action event of the operation is 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 of the operation. 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 automatically generates an operation component according to the operation identifier and the menu identifier, and updates the menu information container 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 accurate creation of the menu information container, and recognizes different types of action events and updates the content in the menu information container in different ways by identifying the action events of the front-end code and parsing the code content, thereby realizing accurate update of the menu information container. Since the knowledge database is constructed based on the menu information container, when the accuracy of the menu information container is significantly improved, the accuracy of the knowledge database construction is also improved, thereby ensuring the accuracy of subsequent knowledge retrieval based on the knowledge database.
[0094] Embodiment 2
[0095] Figure 2 This is a flow chart of a business query method based on a question-answer model provided in Embodiment 2 of the present invention. This embodiment provides a preferred example based on the above embodiments.
[0096] like Figure 2 As shown, the method comprises the following specific steps:
[0097] S201. When it is detected that a system program of the business management system is running, database connection configuration information is read, and a business database is connected according to the database connection configuration information to obtain at least one database table in the business database.
[0098] S202: Search menu fields of each database table to generate a target menu database table, and determine 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, 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.
[0101] S205. If the loading address is in the menu information container, the front-end code is parsed to determine whether there is an action event for executing a preset operation in the front-end code; if there is an action event for executing a preset operation in the front-end code, and the action event of the operation is determined to be a front-end code component, S206A is executed; if there is an action event for executing a preset operation in the front-end code, and the action event of the operation is determined to be hard-coded on the page, S206B-S206D is executed.
[0102] S206A, parsing the content of the front-end code, determining the operation name of the action event and its associated operation component, and updating 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 triggering 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 triggering function; 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.
[0104] S207: Create a knowledge database according to the content of the menu information container.
[0105] Specifically, the component name in a pre-built menu information container is obtained; at least one relevant information including menu information, operation name, component name and component address is stored in the menu information container; the component code of the menu component corresponding to the component name is parsed to determine the two-way binding variable of the HTTP request when the menu component is initialized; the Chinese name of the form corresponding to the two-way binding variable is determined, and a mapping relationship between the two-way binding variable and the Chinese name of the form is established, and the mapping relationship is used as an interface variable table; a knowledge record including the menu information and the operation name is generated, and the corresponding component address and the interface variable table are used as dynamic parameters of the knowledge record; a knowledge database storing at least one knowledge record and its corresponding dynamic parameters is generated.
[0106] S208. Obtain the question and answer statements generated by the target user based on the management business system, and input the question and answer statements into the pre-trained knowledge retrieval model, search the knowledge database through the knowledge retrieval model, and output the component names and interface variable table associated with the question and answer statements.
[0107] S209: Input the question and answer statements and the interface variable table into the public question and answer model to generate question and answer interaction results.
[0108] S210. Generate business query results based on the component name and the question-answer interaction results, and render the target component page through the rendering engine of the management business system to display the business query results.
[0109] Specifically, 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; perform content parsing on the component running code to obtain the two-way binding variable of the target component, and determine 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 and processing code of the target component into the function slot to obtain the target function slot; establish a global data object based on 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 3
[0111] Figure 3 A schematic diagram of the structure of a business query device based on a question-answer model provided in the third embodiment of the present invention. A business query device based on a question-answer model provided in the embodiment of the present invention can be used to quickly and accurately query or retrieve business-related data managed in a business management system scenario. The business query device based on the question-answer model can be implemented in the form of hardware and / or software, such as Figure 3 As shown, the device specifically includes: a knowledge retrieval module 301, a sentence interaction module 302 and a page rendering module 303. Among them,
[0112] The knowledge retrieval module 301 is used to obtain the question and answer statements generated by the target user based on the management business system, and input the question and answer statements into the 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;
[0113] A statement interaction module 302, used to 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;
[0114] The page rendering module 303 is used to generate a business query result based on the component name and the question-answer interaction result, and render the target component page through the rendering engine of the management business system to display the business query result.
[0115] The technical solution of the embodiment of the present invention obtains the question and answer statements generated by the target user based on the management business system, and inputs the question and answer statements into the knowledge retrieval model, and the knowledge retrieval model outputs the component name and interface variable table after performing content retrieval based on the knowledge database; the question and answer statements and the interface variable table are input into the public question and answer model to generate the question and answer interaction results; the business query results are generated according to the component name and the question and answer interaction results, and the target component page is rendered in the management business system to display the business query results. The above technical solution uses the knowledge retrieval model to retrieve the relevant component information based on the knowledge database, and inputs it into the public question and answer model, so as to render the component page based on the output result of the public question and answer model, without the need for complex business query large model training, reducing the server hardware resource cost, and using the lightweight knowledge retrieval model and the existing public question and answer model to be deeply integrated and merged with the management business system, and cooperates with the management business system to realize the retrieval and query of business resources, improve the business query efficiency and query accuracy, and improve the user query operation experience.
[0116] Optionally, the page rendering module 303 is specifically used 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] 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;
[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 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;
[0121] 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.
[0122] Optionally, the device further comprises:
[0123] 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;
[0124] 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;
[0125] 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;
[0126] 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;
[0127] The database generation module is used to generate a knowledge database storing at least one knowledge record and its corresponding dynamic parameters.
[0128] Optionally, the device further comprises:
[0129] A table acquisition module is used to read database connection configuration information before acquiring the menu components in the pre-built menu information container, when detecting that the system program of the management business system is running, and connect to the business database according to the database connection configuration information to acquire at least one database table in the business database;
[0130] A field search module is used to search menu fields in each database table, generate a target menu database table, and determine the menu information in the target menu database table;
[0131] The information container generating module is used to generate a menu information container including at least one menu information.
[0132] Optionally, the device further comprises:
[0133] A compiling detection module, for obtaining the menu information container and determining a loading address for loading the front-end code when a compiling operation is detected on the front-end code of the management business system after the menu information container including at least one menu information is generated; the menu information includes a component address;
[0134] A content analysis module, configured to perform content analysis on the front-end code if the loading address is in the menu information container, and determine whether the front-end code has an action event for executing a preset operation behavior;
[0135] The information container updating module is used to determine the operation component if the front-end code has an action event for executing a preset operation behavior, 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 used to:
[0137] 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;
[0138] 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;
[0139] Determine the HTML element code associated with the two-way binding variable corresponding to the event triggering function;
[0140] 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.
[0141] The business query device based on the question-answer model provided in the embodiment of the present invention can execute the business query method based on the question-answer model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0142] Embodiment 4
[0143] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0144] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and 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 to 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 through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0145] A number of 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 disk, an optical disk, 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 through a computer network such as the Internet and / or various telecommunication networks.
[0146] The processor 41 may be a variety of general and / or special 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 special 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 a business query method based on a question-answering model.
[0147] In some embodiments, the business query method based on the question-answer model may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on 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 the question-answer model described above may be executed. Alternatively, in other embodiments, the processor 41 may be configured to execute the business query method based on the question-answer model in any other appropriate manner (e.g., by means of firmware).
[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0149] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0150] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk 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 may 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 trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0152] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0153] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in 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-and-answer interaction result, a business query result is generated, and a target component page is rendered through the rendering engine of the management business system to display the business query result.
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: 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.
4. The method according to claim 3, 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.
5. The method according to claim 4, 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.
6. The method according to claim 5, 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.
7. 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 is used to generate business query results based on the component name and the question-and-answer interaction results, and render the target component page through the rendering engine of the management business system to display the business query results.
8. 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 6.
9. 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 the question-answer model according to any one of claims 1 to 6 when executed.
10. 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 6.
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
Insurance field automatic question-answering method and device based on large model, equipment and medium
CN119202194A
Financial business processing method and system, storage medium and computer program product
CN119226536A
Question and answer method and device based on large model, electronic equipment and storage medium
CN119357350A
Cited By
Menu retrieval method, system and device based on artificial intelligence
CN121233219A