Business query methods, devices, storage media and electronic equipment
By setting different loss values for different types of business statements, the trained business query model solves the problems of low model accuracy and poor applicability caused by a single loss value judgment, and achieves query results with higher precision and accuracy.
Patent Information
- Application Number
- CN202310232034.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-03-10
AI Technical Summary
In the fintech field, existing technologies use a single loss value as the convergence criterion for the model, which leads to low accuracy and poor applicability of the business query model, resulting in inaccurate query results.
The model loss during model training is determined by using the loss values corresponding to multiple business dialogues, including the first business dialogue with continuous fields and the second business dialogue with discrete fields. The target business query model is obtained by training a deep neural network model.
It improved the accuracy and applicability of the business query model and enhanced the accuracy of query results.
Smart Images

Figure CN116431797B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and more specifically, to a business query method, apparatus, storage medium, and electronic device. Background Technology
[0002] Currently, in the fintech field, pre-built business query models are widely used for relevant business queries. However, when training these models, a single loss value is often used as the convergence criterion. In some application scenarios, such as the credit sector, the accuracy requirements for different types of business information vary, making this single loss value approach unsuitable for all types of business information. This results in low accuracy and poor applicability of the obtained business query models, ultimately leading to inaccurate query results.
[0003] There is currently no effective solution to the problem that using a single loss value as the convergence criterion when acquiring business query models in related technologies leads to low model accuracy and poor applicability, which in turn results in low query accuracy. Summary of the Invention
[0004] The main objective of this application is to provide a business query method, apparatus, storage medium, and electronic device to solve the problem in related technologies where a single loss value is used as the model convergence criterion when acquiring a business query model, resulting in low model accuracy and poor applicability, which in turn leads to low accuracy of query results.
[0005] To achieve the above objectives, according to one aspect of this application, a business query method is provided. The method includes: acquiring a business script to be queried and corresponding business information; inputting the business script to be queried and the corresponding business information into a pre-trained target business query model to obtain a target query result corresponding to the business script; wherein the target business query model is trained based on multiple business scripts and corresponding business information; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during model training is determined based on the loss values corresponding to the first and second business scripts, respectively.
[0006] To achieve the above objectives, according to another aspect of this application, a business query device is provided. The device includes: an acquisition module for acquiring a business script to be queried and corresponding business information; and a query module for inputting the business script to be queried and the corresponding business information into a pre-trained target business query model to obtain a target query result corresponding to the business script; wherein the target business query model is trained based on multiple business scripts and corresponding business information; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; and the model loss during model training is determined based on the loss values corresponding to the first and second business scripts, respectively.
[0007] To achieve the above objectives, according to another aspect of this application, a non-volatile storage medium is also provided, which stores a plurality of instructions adapted for loading by a processor and executing any one of the above-described business query methods.
[0008] To achieve the above objectives, according to another aspect of this application, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described business query methods.
[0009] This application employs the following steps: obtaining the business script to be queried and the corresponding business information; inputting the business script to be queried and the corresponding business information into a pre-trained target business query model to obtain the target query result corresponding to the business script; wherein, the target business query model is trained based on multiple business scripts and the business information corresponding to each of the multiple business scripts; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during model training is determined based on the loss values corresponding to the first and second business scripts, respectively, achieving the goal of performing business queries through a higher-precision business query model. This solves the problem in related technologies where a single loss value is used as the model convergence criterion when obtaining the business query model, resulting in low model accuracy and poor applicability, which in turn leads to low query result accuracy. Therefore, this achieves the effect of improving the accuracy and applicability of the business query model, thereby improving the accuracy of the query results. Attached Figure Description
[0010] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0011] Figure 1 This is a flowchart of a business query method provided according to an embodiment of this application; and
[0012] Figure 2 This is a schematic diagram of an optional business query method according to an embodiment of this application;
[0013] Figure 3 This is a schematic diagram of a business query device provided according to an embodiment of this application;
[0014] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0015] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0016] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0018] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining the relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information from the aforementioned user or organization.
[0019] The following describes this application in conjunction with the preferred implementation steps. Figure 1 This is a flowchart of a business query method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0020] Step S101: Obtain the business script to be queried, and the business information corresponding to the business script to be queried.
[0021] Step S102: Input the above-mentioned business script to be queried and the business information corresponding to the above-mentioned business script to the pre-trained target business query model to obtain the target query result corresponding to the above-mentioned business script; wherein, the above-mentioned target business query model is trained based on multiple business scripts and the business information corresponding to the multiple business scripts respectively; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during the model training process is determined based on the loss values corresponding to the above-mentioned first business script and the above-mentioned second business script respectively.
[0022] By employing steps S101 to S102, the goal of conducting business queries using a more precise business query model can be achieved. This addresses the problem in related technologies where a single loss value is used as the model convergence criterion, resulting in low model accuracy and poor applicability, which in turn leads to low query result accuracy. Ultimately, this improves the accuracy and applicability of the business query model, thereby enhancing the accuracy of the query results.
[0023] It's important to note that in real-world applications, the query results for the business statements to be queried may be either continuous or discrete fields. For example, if the business statement inquires about loan balances, the result will be a specific numerical value in a continuous field; conversely, if it inquires about address information, the result will be a specific address in a discrete field. The precision requirements for continuous and discrete field queries differ. Continuous fields require more accurate results, while even minor errors in discrete fields allow business personnel to infer the correct result from the slightly inaccurate one. Therefore, during model training, loss values are calculated for business statements with different field types in the query results (i.e., the first and second business statements). The model loss during training is then determined by combining these loss values. This method comprehensively considers the precision requirements of different types of business statements, resulting in the most accurate and optimal output business query results.
[0024] In an optional embodiment, before inputting the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain the target query result corresponding to the business script, the method further includes: acquiring the plurality of business scripts and the business information corresponding to the plurality of business scripts respectively; training an initial business query model using the plurality of business scripts and the business information corresponding to the plurality of business scripts respectively to obtain a trained business query model, a first query result corresponding to the first business script, and a second query result corresponding to the second business script; determining a first loss value corresponding to the first business script based on the first query result and the second query result, and determining a second loss value corresponding to the second business script based on the second query result, wherein the first loss value is determined based on a first difference between a preset third query result and the first query result, and the second loss value is determined based on a second difference between a preset fourth query result and the second query result; and using the trained business query model as the target business query model when the first loss value and the second loss value satisfy a preset loss condition.
[0025] Optionally, the third query result is the standard query result corresponding to the first business script; the fourth query result is the standard query result corresponding to the second business script. The initial business query model is constructed based on a deep neural network (DNN) model.
[0026] It is understandable that before using the target business query model for business queries, the aforementioned target business query model needs to be obtained through model training. Using the above method, multiple business phrases and their corresponding business information are used as model inputs to train the initial business query model for a preset number of training rounds. This results in the final training round output of the trained business query model, including the first query result corresponding to the first business phrase and the second query result corresponding to the second business phrase. A first loss value is calculated between the first query result and its corresponding standard query result (i.e., the preset third query result), and a second loss value is calculated between the second query result and its corresponding standard query result (i.e., the preset fourth query result). When the first and second loss values meet the preset loss conditions, it indicates that the trained business query model has reached the predetermined accuracy requirement. At this point, the trained business query model is directly output as the final target business query model.
[0027] It should be noted that in related technologies, a single loss value is used as the convergence criterion when training the business query model, resulting in low training accuracy and poor applicability. The embodiments of this application improve the training accuracy and applicability of the business query model by setting different loss methods for different field types of business data when training the business query model.
[0028] In an optional embodiment, the step of using the trained business query model as the target business query model when the first loss value and the second loss value satisfy a preset loss condition includes: obtaining a first weight value corresponding to the first loss value and a second weight value corresponding to the second loss value, wherein the first weight value is less than the second weight value; determining the total model loss corresponding to the trained business query model based on the first loss value, the first weight value, the second loss value, and the second weight value; and using the trained business query model as the target business query model when the total model loss is less than a preset third loss threshold.
[0029] It should be noted that the first and second business statements have different precision requirements for the output query results. The query results for continuous fields corresponding to the first business statement have higher precision requirements, while the query results for discrete fields corresponding to the second business statement may not have such high precision requirements. This is reflected in the loss value requirements, where the loss value corresponding to the first business statement is smaller than that corresponding to the second business statement. Therefore, when calculating the total model loss, different weights are assigned to the first and second weight values. For example, the first weight value corresponding to the first loss value is set between 0 and 0.5, and the first weight value corresponding to the second loss value is set to 1. Based on this, the first and second weight values are weighted and summed. The resulting total model loss integrates the different precision requirements of the first and second business statements for the output query results, resulting in a final target business query model with higher model precision, which can better adapt to business query needs.
[0030] In an optional embodiment, the above-mentioned use of the trained business query model as the target business query model when the first loss value and the second loss value satisfy a preset loss condition includes: using the trained business query model as the target business query model when the first loss value is less than a preset first loss threshold and the second loss value is less than a preset second loss threshold, wherein the first loss threshold is less than the second loss threshold.
[0031] It should be noted that the first and second business queries have different precision requirements for the output query results. The query results for continuous fields corresponding to the first business query have higher precision requirements, while the query results for discrete fields corresponding to the second business query may not have such high precision requirements. This is reflected in the loss value requirements, where the loss value for the first business query is smaller than that for the second business query. Therefore, when setting the loss value judgment conditions, a smaller loss threshold is set for the first loss value corresponding to the first business query. When both the first and second loss values are less than their respective loss thresholds during training, it indicates that the model training has reached the corresponding precision requirements, at which point training can be stopped, and the final target business query model can be output.
[0032] In an optional embodiment, the method further includes: when the first loss value and the second loss value do not meet the preset loss condition, using the trained business query model as a new initial business query model, and repeatedly performing the following operations until the new first loss value and the new second loss value meet the loss condition: acquiring multiple new business scripts and business information corresponding to each of the multiple new business scripts; inputting the multiple new business scripts and the business information corresponding to each of the multiple new business scripts into the new initial business query model for training, to obtain a new trained business query model, and the new first query model corresponding to the first business script. The query results, and the new second query results corresponding to the second business script; based on the new first query results, determine the new first loss value corresponding to the first business script, and based on the new second query results, determine the new second loss value corresponding to the second business script; use the new first loss value as the first loss value, use the new second loss value as the second loss value, and use the new trained business query model as the trained business query model; if the new first loss value and the new second loss value satisfy the preset loss conditions, use the new trained business query model as the target business query model.
[0033] It is understandable that if the first loss value and the second loss value do not meet the preset loss conditions, it indicates that the accuracy of the currently obtained trained business query model is insufficient. More business statements and corresponding business information (i.e., multiple new business statements and the business information corresponding to the multiple new business statements) can be obtained to continue model training until the new first loss value and the new second loss value meet the preset loss conditions.
[0034] As an optional embodiment, if the first loss value and the second loss value do not meet the preset loss condition, the trained business query model is used as a new initial business query model, and the following operations are performed iteratively until the new first loss value and the new second loss value meet the aforementioned loss condition: The plurality of business phrases and the business information corresponding to each of the plurality of business phrases are input into the new initial business query model for training, resulting in a new trained business query model, a new first query result corresponding to the first business phrase, and a new second query result corresponding to the second business phrase; Based on the new first query result, a new first loss value corresponding to the first business phrase is determined, and based on the new second query result, a new second loss value corresponding to the second business phrase is determined; The new first loss value is used as the first loss value, the new second loss value is used as the second loss value, and the new trained business query model is used as the trained business query model; If the new first loss value and the new second loss value meet the preset loss condition, the new trained business query model is used as the target business query model.
[0035] It is understandable that if the first loss value and the second loss value do not meet the preset loss conditions, it indicates that the accuracy of the currently obtained trained business query model is insufficient. The model can continue to be trained based on multiple business dialogues and corresponding business information until the new first loss value and the new second loss value meet the preset loss conditions.
[0036] In an optional embodiment, the above-mentioned acquisition of new multiple business scripts includes: adjusting the ratio of the first business script and the second business script included in the multiple business scripts based on the first loss value and the second loss value, to obtain the above-mentioned new multiple business scripts.
[0037] Optionally, if the first loss value and the second loss value do not meet the preset loss conditions, it indicates that the accuracy of the currently acquired trained business query model is insufficient. In this case, the proportion of the first business statement and the second business statement among multiple business statements can be adaptively adjusted according to the magnitude of the first and second loss values to continue model training. For example, if the first loss value is greater than the second loss value, it indicates that the first loss value has a greater impact on the model accuracy, and the current business query model's prediction accuracy for the query results of the first business statement is insufficient. In this case, consider increasing the proportion of the first business statement among multiple business statements to continue model training, thereby accelerating the model's convergence speed.
[0038] In an optional embodiment, the above-mentioned inputting the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain the target query result corresponding to the business script includes: inputting the business script to be queried into the target business query model to obtain a fifth business query result corresponding to the business script to be queried, wherein the fifth business query result is in a structured query language statement format; determining a first query instruction corresponding to the fifth business query result and sending the first query instruction to the target database; and receiving the target query result returned by the target database.
[0039] Optionally, the above target query results are query results in natural language statement format.
[0040] Optionally, when the business to be queried is input into the target business query model for business query, the corresponding output query result (i.e., the fifth business query result) is in the format of a structured query language statement (i.e., SQL statement format). At this time, an SQL query instruction (i.e., the first query instruction) corresponding to the fifth business query result is generated and sent to the corresponding target database. The target database performs data query based on the SQL query instruction and finds the query result in the format of a natural language statement corresponding to the fifth business query result. The query result in the above-mentioned natural language statement format returned by the target database is the target query result.
[0041] Based on the above embodiments and optional embodiments, this application proposes an optional implementation method. Figure 2 This is a flowchart of an optional business query method according to an embodiment of this application, such as... Figure 2 As shown, the method includes:
[0042] Step S1: Connect to the database, obtain multiple business scripts, business information corresponding to each business script, and standard query results in SQL format corresponding to each business script.
[0043] Step S2: Input multiple business scripts and the business information corresponding to each business script into the DNN model for training, obtain the trained DNN model, and output the business query results corresponding to each business script. Classify the business query results corresponding to each business script by field to obtain continuous business query results and discrete business query results.
[0044] Step S3: Based on the continuous business query results and the corresponding standard query results, calculate the loss value corresponding to the continuous business query results, and perform weighted calculation on the loss value corresponding to the continuous business query results to obtain the first loss value; based on the discrete business query results and the corresponding standard query results, calculate the second loss value corresponding to the discrete business query results, and sum the first loss value and the second loss value to obtain the total model loss.
[0045] Step S4: Determine whether the convergence condition has been met based on the total model loss, i.e., whether the total model loss is less than the preset loss threshold.
[0046] Step S5: If the convergence condition is met, the model training ends, and the trained business query model is output as the target business query model.
[0047] Step S6: If the convergence condition is not met, repeat steps S2 to S4 until the convergence condition is met.
[0048] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0049] This application also provides a business query device. It should be noted that the business query device of this application can be used to execute the business query method provided in this application. The business query device provided in this application is described below.
[0050] Figure 3 This is a schematic diagram of a business query device according to an embodiment of this application. Figure 3 As shown, the device includes: an acquisition module 300 and a query module 302, wherein,
[0051] The aforementioned acquisition module 300 is used to acquire the business script to be queried, as well as the business information corresponding to the business script to be queried.
[0052] The query module 302, connected to the acquisition module 300, is used to input the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain the target query result corresponding to the business script. The target business query model is trained based on multiple business scripts and the business information corresponding to each of the multiple business scripts. The multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field. The model loss during the model training process is determined based on the loss values corresponding to the first business script and the second business script, respectively.
[0053] In this application, an acquisition module 300 is set up to acquire the business script to be queried and the corresponding business information. A query module 302, connected to the acquisition module 300, is used to input the business script to be queried and the corresponding business information into a pre-trained target business query model to obtain the target query result corresponding to the business script. The target business query model is trained based on multiple business scripts and the corresponding business information. The multiple business scripts include a first business script with a continuous field as the query result and a second business script with a discrete field as the query result. The model loss during training is determined based on the loss values corresponding to the first and second business scripts, achieving the goal of performing business queries using a higher-precision business query model. This solves the problem in related technologies where a single loss value is used as the model convergence criterion, resulting in low model accuracy and poor applicability, leading to low query result accuracy. Therefore, this method improves the accuracy and applicability of the business query model, thereby improving the accuracy of the query results.
[0054] The business query device provided in this application embodiment achieves the goal of performing business queries through a higher-precision business query model. It solves the problem in related technologies where a single loss value is used as the model convergence judgment condition when obtaining the business query model, resulting in low model accuracy and poor applicability, which in turn leads to low query result accuracy. Thus, it achieves the effect of improving the accuracy and applicability of the business query model, thereby improving the accuracy of the query results.
[0055] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0056] It should be noted that the acquisition module 300 and query module 302 mentioned above correspond to steps S101 to S102 in the embodiments. The instances and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run in a computer terminal.
[0057] It should be noted that the optional or preferred implementation methods of this embodiment can be found in the relevant descriptions in the embodiments, and will not be repeated here.
[0058] The aforementioned business query device includes a processor and a memory. All of the aforementioned units are stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0059] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and their parameters can be adjusted (for the purposes of this application).
[0060] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0061] This application provides a non-volatile storage medium storing a program that, when executed by a processor, implements the aforementioned business query method.
[0062] This application provides a processor for running a program, wherein the program executes the business query method.
[0063] like Figure 4 As shown, this application embodiment provides an electronic device 10, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring a business script to be queried and the corresponding business information; inputting the business script to be queried and the corresponding business information into a pre-trained target business query model to obtain a target query result corresponding to the business script; wherein, the target business query model is trained based on multiple business scripts and the business information corresponding to each of the multiple business scripts; the multiple business scripts include a first business script whose query result is a continuous field, and a second business script whose query result is a discrete field; the model loss during model training is determined based on the loss values corresponding to the first business script and the second business script, respectively. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0064] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program with the following initialization steps: obtaining a business script to be queried and the business information corresponding to the business script; inputting the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain a target query result corresponding to the business script; wherein, the target business query model is trained based on multiple business scripts and the business information corresponding to the multiple business scripts respectively; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during the model training process is determined based on the loss values corresponding to the first business script and the second business script respectively.
[0065] Optionally, the aforementioned computer program product is also suitable for executing an initialization program with the following steps: acquiring the aforementioned multiple business scripts and the business information corresponding to each of the aforementioned multiple business scripts; training an initial business query model using the aforementioned multiple business scripts and the business information corresponding to each of the aforementioned multiple business scripts to obtain a trained business query model, a first query result corresponding to the aforementioned first business script, and a second query result corresponding to the aforementioned second business script, wherein the aforementioned initial business query model is constructed based on a deep neural network model; determining a first loss value corresponding to the aforementioned first business script based on the aforementioned first query result and the aforementioned second query result, and determining a second loss value corresponding to the aforementioned second business script based on the aforementioned second query result, wherein the aforementioned first loss value is determined based on a first difference between a preset third query result and the aforementioned first query result, and the aforementioned second loss value is determined based on a second difference between a preset fourth query result and the aforementioned second query result; and using the trained business query model as a target business query model when the aforementioned first loss value and the aforementioned second loss value satisfy a preset loss condition.
[0066] Optionally, the aforementioned computer program product is also suitable for executing an initialization program with the following method steps: obtaining a first weight value corresponding to the first loss value and a second weight value corresponding to the second loss value, wherein the first weight value is less than the second weight value; determining the total model loss corresponding to the trained business query model based on the first loss value, the first weight value, the second loss value, and the second weight value; and using the trained business query model as the target business query model if the total model loss is less than a preset third loss threshold.
[0067] Optionally, the computer program product described above is also suitable for executing a program that initializes the following steps: when the first loss value is less than a preset first loss threshold and the second loss value is less than a preset second loss threshold, the trained business query model is used as the target business query model, wherein the first loss threshold is less than the second loss threshold.
[0068] Optionally, the aforementioned computer program product is also suitable for executing an initialization program with the following steps: If the first loss value and the second loss value do not satisfy a preset loss condition, the trained business query model is used as a new initial business query model, and the following operations are performed iteratively until the new first loss value and the new second loss value satisfy the aforementioned loss condition: acquiring multiple new business phrases and the business information corresponding to each of the multiple new business phrases; inputting the multiple new business phrases and the business information corresponding to each of the multiple new business phrases into the new initial business query model for training, thereby obtaining a new trained business query model, wherein the first business phrase... The new first query result and the new second query result corresponding to the second business script are obtained; based on the new first query result, the new first loss value corresponding to the first business script is determined, and based on the new second query result, the new second loss value corresponding to the second business script is determined; the new first loss value is used as the first loss value, the new second loss value is used as the second loss value, and the new trained business query model is used as the trained business query model; if the new first loss value and the new second loss value satisfy the preset loss condition, the new trained business query model is used as the target business query model.
[0069] Optionally, the computer program product described above is also suitable for executing a program that initializes the following steps: based on the first loss value and the second loss value, adjusting the proportions of the first business script and the second business script included in the plurality of business scripts to obtain the plurality of new business scripts.
[0070] Optionally, the aforementioned computer program product is also suitable for executing a program that initializes the following steps: inputting the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain the target query result corresponding to the business script, including: inputting the business script to be queried into the target business query model to obtain a fifth business query result corresponding to the business script to be queried, wherein the fifth business query result is in a structured query language statement format; determining a first query instruction corresponding to the fifth business query result and sending the first query instruction to the target database; and receiving the target query result returned by the target database.
[0071] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0072] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0075] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0076] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0077] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0078] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0079] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0080] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A business query method, characterized in that, include: Obtain the business script to be queried, and the business information corresponding to the business script to be queried; The business script to be queried and the business information corresponding to the business script to be queried are input into the pre-trained target business query model to obtain the target query result corresponding to the business script; The target business query model is trained based on multiple business scripts and the business information corresponding to each of the multiple business scripts; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during the model training process is determined based on the loss values corresponding to the first business script and the second business script respectively. The step of inputting the business script to be queried and the business information corresponding to the business script to a pre-trained target business query model to obtain the target query result corresponding to the business script includes: inputting the business script to be queried into the target business query model to obtain a fifth business query result corresponding to the business script to be queried, wherein the fifth business query result is in a structured query language statement format; determining a first query instruction corresponding to the fifth business query result and sending the first query instruction to the target database; and receiving the target query result returned by the target database. The method further includes: determining a first loss value corresponding to the first business script based on a first query result, and determining a second loss value corresponding to the second business script based on a second query result, wherein the first query result corresponds to the first business script, the second query result corresponds to the second business script, the first loss value is determined based on a first difference between a preset third query result and the first query result, and the second loss value is determined based on a second difference between a preset fourth query result and the second query result.
2. The method according to claim 1, characterized in that, Before inputting the business script to be queried and the business information corresponding to the business script to the pre-trained target business query model to obtain the target query result corresponding to the business script, the method further includes: Obtain the multiple business scripts and the business information corresponding to each of the multiple business scripts; The initial business query model is trained using the multiple business scripts and the business information corresponding to the multiple business scripts to obtain the trained business query model, the first query result corresponding to the first business script, and the second query result corresponding to the second business script. The initial business query model is constructed based on a deep neural network model. If the first loss value and the second loss value satisfy a preset loss condition, the trained business query model is used as the target business query model.
3. The method according to claim 2, characterized in that, The step of using the trained business query model as the target business query model when the first loss value and the second loss value satisfy a preset loss condition includes: Obtain a first weight value corresponding to the first loss value and a second weight value corresponding to the second loss value, wherein the first weight value is less than the second weight value; Based on the first loss value, the first weight value, the second loss value, and the second weight value, the total model loss corresponding to the trained business query model is determined; If the total loss of the model is less than a preset third loss threshold, the trained business query model is used as the target business query model.
4. The method according to claim 2, characterized in that, The step of using the trained business query model as the target business query model when the first loss value and the second loss value satisfy a preset loss condition includes: If the first loss value is less than a preset first loss threshold and the second loss value is less than a preset second loss threshold, the trained business query model is used as the target business query model, wherein the first loss threshold is less than the second loss threshold.
5. The method according to claim 2, characterized in that, The method further includes: If the first loss value and the second loss value do not meet the preset loss condition, the trained business query model is used as a new initial business query model, and the following operations are performed iteratively until the new first loss value and the new second loss value meet the loss condition: Acquire multiple new business phrases and corresponding business information; input the multiple new business phrases and corresponding business information into the new initial business query model for training, to obtain a new trained business query model, a new first query result corresponding to the first business phrase, and a new second query result corresponding to the second business phrase; based on the new first query result, determine a new first loss value corresponding to the first business phrase, and based on the new second query result, determine a new second loss value corresponding to the second business phrase; use the new first loss value as the first loss value, the new second loss value as the second loss value, and the new trained business query model as the trained business query model. If the new first loss value and the new second loss value satisfy the preset loss condition, the new trained business query model is used as the target business query model.
6. The method according to claim 5, characterized in that, The acquisition of multiple new business scripts includes: Based on the first loss value and the second loss value, the proportions of the first business script and the second business script included in the plurality of business scripts are adjusted to obtain the new plurality of business scripts.
7. A business query device, characterized in that, include: The acquisition module is used to acquire the business script to be queried, as well as the business information corresponding to the business script to be queried; The query module is used to input the business script to be queried and the business information corresponding to the business script to be queried into a pre-trained target business query model to obtain the target query result corresponding to the business script. The target business query model is trained based on multiple business scripts and the business information corresponding to each of the multiple business scripts; the multiple business scripts include a first business script whose query result is a continuous field and a second business script whose query result is a discrete field; the model loss during the model training process is determined based on the loss values corresponding to the first business script and the second business script respectively. The query module is further configured to input the business script to be queried into the target business query model to obtain the fifth business query result corresponding to the business script to be queried, wherein the fifth business query result is in a structured query language statement format; determine the first query instruction corresponding to the fifth business query result and send the first query instruction to the target database; and receive the target query result returned by the target database. The device is further configured to determine a first loss value corresponding to the first business script based on a first query result, and to determine a second loss value corresponding to the second business script based on a second query result, wherein the first query result corresponds to the first business script, the second query result corresponds to the second business script, the first loss value is determined based on a first difference between a preset third query result and the first query result, and the second loss value is determined based on a second difference between a preset fourth query result and the second query result.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the business query method according to any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the business query method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Report query method and device, storage medium and electronic equipment
CN110347784A
Information query method, device and system, and storage medium
CN114117025A