Instruction construction method and device, electronic equipment, storage medium and program product
By integrating business databases and knowledge databases to construct model instructions, the problem of inaccurate answers from AI models in complex business scenarios was solved, achieving higher answer accuracy.
Patent Information
- Application Number
- CN202511455165.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-02-03
AI Technical Summary
The existing AI model's knowledge base struggles to reflect the dynamic changes in business data in real time, resulting in inconsistent answers and poor accuracy in complex business scenarios.
By integrating the business database and knowledge database of the first business type, a business knowledge database is constructed, generating model instructions that are more closely aligned with business inquiry scenarios, and obtaining business data and knowledge data that match the question information.
This improves the accuracy of the answers output by the AI model, ensuring that the answers are more closely aligned with the user's questions and business scenarios.
Smart Images

Figure CN121456086A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to instruction construction methods, apparatus, electronic devices, storage media, and program products. Background Technology
[0002] Currently, question-answering systems in artificial intelligence (AI) models are one of the applications of natural language processing technology in real-world scenarios, and they are widely used in various fields such as law, medicine, and finance.
[0003] In related technologies, the aforementioned question-answering system needs to use a specified set of documents, i.e., a knowledge base, to answer user questions. Therefore, it is also called a knowledge base-based vertical domain question-answering system. Typically, electronic devices can build knowledge bases using expertise from various fields, so that AI models can generate corresponding response information based on the user's input question and the expertise in the knowledge base.
[0004] However, since the knowledge base only stores professional knowledge in various fields, the information stored in the knowledge base is difficult to reflect the dynamic changes of business data (such as order status, business system process data, user behavior, and device logs) in real time. This leads to inconsistencies between the responses output by the AI model and the real business data in complex business scenarios, resulting in poor accuracy of the answers output by the AI model. Summary of the Invention
[0005] This application provides an instruction construction method, apparatus, electronic device, storage medium, and program product for improving the accuracy of answer information output by an AI model.
[0006] In a first aspect, this application provides an instruction construction method, comprising: receiving question information input by a user, the question information being a question for a first business type; determining first business knowledge data matching the question information based on a business knowledge database corresponding to the first business type, the business knowledge database including at least one business knowledge data corresponding to the first business type, each of the at least one business knowledge data including a business data and knowledge data related to the business data; constructing model instructions based on the question information and the first business knowledge data; and obtaining answer information corresponding to the question information based on the model instructions; wherein the business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
[0007] The technical solution provided in this application brings at least the following beneficial effects: by merging the business database corresponding to the first business type with the knowledge database to obtain a business knowledge database, business data and knowledge data matching the question information can be obtained based on the question information input by the user, namely the first business knowledge data. Thus, a more accurate model instruction that fits the business inquiry scenario can be constructed based on the first business knowledge data and the question information input by the user. In turn, an accurate question answer can be obtained through the model instruction, thereby improving the accuracy of the question answer output by the model.
[0008] One possible implementation involves determining the first business knowledge data that matches the problem information based on the business knowledge database corresponding to the first business type. This includes: vectorizing the business knowledge database to obtain a vectorized business knowledge database; querying the first sub-data that matches the problem information from the business knowledge database; querying the second sub-data that matches the problem information from the vectorized business knowledge database; and taking the data with the highest correlation to the problem information from the first and second sub-data as the first business knowledge data.
[0009] Another possible implementation, before receiving the user's input question information, further includes: obtaining a business database corresponding to the first business type, the business database including business data corresponding to the first business type; obtaining at least one knowledge database corresponding to the first business type, each of the at least one knowledge database including knowledge data associated with the first business type; and for each piece of business data in the business database, associating and storing the business data with the knowledge data associated with the business data in the at least one knowledge database to obtain a business knowledge database.
[0010] Another possible implementation involves, before receiving the user's input question information, the method further includes: acquiring at least one knowledge text related to the first business type; dividing the at least one knowledge text into at least one knowledge text fragment; parsing the at least one knowledge text fragment to obtain at least one knowledge keyword and a knowledge description text corresponding to each knowledge keyword; and associating and storing each knowledge keyword with the knowledge description text corresponding to each knowledge keyword to obtain a knowledge database.
[0011] Another possible implementation method, before receiving the user's input question information, further includes: obtaining at least one business data corresponding to the first business type; processing the business data to obtain processed business data, and storing the processed business data to obtain a business database; wherein, the data processing includes at least one of the following: data cleaning and data format conversion.
[0012] Secondly, this application provides an instruction construction apparatus, comprising: a receiving module, a determining module, a constructing module, and an acquiring module. The receiving module is used to receive question information input by a user, wherein the question information is a question concerning a first business type. The determining module is used to determine first business knowledge data matching the question information based on a business knowledge database corresponding to the first business type. The business knowledge database includes at least one piece of business knowledge data corresponding to the first business type, and each piece of business knowledge data includes a piece of business data and knowledge data related to that piece of business data. The constructing module is used to construct model instructions based on the question information received by the receiving module and the first business knowledge data determined by the determining module. The acquiring module is used to acquire answer information corresponding to the question information based on the model instructions constructed by the constructing module; wherein the business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
[0013] In one possible implementation, the instruction construction device further includes a processing module. The processing module is used to vectorize the business knowledge database to obtain a vectorized business knowledge database; query the business knowledge database for first sub-data matching the problem information; and query the vectorized business knowledge database for second sub-data matching the problem information. Specifically, the determining module is used to select the data with the highest correlation to the problem information from the first and second sub-data obtained by the processing module as the first business knowledge data.
[0014] In another possible implementation, the instruction construction apparatus further includes a storage module. The acquisition module is further configured to, before the receiving module receives the user-input question information, acquire a business database corresponding to the first business type, the business database including business data corresponding to the first business type; and acquire at least one knowledge database corresponding to the first business type, each knowledge database including knowledge data associated with the first business type. The storage module is configured to, for each piece of business data in the business database, associate and store the business data with the knowledge data associated with the business data in at least one knowledge database to obtain a business knowledge database.
[0015] In another possible implementation, the instruction construction device further includes a processing module. The acquisition module is further configured to acquire at least one knowledge text related to the first business type before receiving the user-inputted question information. The processing module is configured to perform text segmentation on the at least one knowledge text to obtain at least one knowledge text fragment; and to perform text parsing on the at least one knowledge text fragment to obtain at least one knowledge keyword and a knowledge description text corresponding to each knowledge keyword. The storage module is further configured to associate and store each knowledge keyword with the corresponding knowledge description text to obtain the knowledge database.
[0016] In another possible implementation, the instruction construction apparatus further includes a processing module. The acquisition module is further configured to acquire at least one piece of business data corresponding to the first business type before receiving user-inputted question information. The processing module is configured to process the business data to obtain processed business data and store the processed business data to obtain a business database; wherein the data processing includes at least one of the following: data cleaning and data format conversion.
[0017] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to implement the method of the first aspect described above.
[0018] Fourthly, this application provides a computer-readable storage medium comprising: computer software instructions; which, when executed in an electronic device, cause the electronic device to implement the method described in the first aspect.
[0019] Fifthly, this application provides a computer program product comprising a computer program; when the computer program is run in an electronic device, the electronic device performs the method described in the first aspect.
[0020] The beneficial effects of the second to fifth aspects mentioned above are described in the corresponding description of the first aspect and will not be repeated here. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the application environment of an instruction construction method provided in an embodiment of this application; Figure 2 A flowchart illustrating an instruction construction method provided in an embodiment of this application; Figure 3 A flowchart illustrating another instruction construction method provided in an embodiment of this application; Figure 4A flowchart illustrating another instruction construction method provided in an embodiment of this application; Figure 5 A flowchart illustrating another instruction construction method provided in an embodiment of this application; Figure 6 A flowchart illustrating another instruction construction method provided in an embodiment of this application; Figure 7 A flowchart illustrating another instruction construction method provided in an embodiment of this application; Figure 8 A schematic diagram of the system architecture of an instruction construction system provided in this application embodiment; Figure 9 A flowchart illustrating a data fusion processing module provided in an embodiment of this application; Figure 10 A flowchart illustrating a retrieval enhancement module provided in an embodiment of this application; Figure 11 This is a schematic diagram illustrating the composition of an instruction construction apparatus provided in an embodiment of this application; Figure 12 A schematic diagram illustrating the composition of another instruction construction apparatus provided in an embodiment of this application; Figure 13 A schematic diagram illustrating the composition of another instruction construction apparatus provided in this application embodiment; Figure 14 This is a schematic diagram of the composition of an electronic device provided in an embodiment of this application. Detailed Implementation
[0022] The instruction construction method, apparatus, electronic device, storage medium, and program product provided in this application will now be described in detail with reference to the accompanying drawings.
[0023] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0024] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0025] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0026] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0027] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0028] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0029] The instruction construction method provided in this application can be applied to AI model question-answering scenarios in vertical fields, such as medical, cybersecurity, or financial question-answering scenarios.
[0030] In existing technologies, within the aforementioned medical question-and-answer scenario, if a user inputs "What is Dr. A's appointment number today?" into a medical AI model, the AI model can display Dr. A's specialty and its corresponding professional explanation stored in its knowledge database. For example, Dr. A specializes in cervical spondylosis, which is often caused by prolonged periods of looking down or lack of neck exercises after long hours of work. In this case, it's clear that the AI model's output doesn't directly correspond to the user's question, indicating poor accuracy.
[0031] In the aforementioned question-and-answer scenario in the field of cybersecurity, if a user inputs "Is the current network secure?" into the cybersecurity AI model, the AI model can display the steps for determining network security stored in its knowledge database. For example, the steps for determining network security are as follows: Step 1: Preparation and Planning; Step 2: Information Gathering and Discovery; Step 3: Analysis and Risk Assessment. It is clear that the AI model's output answer does not correspond to the user's question, indicating poor accuracy in the AI model's output.
[0032] In the aforementioned financial Q&A scenario, if a user inputs "Which company's stock is suitable to buy?" into a financial AI model, the AI model can display the stock's rise and fall processes stored in its knowledge database. For example, a stock's upward trend is typically defined as a series of higher highs and higher lows, driven by increasing investor confidence and a sustained excess of buying demand over selling supply. Conversely, a stock's downward trend is typically defined as a series of lower highs and lower lows, driven by a collapse in investor confidence and a sustained excess of selling pressure over buying demand. In this case, it's clear that the AI model's output doesn't directly correspond to the user's question, indicating poor accuracy.
[0033] Based on the three scenarios mentioned above, it can be concluded that the current AI model, for a specific application scenario, only provides answers based on the content of the knowledge database corresponding to that application scenario. However, the content of the knowledge database is difficult to reflect the dynamic changes of the business system in real time, resulting in inconsistencies between the answers and the user's input questions in complex business scenarios.
[0034] To address the aforementioned technical problems, this application provides an instruction construction method, apparatus, electronic device, storage medium, and program product. By merging a business database corresponding to a first business type with a knowledge database to obtain a business knowledge database, the instruction construction apparatus can obtain business data and knowledge data matching the user's input question information, i.e., first business knowledge data. Based on this first business knowledge data and the user's input question information, the instruction construction apparatus can construct a more accurate model instruction that better fits the business inquiry scenario. Furthermore, the instruction construction apparatus can obtain an accurate answer to the question through this model instruction, thus improving the accuracy of the model's output answer.
[0035] The embodiments provided in this application will now be described in detail with reference to the accompanying drawings.
[0036] The instruction construction method provided in this application can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1As shown, the application environment includes an instruction building device 101 and a front-end device 102. The instruction building device 101 and the front-end device 102 are interconnected.
[0037] In some embodiments, the instruction building apparatus 101 may be a server cluster consisting of multiple servers, a single server, a computer, or a processor or processing chip in a server or computer. This application does not limit the specific device form of the instruction building apparatus 101. Figure 1 The instruction construction device 101 is shown as a single server as an example.
[0038] In some embodiments, the front-end device 102 can be a device with wireless transceiver capabilities, such as a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This application embodiment does not limit the specific device form of the front-end device 102. Figure 1 The example shown is a mobile phone terminal, with the front-end device 102 as the example.
[0039] In some embodiments, the front-end device 102 can upload the question information input by the user to the instruction construction device 101. Based on the question information, the instruction construction device 101 determines the first business knowledge data from the business knowledge database corresponding to the first business type of the question information, and constructs a model instruction through the question information and the first business knowledge data. Then, the answer information corresponding to the question information is obtained through the model instruction, and finally the answer information is sent to the front-end device 102, so that the front-end device 102 can display the answer information.
[0040] It should be noted that the system architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0041] See Figure 2 This is a flowchart illustrating an instruction construction method provided in an embodiment of this application. Figure 2 As shown, the instruction construction method provided in this application can be implemented by the above-mentioned instruction construction device, specifically including the following steps S201~S204.
[0042] S201, The instruction construction device receives the problem information input by the user.
[0043] In some embodiments, the above-mentioned problem information is a problem for a first business type.
[0044] For example, the aforementioned question information can be any of the following: "What is the current waiting list number for Dr. A today?", "Is the current network secure?", or "Which company's stock is suitable to buy?". The specific information can be determined according to actual usage needs, and this application embodiment does not impose any limitations.
[0045] In some embodiments, the first business type mentioned above can be any of the following: medical business type, cybersecurity business type, or financial business type, etc. The specific type can be determined according to actual usage needs, and this application embodiment does not impose any limitations.
[0046] In some embodiments, the instruction construction apparatus may perform semantic parsing on the problem information to determine the first service type corresponding to the problem information.
[0047] For example, when the question information is: "What number is Dr. A's appointment number today?", the instruction construction device performs semantic parsing and determines the keywords: "Dr. A" and "appointment number". Based on the preset correspondence between keywords and business types, the first business type corresponding to the question information is determined to be the medical business type.
[0048] For example, when the above question information is "Is the current network secure?", the instruction construction device performs semantic parsing and determines the keywords "network" and "security". Then, based on the preset correspondence between the keywords and the service type, it determines that the first service type corresponding to the question information is the network security service type.
[0049] For example, when the question information is "show which company's stock is suitable to buy", the instruction construction device performs semantic parsing and determines the keyword "stock". Then, based on the preset correspondence between the keyword and the business type, it determines that the first business type corresponding to the question information is the financial business type.
[0050] In some embodiments, the instruction building apparatus may include a question-and-answer model, through which the instruction building apparatus may receive question information input by the user.
[0051] For example, the question-answering model mentioned above is the AI model corresponding to the first business type.
[0052] For example, the AI model mentioned above can be a Large Language Model (LLM).
[0053] In some embodiments, the instruction building apparatus may include an input control, through which the instruction building apparatus may receive question information input by the user.
[0054] In some embodiments, the above-mentioned input control can be a text input control or a voice input control, which can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions.
[0055] In one example, when the input control is a text input control, the instruction building device can obtain the problem information by the text entered by the user in the text input control.
[0056] In another example, where the input control is a voice input control, the instruction building device can obtain problem information through the voice input by the user in the voice input control.
[0057] For example, when the instruction generation device receives voice input from a user, it can perform text conversion processing on the voice to obtain question information.
[0058] It should be noted that the specific operation process of the above speech-to-text conversion can be found in the description of the relevant technologies, and will not be repeated here to avoid repetition.
[0059] S202, The instruction construction device determines the first business knowledge data that matches the problem information based on the business knowledge database corresponding to the first business type.
[0060] In some embodiments, the business knowledge database includes at least one business knowledge data corresponding to a first business type, and each of the at least one business knowledge data includes a business data and knowledge data related to the business data.
[0061] In some embodiments, the aforementioned business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
[0062] In some embodiments, the aforementioned business data includes at least one of the following: order status, business system process data, user behavior, device logs, etc. The specific data can be determined based on actual usage requirements, and this application embodiment does not impose any limitations.
[0063] It should be noted that the specific process of obtaining the business knowledge database described above can be found in the following embodiments, and will not be repeated here to avoid repetition.
[0064] In some embodiments, the aforementioned business knowledge database may include a database name. If the matching degree between the database name and the first business type is greater than or equal to a first preset threshold, the instruction construction device may determine the business knowledge database corresponding to the first business type.
[0065] In some embodiments, the aforementioned first preset threshold may be preset by the instruction construction device; or, it may be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0066] For example, the instruction construction device can perform feature extraction on each database name to obtain a first feature value corresponding to each database name, and perform feature extraction on the first business type to obtain a second feature value corresponding to the first business type. Then, the business knowledge database corresponding to the first business type whose matching degree between the second feature value and the first feature value is greater than or equal to 80% is determined as the business knowledge database corresponding to the first business type.
[0067] In some embodiments, the instruction construction device can perform semantic recognition on the problem information to obtain the semantic information of the problem information, and determine the business knowledge data that is associated with the keywords in the business knowledge database and the semantic information with a similarity greater than or equal to a second preset threshold as the first business knowledge data that matches the problem information.
[0068] In some embodiments, the aforementioned second preset threshold may be preset by the instruction construction device; or, it may be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0069] For example, the instruction construction device can perform semantic recognition on the problem information to obtain the semantic information of the problem information, and then compare the semantic information with the keywords stored in the business knowledge database one by one. Then, the keyword with a similarity of greater than or equal to 90% between the semantic information and the keyword is determined as the first keyword. Finally, the business knowledge data associated with the first keyword is determined as the first business knowledge data that matches the problem information.
[0070] In some embodiments, the first keyword may be one or more. It is understood that when there are multiple first keywords, the first business knowledge data includes business knowledge data associated with multiple first keywords.
[0071] It should be noted that the specific process of semantic recognition of the problem information by the above-mentioned instruction construction device can be found in the description in the relevant technology. To avoid repetition, it will not be repeated here.
[0072] S203, The instruction construction device constructs model instructions based on problem information and primary business knowledge data.
[0073] In some embodiments, the instruction building apparatus may add problem information and first business knowledge data to the initial model instruction to obtain the model instruction.
[0074] For example, the initial model instruction mentioned above may include a question template. The instruction building device can concatenate the question information and the first business knowledge data to obtain the concatenated question information, and add the concatenated question information to the question template to obtain the model instruction.
[0075] For example, the above question template could be: "You are a question-and-answer expert in a certain field. Please output the corresponding answer based on information A."
[0076] In one example, combining the above-mentioned medical Q&A scenario, the question information is: "What number is Dr. A's appointment number today?" The first business knowledge data could be: "Dr. A released 30 appointments today, and currently, number 15 has been booked; all 30 appointments have been filled. Dr. A specializes in cervical spondylosis. Cervical spondylosis is usually caused by prolonged periods of looking down or not exercising the cervical spine after long hours of work. Effective ways to relieve cervical spondylosis include: applying a cold compress for 15-20 minutes; or resting in a supine position with a pillow under the knees to maintain the natural curvature of the spine. When lying on your side, ensure the pillow fills the gap between your ear and shoulder, keeping your head, neck, and spine in a straight line."
[0077] Then, the instruction construction device can combine the problem information and the first business knowledge data to obtain: "Problem: What number is Dr. A's appointment number today? Reference information: Currently, the appointment number is 15, and all 30 appointments have been booked. Dr. A specializes in cervical spondylosis. Cervical spondylosis is usually caused by prolonged periods of looking down or not exercising the cervical spine after long hours of work. Effective ways to relieve cervical spondylosis include: applying a cold compress for 15-20 minutes; or resting in a supine position with a pillow under the knees to maintain the natural curvature of the spine. When lying on your side, ensure that the pillow fills the gap between the ear and shoulder, keeping the head, neck, and spine in a straight line."
[0078] Next, the concatenated information is added to the question template, resulting in the model instruction: "You are a question-and-answer master in the medical field. Please provide the following answers based on the questions: What is the current appointment number for Dr. A? Reference information: The current appointment number is 15, and all 30 appointments have been booked. Dr. A specializes in cervical spondylosis. Cervical spondylosis is usually caused by prolonged periods of looking down or not exercising the cervical spine after long hours of work. Effective ways to relieve cervical spondylosis include: applying a cold compress for 15-20 minutes; or resting in a supine position with a pillow under the knees to maintain the natural curvature of the spine. When lying on your side, ensure the pillow fills the gap between your ear and shoulder, keeping your head, neck, and spine in a straight line."
[0079] In another example, combining the above network security Q&A scenario, the question information is: "Is the current network secure?" The first business knowledge data can be: "The current network has 0 abnormal information, the network ping packet loss rate is 1%, and the steps to determine whether the network is secure are as follows: Step 1: Preparation and planning, Step 2: Information collection and discovery, Step 3: Analysis and risk assessment."
[0080] Then, the instruction construction device can combine the problem information and the first business knowledge data to obtain "Problem: Is the current network secure? Reference information: The current network has 0 abnormal information and the network ping interface packet loss rate is 1%. The steps to determine whether the network is secure are as follows: Step 1: Preparation and planning, Step 2: Information collection and discovery, Step 3: Analysis and risk assessment".
[0081] Next, the concatenated information is added to the question template to obtain the model instruction: "You are a question-and-answer master in the field of network security. Please answer the following questions based on the following information: Is the current network secure? Reference information: The current network has 0 abnormal information and the network ping packet loss rate is 1%. The steps to determine whether the network is secure are as follows: Step 1: Preparation and planning, Step 2: Information collection and discovery, Step 3: Analysis and risk assessment, and output the corresponding answer."
[0082] In another example, combined with the above financial Q&A scenario, the question information is: "Show which company's stock is suitable to buy", and the first business knowledge data can be: "Company A has a strong track record, and its current stocks B, C, and D are continuously rising; Company B has a lower track record than Company A, and Company B's market share is greater than Company A's."
[0083] Then, the instruction construction device can combine the problem information and the first business knowledge data to obtain "Problem: Show which company's stock is suitable to buy; Reference information: Company A has a strong track record, and the current stocks of B, C, and D are continuously rising; Company B has a lower track record than Company A, and Company B's market share is greater than Company A's."
[0084] Next, the concatenated information is added to the question template to obtain the model instruction: "You are a question-and-answer master in the financial field. Based on the question: show which company's stock is suitable to buy; reference information: Company A has a strong track record, and the current stocks of B, C, and D are continuously rising; Company B has a lower track record than Company A, and Company B's market share is greater than Company A's. Output the corresponding answer."
[0085] In some embodiments, the above-mentioned question template may also include model output requirements.
[0086] For example, the output requirements of the above model can be either: a concise output of the answer information that the user wants; or a detailed output of the answer information that the user wants.
[0087] In some embodiments, the above-mentioned model output requirements can be preset by the instruction construction device; or, user-defined. The specific requirements can be determined according to actual usage needs, and this application embodiment does not impose any limitations.
[0088] S204. The instruction construction device obtains the answer information corresponding to the question information based on the model instructions.
[0089] In some embodiments, the instruction building device can input the above-mentioned model instructions into the AI model so that the AI model can output the answer information corresponding to the question information.
[0090] In one example, if the model instruction is: "You are a medical Q&A master. Please provide the following answer based on the question: What is the current appointment number for Dr. A today? Reference information: The current appointment number is 15, and all 30 appointments have been booked. Dr. A specializes in cervical spondylosis. Cervical spondylosis is usually caused by prolonged periods of looking down or not exercising the cervical spine after long hours of work. Effective ways to relieve cervical spondylosis include: applying a cold compress for 15-20 minutes; or resting in a supine position with a pillow under the knees to maintain the natural curvature of the spine. When lying on your side, ensure the pillow fills the gap between your ear and shoulder, keeping your head, neck, and spine in a straight line." The answer could be: "Dr. A's appointments are all booked today. It is recommended to book earlier tomorrow. Applying a cold compress to the painful area for 15-20 minutes can provide quick relief."
[0091] In another example, if the above model instruction is: "You are a Q&A master in the field of network security, please answer the following questions: Is the current network secure? Reference information: The current network has 0 abnormal information and the network ping packet loss rate is 1%. The steps to determine whether the network is secure are as follows: Step 1: Preparation and planning, Step 2: Information collection and discovery, Step 3: Analysis and risk assessment," the answer information could be: "The current network is in a normal state. You can re-evaluate the network's security by following these steps: Step 1: Preparation and planning, Step 2: Information collection and discovery, Step 3: Analysis and risk assessment."
[0092] In another example, if the above model instruction is: "You are a master of answering questions in the financial field. Based on the question: Which company's stock is suitable to buy? Reference information: Company A has a strong track record, and the current stocks of B, C, and D are continuously rising; Company B has a lower track record than Company A, but Company B has a larger market share than Company A," the above answer information could be: "Although Company A has a strong track record, Company B has a larger market share than Company A. Based on market research, it is recommended to buy Company B's stock."
[0093] In the instruction construction method provided in this application embodiment, a business knowledge database is obtained by merging the business database corresponding to the first business type with the knowledge database. The instruction construction device can obtain business data and knowledge data matching the question information based on the question information input by the user, namely the first business knowledge data. Thus, the instruction construction device can construct a more accurate model instruction that fits the business inquiry scenario based on the first business knowledge data and the question information input by the user. In turn, the instruction construction device can obtain an accurate question answer through the model instruction, thereby improving the accuracy of the question answer output by the model.
[0094] In some embodiments, combined with Figure 2 ,like Figure 3 As shown, S202 can be specifically implemented as S202a-S202d as follows: S202a, The instruction construction device vectorizes the business knowledge database to obtain the vectorized business knowledge database.
[0095] In some embodiments, the instruction construction apparatus can vectorize all business knowledge data stored in the business knowledge database to obtain a vectorized business knowledge database.
[0096] It should be noted that the specific process of the above vectorization can be found in the description of related technologies, and will not be repeated here to avoid repetition.
[0097] S202b, The instruction construction device queries the business knowledge database for the first sub-data that matches the problem information.
[0098] In some embodiments, the first sub-data mentioned above can be one or more.
[0099] In some embodiments, the instruction construction device can perform semantic recognition on the problem information to obtain the semantic information of the problem information, and determine the business knowledge data associated with the keywords in the business knowledge database and the keywords whose similarity with the semantic information is greater than or equal to a second preset threshold as the first sub-data.
[0100] For example, the instruction construction device can perform semantic recognition on the problem information to obtain the semantic information of the problem information, and then compare the semantic information with the keywords stored in the business knowledge database one by one. Then, the keywords with a similarity of greater than or equal to 80% between the semantic information and the keywords are determined as the second keywords. Finally, the business knowledge data associated with the second keywords are determined as the first business knowledge data that matches the problem information.
[0101] S202c, The instruction construction device queries the vectorized business knowledge database for the second sub-data that matches the problem information.
[0102] In some embodiments, the aforementioned second sub-data may be one or more.
[0103] In some embodiments, the instruction construction device can extract features from the problem information to obtain feature information of the problem information, and determine the business knowledge data associated with the keywords in the vectorized business knowledge database whose similarity with the feature information corresponding to the problem information is greater than or equal to a third preset threshold as the second sub-data.
[0104] In some embodiments, the aforementioned third preset threshold may be preset by the instruction construction device or user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0105] For example, the instruction construction device can extract features from the problem information to obtain the feature information of the problem information, and then compare the feature information corresponding to the problem information with the feature information of the keywords stored in the vectorized business knowledge database one by one. Then, the keywords with a similarity of more than or equal to 90% between the problem information and the keywords are determined as the third keywords. Finally, the business knowledge data associated with the third keyword is determined as the second sub-data that matches the problem information.
[0106] S202d, the instruction construction device takes the data with the highest correlation to the problem information from the first sub-data and the second sub-data as the first business knowledge data.
[0107] In some embodiments, after obtaining the correlation degree between the first sub-data and the problem information and the correlation degree between the second sub-data and the problem information, the instruction construction device can sort the first sub-data and the second sub-data based on the correlation degree, and then take the sub-data with the highest ranking as the first business knowledge data.
[0108] In this way, the instruction construction device generates high-precision enhanced model instructions through a joint query mechanism of the structured business knowledge database and the vector business knowledge database, combined with reordering technology, thereby achieving semantic understanding and accurate data response in complex business scenarios.
[0109] It should be understood that the instruction building device can also perform an operation to obtain the business knowledge database before receiving the question information input by the user.
[0110] Therefore, combining Figure 2 ,like Figure 4 As shown, prior to S201, the embodiments of this application provide an instruction construction method, which further includes the following S301-S303: S301, The instruction construction device obtains the service database corresponding to the first service type.
[0111] In some embodiments, the aforementioned business database includes business data corresponding to the first business type.
[0112] In some embodiments, the business database may include a business database name. If the matching degree between the business database name and the first business type is greater than or equal to a fourth preset threshold, the instruction construction device may determine the business database corresponding to the first business type.
[0113] In some embodiments, the aforementioned fourth preset threshold may be preset by the instruction construction device; or, it may be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0114] For example, the instruction construction device can perform feature extraction on each business database name to obtain a third feature value corresponding to each business database name, and perform feature extraction on the first business type to obtain a second feature value corresponding to the first business type. Then, the business databases whose matching degree between the second feature value and the third feature value is greater than or equal to 80% are determined as the business databases corresponding to the first business type.
[0115] S302, The instruction construction device acquires at least one knowledge database corresponding to the first business type.
[0116] In some embodiments, each of the at least one knowledge databases mentioned above includes knowledge data associated with the first business type.
[0117] In some embodiments, the knowledge database may include a knowledge database name. If the matching degree between the knowledge database name and the first business type is greater than or equal to a fifth preset threshold, the instruction construction device may determine the knowledge database corresponding to the first business type.
[0118] In some embodiments, the aforementioned fifth preset threshold may be preset by the instruction construction device; or, it may be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0119] For example, the instruction construction device can extract features from multiple knowledge database names to obtain fourth feature values corresponding to each of the multiple knowledge database names, and extract features from a first business type to obtain a second feature value corresponding to the first business type. Then, the knowledge database corresponding to the first business type is determined to be the knowledge database corresponding to the first business type if the matching degree between the second feature value and the fourth feature value is greater than or equal to 80%.
[0120] S303. For each piece of business data in the business database, the instruction construction device associates and stores the business data with knowledge data associated with the business data in at least one knowledge database to obtain a business knowledge database.
[0121] In some embodiments, for a piece of business data in a business database, the instruction construction device can extract keywords from the business data and at least one knowledge data associated with the business data in a knowledge database to obtain the keywords corresponding to the business data, and then associate and store the keywords with the business data and the knowledge data associated with the business data in at least one knowledge database to obtain a business knowledge database.
[0122] It should be noted that, for each piece of business data in the business database, the instruction building device can associate and store each piece of business data with knowledge data associated with each piece of business data in at least one knowledge database in the manner described above, so as to obtain a business knowledge database.
[0123] In some embodiments, the instruction building apparatus may create a new database, thereby storing the keywords corresponding to each business data, each business data, and at least one knowledge data associated with each business data in the new database to obtain a business knowledge database.
[0124] In this way, by merging the business database corresponding to the first business type with the knowledge database to obtain a business knowledge database, electronic devices can obtain business data and knowledge data that match the question information input by the user, thereby improving the comprehensiveness of the reference information obtained by the instruction construction device.
[0125] It should be understood that the instruction building device can also perform a knowledge database acquisition operation before receiving the question information input by the user.
[0126] Therefore, combining Figure 2 ,like Figure 5 As shown, prior to S201, the embodiments of this application provide an instruction construction method, which further includes the following S401-S404: S401, The instruction construction device acquires at least one knowledge text related to the first business type.
[0127] In some embodiments, the instruction building apparatus may obtain at least one knowledge text related to a first business type from the network via a web crawler.
[0128] In some embodiments, the instruction building apparatus may obtain at least one knowledge text related to the first business type from the network through a web crawler at preset intervals.
[0129] In some embodiments, the aforementioned preset duration can be preset by the instruction construction device; or it can be user-defined. The specific duration can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0130] For example, the preset duration can be 15 days, 30 days, or 60 days, etc.
[0131] S402, The instruction construction device performs text segmentation on at least one knowledge text to obtain at least one knowledge text fragment.
[0132] In some embodiments, the instruction construction apparatus may perform text segmentation on at least one knowledge text using a first segmentation method to obtain at least one knowledge text fragment.
[0133] In some embodiments, the first division method described above can be any of the following: punctuation mark division, paragraph division, semantic division, etc. The specific method can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0134] For example, the above punctuation mark division includes at least one of the following: comma division, period division, and special symbol division.
[0135] S403, The instruction construction device performs text parsing on at least one knowledge text fragment to obtain at least one knowledge keyword and the knowledge description text corresponding to each knowledge keyword.
[0136] In some embodiments, the instruction construction apparatus may perform semantic parsing on each knowledge text fragment in at least one knowledge text fragment to obtain the knowledge description text corresponding to each knowledge text fragment, and then perform a text summary on the knowledge description text corresponding to each knowledge text fragment to obtain the knowledge keywords corresponding to each knowledge text fragment.
[0137] In some embodiments, the instruction construction apparatus may directly identify the technical terms contained in each of the at least one knowledge text fragment as knowledge keywords.
[0138] For example, the instruction construction device can compare the words contained in each knowledge text fragment with the professional terms contained in a preset professional terminology database one by one to determine the professional terms contained in each knowledge text fragment.
[0139] S404, The instruction construction device associates and stores each of the at least one knowledge keywords with the knowledge description text corresponding to each of the at least one knowledge keywords, thereby obtaining a knowledge database.
[0140] It is understandable that, since the instruction building device can obtain at least one knowledge text related to the first business type from the network through a web crawler at preset intervals, the instruction building device can update the knowledge data stored in the knowledge database according to the currently obtained knowledge text.
[0141] In this way, by updating the knowledge data stored in the knowledge database in real time, the lag in knowledge database updates is avoided, which would prevent insufficient response to new problems and scenarios. This improves the accuracy of the instruction construction device in obtaining answer information.
[0142] It should be understood that the instruction building device can also perform the operation of obtaining the business database before receiving the question information input by the user.
[0143] Therefore, combining Figure 2 ,like Figure 6 As shown, prior to S201, the embodiments of this application provide an instruction construction method, which further includes the following S501-S502: S501, The instruction construction device acquires at least one type of service data corresponding to the first service type.
[0144] In some embodiments, the instruction construction apparatus may obtain at least one type of business data corresponding to the first business type through a business interface.
[0145] For example, the instruction construction device can perform semantic analysis on the first business type to obtain semantic information corresponding to the first business type, and then obtain at least one business data from the business configuration file through the business interface that has a matching degree with the semantic information corresponding to the first business type greater than or equal to a fifth preset threshold.
[0146] In some embodiments, the aforementioned fifth preset threshold may be preset by the instruction construction device; or, it may be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0147] For example, the instruction construction device can perform semantic analysis on the first business type to obtain the semantic information corresponding to the first business type, and then obtain at least one business data with a matching degree of greater than or equal to 80% with the semantic information corresponding to the first business type from the business configuration file through the business interface.
[0148] In some embodiments, the instruction construction apparatus may acquire at least one type of service data corresponding to a first service type at each preset time interval.
[0149] S502, The instruction construction device processes the business data to obtain processed business data and stores the processed business data to obtain a business database.
[0150] In some embodiments, the above data processing includes at least one of the following: data cleaning and data format conversion.
[0151] In some embodiments, the above data cleaning can be: the instruction building apparatus can delete words that are the same as preset words in each of at least one business data.
[0152] In some embodiments, the aforementioned preset terms may be preset by the instruction building device; or, user-defined. The specific terminology can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0153] For example, the preset words mentioned above may include at least one of the following: conjunctions, interjections, adjectives, etc.
[0154] In some embodiments, the instruction building apparatus may automatically determine the words that need to be deleted based on the grammatical structure in the business data.
[0155] It should be noted that the above deletion is only to reduce the amount of data and does not change the original semantics of the business data.
[0156] For example, assuming the above business data is: "I wore a red coat today", then without changing the original semantics of the business data, the above processed business data can be: "I wore a coat today".
[0157] In some embodiments, the instruction construction apparatus can convert the data format of business data into a preset data format to obtain processed business data.
[0158] In some embodiments, the aforementioned preset data format may be preset by the instruction construction device; or it may be user-defined. The specific format can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0159] For example, assuming the above business data is: "Today is August 20th, one item is shipped", the above preset data format is: time: year-month-day. The instruction construction device performs a format conversion on the time in the business data to obtain the converted business data as: "Today is 2025-08-20, one item is shipped".
[0160] It is understandable that, since the instruction building device can acquire at least one business data corresponding to the first business type at each preset time interval, the instruction building device can update the business data stored in the business database according to the currently acquired business data.
[0161] In this way, the instruction building device can reduce the amount of business data stored by processing business data, thereby improving the efficiency of the instruction building device in searching for business knowledge data in the business knowledge database.
[0162] The following describes the instruction construction method of this application according to a specific embodiment. The specific implementation process of the instruction construction method is as follows: Figure 7 As shown, the specific process is as follows, S1 to S8: S1. The instruction construction device acquires at least one knowledge text related to the first business type every preset time interval.
[0163] S2. The instruction construction device performs text segmentation on at least one knowledge text to obtain at least one knowledge text fragment.
[0164] S3. The instruction construction device performs text parsing on each knowledge text segment in at least one knowledge text segment to obtain at least one knowledge keyword and the knowledge description text corresponding to each knowledge keyword.
[0165] S4. The instruction construction device associates and stores each knowledge keyword in at least one knowledge keyword with the knowledge description text corresponding to each knowledge keyword to obtain a knowledge database.
[0166] S5. The instruction construction device acquires at least one piece of business data related to the first business type every preset time interval.
[0167] S6. The instruction construction device processes the business data to obtain processed business data and stores the processed business data to obtain a business database.
[0168] S7. The instruction construction device receives the question information input by the user.
[0169] S8. The instruction construction device determines the first business knowledge data that matches the question information based on the business knowledge database corresponding to the first business type, and constructs model instructions based on the question information and the first business knowledge data; and obtains the answer information corresponding to the question information based on the model instructions.
[0170] It should be noted that the specific implementation process of S1 to S8 can be found in the above embodiments, and will not be repeated here to avoid repetition.
[0171] Figure 8 The system architecture diagram is shown in the embodiment of this application. The system can be an instruction building system. The instruction building system 800 may include: a data acquisition and storage module 801, a data fusion processing module 802, a retrieval enhancement module 803, and an enhanced instruction push module 804.
[0172] The data acquisition and storage module 801 is used to acquire at least one knowledge text related to the first business type and at least one business data corresponding to the first business type. Then, it constructs a database through a standardized interface protocol to achieve automated integration and persistent management of multi-source heterogeneous data. The above instruction construction system adopts a dual-channel architecture of RESTful API and WebSocket, supporting real-time high-concurrency data acquisition of business data and knowledge data. This data acquisition and storage module 801 can be applied to the related solutions of S401 and S501 mentioned above, such as S401 in the above embodiment.
[0173] The aforementioned data fusion processing module 802 is used to obtain a knowledge database and a business database based on at least one knowledge text and business data acquired by the data acquisition and storage module 801. Then, it fuses these knowledge database and business database to obtain a business knowledge database and a business knowledge database. For knowledge documents, a BERT-based adaptive text segmentation algorithm is used, combined with a sliding window and attention mechanism to achieve intelligent document segmentation. For business data, a dynamic ETL (Extract-Transform-Load) pipeline is constructed to automatically improve data quality. Through an incremental update algorithm, an update interface is automatically invoked in conjunction with a knowledge graph to dynamically fuse knowledge data and business data, ultimately generating a fused structured database and a vector database. This data fusion processing module 802 can be applied to the related solutions of S301-S303, S402, and S502 mentioned above, such as S502 in the above embodiment.
[0174] For example, such as Figure 9 As shown, the data fusion processing module 802 can acquire knowledge documents, perform text segmentation on the knowledge documents to obtain text fragments; and the data fusion processing module 802 can acquire business data, perform data cleaning and data format conversion on the business data to obtain processed business data, and then fuse the processed business data with the text fragments to obtain a structured business knowledge database, and perform vectorization processing on the structured business knowledge database to obtain a vectorized business knowledge database.
[0175] The aforementioned retrieval enhancement module 803 is used to generate a high-precision enhanced prompt through a joint query mechanism of the structured business knowledge database and the vectorized business knowledge database, combined with intelligent re-ranking technology, thereby achieving semantic understanding and accurate data response in complex business scenarios. This retrieval enhancement module 803 can be applied to the relevant solutions in S202a-S202d and S201-S203, such as S202a in the above embodiment.
[0176] For example, such as Figure 10 As shown, after receiving a user question, the retrieval enhancement module 803 determines the first sub-data matching the user question from the structured business knowledge database and the second sub-data matching the user question from the vectorized business knowledge database. Then, it inputs the first and second sub-data into the rerank model, and takes the data with the highest correlation to the question information from the first and second sub-data as the first business knowledge data. Based on the first business knowledge data and the user question, it generates a high-precision enhancement model instruction.
[0177] The aforementioned enhancement instruction push module 804 is used to transmit high-precision enhancement model instructions to the AI model to obtain accurate answers. This enhancement instruction push module 804 can be applied to the relevant solutions in step S204 above.
[0178] It should be noted that for a detailed explanation of the steps performed by each module and their beneficial effects, please refer to the description in the above embodiments, which will not be repeated here.
[0179] As can be seen, the above mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the embodiments of this application provide corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0180] This application embodiment can divide the instruction construction device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0181] In some embodiments, this application also provides an instruction construction apparatus. The instruction construction apparatus may include one or more functional modules for implementing the instruction construction method of the above method embodiments.
[0182] For example, Figure 11 This is a schematic diagram illustrating the composition of an instruction construction apparatus 900 provided in an embodiment of this application. Figure 11 As shown, the instruction construction device includes: a receiving module 901, a determining module 902, a construction module 903, and an acquisition module 904.
[0183] The system includes a receiving module 901 for receiving user-inputted question information, which is a question related to a first business type. A determining module 902 is used to determine first business knowledge data matching the question information based on a business knowledge database corresponding to the first business type. This business knowledge database includes at least one piece of business knowledge data corresponding to the first business type, and each piece of business knowledge data includes a business data item and related knowledge data. A building module 903 is used to build model instructions based on the question information received by the receiving module 901 and the first business knowledge data determined by the determining module 902. An obtaining module 903 is used to obtain answer information corresponding to the question information based on the model instructions built by the building module 903; wherein the business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
[0184] In the instruction construction device provided in this application, a business knowledge database is obtained by merging the business database corresponding to the first business type with the knowledge database. The instruction construction device can obtain business data and knowledge data matching the question information input by the user, namely the first business knowledge data. Thus, the instruction construction device can construct a more accurate model instruction that fits the business inquiry scenario based on the first business knowledge data and the question information input by the user. In turn, the instruction construction device can obtain an accurate question answer through the model instruction, thereby improving the accuracy of the question answer output by the model.
[0185] In some embodiments, combined with Figure 11 ,like Figure 12 As shown, the instruction construction device 900 further includes a processing module 905. The processing module 905 is used to vectorize the business knowledge database to obtain a vectorized business knowledge database; and to query a first sub-data matching the problem information from the business knowledge database; and to query a second sub-data matching the problem information from the vectorized business knowledge database. Specifically, the determining module is used to select the data with the highest correlation to the problem information from the first and second sub-data obtained by the processing module as the first business knowledge data.
[0186] In other embodiments, combined with Figure 12 ,like Figure 13 As shown, the instruction construction device 900 further includes a storage module 906. The acquisition module 904 is further configured to, before the receiving module receives user-inputted question information, acquire a business database corresponding to the first business type, the business database including business data corresponding to the first business type; and acquire at least one knowledge database corresponding to the first business type, each knowledge database including knowledge data associated with the first business type. The storage module 906 is configured to, for each piece of business data in the business database, associate and store the business data with the knowledge data associated with the business data in at least one knowledge database to obtain a business knowledge database.
[0187] In some embodiments, the instruction construction apparatus 900 further includes a processing module 905. The acquisition module 904 is further configured to acquire at least one knowledge text related to the first business type before receiving the user-inputted question information. The processing module 905 is configured to perform text segmentation on the at least one knowledge text to obtain at least one knowledge text fragment; and to perform text parsing on the at least one knowledge text fragment to obtain at least one knowledge keyword and a knowledge description text corresponding to each knowledge keyword. The storage module 906 is further configured to associate and store each knowledge keyword with the corresponding knowledge description text to obtain a knowledge database.
[0188] In some other embodiments, the instruction construction apparatus 900 further includes a processing module 905. The acquisition module 904 is further configured to acquire at least one type of business data corresponding to the first business type before receiving user-inputted question information. The processing module 905 is configured to process the business data to obtain processed business data and store the processed business data to obtain a business database; wherein the data processing includes at least one of the following: data cleaning and data format conversion.
[0189] It should be noted that the instruction construction device can implement all the processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0190] In the case of implementing the functions of the integrated modules described above in hardware, this embodiment of the invention provides a possible structural schematic diagram of the electronic device involved in the above embodiments. For example... Figure 14 As shown, the electronic device 90 includes: a processor 92, a communication interface 93, and a bus 94. Optionally, the electronic device 90 may also include a memory 91.
[0191] Processor 92 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 92 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 92 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0192] Communication interface 93 is used to connect with other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0193] The memory 91 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0194] In one possible implementation, the memory 91 can exist independently of the processor 92. The memory 91 can be connected to the processor 92 via a bus 94 and is used to store instructions or program code. When the processor 902 calls and executes the instructions or program code stored in the memory 91, it can implement the instruction construction method provided in this embodiment of the invention.
[0195] In another possible implementation, memory 91 can also be integrated with processor 92.
[0196] Bus 94 can be an extended industry standard architecture (EISA) bus, etc. Bus 94 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0197] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the service calling device can be divided into different functional modules to complete all or part of the functions described above.
[0198] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. The program can be stored in the aforementioned computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The aforementioned computer-readable storage medium can also be an external storage device of the aforementioned service invocation device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the aforementioned service invocation device. Further, the aforementioned computer-readable storage medium can include both internal storage units of the aforementioned service invocation device and external storage devices. The aforementioned computer-readable storage medium is used to store the aforementioned computer program and other programs and data required by the aforementioned service invocation device. The aforementioned computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0199] This application also provides a computer program product comprising a computer program that, when run on a computer, causes the computer to execute any of the instruction construction methods provided in the above embodiments.
[0200] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for constructing instructions, characterized in that, include: Receive user-inputted question information, wherein the question information is a question related to a first business type; Based on the business knowledge database corresponding to the first business type, a first business knowledge data matching the problem information is determined. The business knowledge database includes at least one business knowledge data corresponding to the first business type. Each business knowledge data includes a business data and knowledge data related to the business data. Based on the problem information and the first business knowledge data, construct model instructions; Based on the model instructions, obtain the answer information corresponding to the question information; The business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
2. The instruction construction method according to claim 1, characterized in that, The step of determining the first business knowledge data matching the problem information based on the business knowledge database corresponding to the first business type includes: The business knowledge database is vectorized to obtain the vectorized business knowledge database. Query the first sub-data that matches the question information from the business knowledge database; Query the second sub-data that matches the question information from the vectorized business knowledge database; The data with the highest correlation to the problem information among the first sub-data and the second sub-data is taken as the first business knowledge data.
3. The instruction construction method according to claim 1, characterized in that, Before receiving the user-inputted question information, the method further includes: Obtain the business database corresponding to the first business type, wherein the business database includes the business data corresponding to the first business type; Obtain at least one knowledge database corresponding to the first business type, each knowledge database including knowledge data associated with the first business type; For each piece of business data in the business database, the business data is associated with knowledge data in at least one knowledge database to obtain the business knowledge database.
4. The instruction construction method according to claim 1 or 3, characterized in that, Before receiving the user-inputted question information, the method further includes: Obtain at least one knowledge text related to the first business type; The at least one knowledge text is divided into at least one knowledge text fragment; The at least one knowledge text fragment is parsed to obtain at least one knowledge keyword and a knowledge description text corresponding to each knowledge keyword; Each knowledge keyword is associated with and stored in relation to its corresponding knowledge description text to obtain the knowledge database.
5. The instruction construction method according to claim 1 or 3, characterized in that, Before receiving the user-inputted question information, the method further includes: Obtain at least one piece of business data corresponding to the first business type; The business data is processed to obtain processed business data, and the processed business data is stored to obtain the business database; The data processing includes at least one of the following: data cleaning and data format conversion.
6. An instruction construction apparatus, characterized in that, The instruction construction device includes: a receiving module, a determining module, a construction module, and an acquiring module; The receiving module is used to receive question information input by the user, wherein the question information is a question related to the first business type; The determining module is used to determine first business knowledge data that matches the problem information based on the business knowledge database corresponding to the first business type. The business knowledge database includes at least one business knowledge data corresponding to the first business type, and each business knowledge data includes a business data and knowledge data related to the business data. The construction module is used to construct model instructions based on the problem information received by the receiving module and the first business knowledge data determined by the determining module; The acquisition module is used to acquire answer information corresponding to the question information based on the model instructions constructed by the construction module; The business knowledge database is obtained by fusing at least one knowledge database related to the first business type and a business database corresponding to the first business type.
7. The instruction construction apparatus according to claim 6, characterized in that, The instruction construction device further includes: a processing module; The processing module is used to vectorize the business knowledge database to obtain the vectorized business knowledge database; And query the first sub-data that matches the problem information from the business knowledge database; And query the vectorized business knowledge database for second sub-data that matches the problem information; The determining module is specifically used to take the data with the highest correlation to the problem information among the first sub-data and the second sub-data obtained by the processing module as the first business knowledge data.
8. The instruction construction apparatus according to claim 6, characterized in that, The instruction construction device further includes: a storage module; The acquisition module is further configured to acquire a business database corresponding to the first business type before the receiving module receives the question information input by the user, wherein the business database includes business data corresponding to the first business type; And acquire at least one knowledge database corresponding to the first business type, each knowledge database including knowledge data associated with the first business type; The storage module is used to associate and store each piece of business data in the business database with knowledge data associated with the business data in at least one knowledge database to obtain the business knowledge database.
9. The instruction construction apparatus according to claim 6 or 8, characterized in that, The instruction construction device further includes: a processing module; The acquisition module is further configured to acquire at least one knowledge text related to the first business type before receiving the question information input by the user; The processing module is used to perform text segmentation on the at least one knowledge text to obtain at least one knowledge text fragment; The at least one knowledge text fragment is then parsed to obtain at least one knowledge keyword and the knowledge description text corresponding to each knowledge keyword. The storage module is further configured to associate and store each knowledge keyword with the corresponding knowledge description text to obtain the knowledge database.
10. An electronic device, characterized in that, The device includes a processor and a memory, the processor being coupled to the memory; the memory is used to store computer instructions, which are loaded and executed by the processor to enable the computer device to implement the instruction construction method as described in any one of claims 1 to 5.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer-executable instructions that, when executed on a computer, cause the computer to perform the instruction construction method according to any one of claims 1 to 5.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when run on an electronic device, causes the electronic device to perform the instruction construction method as described in any one of claims 1 to 5.