Method and device for adjusting query system, electronic equipment, medium and product
The query strategy group is adjusted through the simulated annealing algorithm and the query system is optimized based on user feedback information, which solves the problem of low adaptability of query strategies and improves query accuracy and user experience.
Patent Information
- Application Number
- CN202510772664.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-11
AI Technical Summary
The preset query strategies in the query system are low in adaptability, resulting in low query accuracy. Users need to readjust the data to be queried or query strategies, which raises the threshold for use and reduces the user experience.
The initial query policy group is adjusted through the simulated annealing algorithm, multiple query policy groups are generated to be selected, the target query policy group is determined based on the user feedback information, and the query results are generated through the target query policy group, and the query system is gradually optimized to adapt to user behavior.
It improves the query accuracy of the query system, lowers the threshold for user adjustment, and improves the user experience.
Smart Images

Figure CN120296036A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and particularly to a method, apparatus, electronic device, medium, and product for adjusting a query system. Background Art
[0002] The query system performs query processing on the data to be queried, obtains documents associated with the data to be queried, inputs the documents into a pre-trained model, and obtains a query result corresponding to the data to be queried, so as to implement the query for the data to be queried.
[0003] However, in the related art, the query system performs detection processing through a preset query strategy, and the preset query strategy has a problem of low adaptability, resulting in a problem of low query accuracy of the query system. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, medium, and product for adjusting a query system, so as to at least solve the problem of low query accuracy in the related art.
[0005] This application provides a method for adjusting a query system, including: receiving a query request sent by a user terminal, where the query request includes data to be queried; determining an initial query strategy group of an initial query system according to the query request; performing adjustment processing on the initial query strategy group through a simulated annealing algorithm to obtain a plurality of candidate query strategy groups; determining a target query strategy group from the plurality of candidate query strategy groups, generating a query result corresponding to the data to be queried through the target query strategy group, and obtaining a plurality of user feedback messages corresponding to the query result; and performing adjustment processing on the initial query system according to the plurality of user feedback messages and the target query strategy group to obtain an adjusted query system.
[0006] This application further provides an apparatus for adjusting a query system, including: a receiving module, configured to receive a query request sent by a user terminal, where the query request includes data to be queried; a determining module, configured to determine an initial query strategy group of an initial query system according to the query request; an adjustment module, configured to perform adjustment processing on the initial query strategy group through a simulated annealing algorithm to obtain a plurality of candidate query strategy groups; a generating module, configured to determine a target query strategy group from the plurality of candidate query strategy groups, generate a query result corresponding to the data to be queried through the target query strategy group, and obtain a plurality of user feedback messages corresponding to the query result; and an optimization module, configured to perform adjustment processing on the initial query system according to the plurality of user feedback messages and the target query strategy group to obtain an adjusted query system.
[0007] The present application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above query system adjustment methods when executing the computer program.
[0008] The present application also provides a non-volatile computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any of the above query system adjustment methods when executed by a processor.
[0009] The present application also provides a computer program product including a computer program, which implements the steps of any of the above query system adjustment methods when executed by a processor.
[0010] Through the present application, the query strategy group in the query system can be adjusted according to user feedback information, so that the query strategy group adapts to the user's behavior, thereby gradually optimizing the query system to improve query accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 It is a schematic diagram of an application scenario of a query system adjustment method provided by an embodiment of the present application;
[0013] Figure 2 It is a schematic flowchart of a query system adjustment method provided by an embodiment of the present application;
[0014] Figure 3 It is a schematic flowchart of a query system adjustment method provided by an embodiment of the present application;
[0015] Figure 4 It is a schematic diagram of a historical strategy usage record provided by an embodiment of the present application;
[0016] Figure 5 It is a schematic diagram of feedback information provided by an embodiment of the present application;
[0017] Figure 6 It is a schematic diagram of the combination of a multi-armed bandit algorithm and a simulated annealing algorithm provided by an embodiment of the present application;
[0018] Figure 7 It is a schematic structural diagram of a query system adjustment device provided by an embodiment of the present application;
[0019] Figure 8Structural schematic diagram of an adjustment device for a query system provided by an embodiment of the present application;
[0020] Figure 9 Structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0021] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0022] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0023] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, use, processing, transmission, provision, disclosure, and application, complies with relevant laws, regulations, and standards of relevant countries and regions, takes necessary confidentiality measures, does not violate public order and good customs, and provides corresponding operation entrances for users to choose to authorize or refuse.
[0024] Furthermore, for the technical solution of the present application that involves big data analysis of user information (including but not limited to personal biometric characteristics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and uses artificial intelligence technology for automated decision-making, and makes decisions having a significant impact on personal rights and interests based on the results of automated decision-making, corresponding operation entrances are provided for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0025] Exemplarily, the query system outputs corresponding query results according to the data to be queried by the user. For example, if the data to be queried is a question, the query result is the answer corresponding to the question. The working process of the query system includes two steps: querying relevant documents of the data to be queried, and performing mapping processing on the relevant documents through a pre-trained model to obtain query results. The query system executes a query strategy to query relevant documents from the document library for the data to be queried.
[0026] It can be understood that the higher the relevance of the documents queried by the query system to the data to be queried, the more accurate the query results output by the pre-trained model.
[0027] In the related art, the query system performs queries by executing a preset query strategy. The preset query strategy cannot adapt to the query habits of different users, resulting in a low degree of relevance between the documents queried by the query system and the data to be queried, and further resulting in a low accuracy of the query results of the query system. Users need to readjust the data to be queried or the query strategy according to the query results, which increases the user's usage threshold and further reduces the user's usage experience.
[0028] To enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the adjustment method of the query system depends, the specific application environment architecture or specific hardware architecture will be described herein. Refer to Figure 1 , Figure 1 is a schematic application diagram of the adjustment method of the query system. The user terminal sends the data to be queried to the query system. The query system queries relevant documents for the data to be queried through a query strategy, the query system calls a pre-trained model to map the relevant documents to obtain query results, and sends the query results to the user terminal. The user terminal determines whether to continue query processing according to the query results.
[0030] Figure 2 is a schematic flowchart of the adjustment method of the query system provided by the embodiment of the present application. As Figure 2 shown, the embodiment of the present application provides an adjustment method for a query system, and the method will be described in detail as follows:
[0031] S201. Receive a query request sent by the user terminal, where the query request includes the data to be queried.
[0032] Exemplarily, the query request is used to trigger the query system to perform a query, and the data to be queried is the basis for the query system to perform the query.
[0033] Exemplarily, a user may interact with a user terminal, and the user terminal generates data to be queried according to content input by the user, and initiates a query request to a query system.
[0034] Exemplarily, the data to be queried may be a question (such as what will the weather be like tomorrow) or an instruction (generate an argumentative essay), and the query system uses different strategies to perform queries based on different data to be queried.
[0035] S202: Determine an initial query strategy group of the initial query system according to the query request.
[0036] Exemplarily, the initial query system is the current state of the query system, and the initial query policy group is the query policy group currently used by the initial query system.
[0037] Exemplarily, the initial query system uses multiple query strategy groups, each query strategy group is adapted to a different data type, and the initial query strategy group is a query strategy group adapted to the data to be queried sent by the user end.
[0038] Exemplarily, the initial query strategy group includes at least one query strategy. The query strategy includes but is not limited to at least one of the following: vector query, keyword query, or graph query. Each query strategy is adapted to different data types. The initial query strategy group obtained by combining multiple query strategies can realize comprehensive query of multiple dimensions to improve the accuracy of the query.
[0039] Exemplarily, for an initial query strategy group including multiple query strategies, the multiple query strategies may be mixed in proportion, for example, the vector query strategy accounts for 70% and the keyword query strategy accounts for 30% in the initial query strategy group.
[0040] S203: Adjust the initial query strategy group through a simulated annealing algorithm to obtain multiple query strategy groups to be selected.
[0041] Exemplarily, the simulated annealing algorithm (SA) is used to find a near global optimal solution in a large-scale search space.
[0042] For example, the initial query strategy group may not be the query strategy group that best suits the user, and the initial query strategy group is fine-tuned by the simulated annealing algorithm to obtain multiple candidate query strategy groups. The query strategy group that suits the user is determined by evaluating the multiple candidate query strategy groups respectively, thereby improving the accuracy of the query.
[0043] Exemplarily, the initial query strategy group is adjusted through multiple adjustment methods to obtain multiple candidate query strategy groups, where each candidate query strategy group corresponds to an adjustment method. Through multiple adjustment methods, the initial query strategy group can be adjusted from different dimensions to search for the global optimal solution and improve the accuracy of adjustment.
[0044] S204. Determine the target query strategy group from multiple candidate query strategy groups, generate the query result corresponding to the data to be queried through the target query strategy group, and obtain multiple user feedback messages corresponding to the query result.
[0045] Exemplarily, the target query strategy group is screened from multiple candidate query strategy groups. The target query strategy group is the query strategy group used to execute the query request. By executing the target query strategy group, it can be determined whether the target query strategy group is suitable for the user.
[0046] Exemplarily, the user feedback message can be the interaction behavior of the user on the user side. For example, it can be: the residence time of the user on the user-side interface, the control clicked by the user on the user-side interface (the control can be to approve or disapprove the query result), etc. The user feedback message can reflect whether the query result meets the user's expectations, so as to adjust the query system according to the user feedback message.
[0047] Combined with the scenario example, the query system executes the target query strategy group, queries relevant documents from the document library, and inputs the relevant documents into the pre-trained model to obtain the corresponding query result.
[0048] S205. Adjust the initial query system according to multiple user feedback messages and the target query strategy group to obtain the adjusted query system.
[0049] Exemplarily, if the target query strategy group is more suitable for the user, the initial query strategy group is replaced by the target query strategy group to obtain the adjusted query system. Otherwise, the target query strategy group is deleted.
[0050] Exemplarily, it is determined whether the query result meets the user's expectations through multiple user feedback messages, and it is indirectly determined whether the target query strategy group is suitable for the user according to whether the query result meets the user's expectations, so as to determine whether to retain the target query strategy group.
[0051] Exemplarily, the adjusted query system continuously performs iterative adjustment to gradually obtain a query system that is more suitable for the user.
[0052] Combined with the scenario example, the adjusted query system is more suitable for the user. When the query request is executed subsequently, the adjusted query system is used. The adjusted query system iteratively performs the above adjustment during use to make the query system gradually adapt to the user, thereby improving the accuracy of the query.
[0053] The adjustment method of the query system provided by the embodiment of the present application receives a query request sent by a user terminal, where the query request includes data to be queried; determines an initial query strategy group of an initial query system according to the query request; adjusts the initial query strategy group through a simulated annealing algorithm to obtain multiple candidate query strategy groups; determines a target query strategy group from the multiple candidate query strategy groups, generates a query result corresponding to the data to be queried through the target query strategy group, and obtains multiple user feedback information corresponding to the query result; adjusts the initial query system according to the multiple user feedback information and the target query strategy group to obtain an adjusted query system. According to the above solution, the query strategy group in the query system is adjusted according to the user feedback information, so that the query strategy group adapts to the user's behavior, thereby gradually optimizing the query system to improve query accuracy.
[0054] Based on any of the above embodiments, below, in combination with Figure 3 , the detailed process of the adjustment method of the query system will be described.
[0055] Figure 3 It is a schematic flowchart of an adjustment method of a query system provided by an embodiment of the present application. As Figure 3 shown, the method includes:
[0056] S301. Receive a query request sent by a user terminal, where the query request includes data to be queried.
[0057] It should be noted that the execution process of S301 refers to S201, which will not be elaborated here.
[0058] S302. Determine an initial query strategy group of an initial query system according to the query request.
[0059] A feasible implementation manner can determine the initial query strategy group through the following method: determine the target data type of the data to be queried; determine the mapping relationship between the data type and the query strategy group; determine the initial query strategy group according to the target data type and the mapping relationship.
[0060] Exemplarily, the mapping relationship includes the query strategy group corresponding to each data type. The query strategy group corresponding to the target data type in the mapping relationship is determined as the initial query strategy group.
[0061] Combined with the scenario example, each query strategy group adapts to the corresponding data type, and querying through the initial query strategy group corresponding to the target data type can improve the query accuracy.
[0062] Optionally, the query system maintains a policy pool, and the policy pool includes multiple query strategy groups, and determines the initial query strategy group from the multiple query strategy groups.
[0063] In this feasible implementation manner, the initial query policy group adapted to the data to be queried can be accurately determined through the mapping relationship, thereby improving the query accuracy.
[0064] S303. Adjust the policy parameters and / or policy structure of the initial query policy group through a perturbation function to obtain multiple candidate query policy groups.
[0065] Exemplarily, the policy parameter adjustment can be to adjust the proportion of each query policy in the initial query policy group.
[0066] Combined with the scenario example, in the initial query policy group, the vector query policy accounts for 70% and the keyword query policy accounts for 30%. One of the candidate query policy groups obtained by perturbing and calculating the weight proportion of the vector query policy through the perturbation function has the weight proportion of the vector query policy as 68%, and the corresponding weight proportion of the keyword query policy is adaptively adjusted to 32%. Multiple perturbation calculations are respectively performed on the initial query policy group to obtain multiple candidate query policy groups.
[0067] Exemplarily, the policy structure adjustment can be to add, delete, or replace query policies in the initial query policy group.
[0068] Optionally, the policy structure adjustment can be performed through the following formula:
[0069]
[0070] Among them, represents the initial query policy group, represents the policy structure adjustment of the initial query policy group, represents the candidate query policy group, represents the probability of policy structure adjustment.
[0071] Combined with the scenario example, through the probability control is used to perform a random perturbation strategy, and it is judged whether to execute the policy structure adjustment through the probability. If so, the query policy group obtained by the policy structure adjustment is determined as the candidate query policy group. If not, the policy structure adjustment is not executed.
[0072] Based on the above implementation manner, compared with the deterministic method, performing the policy structure adjustment through the random method can explore the globally optimal query policy group, thereby improving the query accuracy.
[0073] S304. Determine the historical policy usage record, where the historical policy usage record includes multiple query policy groups, the feedback values corresponding to each query policy group, and the usage frequencies corresponding to each query policy group.
[0074] Exemplarily, the feedback value is determined according to the user's satisfaction with the query result, indicating the degree of adaptation between the query result and the user. The usage frequency represents the frequency of the query system using the query strategy group, indicating the tendency of the query system towards the query strategy group.
[0075] S305. Determine multiple candidate feedback values and multiple candidate usage frequencies corresponding to multiple candidate query strategy groups according to the historical strategy usage records.
[0076] Next, Figure 4 describe the historical strategy usage records.
[0077] Figure 4 is a schematic diagram of the historical strategy usage records provided by the embodiments of the present application. As Figure 4 shown, the historical strategy usage records include multiple query strategy groups, multiple feedback values, and multiple usage frequencies, and there is a one-to-one relationship among the query strategy groups, feedback values, and usage frequencies. By comparing the composition of the candidate query strategy groups with the historical strategy usage records, determine the corresponding multiple candidate feedback values and multiple candidate usage frequencies.
[0078] Optionally, for the feedback values and usage frequencies of the new candidate query strategy groups obtained through adjustment processing, they can be determined by the query strategy groups with similar parameters in the historical strategy usage records. For example, if the weight ratio of the vector query of the new candidate query strategy group is 65%, the feedback values and usage frequencies of the query strategy groups with a vector query weight ratio between 60% and 70% in the historical strategy usage records can be comprehensively considered to determine the feedback values and usage frequencies of the candidate query strategy groups.
[0079] S306. Perform calculation processing through the multi-armed bandit algorithm according to multiple candidate feedback values and multiple candidate usage frequencies to obtain multiple priority information corresponding to multiple candidate query strategy groups.
[0080] Exemplarily, the priority information is used to determine the priority ranking of the candidate query strategies. The candidate query strategies with a higher priority ranking should be used preferentially.
[0081] Exemplarily, the higher the feedback value of the candidate query strategy group, the more the user tends to use it, and the corresponding priority is higher. The less the usage frequency of the candidate query strategy group, there may be a problem that the query system uses the local optimal solution as the basis for using the query strategy group, while missing the query strategy group with higher accuracy. Increase the priority of the candidate query strategy group with less usage frequency to achieve the global optimum, thereby improving the accuracy of the query.
[0082] S307. Determine the target query strategy group from multiple candidate query strategies according to multiple priority information.
[0083] Optionally, the target query policy group can be determined by the following formula:
[0084]
[0085] Wherein, represents the target query policy group, represents the feedback value of one of the candidate query policy groups and represents the usage frequency of one of the candidate query policy groups , represents multiple candidate query policy groups, S represents the total historical query times of the query system, and α is a coefficient for controlling the exploration degree.
[0086] Exemplarily, the candidate query policy group with the highest priority is determined as the target query policy group.
[0087] Exemplarily, it is used to preferentially use the strategies with fewer historical usage times to avoid local optimal solutions.
[0088] Based on the above embodiments, by comprehensively considering the candidate feedback value and the candidate usage frequency, the target query group can be determined comprehensively from multiple dimensions, thereby improving the query accuracy.
[0089] A feasible implementation method can generate query results by the following method: execute the target query policy group through the initial query system, perform query processing in the document library to obtain multiple candidate documents corresponding to the data to be queried; input the multiple candidate documents into the pre-trained model of the initial query system to obtain the query results.
[0090] Exemplarily, the multiple candidate documents are documents related to the data to be queried. Inputting the multiple candidate documents into the pre-trained model can provide more samples for the pre-trained model. The multiple samples can enable the pre-trained model to compare and self-check the query results, thereby improving the query accuracy.
[0091] Optionally, add relevance marks to the multiple candidate documents, and input the multiple candidate documents with relevance marks into the pre-trained model, so that the pre-trained model can judge the reliability of the candidate documents according to the relevance, thereby improving the accuracy of the query results. Wherein, the relevance indicates the degree of association between the candidate document and the data to be queried.
[0092] In this feasible implementation method, by inputting the multiple candidate documents into the pre-trained model, the pre-trained model can compare and self-check the query results, thereby improving the query accuracy.
[0093] S308. Adjust the initial query system according to multiple user feedback information and the target query policy group to obtain an adjusted query system.
[0094] A feasible implementation method can obtain multiple user feedback messages corresponding to a query result through the following steps, including: determining a target duration according to the number of texts in the query result; sending the query result to the user terminal; and obtaining multiple user feedback messages from the user terminal within the target duration.
[0095] Exemplarily, the user feedback message represents the degree of approval of the user for the query result, and the user feedback message includes but is not limited to at least one of the following: the user clicks the approval control or the disapproval control on the user terminal, the dwell time of the user on any page of the query result on the user terminal, etc.
[0096] Exemplarily, the more texts in the query result, the longer the time required for the user to read and analyze the query result, and the target duration should be extended accordingly.
[0097] Optionally, perform normalization processing on the obtained data to obtain user feedback messages in numerical form.
[0098] Next, in combination with Figure 5 explain the feedback message.
[0099] Figure 5 is a schematic diagram of the feedback message provided by the embodiment of the present application. As Figure 5 shown, after the query system generates a query result according to the data to be queried sent by the user terminal, it sends the query result to the user terminal, and adjusts the query system according to the feedback message of the user terminal for the query result.
[0100] In this feasible implementation method, determining the target duration according to the number of texts conforms to the time required for the user to read and analyze the query result, so that the user feedback message can accurately reflect the degree of approval of the user for the query result, thereby improving the accuracy of the adjustment of the query system.
[0101] A feasible implementation method can perform adjustment processing through the following steps to obtain an adjusted query system, including: determining an initial feedback value corresponding to the initial query policy group from the historical policy usage records; determining multiple weights corresponding to multiple user feedback messages; determining the current learning rate; performing weighted calculation processing on multiple user feedback messages according to multiple weights to obtain a weighted calculation result corresponding to the target query policy group; determining a target feedback value according to the weighted calculation result and the current learning rate, where the current learning rate is used to control the convergence speed of the target feedback value; comparing the target feedback value with the initial feedback value; if the target feedback value is greater than the initial feedback value, then replace the initial query policy group with the target query policy group to perform adjustment processing on the initial query system to obtain an adjusted query system; if the target feedback value is less than or equal to the initial feedback value, then perform adjustment processing on the initial query system through the simulated annealing algorithm to obtain an adjusted query system.
[0102] Exemplarily, if the learning rate is too large, the response to new user feedback is overly sensitive, which may lead to frequent changes in the strategy and difficulty in convergence; if the learning rate is too small, the learning speed of the feedback is too slow, which will affect the optimization efficiency of the system. The learning rate is dynamically adjusted to balance the learning speed and the convergence speed.
[0103] Exemplarily, the contribution degree of each user feedback information to the degree of approval of the user for the query result is different, and the contribution degree is reflected by the weight. By weighted calculation, multiple user feedback information can be integrated, thereby improving the accuracy of adjustment.
[0104] Exemplarily, if the target feedback value is greater than the initial feedback value, it indicates that the target query strategy group is more suitable for the user, and then the initial query strategy group is replaced by the target query strategy group.
[0105] Exemplarily, if the target feedback value is less than or equal to the initial feedback value, further judgment is performed to avoid the situation of local optimal solution.
[0106] In this feasible implementation, by replacing the initial query strategy group with the target query strategy group that the user approves more under the preset conditions, the query system can be gradually optimized to improve the query accuracy of the query system.
[0107] A feasible implementation can be adjusted and processed through the following method to obtain an adjusted query system, including: calculating an acceptance probability value through a simulated annealing algorithm according to the target feedback value and the initial feedback value; if the acceptance probability value is greater than or equal to the probability threshold, the initial query strategy group is replaced by the target query strategy group to perform adjustment processing on the initial query system to obtain an adjusted query system.
[0108] Exemplarily, the acceptance probability value is used to evaluate the feasibility of the target feedback value relative to the initial feedback value. If the acceptance probability value is greater than or equal to the probability threshold, it indicates that the feasibility of the target feedback value is relatively high, and the initial feedback value can be replaced by the target feedback value.
[0109] Optionally, the acceptance probability value is calculated by the following formula:
[0110]
[0111] Wherein, represents the acceptance probability value, represents the target feedback value, represents the initial feedback value, and T represents the exploration coefficient.
[0112] Exemplarily, T decays over time, and the convergence rate of the adjustment process is controlled by T. The larger T is, the greater the acceptance probability for the target feedback value, and the adjustment process can explore more query strategy groups. The smaller T is, the smaller the acceptance probability for the target feedback value, and the adjustment process gradually tends to converge.
[0113] Next, a combination of the multi-armed bandit algorithm and the simulated annealing algorithm will be described in conjunction with Figure 6 the following.
[0114] Figure 6 FIG. is a schematic diagram of the combination of the multi-armed bandit algorithm and the simulated annealing algorithm provided by an embodiment of the present application. As Figure 6 shown, a query request sent by the user terminal is received, a target query strategy group is obtained through processing by a perturbation function, and a query is executed through the target query strategy group to obtain feedback information of the user terminal. When the target feedback value is less than or equal to the initial feedback value, an acceptance probability value is calculated through the simulated annealing algorithm. According to the acceptance probability value, the priority information is updated through the multi-armed bandit algorithm. When the query request is executed next time, the updated priority information is used to achieve iterative update of the query system.
[0115] In this feasible implementation manner, in the case where the target feedback value is less than or equal to the initial feedback value, calculating the acceptance probability value through the simulated annealing algorithm to determine whether to use the target feedback value can explore multiple feedback values to achieve the global optimal solution, thereby improving the accuracy of the query.
[0116] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation manner.
[0117] Figure 7 FIG. is a schematic structural diagram of an adjustment device for a query system provided by an embodiment of the present application. As Figure 7 shown, an embodiment of the present application further provides an adjustment device for a query system. The adjustment device 70 for the query system may include: a receiving module 71, a determining module 72, an adjusting module 73, a generating module 74, and an optimizing module 75, where
[0118] The receiving module 71 is configured to receive a query request sent by the user terminal, and the query request includes data to be queried.
[0119] The determining module 72 is configured to determine an initial query strategy group of the initial query system according to the query request.
[0120] The adjusting module 73 is configured to perform an adjustment process on the initial query strategy group through the simulated annealing algorithm to obtain a plurality of candidate query strategy groups.
[0121] A generation module 74, configured to determine a target query policy group from multiple candidate query policy groups, generate a query result corresponding to the data to be queried through the target query policy group, and obtain multiple user feedback messages corresponding to the query result.
[0122] An optimization module 75, configured to adjust and process an initial query system according to multiple user feedback messages and the target query policy group to obtain an adjusted query system.
[0123] Optionally, the receiving module 71 may execute Figure 2 S201 in the embodiment.
[0124] Optionally, the determining module 72 may execute Figure 2 S202 in the embodiment.
[0125] Optionally, the adjustment module 73 may execute Figure 2 S203 in the embodiment.
[0126] Optionally, the generation module 74 may execute Figure 2 S204 in the embodiment.
[0127] Optionally, the optimization module 75 may execute Figure 2 S205 in the embodiment.
[0128] It should be noted that the adjustment device of the query system shown in the embodiments of the present application may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, and will not be elaborated here.
[0129] In a possible implementation manner, the adjustment module 73 is specifically configured to: adjust the policy parameters and / or the policy structure of the initial query policy group through a perturbation function to obtain multiple candidate query policy groups.
[0130] Figure 8 This is a schematic structural diagram of an adjustment device of a query system provided by an embodiment of the present application. Based on the embodiment shown in Figure 7 As shown in Figure 8 the adjustment device 70 of the query system further includes: a screening module 76, an input module 77, an acquisition module 78, a replacement module 79, and a mapping module 710, where
[0131] The screening module 76 is configured to:
[0132] Determine a historical policy usage record, where the historical policy usage record includes multiple query policy groups, feedback values corresponding to each query policy group, and usage frequencies corresponding to each query policy group;
[0133] Determine multiple candidate feedback values and multiple candidate usage frequencies corresponding to multiple candidate query strategy groups according to historical strategy usage records;
[0134] Perform calculation processing through a multi-armed selection algorithm based on multiple candidate feedback values and multiple candidate usage frequencies to obtain multiple priority information corresponding to multiple candidate query strategy groups;
[0135] Determine a target query strategy group from multiple candidate query strategies according to multiple priority information.
[0136] The input module 77 is used for:
[0137] Execute the target query strategy group through the initial query system, and perform query processing in the document library to obtain multiple candidate documents corresponding to the data to be queried;
[0138] Input multiple candidate documents into the pre-trained model of the initial query system to obtain a query result.
[0139] The acquisition module 78 is used for:
[0140] Determine a target duration according to the number of texts in the query result;
[0141] Send the query result to the user side;
[0142] Obtain multiple user feedback information from the user side within the target duration.
[0143] The replacement module 79 is used for:
[0144] Determine the initial feedback value corresponding to the initial query strategy group from the historical strategy usage records;
[0145] Determine multiple weights corresponding to multiple user feedback information;
[0146] Determine the current learning rate;
[0147] Perform weighted calculation processing on multiple user feedback information according to multiple weights to obtain a weighted calculation result corresponding to the target query strategy group;
[0148] Determine a target feedback value according to the weighted calculation result and the current learning rate, and the current learning rate is used to control the convergence speed of the target feedback value;
[0149] Compare the target feedback value with the initial feedback value;
[0150] If the target feedback value is greater than the initial feedback value, replace the initial query strategy group with the target query strategy group to perform adjustment processing on the initial query system to obtain an adjusted query system;
[0151] If the target feedback value is less than or equal to the initial feedback value, the initial query system is adjusted by the simulated annealing algorithm to obtain an adjusted query system.
[0152] In a possible implementation manner, the replacement module 79 is specifically configured to:
[0153] Calculate an acceptance probability value through the simulated annealing algorithm according to the target feedback value and the initial feedback value;
[0154] If the acceptance probability value is greater than or equal to the probability threshold, the initial query policy group is replaced by the target query policy group to adjust the initial query system and obtain an adjusted query system.
[0155] The mapping module 710 is configured to:
[0156] Determine the target data type of the data to be queried;
[0157] Determine the mapping relationship between the data type and the query policy group;
[0158] Determine the initial query policy group according to the target data type and the mapping relationship.
[0159] For the description of the features in the embodiments corresponding to the adjustment device of the query system, reference can be made to the relevant descriptions in the embodiments corresponding to the adjustment method of the query system, which will not be elaborated here one by one.
[0160] Figure 9 This is a schematic structural diagram of the electronic device provided in the present application. As Figure 9 shown, the electronic device 90 provided in this embodiment includes: at least one processor 901 and a memory 902. Optionally, the electronic device 90 further includes a communication component 903. Among them, the processor 901, the memory 902, and the communication component 903 are connected through a bus.
[0161] In the specific implementation process, at least one processor 901 executes the computer execution instructions stored in the memory 902, so that at least one processor 901 executes the above-mentioned embodiments of the adjustment method of the query system.
[0162] For the specific implementation process of the processor 901, reference can be made to the above method embodiments, and their implementation principles and technical effects are similar, which will not be elaborated here in this embodiment.
[0163] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the application may be directly implemented by the execution of the hardware processor, or may be implemented by the combination of hardware and software modules in the processor.
[0164] The memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0165] The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0166] The embodiments of the present application also provide a non-volatile computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any of the above embodiments of the adjustment method of the query system when running.
[0167] In an exemplary embodiment, the above non-volatile computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs, etc., various media that can store computer programs.
[0168] The embodiments of the present application also provide a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the adjustment method of the query system are implemented.
[0169] Embodiments of the present application further provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps in any of the above-described embodiments of the adjustment method of the query system.
[0170] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0171] The above has introduced in detail an adjustment method, device, electronic device, medium, and product of a query system provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for adjusting a query system, characterized in that Including: Receiving a query request sent by a user terminal, where the query request includes data to be queried; Determining an initial query strategy group of an initial query system according to the query request; Performing an adjustment process on the initial query strategy group through a simulated annealing algorithm to obtain multiple candidate query strategy groups; Determining a target query strategy group from the multiple candidate query strategy groups, generating a query result corresponding to the data to be queried through the target query strategy group, and obtaining multiple user feedback messages corresponding to the query result; Performing an adjustment process on the initial query system according to the multiple user feedback messages and the target query strategy group to obtain an adjusted query system.
2. The adjustment method of the query system according to claim 1, wherein Performing an adjustment process on the initial query strategy group through a simulated annealing algorithm to obtain multiple candidate query strategy groups, including: Performing strategy parameter adjustment and / or strategy structure adjustment on the initial query strategy group through a perturbation function to obtain the multiple candidate query strategy groups.
3. The adjustment method of the query system according to claim 2, characterized in that Determining a target query strategy group from the multiple candidate query strategy groups, including: Determining a historical strategy usage record, where the historical strategy usage record includes multiple query strategy groups, feedback values corresponding to each query strategy group, and usage frequencies corresponding to each query strategy group; Determining multiple candidate feedback values and multiple candidate usage frequencies corresponding to the multiple candidate query strategy groups according to the historical strategy usage record; Performing a calculation process through a multi-armed bandit algorithm according to the multiple candidate feedback values and the multiple candidate usage frequencies to obtain multiple priority information corresponding to the multiple candidate query strategy groups; Determining the target query strategy group from the multiple candidate query strategies according to the multiple priority information.
4. The adjustment method of the query system according to any one of claims 1-3, characterized in that Generating a query result corresponding to the data to be queried through the target query strategy group, including: Executing the target query strategy group through the initial query system, and performing a query process in a document library to obtain multiple candidate documents corresponding to the data to be queried; Inputting the multiple candidate documents into a pre-trained model of the initial query system to obtain the query result.
5. The adjustment method of the query system according to claim 4, characterized in that, Obtaining multiple user feedback messages corresponding to the query result, including: Determining a target duration according to the number of texts in the query result; Sending the query result to the user terminal; Obtaining the multiple user feedback messages from the user terminal within the target duration.
6. The adjustment method of the query system according to claim 5, characterized in that, Performing an adjustment process on the initial query system according to the multiple user feedback messages and the target query strategy group to obtain an adjusted query system, including: Determining an initial feedback value corresponding to the initial query strategy group from the historical strategy usage record; Determining multiple weights corresponding to the multiple user feedback messages; Determining a current learning rate; Performing a weighted calculation process on the multiple user feedback messages according to the multiple weights to obtain a weighted calculation result corresponding to the target query strategy group; Determining a target feedback value according to the weighted calculation result and the current learning rate, where the current learning rate is used to control the convergence speed of the target feedback value; Comparing the target feedback value with the initial feedback value; If the target feedback value is greater than the initial feedback value, replace the initial query policy group with the target query policy group to perform an adjustment process on the initial query system, thereby obtaining the adjusted query system; If the target feedback value is less than or equal to the initial feedback value, perform an adjustment process on the initial query system through a simulated annealing algorithm to obtain the adjusted query system.
7. The adjustment method of the query system according to claim 6, characterized in that Performing an adjustment process on the initial query system through a simulated annealing algorithm to obtain the adjusted query system includes: According to the target feedback value and the initial feedback value, calculate an acceptance probability value through the simulated annealing algorithm; If the acceptance probability value is greater than or equal to a probability threshold, replace the initial query policy group with the target query policy group to perform an adjustment process on the initial query system, thereby obtaining the adjusted query system.
8. The adjustment method of the query system according to claim 1, characterized in that The method further includes: Determine the target data type of the data to be queried; Determine the mapping relationship between the data type and the query policy group; According to the target data type and the mapping relationship, determine the initial query policy group.
9. An adjustment device for a query system, characterized in that It includes: A receiving module, configured to receive a query request sent by a user terminal, where the query request includes data to be queried; A determining module, configured to determine an initial query policy group of an initial query system according to the query request; An adjustment module, configured to perform an adjustment process on the initial query policy group through a simulated annealing algorithm to obtain a plurality of candidate query policy groups; A generating module, configured to determine a target query policy group from the plurality of candidate query policy groups, generate a query result corresponding to the data to be queried through the target query policy group, and obtain a plurality of user feedback messages corresponding to the query result; An optimization module, configured to perform an adjustment process on the initial query system according to the plurality of user feedback messages and the target query policy group to obtain an adjusted query system.
10. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the adjustment method of the query system according to any one of claims 1 to 8 when executing the computer program.
11. A non-volatile computer-readable storage medium, characterized in that, A computer program is stored in the non-volatile computer-readable storage medium, where the computer program implements the steps of the adjustment method of the query system according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
Dynamic correlation enhancement retrieval generation system and method driven by intelligent knowledge graph
CN118839021A
Dialogue model training method and device, equipment and medium
CN119578558A
Flight query data processing method and device, electronic equipment and storage medium
CN119829628A
Document retrieval method and device, electronic equipment and computer readable storage medium
CN119938831A
Multi-level cache adaptive system and strategy based on machine learning
WO2024207834A1