Large model cue word intelligent routing method, device and equipment and storage medium

By generating a decision tree and building a model based on the amount of knowledge data, the problem of building a single industry model and the problem of insufficient accuracy in answering public big models is solved, and the accuracy of prompt words is improved.

CN119691137AActive Publication Date: 2025-03-25HANGZHOU NEWGRAND TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510206990.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-03-25
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

It is difficult for a single industry to establish a private industry model. The public big model has poor accuracy in answering a single industry, due to the limited amount of public knowledge.

Method used

By generating a decision tree based on the code file and a preset database, determining the amount of knowledge data of the module node, building a first model to process the user's prompt words, and deciding whether to access the second model with the help of the tag node in the decision tree.

Benefits of technology

The accuracy of the prompt word corresponds to the answers is improved, and by calculating the amount of knowledge data of the module node, it is convenient to deploy the corresponding knowledge model and ensure that the answers are carried out within the knowledge scope.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691137A_ABST
    Figure CN119691137A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of large models, in particular to a large model cue word intelligent routing method and device, equipment and a storage medium, and the method comprises the steps: generating a decision tree based on a code file and a preset database; determining a node type of each module node under a condition node in the decision tree, and determining a knowledge data volume of the module node based on the node type, the decision tree, the code file and the database; constructing a first model based on the knowledge data volume of the module node, and processing a cue word based on the first model in response to the cue word sent by a hit user of the first model; and in response to the condition that the first model does not hit the cue word, determining whether to use the cue word to access a second model based on the cue word and the label node in the decision tree. The method is convenient for improving the accuracy of the corresponding answer of the cue word.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of large model technology, and in particular to a large model prompt word intelligent routing method, device, equipment and storage medium. Background Art

[0002] The continuous development of AI big models has brought better intelligent experience to users.

[0003] If a single industry wants to establish a private industry model for its own industry, it not only requires a large amount of high-privacy data, but also requires a relatively high cost. Due to the difficulty in obtaining a large amount of high-privacy data and cost constraints, it is currently difficult for a single industry to establish a private industry model for its own industry. There are already many public large models on the market, but for a single industry, the public large model can only answer the prompt words given by the user based on the publicly disclosed knowledge of the single industry. Due to the small amount of publicly disclosed knowledge of a single industry, the accuracy of the corresponding answers to the prompt words is poor. Summary of the invention

[0004] In order to improve the accuracy of answers corresponding to prompt words, the present application provides a large-model prompt word intelligent routing method, device, equipment and storage medium.

[0005] In a first aspect, the present application provides a large model prompt word intelligent routing method, comprising:

[0006] Generate a decision tree based on code files and a preset database;

[0007] Determine the node type of each module node under the condition node in the decision tree, and determine the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database;

[0008] Building a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, processing the prompt word based on the first model;

[0009] In response to the first model not hitting the prompt word, determining whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0010] In a second aspect, the present application provides a large model prompt word intelligent routing device, comprising:

[0011] A decision tree construction module is used to generate a decision tree based on code files and a preset database;

[0012] A data volume calculation module, used to determine the node type of each module node under the condition node in the decision tree, and determine the knowledge data volume of the module node based on the node type, the decision tree, the code file and the database;

[0013] A model processing module, configured to construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, process the prompt word based on the first model;

[0014] An access judgment module is used to determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree in response to the first model not hitting the prompt word.

[0015] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0017] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0018] The above-mentioned large model prompt word intelligent routing method, device, equipment and storage medium generate a decision tree based on a code file and a preset database; determine the node type of each module node under the condition node in the decision tree, and determine the knowledge data volume of the module node based on the node type, the decision tree, the code file and the database; construct a first model based on the knowledge data volume of the module node, and in response to the first model hitting the prompt word issued by the user, process the prompt word based on the first model; in response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree. Through the above implementation, by calculating the knowledge data volume corresponding to each module node, it is convenient to deploy the first model to the server corresponding to the knowledge data volume. Since the first model has knowledge corresponding to the knowledge data volume, the prompt word issued by the user can be effectively answered within the knowledge scope of the first model, thereby improving the accuracy of the answer corresponding to the prompt word.

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

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A flow chart of a large model prompt word intelligent routing method provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the structure of a large model prompt word intelligent routing device provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;

[0024] Figure 4 This is a diagram of the internal structure of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0027] In this article, the term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.

[0028] Embodiment 1

[0029] Figure 1 A flowchart of a large model prompt word intelligent routing method provided in Example 1 of this application, refer to Figure 1 The method may be performed by a device for performing the method, and the device may be implemented by software and / or hardware. The method includes:

[0030] S110, generating a decision tree based on the code file and a preset database.

[0031] In order to provide another routing option of prompt words for users of a single industry based on the second model, this embodiment needs to construct a first model of the single industry, wherein the prompt words are the content that the user is going to input into the model.

[0032] In this embodiment, the first model is composed of knowledge models installed in different servers, and each knowledge model has a certain amount of knowledge. In order to facilitate the determination of the data volume of each knowledge model, it is necessary to build a decision tree associated with the first model. In order to obtain the decision tree, corresponding programming work needs to be performed first to obtain the corresponding code file. In order to facilitate the storage of data required for the operation of the code file, a preset database is also prepared for the code file; a primary decision tree can be constructed by extracting feature data corresponding to the above-mentioned single industry from the code file. Furthermore, the primary decision tree can be improved through the primary decision tree and the database to obtain the target decision tree.

[0033] S120, determining the node type of each module node under the condition node in the decision tree, and determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database.

[0034] Among them, the root node of the decision tree is established based on the storage path of the code file. To obtain the storage path, it is necessary to first build the front-end engineering framework compiler loader through Node.js (JavaScript runtime environment based on Chrome V8 engine), and then configure the front-end engineering framework compiler loader to the front-end engineering file, and then run the Nup runbuild instruction to trigger the front-end engineering framework compiler loader to read the code file, thereby obtaining the storage path of the code file. The storage path includes multi-level storage nodes.

[0035] Exemplarily, a storage path is a / b / c / d / e / dform / dconstant..., wherein a, b, c, d, e, dform, dconstant... are storage nodes at each level respectively; starting from the last level storage node of the storage path, for each level node, determine whether there is a file under the storage node of this level. If not, use the node of this level as the business function module corresponding to the storage path, wherein the business function module is a function module of the corresponding business system; exemplary, a business system is specifically a case management system, wherein there is a function module which is a case query module.

[0036] After determining the business function module corresponding to the storage path, the storage node corresponding to the business function module is used as the root node of the decision tree, and the next-level storage node of the root node is used as the second-level node of the decision tree; exemplarily, dform is used as the root node of the decision tree, and the next-level storage node dconstant of dform is used as the second-level node of the decision tree.

[0037] Furthermore, in order to expand the decision tree, the present embodiment also adds three third-level nodes under the second-level node, namely a model node, a condition node and a label node; subsequently, by extracting the characteristic data corresponding to the above-mentioned single industry from the code file, the fourth-level nodes under each third-level node can be added, and the fourth-level nodes under the condition node are recorded as module nodes, each module node is used to determine the corresponding knowledge model, in order to determine the amount of knowledge data required for the corresponding knowledge model, each module node needs to be classified to determine the node type of each module node; in this embodiment, the node types include: time type, organization type, fuzzy matching type and interval type.

[0038] Among them, if it is determined that the module node contains time information, the node type of the module node is determined to be a time type, wherein the time information includes annual information and start and end time information; exemplarily, the annual information is such as 20XX, etc., and the start and end time information is used to indicate the start time and end time of a period of time, such as X month 20XX-Y month 20YY, etc.

[0039] If it is determined that the module node contains the org field, the node type of the module node is determined to be the organization type; it should be noted that the org field indicates that the data corresponding to the module node is data with an organizational relationship.

[0040] Among them, the information contained in the module node includes the table name and field type of the data table. If it is determined that the table name of the module node is consistent with the table name of the data table in the database, and the field type is consistent with the type of the field of the data table, then the node type of the module node is determined to be a fuzzy matching type.

[0041] If it is determined that the fuzzy node contains an interval symbol, the node type of the module node is determined to be an interval type; illustratively, the interval symbols are “<”, “>”, “≤”, and “≥”.

[0042] It should be noted that after determining the node type corresponding to each module node one by one, the amount of knowledge data corresponding to each model node can be further determined based on the node type corresponding to each model node, as well as the above-mentioned decision tree, code file, and database, and the amount of knowledge data is recorded as the knowledge data amount.

[0043] S130, constructing a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, processing the prompt word based on the first model.

[0044] Among them, the first model is constructed based on knowledge models installed on multiple servers, and each knowledge model is established based on the amount of knowledge data of each module node. After the first model is constructed, users of a single industry corresponding to the first model can send prompt words to the first model; for example, a prompt word is "Please give the cases of annual ZZ information statistics of the XX industry in the year YY"; after the first model receives the prompt word, if it matches the content with a high degree of matching with the prompt word in the decision tree (in this embodiment, specifically the fourth-level node under the condition node of the decision tree), the prompt word is processed to meet the needs of the user.

[0045] In an optional embodiment, after responding to the first model hitting the prompt word issued by the user, it also includes: determining the module node corresponding to the prompt word in the decision tree, determining the module nodes of the same node type as the module node, and generating guiding questions based on the module nodes of the same node type.

[0046] Among them, the prompt word can be matched with each module node under the condition node. Specifically, the similarity between the prompt word and the content in the module node (such as some Chinese characters) is determined, and the similarity is recorded as the matching degree. It is determined whether the matching degree is greater than a preset matching degree threshold. Exemplarily, the matching degree threshold is 80%. If the matching degree is greater than the matching degree threshold, it means that the content with a high matching degree with the prompt word is matched in the decision tree. At this time, the module node corresponding to the matching degree greater than the preset matching degree threshold is used as the module node corresponding to the prompt word in the decision tree; after the module nodes are classified, each node type includes a certain number of module nodes, and the prompt word in the decision tree The node type corresponding to the corresponding module node also includes module nodes of the same node type as the module node; through the module nodes of the same node type as the module node, a guiding question can be generated to guide the user to issue a new prompt word; it should be noted that, although the prompt word issued by the user for the first time may be matched with content with a high degree of matching in the decision tree, the prompt word may not be suitable for effective processing by the first model. Therefore, in order to provide a better user experience, a guiding question can be further generated based on the module nodes of the same node type, so that the user can again issue a prompt word to the first model that is more suitable for effective processing by the first model; exemplarily, the guiding question is "Do you want to conduct a case query based on the case name?"

[0047] S140: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0048] Among them, after the first model receives the prompt word, if the corresponding decision tree (in this embodiment, mainly the fourth-level node of the decision tree) does not match the content with a high degree of matching with the prompt word, it means that there is no content corresponding to the prompt word in the fourth-level node under the condition node; but there may still be content with a high degree of matching with the prompt word in the fourth-level node under the label node; for this reason, it can be further determined whether there is content with a high degree of matching with the prompt word in the fourth-level node under the label node. If so, it means that the first model still has the ability to accurately answer the prompt word. At this time, the first model is still used to process the prompt word and answer the prompt word; if not, it means that the first model does not have the ability to accurately answer the prompt word. At this time, the prompt word is used to further access the second model so that the second model can answer the prompt word.

[0049] It should be noted that this embodiment generates a decision tree based on a code file and a preset database; determines the node type of each module node under the conditional node in the decision tree, and determines the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database; constructs a first model based on the amount of knowledge data of the module node, and in response to the first model hitting the prompt word issued by the user, processes the prompt word based on the first model; in response to the first model not hitting the prompt word, determines whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree. Through the above implementation, by calculating the amount of knowledge data corresponding to each module node, it is convenient to deploy the first model to the server corresponding to the amount of knowledge data. Since the first model has knowledge corresponding to the amount of knowledge data, it can effectively answer the prompt word issued by the user within the knowledge scope of the first model, thereby improving the accuracy of the answer corresponding to the prompt word.

[0050] Embodiment 2

[0051] A large model prompt word intelligent routing method is provided in the second embodiment of the present application. The method refines the "generating a decision tree based on a code file and a preset database" in the first embodiment. It should be noted that for the parts not described in detail in the present embodiment, reference can be made to the descriptions of other embodiments. The method includes:

[0052] S211. Determine a root node based on the storage path of the code file, and add a secondary node under the root node.

[0053] Among them, it can be known from step S120 in the first embodiment that, starting from the last level storage node of the storage path, for each level node, it is determined whether there is a file under the storage node of the level, if not, the level node is used as the business function module corresponding to the storage path, and then the storage node corresponding to the business function module is used as the root node of the decision tree, and further, a secondary node can be added under the root node. Exemplarily, dform is used as the root node of the decision tree, and the next level storage node dconstant of dform is used as the secondary node of the decision tree.

[0054] S212: Add a third-level node under the second-level node, wherein the third-level node includes a model node, a condition node, and a label node.

[0055] Among them, the three-level nodes in this embodiment include model nodes, condition nodes and label nodes. In other embodiments, there is no specific limitation.

[0056] S213. Determine a fourth-level node under the third-level node based on the code file.

[0057] Among them, the code file contains characteristic data corresponding to a single industry. After the characteristic data is extracted from the code file, the characteristic data can be used as a fourth-level node under the third-level node. It should be noted that the characteristic data includes: data labels, label values, text descriptions, etc.

[0058] S214: Determine a new fourth-level node under the label node based on a preset database and the second-level node.

[0059] Among them, there is a menu table in the database, which contains multiple menus, and each menu has a corresponding menu path; in this embodiment, the secondary node of the decision tree is dconstant, and the storage path of the secondary node is "a / b / c / d / e / dform / dconstant". After completing the addition of the model node, condition node and the fourth-level node under the label node through the code file, further, the storage path of the secondary node and the menu path of each menu in the menu table in the database are obtained; then, each menu path is judged to be consistent with the storage path of the secondary node. If there is a menu path that is consistent with the storage path of the secondary node, the menu name corresponding to the menu path is added to the label node, thereby serving as a new fourth-level node under the label node.

[0060] S215: Obtain a decision tree based on the root node, the second-level nodes, the third-level nodes, and the fourth-level nodes.

[0061] In this embodiment, a decision tree is constructed by adding a second-level node under a root node, adding a third-level node under a second-level node, and adding a fourth-level node under a third-level node. In other embodiments, the specifics are not limited.

[0062] S220, determining the node type of each module node under the conditional node in the decision tree, and determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database.

[0063] S230: construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by the user, process the prompt word based on the first model.

[0064] S240: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0065] Embodiment 3

[0066] A large model prompt word intelligent routing method is provided in the third embodiment of the present application. The method refines the "determining the fourth-level node under the third-level node based on the code file" in the second embodiment. It should be noted that for the part not described in detail in the present embodiment, reference can be made to the description of other embodiments. The method includes:

[0067] S311. Determine a root node based on the storage path of the code file, and add a secondary node under the root node.

[0068] S312: Add a third-level node under the second-level node, wherein the third-level node includes a model node, a condition node, and a label node.

[0069] S3131. In response to the presence of a global label in the code file, use the label value of the global label as a fourth-level node under the label node.

[0070] Among them, the global tags include the title tag and the header tag. For example, the title tag is " <title> Case Management< / title> ", the tag value of the global tag is the Chinese characters in the global tag, for example, the title tag " <title> Case Management< / title> " has a tag value of "Case Management".

[0071] S3132. In response to the existence of a form tag in the code file, the form ID and form fields corresponding to the form tag are used as fourth-level nodes under the model node, and the form fields are used as fourth-level nodes under the tag node.

[0072] Among them, the form tag in this embodiment is also the form tag. The corresponding form can be obtained by parsing the form tag, and the form includes a form ID and form fields. If there is a form tag in the code file, "form ID+form field" needs to be used as the fourth-level node under the model node, and the form field needs to be used as the fourth-level node under the tag node.

[0073] S3133. In response to the presence of a table tag in the code file, the table header description and field identifier corresponding to the table tag are used as the fourth-level node under the model node, and the table header description is used as the fourth-level node under the tag node.

[0074] Among them, the table tag in this embodiment is also the table tag. The corresponding table can be obtained by parsing the table tag. The table includes a header description and a field identifier. The header description is used to display the subject of the table, such as "transcript". The field identifier is also the field name of each field in the table. Exemplarily, the field names include: task summary, task type, task attributes...; if there is a table tag in the code file, "field identifier + header description" must be used as a fourth-level node under the model node, and the header description must also be used as a fourth-level node under the tag node.

[0075] S3134. In response to the existence of an additional tag in the code file, use the Chinese description corresponding to the additional tag as a fourth-level node under the tag node.

[0076] Among them, the extra tags are other types of tags in the code file except global tags, form tags and table tags, such as span tags, etc.; a corresponding Chinese description can be obtained for the extra tags, and the Chinese description can be used to add to the tag node, thereby serving as a fourth-level node under the tag node.

[0077] S314: Determine a new fourth-level node under the label node based on a preset database and the second-level node.

[0078] S315: Obtain a decision tree based on the root node, the second-level nodes, the third-level nodes, and the fourth-level nodes.

[0079] S320, determining the node type of each module node under the conditional node in the decision tree, and determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database.

[0080] S330: construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by the user, process the prompt word based on the first model.

[0081] S340: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0082] Embodiment 4

[0083] A large model prompt word intelligent routing method is provided in the fourth embodiment of the present application. The method refines the "using the label value of the global label as the fourth-level node under the label node" in the third embodiment, and supplements the steps after "using the header description as the fourth-level node under the label node" in the third embodiment; it should be noted that for the parts not described in detail in this embodiment, please refer to the description of other embodiments. The method includes:

[0084] S411. Determine a root node based on the storage path of the code file, and add a secondary node under the root node.

[0085] S412: Add a third-level node under the second-level node, wherein the third-level node includes a model node, a condition node, and a label node.

[0086] S41311, in response to the presence of a global tag in the code file.

[0087] S41312: In response to the presence of punctuation marks in the label value of the global label, perform regular expression segmentation on the label value to obtain sub-label values.

[0088] It should be noted that there may be punctuation marks in the label value of the global label. If there are punctuation marks in the label value of the global label, the label value should not be directly used as the fourth-level node under the label node, because it will have an adverse effect on the subsequent matching process of the prompt word with the fourth-level node under the label node. Therefore, after obtaining the label value of the global label, it is necessary to further determine whether there are punctuation marks in the label value. If so, it is necessary to perform regular segmentation on the label value. Regular segmentation means removing the punctuation marks in the label value and segmenting the label value at the original punctuation marks to obtain multiple sub-label values. For example, assuming that the label value of a global label is "query, process", two sub-label values ​​are obtained after regular segmentation of the label value, namely "query" and "process".

[0089] S41313. Use the sub-label value as the fourth-level node under the label node.

[0090] If there is a punctuation mark in the label value of the global label, the sub-label value corresponding to the label value needs to be used as the fourth-level node under the label node.

[0091] S4132. In response to the existence of a form tag in the code file, the form ID and form fields corresponding to the form tag are used as fourth-level nodes under the model node, and the form fields are used as fourth-level nodes under the tag node.

[0092] S4133. In response to the presence of a table tag in the code file, the table header description and field identifier corresponding to the table tag are used as the fourth-level node under the model node, and the table header description is used as the fourth-level node under the tag node.

[0093] S4134. In response to the existence of an additional tag in the code file, use the Chinese description corresponding to the additional tag as a fourth-level node under the tag node.

[0094] S414: Determine a new fourth-level node under the label node based on a preset database and the second-level node.

[0095] S415: Obtain a decision tree based on the root node, the second-level nodes, the third-level nodes, and the fourth-level nodes.

[0096] S420, determining the node type of each module node under the conditional node in the decision tree, and determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database.

[0097] S430: construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by the user, process the prompt word based on the first model.

[0098] S440: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0099] Embodiment 5

[0100] A large model prompt word intelligent routing method is provided in the fifth embodiment of the present application. The method refines the "determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database" in the first embodiment; it should be noted that for the part not described in detail in this embodiment, reference can be made to the description of other embodiments. The method includes:

[0101] S510: Generate a decision tree based on the code file and a preset database.

[0102] S521. Determine the node type of each module node under the condition node in the decision tree.

[0103] Among them, it can be known from step S120 of the first embodiment that each module node under the condition node can be classified into a corresponding node type, wherein the node type includes: time type, organization type, fuzzy matching type and interval type.

[0104] S522. Determine a target data table based on the decision tree, the code file, and the database.

[0105] The database includes multiple data tables, one of which is related to the decision tree, and the amount of knowledge data of the module node can be further determined through the data table related to the decision tree. In this embodiment, by matching the decision tree, the code file and the database, the data table related to the decision tree can be determined from the multiple data tables.

[0106] S523: Determine the amount of knowledge data of the corresponding module node based on the target data table and the node type.

[0107] It should be noted that the calculation method of the knowledge data volume of module nodes of different node types is different.

[0108] Among them, if the node type of the module node is the time type, and specifically the annual information, then the time classification statistics SQL statement corresponding to the target data table is determined, and the time classification statistics SQL statement is added to the module node; it should be noted that if the target data table contains an org field, that is, the target data table contains data with organizational relationships, then the org field needs to be added to the time classification statistics SQL statement; subsequently, by executing the time classification statistics SQL statement, the amount of knowledge data of the module node can be obtained. If the node type of the module node is the time type, and specifically the start and end time information, then the full amount SQL statement corresponding to the target data table is determined, and the full amount SQL statement is added to the module node. Similarly, if the target data table contains an org field, that is, the target data table contains data with organizational relationships, then the org field needs to be added to the full amount SQL statement; subsequently, by executing the full amount SQL statement, the amount of knowledge data of the module node can be obtained.

[0109] Among them, if the node type of the module node is an organizational type, the organizational classification statistics SQL statement corresponding to the target data table is determined, and the organizational classification statistics SQL statement is added to the module node; subsequently, by executing the organizational classification statistics SQL statement, the knowledge data volume of the module node can be obtained.

[0110] Among them, if the node type of the module node is a fuzzy matching type, the full SQL statement corresponding to the target data table is determined, and the full SQL statement is added to the module node; subsequently, the knowledge data volume of the module node can be obtained by executing the full SQL statement.

[0111] Among them, if the node type of the module node is an interval type, the target data table is grouped according to the interval symbol in the module node to obtain multiple groups of tables, and then the SQL statements corresponding to the group tables are determined, and each SQL statement is added to the module node; subsequently, by executing each SQL statement, the knowledge data volume of the module node can be obtained.

[0112] S530, constructing a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, processing the prompt word based on the first model;

[0113] S540: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0114] Embodiment 6

[0115] A large model prompt word intelligent routing method is provided in Example 6 of the present application. The method refines the "determining the target data table based on the decision tree, the code file and the database" in Example 5. It should be noted that for the parts not described in detail in this embodiment, reference can be made to the descriptions of other embodiments. The method includes:

[0116] S610: Generate a decision tree based on the code file and a preset database.

[0117] S621. Determine the node type of each module node under the condition node in the decision tree.

[0118] S6221. In response to the existence of a data table name in the database that is consistent with the file identifier of the code file, determine whether the degree of matching between the form ID in the decision tree and the field of the data table exceeds a preset matching threshold.

[0119] There are multiple data tables in the database, each of which has a one-to-one corresponding table name; the code file has a corresponding code identifier; the model node or condition node of the decision tree contains multiple form IDs, and the data table also contains multiple fields. If it is necessary to determine the data table corresponding to the decision tree from multiple data tables, that is, the target data table, it is necessary to first determine the data table whose table name is consistent with the file identifier of the code file from multiple data tables; then it is necessary to calculate the degree of match between the form ID in the decision tree and the field of the data table, wherein, taking a form ID as an example, if the form ID is consistent with a field name of the data table, it means that the form ID matches the field name, and by matching the multiple form IDs in the decision tree with the names of multiple fields of each data table in turn, the ratio of the number of successfully matched fields to the total number of fields in the data table is the degree of match, and in order to facilitate the judgment of the size of the degree of match, a matching threshold is also preset, and exemplary, the matching threshold is 80%.

[0120] S6222: If yes, use the data table as the target data table.

[0121] If the matching degree exceeds the preset matching threshold, it means that the matching degree is high, that is, the data table corresponding to the matching degree is a data table related to the decision tree, that is, the target data table.

[0122] S623. Determine the amount of knowledge data of the corresponding module node based on the target data table and the node type.

[0123] S630: construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by the user, process the prompt word based on the first model.

[0124] S640: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0125] Embodiment 7

[0126] A large model prompt word intelligent routing method is provided in Embodiment 7 of the present application. The method refines the "building a first model based on the amount of knowledge data of the module node" in Embodiment 1. It should be noted that for the parts not described in detail in this embodiment, reference can be made to the descriptions of other embodiments. The method includes:

[0127] S710: Generate a decision tree based on the code file and a preset database.

[0128] S720. Determine the node type of each module node under the conditional node in the decision tree, and determine the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database.

[0129] S731. Determine the server corresponding to the module node based on the amount of knowledge data.

[0130] Among them, each module node under the conditional node can calculate the corresponding knowledge data volume. In this embodiment, a knowledge model for building a first model is constructed, and multiple servers are preset. Each server has a corresponding knowledge data capacity. In this embodiment, the server corresponding to each module node can be determined according to the knowledge data capacity of each server and the knowledge data volume of each module node; exemplarily, assuming that the knowledge data volume of module node A is 5K, the knowledge data volume of module node B is 2K, the knowledge data capacity of server 1 is 8K, and the knowledge data capacity of server 2 is 5K, then the server corresponding to module node A is determined to be server 1, and the server corresponding to module node B is determined to be server 2, and so on.

[0131] S732. Build a corresponding knowledge model based on the knowledge data volume of the module node, and deploy the knowledge model on a server corresponding to the module node.

[0132] Among them, the corresponding knowledge model can be built according to the amount of knowledge data of the module node. In order to build the first model later, the knowledge model needs to be deployed on the server corresponding to the module node.

[0133] S733. Obtain a first model based on the knowledge models on each server.

[0134] Among them, the first model is a collection of various knowledge models.

[0135] S734: In response to the first model hitting a prompt word issued by the user, process the prompt word based on the first model.

[0136] S740: In response to the first model not hitting the prompt word, determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

[0137] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0138] Embodiment 8

[0139] Based on the same inventive concept, this embodiment also provides a prompt word intelligent routing device for implementing the above-mentioned large model prompt word intelligent routing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more prompt word intelligent routing device embodiments provided below can refer to the limitations of the prompt word intelligent routing method above, and will not be repeated here.

[0140] In this embodiment, Figure 2 As shown, a large model prompt word intelligent routing device is provided, comprising:

[0141] A decision tree construction module is used to generate a decision tree based on code files and a preset database;

[0142] A data volume calculation module, used to determine the node type of each module node under the condition node in the decision tree, and determine the knowledge data volume of the module node based on the node type, the decision tree, the code file and the database;

[0143] A model processing module, configured to construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, process the prompt word based on the first model;

[0144] An access judgment module is used to determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree in response to the first model not hitting the prompt word.

[0145] Each module in the above prompt word intelligent routing device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module above.

[0146] It should be noted that this embodiment generates a decision tree based on a code file and a preset database; determines the node type of each module node under the conditional node in the decision tree, and determines the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database; constructs a first model based on the amount of knowledge data of the module node, and in response to the first model hitting the prompt word issued by the user, processes the prompt word based on the first model; in response to the first model not hitting the prompt word, determines whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree. Through the above implementation, by calculating the amount of knowledge data corresponding to each module node, it is convenient to deploy the first model to the server corresponding to the amount of knowledge data. Since the first model has knowledge corresponding to the amount of knowledge data, it can effectively answer the prompt word issued by the user within the knowledge scope of the first model, thereby improving the accuracy of the answer corresponding to the prompt word.

[0147] Embodiment 9

[0148] In this embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a large model prompt word intelligent routing method is implemented.

[0149] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0150] Embodiment 10

[0151] In this embodiment, a computer readable storage medium is provided. Figure 4 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0152] Embodiment 11

[0153] In this embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0154] 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 used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0155] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.

[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0157] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.

Claims

1. A large model prompt word intelligent routing method, characterized in that: include: Generate a decision tree based on code files and a preset database; Determine the node type of each module node under the condition node in the decision tree, and determine the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database; Building a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, processing the prompt word based on the first model; In response to the first model not hitting the prompt word, determining whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree.

2. The method according to claim 1, characterized in that: The generating of a decision tree based on the code file and a preset database includes: Determine a root node based on the storage path of the code file, and add a secondary node under the root node; Adding a third-level node under the second-level node, wherein the third-level node includes a model node, a condition node, and a label node; Determine a fourth-level node under the third-level node based on the code file; Determine a new fourth-level node under the label node based on a preset database and the second-level node; A decision tree is obtained based on the root node, the second-level nodes, the third-level nodes and the fourth-level nodes.

3. The method according to claim 2, characterized in that The determining the fourth-level node under the third-level node based on the code file includes: In response to the presence of a global tag in the code file, using a tag value of the global tag as a fourth-level node under the tag node; In response to the existence of a form tag in the code file, the form ID and form fields corresponding to the form tag are used as fourth-level nodes under the model node, and the form fields are used as fourth-level nodes under the tag node; In response to the presence of a table tag in the code file, a table header description and a field identifier corresponding to the table tag are used as a fourth-level node under the model node, and the table header description is used as a fourth-level node under the tag node; In response to the existence of an additional tag in the code file, the Chinese description corresponding to the additional tag is used as a fourth-level node under the tag node.

4. The method according to claim 3, characterized in that: The step of using the label value of the global label as a fourth-level node under the label node includes: In response to the presence of punctuation marks in the label value of the global label, performing regular expression segmentation on the label value to obtain sub-label values; Using the sub-label value as the fourth-level node under the label node; After describing the table header as a fourth-level node under the label node, the method further includes: In response to the existence of a form tag in the code file, the fourth-level tag corresponding to the form tag under the model node is moved to under the condition node as a fourth-level node under the condition node.

5. The method according to claim 1, characterized in that The determining the amount of knowledge data of the module node based on the node type, the decision tree, the code file and the database comprises: Determine a target data table based on the decision tree, the code file, and the database; The amount of knowledge data of the corresponding module node is determined based on the target data table and the node type.

6. The method according to claim 5, characterized in that The determining of the target data table based on the decision tree, the code file and the database includes: In response to the existence in the database of a table name of a data table that is consistent with the file identifier of the code file, determining whether a matching degree between the form ID in the decision tree and a field of the data table exceeds a preset matching threshold; If so, the data table is used as the target data table.

7. The method according to claim 1, characterized in that The step of constructing a first model based on the amount of knowledge data of the module node comprises: Determine the server corresponding to the module node based on the amount of knowledge data; Building a corresponding knowledge model based on the knowledge data volume of the module node, and deploying the knowledge model on a server corresponding to the module node; A first model is obtained based on the knowledge models on each server.

8. A large model prompt word intelligent routing device, characterized in that: The device comprises: A decision tree construction module is used to generate a decision tree based on code files and a preset database; A data volume calculation module, used to determine the node type of each module node under the condition node in the decision tree, and determine the knowledge data volume of the module node based on the node type, the decision tree, the code file and the database; A model processing module, configured to construct a first model based on the amount of knowledge data of the module node, and in response to the first model hitting a prompt word issued by a user, process the prompt word based on the first model; An access judgment module is used to determine whether to use the prompt word to access the second model based on the prompt word and the label node in the decision tree in response to the first model not hitting the prompt word.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Patent Citations

  • Method for protecting model privacy, data privacy and model consistency of decision tree model

    CN117077038A

  • Three-dimensional CAD (computer-aided design) generative design method based on knowledge graph and machine learning

    CN117235929A

  • Providing the Status of Model Extraction in the Presence of Colluding Users

    US20190354687A1

  • Methods and systems for automated generation of personalized messages

    WO2018209254A1

Cited By

  • Answer prediction method, device and equipment based on distributed learning

    CN120196729A

  • An answer prediction method, device and equipment based on distributed learning

    CN120196729B

  • Bank intelligent customer service question answering method and system based on large model

    CN120994786A