Question and answer processing method and electronic device
By converting question data into slot values in the question-and-answer system and sending them to the second application system for retrieval, and then using JSON data messages to call the target program of the first application system, the problem of inaccurate answers from external data platforms was solved, and more accurate answer retrieval was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRICULTURAL BANK OF CHINA
- Filing Date
- 2022-11-04
- Publication Date
- 2026-07-07
AI Technical Summary
In application systems that provide question-and-answer services, the inability of external data platforms to call the application system's interfaces leads to inaccurate answers.
The system receives question input on the first application system, generates first data containing slot values, sends it to the second application system for answer retrieval, converts it into a JSON data message, and calls the target program of the first application system to obtain the answer data.
This improves the accuracy of the answers, avoids the problem of inaccurate answers caused by direct retrieval from external data platforms, and obtains more accurate answers by combining the output results of the target program of the first application system.
Smart Images

Figure CN115827820B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent customer service technology, and in particular to a question-and-answer processing method and electronic device. Background Technology
[0002] In application systems that can provide question-and-answer services, an external data platform is usually configured for the application system to improve the accuracy of the answers. However, the external data platform cannot call the application system's interface during the answer query process, which may result in inaccurate answers obtained by the data platform. Summary of the Invention
[0003] In view of this, this application provides a question-and-answer processing method and an electronic device to solve the technical problem of inaccurate answers, as follows:
[0004] A question-answering processing method, applied to a first device, the first device being configured with a first application system, the method comprising:
[0005] In response to a question input operation received on the first application system, question data is obtained;
[0006] The problem data is processed to obtain first data, which at least includes the slot value corresponding to the problem data;
[0007] The first data is sent to a second device, which is configured with a second application system, so that the second application system can perform answer retrieval based on the slot value to obtain the second data and convert the second data into a JSON-based data message;
[0008] In response to the data packet sent by the second application system, the corresponding target program in the first application system is run to obtain the third data output by the target program;
[0009] The third data is processed to obtain the answer data corresponding to the question data.
[0010] The above method, preferably, involves running a corresponding target program in the first application system in response to the data packet sent by the second application system to obtain the third data output by the target program, including:
[0011] The data packets sent by the second application system are parsed to obtain the program address corresponding to the target program;
[0012] Run the target program according to the program address.
[0013] In the preferred embodiment of the above method, the data packet includes at least: the program type of the target program, the program address of the target program, the program name of the target program, the slot value, and the attribute name of the target program.
[0014] The above method, preferably, involves processing the third data to obtain the answer data corresponding to the question data, including:
[0015] Extract at least one answer data item from the third data;
[0016] The answer data items are encapsulated according to a preset answer template to obtain the answer data corresponding to the question data.
[0017] Preferably, before processing the problem data to obtain the first data, the above method further includes:
[0018] Search the answer cache area to see if there is any previous round answer data associated with the question data;
[0019] If the previous round's answer data associated with the question data is found in the answer cache area, the answer data corresponding to the question data is obtained based on the previous round's answer data and the question data;
[0020] If no previous round answer data associated with the question data is found in the answer cache area, the following steps are performed: process the question data to obtain the first data.
[0021] In the above method, preferably, the previous round of answer data includes at least one candidate answer data, and the candidate answer data corresponds to a first candidate identifier;
[0022] Specifically, obtaining the answer data corresponding to the question data based on the previous round's answer data and the question data includes:
[0023] Search the previous round of answer data for a first candidate identifier that matches the question data.
[0024] If there is a first candidate identifier in the previous round of answer data that matches the question data, the candidate answer data corresponding to the first candidate identifier corresponding to the question data is determined as the answer data corresponding to the question data.
[0025] In the above method, preferably, the previous round of answer data also includes a program identifier, and the program identifier corresponds to a second candidate identifier;
[0026] The method further includes:
[0027] Search the previous round of answer data for a second candidate identifier that matches the question data.
[0028] If a second candidate identifier that matches the question data exists in the previous round of answer data, run the target program corresponding to the program identifier that matches the question data to obtain the fourth data output by the target program;
[0029] Based on the fourth data, the answer data corresponding to the question data is obtained.
[0030] A question-answering processing method, applied to a second application system, the method comprising:
[0031] Receive first data sent by the first application system; the first data contains at least the slot value corresponding to the problem data;
[0032] At least based on the slot values, an answer is retrieved to obtain the second data;
[0033] Convert the second data into a JSON-based data message;
[0034] The data message is sent to the first application system so that the first application system runs the corresponding target program to obtain the third data output by the target program, and processes the third data to obtain the answer data corresponding to the question data.
[0035] An electronic device, the electronic device comprising:
[0036] The memory is used to store the computer program corresponding to the first application system and the data generated by the operation of the first application system.
[0037] A processor is configured to execute the first application system to: obtain question data in response to a question input operation received on the first application system; process the question data to obtain first data, the first data including at least a slot value corresponding to the question data; send the first data to a second device, the second device being configured with a second application system, such that the second application system performs an answer retrieval based at least on the slot value to obtain second data and convert the second data into a JSON-based data message; run a corresponding target program in the first application system in response to the data message sent by the second application system to obtain third data output by the target program; and process the third data to obtain answer data corresponding to the question data.
[0038] An electronic device, comprising:
[0039] The memory is used to store the computer program corresponding to the second application system and the data generated by the operation of the second application system.
[0040] A processor is configured to execute the second application system to: receive first data sent by a first device; the first data includes at least a slot value corresponding to question data; the first device is configured with a first application system; perform answer retrieval based at least on the slot value to obtain second data; convert the second data into a JSON-based data message; and send the data message to the first device so that the first application system runs a corresponding target program to obtain third data output by the target program, and processes the third data to obtain answer data corresponding to the question data.
[0041] As can be seen from the above technical solution, in the question-and-answer processing method and electronic device disclosed in this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by a single second application system is inaccurate, and allows for the combination of the results output by the target program of the first application system to obtain more accurate answer data. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A flowchart of a question-and-answer processing method provided in Embodiment 1 of this application;
[0044] Figure 2 This is a configuration example diagram between application systems in the embodiments of this application;
[0045] Figure 3 as well as Figure 4 These are example diagrams of the question-and-answer interaction interface in the embodiments of this application;
[0046] Figure 5 Another flowchart of a question-and-answer processing method provided in Embodiment 1 of this application;
[0047] Figure 6 This is an example diagram of the question-and-answer interaction interface in the embodiments of this application;
[0048] Figure 7 Another flowchart of a question-and-answer processing method provided in Embodiment 1 of this application;
[0049] Figure 8 A flowchart of a question-and-answer processing method provided in Embodiment 2 of this application;
[0050] Figure 9 This is a schematic diagram of the structure of a question-and-answer processing device provided in Embodiment 3 of this application;
[0051] Figure 10 This is a schematic diagram of the structure of a question-and-answer processing device provided in Embodiment 4 of this application;
[0052] Figure 11 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application;
[0053] Figure 12 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of this application;
[0054] Figures 13 to 21 These are application example diagrams for the operation and maintenance scenarios applicable to this application;
[0055] Figures 22 to 27 These are example diagrams illustrating the effects of this application in operation and maintenance scenarios. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] refer to Figure 1 The diagram shown is a flowchart illustrating the implementation of a question-and-answer processing method according to Embodiment 1 of this application. This method can be applied to electronic devices capable of data processing and data transmission, such as... Figure 2The first device shown is equipped with a first application system capable of providing question-and-answer functionality, such as an application system for answering maintenance knowledge questions. Data transmission is possible between the first and second devices. The second device is equipped with a second application system. The first and second application systems are different systems; for example, the second application system might be capable of data retrieval. The technical solution in this embodiment is primarily used to improve the accuracy of the answers.
[0058] Specifically, the method in this embodiment may include the following steps:
[0059] Step 101: In response to the problem input operation received on the first application system, obtain problem data.
[0060] The first application system can output a question-and-answer interactive interface, such as... Figure 3 As shown, the question-and-answer interface includes an input box where users can enter questions. After receiving the input, the first device can obtain question data based on the input. The question data must contain at least the keywords corresponding to the input.
[0061] For example, with Figure 3 As shown in the example, the problem input operation includes the user's input "I want to check tool access". Based on this, the problem data obtained on the first device includes the keywords "check" and "tool access" corresponding to "I want to check tool access".
[0062] Step 102: Process the problem data to obtain the first data, which contains at least the slot values corresponding to the problem data.
[0063] In this embodiment, the keywords contained in the problem data are matched with the slot values in the slot database, and then the slot values that match the keywords are selected, that is, the slot values corresponding to the problem data, such as "system tool access status". Based on this, the first data is generated according to the slot values corresponding to the problem data.
[0064] Step 103: Send the first data to the second device so that the second application system can at least retrieve the answer based on the slot value to obtain the second data and convert the second data into a JSON-based data message.
[0065] The first device can send first data to the second device via a data connection. Upon receiving the first data, the second application system configured on the second device first extracts the slot values from the first data. Then, it searches for answers in the database (knowledge base) corresponding to the second application system based on at least the slot values, thereby obtaining the second data, which is the data of the target program that needs to be invoked in the first application system. Based on this, the second application system converts the second data into a JSON-based data message.
[0066] The data message must contain at least the following: the target program's program type, the target program's program address, the target program's program name, slot values, and other attributes of the target program. For example, taking an API in the first application system as the target program, the JSON-based data message would contain the API's type, API address, method name, slot values, and attribute names.
[0067] Step 104: In response to the data message sent by the second application system, run the corresponding target program in the first application system to obtain the third data output by the target program.
[0068] In this process, after the first device receives a data packet sent by the second application system, the first application system calls the target program corresponding to the data packet according to the data packet, thereby obtaining the third data output by the target program. The third data contains the answer data items obtained by the first application system through data retrieval according to the data packet. For example, the access status of the "data operation" tool is "connected", the access status of the "log query" tool is "connected", and so on.
[0069] Specifically, in this embodiment, after receiving a data packet, the data packet sent by the second application system can be parsed to obtain the program address corresponding to the target program; then, the target program can be run according to the program address. For example, the various message fields contained in the data packet can be parsed to obtain the program address, program type, program name, slot value, and attribute name, etc.; then, according to the program address, the target program corresponding to the program address can be called to obtain the third data output by the target program after it runs.
[0070] Step 105: Process the third data to obtain the answer data corresponding to the question data.
[0071] Specifically, in this embodiment, at least one answer data item can be extracted from the third data, and then these answer data items can be encapsulated according to a preset answer template to obtain the answer data corresponding to the question data.
[0072] For example, encapsulate answer templates arranged in sentence segments, such as "Data manipulation" tool access status is "connected" and "Log query" tool access status is "connected", to obtain, for example... Figure 4 Based on the answer data shown, the answer data is output on the interactive interface of the first application system to be provided to the user.
[0073] As can be seen from the above scheme, in the question-answering processing method provided in Embodiment 1 of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by a single second application system is inaccurate, and allows for the combination of the results output by the target program of the first application system to obtain more accurate answer data.
[0074] In one implementation, before processing the problem data in step 102, the method in this embodiment may further include the following steps, such as... Figure 5 As shown:
[0075] Step 106: Check the answer cache area to see if there is any previous round answer data associated with the question data. If the previous round answer data associated with the question data is found in the answer cache area, proceed to step 107. If the previous round answer data associated with the question data is not found in the answer cache area, proceed to step 102 and subsequent steps.
[0076] Step 107: Based on the answer data and question data from the previous round, obtain the answer data corresponding to the question data.
[0077] The answer cache area contains answer data provided to the user by the first application system after each previous question input operation. In other words, the answer cache area contains at least one historical answer record, corresponding to a previous question input operation and the user identifier of that user. The user identifier can be a username, user number, or other identifier that uniquely identifies the user. Based on this, in step 106, the answer cache area can be searched for historical answer data that matches the user identifier in the question data. If historical answer data matching the user identifier in the question data is found in the answer cache area (i.e., previous round answer data), then step 107 is executed; otherwise, step 102 is executed.
[0078] Specifically, the previous round of answer data must contain at least one candidate answer, and each candidate answer has a corresponding first candidate identifier. This first candidate identifier can be a number or a letter, used to uniquely identify the corresponding candidate answer. For example, ... Figure 6 As shown, in addition to the answer content of the previous round, the previous round of answer data also includes at least four candidate answer data items: querying application first- and second-line contacts, querying application tool access status, querying application current alarm status, querying more application configuration information, etc. These candidate answer data items correspond to different numbers: 1, 2, 3, and 4, to uniquely represent each candidate answer data item. Based on this, in step 107, when obtaining the answer data corresponding to the question data based on the previous round of answer data and question data, it can be achieved in the following way:
[0079] First, search the previous round of answer data for a first candidate identifier that matches the question data. For example, search for the first candidate identifier of the "2" in the question data with the previous round of answer data. If a first candidate identifier that matches the question data exists in the previous round of answer data, the candidate answer data corresponding to the first candidate identifier that matches the question data is determined as the answer data corresponding to the question data. If no first candidate identifier that matches the question data exists in the previous round of answer data, then step 102 can be executed, or a prompt message indicating an input error can be output to prompt the user to re-enter the question.
[0080] In one implementation, the previous round of answer data also includes a program identifier, which corresponds to a second candidate identifier. The second candidate identifier is of the same type as the first candidate identifier and can be either a number or a letter, used to uniquely represent the corresponding program identifier.
[0081] Based on this, after step 107, this embodiment may further include the following steps, such as... Figure 7As shown:
[0082] Step 108: Search the previous round of answer data for a second candidate identifier that matches the question data. If a second candidate identifier that matches the question data exists in the previous round of answer data, proceed to step 109.
[0083] Step 109: Run the target program corresponding to the program identifier that matches the problem data, to obtain the fourth data output by the target program.
[0084] Specifically, in this embodiment, it is possible to search in the previous round of answer data whether there is a second candidate identifier that matches the question data. For example, it is possible to search in the previous round of answer data whether there is a matching second candidate identifier for the "1" in the question data. If there is a second candidate identifier that matches the question data in the previous round of answer data, the program corresponding to the program identifier corresponding to the second candidate identifier corresponding to the question data is determined as the target program, and then the target program is run to obtain the fourth data output by the target program. If there is no second candidate identifier that matches the question data in the previous round of answer data, it indicates that there is no need to call the execution program in the first application.
[0085] Step 110: Based on the fourth data, obtain the answer data corresponding to the question data.
[0086] Specifically, in this embodiment, at least one answer data item can be extracted from the fourth data, and then these answer data items can be encapsulated according to a preset answer template to obtain the answer data corresponding to the question data.
[0087] It should be noted that the answer data has a type identifier, which indicates whether the answer data was obtained from a first application system or a second application system. Therefore, all historical answer data stored in the answer cache area has a type identifier, thus avoiding cache conflicts in the answer cache area through the type identifier.
[0088] For example, if in step 106 the previous round of answer data associated with the question data is found in the answer cache area, then the obtained answer data is marked with a type identifier indicating that the answer data is obtained based on the first application system, such as a local identifier; and if in step 106 the previous round of answer data associated with the question data is not found in the answer cache area, then in this embodiment the answer data is obtained by executing step 102 and subsequent steps, that is, after the data retrieval processing of the second application, and the obtained answer data is marked with a type identifier indicating that the answer data is obtained based on the second application system, such as an external identifier.
[0089] In one implementation, before sending the first data to the second device in step 103, the system can search for table information corresponding to the first data in a preset thesaurus corresponding to the first application system to obtain the answer data corresponding to the question data. If the table information corresponding to the first data is found in the preset thesaurus corresponding to the first application system and the answer data is obtained, then step 103 and subsequent processes do not need to be executed. However, if the table information corresponding to the first data is not found in the preset thesaurus corresponding to the first application system, then no answer data is obtained, and step 103 and subsequent steps continue to be executed.
[0090] In one implementation, before sending the first data to the second device in step 103, a regular expression can be used to match the first data with the answer string corresponding to the first application system to obtain the answer data corresponding to the question data. If the regular expression matches the first data with the answer string corresponding to the first application system and obtains the answer data, then step 103 and subsequent processes do not need to be executed. However, if the regular expression matches the first data with the answer string corresponding to the first application system but does not obtain the answer data, then step 103 and subsequent steps continue to be executed.
[0091] In a preferred implementation, this embodiment can execute step 106 after step 101. If answer data is obtained in step 107, no further steps are needed. However, if no answer data is found in step 106, step 102 continues. Then, a regular expression is used to match the first data with the answer string corresponding to the first application system. If the regular expression matches the first data with the answer string corresponding to the first application system and obtains the answer data, step 103 and subsequent processes are unnecessary. However, if the regular expression matches the first data with the answer string corresponding to the first application system but does not obtain the answer data, the table information corresponding to the first data can be searched in the preset vocabulary of the first application system. If a table information corresponding to the first data is found in the preset vocabulary of the first application system... If the table information is obtained and the answer data is obtained, then step 103 and subsequent processes can be skipped. If no table information corresponding to the first data is found in the preset vocabulary of the first application system, and therefore no answer data is obtained, then step 103 continues. After step 103, if the second data obtained by the second application system needs to call the target program in the first application system to obtain more accurate answer data, the second application system encapsulates the second data into a JSON-based data message and sends it to the first device where the first application system is located. Thus, steps 104 and 105 continue to be executed on the first device. If the second data obtained by the second application system does not need to call the target program in the first application system, the second application can directly send the second data to the first device so that the first application system can obtain the answer data corresponding to the question data based on the second data.
[0092] refer to Figure 8 This is a flowchart illustrating the implementation of a question-and-answer processing method provided in Embodiment 2 of this application. This method can be applied to electronic devices capable of data processing and data transmission, such as... Figure 2 The second device shown is illustrated. The technical solution in this embodiment is mainly used to improve the accuracy of the answer.
[0093] Specifically, the method in this embodiment may include the following steps:
[0094] Step 801: Receive the first data sent by the first application system; the first data contains at least the slot value corresponding to the problem data.
[0095] Step 802: Retrieve answers based at least on slot values to obtain the second data.
[0096] For example, in this embodiment, the answer is retrieved in the database corresponding to the second application system according to the slot value to obtain the second data corresponding to the question data.
[0097] Based on this, if the second data requires calling the target program in the first application system to obtain a more accurate answer, step 803 is executed. If it does not require calling the target program in the first application system, the second data can be directly sent to the first device, so that the first application system can obtain the answer data corresponding to the question data based on the second data. For example, the first application system extracts the answer data items from the second data, encapsulates the answer data items according to the answer template, and obtains the answer data corresponding to the question data.
[0098] Step 803: Convert the second data into a JSON-based data message.
[0099] In this embodiment, the second data can be encapsulated according to the message format corresponding to JSON to obtain a JSON-based data message.
[0100] Step 804: Send the data message to the first application system so that the first application system can run the corresponding target program to obtain the third data output by the target program, and process the third data to obtain the answer data corresponding to the question data.
[0101] As can be seen from the above scheme, in the question-answering processing method provided in Embodiment 2 of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by a single second application system is inaccurate, and allows for the combination of the results output by the target program of the first application system to obtain more accurate answer data.
[0102] refer to Figure 9 This is a schematic diagram of a question-and-answer processing device provided in Embodiment 3 of this application. Specifically, this device is a first application system, configured in... Figure 2 The first device shown. The technical solution in this embodiment is mainly used to improve the accuracy of the answer.
[0103] Specifically, the device in this embodiment may include the following units:
[0104] Problem acquisition unit 901 is used to acquire problem data in response to a problem input operation received on the first application system;
[0105] The first processing unit 902 is used to process the problem data to obtain first data, wherein the first data contains at least the slot value corresponding to the problem data;
[0106] The data sending unit 903 is used to send the first data to a second device, the second device being configured with a second application system, so that the second application system can perform answer retrieval based at least on the slot value to obtain the second data and convert the second data into a JSON-based data message;
[0107] The program execution unit 904 is used to respond to the data message sent by the second application system and run the corresponding target program in the first application system to obtain the third data output by the target program;
[0108] The answer processing unit 905 is used to process the third data to obtain the answer data corresponding to the question data.
[0109] As can be seen from the above scheme, in the question-answering processing device provided in Embodiment 3 of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by a single second application system is inaccurate, and allows for the combination of the results output by the target program of the first application system to obtain more accurate answer data.
[0110] It should be noted that the specific implementation of each unit in this embodiment can be referred to the specific content above, and will not be described in detail here.
[0111] refer to Figure 10This is a schematic diagram of a question-and-answer processing device provided in Embodiment 4 of this application. Specifically, this device is a second application system, which can be configured in, for example... Figure 2 The second device shown. The technical solution in this embodiment is mainly used to improve the accuracy of the answer.
[0112] Specifically, the device in this embodiment may include the following units:
[0113] Data receiving unit 1001 is used to receive first data sent by a first device; the first data includes at least the slot value corresponding to the problem data; a first application system is configured on the first device;
[0114] Answer retrieval unit 1002 is used to retrieve answers based at least on the slot values to obtain second data;
[0115] Message conversion unit 1003 is used to convert the second data into a JSON-based data message;
[0116] The message sending unit 1004 is used to send the data message to the first device so that the first application system runs the corresponding target program to obtain the third data output by the target program, and processes the third data to obtain the answer data corresponding to the question data.
[0117] As can be seen from the above scheme, in the question-answering processing device provided in Embodiment 4 of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by a single second application system is inaccurate, and allows for the combination of the results output by the target program of the first application system to obtain more accurate answer data.
[0118] It should be noted that the specific implementation of each unit in this embodiment can be referred to the specific content above, and will not be described in detail here.
[0119] refer to Figure 11 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application. The electronic device can be as follows: Figure 2 The first device shown is illustrated. The technical solution in this embodiment is mainly used to improve the accuracy of the answer.
[0120] Specifically, the first device in this embodiment may include the following structure:
[0121] The memory 1101 is used to store the computer program corresponding to the first application system and the data generated by the operation of the first application system.
[0122] The processor 1102 is configured to execute the first application system to: obtain question data in response to a question input operation received on the first application system; process the question data to obtain first data, the first data including at least a slot value corresponding to the question data; send the first data to a second device, the second device being configured with a second application system, such that the second application system performs an answer retrieval based at least on the slot value to obtain second data and convert the second data into a JSON-based data message; run a corresponding target program in the first application system in response to the data message sent by the second application system to obtain third data output by the target program; and process the third data to obtain answer data corresponding to the question data.
[0123] As can be seen from the above scheme, in the electronic device provided in Embodiment 5 of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by the second application system alone is inaccurate, and a more accurate answer data can be obtained by combining the results output by the target program of the first application system.
[0124] It should be noted that the specific implementation of the processor in this embodiment can be referred to the specific content above, and will not be described in detail here.
[0125] refer to Figure 12 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of this application. The electronic device can be as follows: Figure 2 The second device shown is illustrated. The technical solution in this embodiment is mainly used to improve the accuracy of the answer.
[0126] Specifically, the second device in this embodiment may include the following structure:
[0127] The memory 1201 is used to store the computer program corresponding to the second application system and the data generated by the operation of the second application system.
[0128] The processor 1202 is configured to execute the second application system to: receive first data sent by a first device; the first data includes at least a slot value corresponding to question data; the first device is configured with a first application system; perform answer retrieval based at least on the slot value to obtain second data; convert the second data into a JSON-based data message; send the data message to the first device so that the first application system runs a corresponding target program to obtain third data output by the target program, and process the third data to obtain answer data corresponding to the question data.
[0129] As can be seen from the above scheme, in the electronic device provided in Embodiment Six of this application, after receiving a question input operation on the first application system, the obtained question data is processed to obtain first data containing the slot values corresponding to the question data. The first data is then sent to the second device. The second application system configured on the second device performs an answer retrieval based at least on the slot values to obtain second data and converts the second data into a JSON-based data message. Thus, by sending the JSON-based data message to the first application system, the corresponding target program in the first application system can be run. The third data output by the target program is then processed to obtain the answer data corresponding to the question data. It is evident that this embodiment achieves the invocation of the corresponding program in the first application system through the transmission of JSON-based data messages. Therefore, after retrieving the second data using an external second application system, the target program in the first application system can be invoked through the transmission of data messages. This avoids the situation where the answer obtained by data retrieval by the second application system alone is inaccurate, and a more accurate answer data can be obtained by combining the results output by the target program of the first application system.
[0130] It should be noted that the specific implementation of the processor in this embodiment can be referred to the specific content above, and will not be described in detail here.
[0131] Based on the technical solutions in the above embodiments, taking the operation and maintenance scenario as an example, this application provides a multi-turn dialogue mechanism based on a state machine, and constructs a retrieval-based question-and-answer intent recognition capability closely aligned with the needs of operation and maintenance domain users. It innovatively combines Natural Language Processing (NLP) semantic analysis technology with CHATOPS. Taking the first application system as an integrated production operation and maintenance platform (hereinafter referred to as the UOPS platform) and the second application system as the Lingxi platform as an example, the technical solution of this application is illustrated in detail below:
[0132] 1. Application Practice of Task-Driven Multi-Turn Dialogue:
[0133] Since it is not possible to directly invoke the local API of the UOPS platform through the Lingxi platform, for this type of task-oriented dialogue scenario, custom simulated messages will be used to enable the robot bot to accurately control the execution of the local API.
[0134] like Figure 13 As shown, in this embodiment, the final answer returned by Lingxi is reconstructed into a JSON simulated message (i.e., a JSON-based data message), and the filled slot values are sent back to the UOPS robot bot backend as part of the message. The bot parses the message to determine the API and interface address to be executed in this dialogue, fills in the required input parameters for the interface, calls the API, and finally encapsulates the API return result, writes it into the placeholders of the predefined answer template, and returns it to the user who asked the question.
[0135] in:
[0136] 1.1 JSON Simulated Message Parsing:
[0137] Based on the characteristics of the business scenario, the message in this embodiment includes five attributes: API type, API address, method name, slot value, and attribute name. The first three combine to form the URL path of the interface that the local bot needs to invoke. The latter two are optional. The slot is the specified parameter returned by Lingxi after user confirmation. The attribute name is other parameter information of the interface to be invoked this time. The message definition is shown in Table 1.
[0138] Table 1 Definition of Task-Type Dialogue Messages
[0139]
[0140] In this embodiment, based on the message content agreed upon on the Lingxi platform and the configuration information in the local configuration file used to verify message validity, after a task-type session is hit, the Bot intercepts the message and triggers the message parsing logic according to the specified node in the task-type session. For local methods (i.e., UOPS local programs), the result of the method call is returned as a string by utilizing Java reflection features and taking the Java class Method. The method for calling external interfaces is similar, using the HTTP request RestTemplate under Spring Boot, and will not be elaborated further.
[0141] 1.2 Slot Configuration and Input Control:
[0142] In the field of application operations and maintenance, the focus is more on the operational status of application systems; therefore, the name of the application system is the slot used in this embodiment. Taking an application module as an example, identifying a module can often be done through multiple methods, such as the system's Chinese name, English abbreviation, the module's Chinese name, or the module's English abbreviation. For such complex parameters, valid slots are defined as follows:
[0143] 1.2.1 Standardizing Communication Parameters: A uniquely identifiable field is selected as the standard name for this complex slot. The Lingxi platform's regular slots consist of a standard name and an alias. When a user's input matches a slot value, the standard name is the unique parameter transmitted between Lingxi and other platforms. Taking an application module as an example, this embodiment selects the module number as the standard name configured in the slot. This is not only because of its uniqueness, but also because, in this embodiment, when searching in the local database, such attributes are often indexed to improve retrieval efficiency. Therefore, this attribute is very suitable for this scenario.
[0144] 1.2.2 Standardizing User Input to Improve Accuracy and Confidence. Although the backend selected module numbers as the standard slot names, it is foreseeable that users will rarely actively input a system number when asking questions during the clarification phase. Based on the characteristics of the UOPS platform, users typically use "full application name fuzzy matching" to search for applications. Therefore, in this embodiment, the Bot frontend, based on the characteristics of task-oriented dialogues, loads a lazy cache of the application system's full name when entering the clarification node, providing a familiar dropdown list for fuzzy matching of the application system's full name, ensuring that user input is standardized, consistent, and compliant.
[0145] 1.2.3 Rationalization of Slot Values: Setting Effective Slot Aliases Based on Lingxi's Slot Hitting Principle. Initially, the full name of the application that perfectly matched the user input was configured as the slot alias. However, it was found that some application modules were not accurately identified by Lingxi, returning incorrect number information. This is because Lingxi's slot recognition capability is based on the principle of Chinese word segmentation. Complex application names are segmented into phrases by Lingxi according to natural language rules. Since there are thousands of application modules in a row, there are bound to be similarities between module names, making it difficult to control the accuracy of the segmented results in hitting the preset aliases. After repeated experiments, the inventors of this application found that English abbreviations would not be further segmented, and the system abbreviation + module abbreviation has the same unique identification as the number. Therefore, the final slot configuration in this embodiment is as follows: Figure 14 As shown, it will bring highly accurate matching results for this complex word slot.
[0146] 1.3. Unified packaging of answer templates:
[0147] like Figure 15 As shown, after invoking the specified API by parsing the message, the encapsulated answer is sequentially injected into the placeholders @@ in the answer template based on the API's return result. Furthermore, different rich text display effects are injected into the answer according to the characteristics of the question channel to improve readability.
[0148] 2. Application Practice of Multi-Turn Dialogue Based on State Machines:
[0149] During the actual application and promotion process, the inventors of this application found that the multi-turn dialogue mechanism based on Lingxi could not well meet the needs of users in all service channels. Due to its complex configuration and numerous preset conditions, users do not have a good input environment in some specific service channels and scenarios. At this time, we pursue a more "lightweight" multi-turn interaction.
[0150] This embodiment implements a multi-turn dialogue mechanism based on a state machine. When the user's input matches a local scenario, the traditional approach still uses a question-and-answer interaction mechanism; however, if the robot's current answer does not satisfy the user and the user wishes to ask further questions, this embodiment designs a guided approach to allow the user to input specified keywords to obtain further answers.
[0151] 2.1 Redis-based storage structure:
[0152] First, we introduce the storage structure for storing temporary answers in this solution. Since intelligent question answering is characterized by being "short, simple, and fast," this embodiment uses Redis as a caching mechanism for storing temporary answers in multi-turn conversations. This ensures that the conversation maintains a high response rate while also allowing for flexible control over the lifespan of temporary answers. The Redis caching mechanism adopts a common "key-value" storage structure, and the storage model in this embodiment is as follows: Figure 16 As shown, the keys contain user ID, channel ID, and group ID (IDs unique to the Changliao client), and the values contain the current round answer, the next round answer, and global variables. The current round answer contains keywords (keywords entered by the user), the displayed question (the text of the question returned to the user), and the displayed answer (the text of the answer returned to the user). The next round answer contains keywords (keywords entered by the user), the cache path (the path to cache the next round answer), and local variables (other input parameters required to call the method). Global variables contain global parameters carried by this conversation.
[0153] In this storage structure, both the current and next round's answers are stored in JSON format. The input keywords are the keys, and the remaining elements constitute the values. An example message is shown below.
[0154]
[0155]
[0156] In designing the storage structure, this embodiment does not include user input as part of the Redis key because the designed multi-turn dialogue shortcut input values are usually Arabic numerals. Since input values overlap between turns, refreshing the Redis update field cannot be controlled. For example, if the user's shortcut input in the current turn is 1, 2, 3, and the shortcut input in the next turn after inputting 1 is 1 and 2, then when the cache is refreshed after inputting 1, the cached key values for shortcut inputs 1 and 2 will be updated synchronously, but the cached key value for input 3 will remain. This means that even if the user enters the next turn, they can still enter part of the shortcut key from the previous turn to retrieve the answer. To avoid confusion for users, this embodiment stores input values under the same key-value pair to ensure the consistency and integrity of the answer when updating the cache.
[0157] 2.2 Dialogue State Machine Model Design:
[0158] The core of achieving multi-turn dialogue lies in the bot's need to constantly understand the user's current state, knowing when the user enters and exits a multi-turn conversation. Here, we will use the principle of state machines to practice a multi-turn dialogue scenario.
[0159] Because users complete a dialogue goal through multiple consecutive interactions, a state state becomes crucial. A state machine is a graph where states can transition, and the relationships between two states are constrained by the state machine. The dialogue states in this embodiment are as follows: Figure 17 As shown in the image.
[0160] In general, the design concept based on the dialogue state machine principle is as follows: The robot bot's front end sets a global variable, with the default user state being a single-turn dialogue state, indicating that the user has not yet entered a multi-turn dialogue. When the user's question hits the multi-turn conversation, depending on the characteristics of the scenario, if there are more than one subsequent turn, the user state enters the multi-turn initial state, indicating that the user is in a multi-turn dialogue and there is still room for another turn; if there is only one subsequent turn, the user state enters the multi-turn ending state, indicating that the user is in the last turn of this multi-turn dialogue scenario.
[0161] Figure 18 The diagram shows a flowchart of a multi-turn dialogue program based on a dialogue state machine. When a user asks a question and enters a multi-turn state, the bot needs to determine whether there is still a next turn of dialogue. If it is the last turn, it only needs to return the answer for this turn to the user; if the current dialogue still has deeper turns, after obtaining the answer for this turn, it also needs to put the answer for the next turn into the cache. The reason for choosing this design scheme in this embodiment is mainly because the bot needs to interact with the caching mechanism to obtain the answer template for multi-turn dialogues. In this case, the number of interactions with the caching mechanism can be minimized, thereby reducing performance overhead as much as possible.
[0162] 2.3 Asynchronous loading of multi-turn dialogues:
[0163] In section 2.2, this embodiment pre-caches the answers for each round of multi-round dialogue in Redis. This means that when the bot needs to refresh the cache in the current round, the answer for the next round is pre-stored. For scenarios where the next round requires invoking an external online interface, loading the answer in this way firstly concentrates the performance pressure on the previous round, secondly, it cannot guarantee that the user will choose to enter the next round, making pre-caching somewhat redundant, and thirdly, some online interfaces have high timeliness requirements, and the real-time search results are constantly changing. Considering the above, this embodiment optimizes the storage structure, allowing results to be returned asynchronously. That is, the bot only invokes the corresponding interface to return the answer for the current round after the user enters a shortcut key.
[0164] like Figure 19As shown in the diagram, in this case, the structure of some parameters in the answer for this round has been adjusted. Since the asynchronous loading method is always for loading local APIs, it is consistent with the method for loading local APIs in 2.1, and will not be repeated here. The answer for this round includes keywords, display method (synchronous display or asynchronous loading), display question, display answer (the path to the local method is stored during asynchronous loading), and parameter list (input parameters during asynchronous loading). The answer for the next round includes keywords, cache path, and local variables. Global variables include global parameters carried by this dialogue.
[0165] 3. A multi-mechanism parallel conflict resolution strategy:
[0166] In the application maintenance robot Bot, multi-turn dialogue scenarios based on Lingxi and multi-turn dialogue scenarios based on state machines coexist. During the pilot process, the inventors of this application discovered a problem where a session was "overwritten".
[0167] Lingxi's traditional FAQ-style question and answer service offers both direct and indirect answering capabilities. The principle is as follows: when a user's question is highly similar to a question in the FAQ knowledge base, Lingxi directly provides the corresponding answer from the knowledge base. When a user's question is very similar to multiple questions in the knowledge base, Lingxi provides a set of recommended questions, each with an Arabic numeral. The user enters the numeral to access the answer to that question. The numeral entered by the user is the same as the user shortcut input value provided in section 2.2 for multi-turn dialogues. Because the bot's operating mechanism prioritizes searching local answers before resorting to Lingxi's answers, if a user first hits a local multi-turn dialogue while the Redis cache is still active, and then subsequently hits Lingxi's indirect answer, the user's shortcut input will be "intercepted" by the local answer.
[0168] Through practical exploration, this embodiment further optimizes the storage structure of local multi-turn dialogues. For example... Figure 20 As shown, by adding a field: answer type, to the outermost layer of the key-value pair's value, for cases where Lingxi indirect answers are triggered, the key-value pair is also cached and updated in Redis beforehand, with the answer type pre-set to "external". For cached answers with the external type, parsing the local answer is skipped, thus avoiding the conflict issue where the same shortcut key is intercepted by one mechanism in the coexistence of two multi-turn dialogues.
[0169] 4. Search-based intelligent question-answering intent recognition:
[0170] The Lingxi platform's intelligent dialogue capabilities provide general service capabilities to various business or technology platforms within the industry. After completing all dialogue types, including FAQs, casual conversations, and task-based dialogues, based on Lingxi, the inventors of this application analyzed user behavior. The findings revealed that, contrary to expectations, users do not communicate with robots using purely natural language as they would with Siri, Tmall Genie, or other similar robots. Because intelligent robots serve specific domains, user questions often contain professional terminology. Furthermore, since the questions are asked via text input rather than voice communication, user questions rarely have complete subject-verb-object sentence structures; verb-object structures or simple nouns are more common.
[0171] Initially, bots serving B / S (Web) architectures increased the probability of hitting functional conversations by setting guiding questions at the front end of the chat interface. However, as the bot's service channels expanded, when the business extended to a service account in a C / S architecture (similar to WeChat and Changliao), the limitations of the overall framework made it impossible to increase the hit rate of direct answers through guiding questions. The inventors of this application also realized that this "semi-automated" solution was not a long-term solution. To truly achieve high intelligence and user satisfaction, it is necessary to further explore user habits and make some localized modifications to make the bot's understanding more aligned with the professional field.
[0172] 4.1 Intent recognition based on dictionary and rules:
[0173] First, based on this professional field, this embodiment clarifies the phrase scenarios that are intended to be directly retrieved, including: service catalog number, change order number, application name, username, IP address, professional terminology, etc. Then, based on the phrase characteristics of each scenario, the retrieval method is determined. Ultimately, three main retrieval methods are used, as detailed in Table 2.
[0174] Table 2 Comparison of local retrieval methods
[0175]
[0176] 4.2 Search order between modules:
[0177] Figure 21 The diagram illustrates the inter-module retrieval order implemented in this embodiment. When a user makes a request, the Bot first determines the user's current state. In multi-turn scenarios, it prioritizes searching the cache for answers. In non-multi-turn scenarios, it prioritizes matching regular expressions and string parsing. If a match is found, it proceeds to the corresponding module and returns the content. Otherwise, it continues searching the dictionary, checking the cache for Bot-related dictionary entries. If a match is found, it proceeds to the corresponding module and returns the content. If none of the above matches, the Lingxi interface is invoked, triggering the Lingxi Bot's recognition logic for a fallback response.
[0178] In addition, to improve the retrieval efficiency and accuracy, based on adjusting the order of the local retrieval module according to the user input frequency, the local retrievals (application number, full name) that conflict with the task-based slot of the Lingxi platform are sunk into the logic of some FAQ-type returns of Lingxi. The knowledge base answers of Lingxi are truncated and then the local retrieval API is invoked to solve the problem of semantic conflict between the two.
[0179] 5. Effect demonstration
[0180] In the task-based dialogue scenario, take the access status of the query tool as an example. Through natural language input, the case scenario is triggered, such as Figure 22 as shown in
[0181] When the user inputs the application name, the full name of the application system is fuzzy matched to improve the accuracy of slot matching, such as Figure 23 as shown in
[0182] After the slot filling is completed, a custom simulation message is used to achieve precise control of the robot Bot for executing the local API, and the answers are uniformly encapsulated according to the local template, such as Figure 24 as shown in
[0183] For local multi-round dialogue, in this embodiment, retrieving application configuration information is taken as the pilot scenario because the configuration information of the application covers a large amount of information and is very suitable for such a gradually in-depth Q&A mode. At the same time, the retrieval ability based on the word list is also combined in this scenario, such as Figure 25 as shown in
[0184] Meanwhile, in this embodiment, the cache conflict between local multi-round Q&A and indirect Q&A on the Lingxi platform is solved to ensure the normal use of the indirect multi-round Q&A on the Lingxi platform, such as Figure 26 as shown in
[0185] When expanding the channels of the chat end, due to the channel framework limitations, the guidance of the front-end style cannot be realized. Therefore, in this embodiment, an intelligent Q&A intent recognition based on retrieval is self-developed. The user can input keywords to query information, which fully reflects the fast and efficient performance ability in this channel, such as Figure 27 as shown in, querying change orders, querying IP addresses, querying fault diagnosis, querying emergency progress, etc.
[0186] It can be seen that the following can be achieved in this embodiment:
[0187] 1. Based on the existing in-line intelligent Q&A platform (Lingxi), self-develop and implement the retrieval service for task-based dialogue, and design a simulated transaction message to invoke the local robot API interface at specific nodes in the dialogue to complete the retrieval service of operation and maintenance scenario information;
[0188] 2. Provide a specific slot association function for proper nouns and a similar question association function for ordinary natural language;
[0189] 3. Developed a self-developed multi-turn dialogue system for robots based on state machine principles and Redis caching mechanisms;
[0190] 4. Resolve the conflict between task-driven dialogue and local state machine-based dialogue.
[0191] 5. Based on intelligent question-and-answer multi-turn interaction, it realizes retrieval-based intent recognition, enabling the robot to not only support natural language dialogue, but also support quick retrieval of configuration information (system, partition, IP, changes, etc.) in the field of operation and maintenance automation.
[0192] 6. By adjusting the retrieval order between modules, semantic conflicts between various dialogue methods were perfectly resolved.
[0193] In summary, since the Lingxi platform cannot directly call the consumer's local API interface, this embodiment uses JSON simulated messages to confirm the API and interface address to be executed in this dialogue, and calls the API after uniformly filling in the required input parameters. Finally, the API return results are uniformly encapsulated. Because the Lingxi platform has complex configurations and many pre-defined conditions, users may lack a good input environment in some specific service channels and scenarios. Therefore, this embodiment provides a "lightweight" multi-turn interaction, where users only need to input keywords such as 1, 2, 3 to obtain operation and maintenance knowledge. Furthermore, since some retrieval scenarios require dynamic, real-time data without prior caching, this embodiment provides an asynchronous loading method for multi-turn dialogues.
[0194] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0195] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software 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 application.
[0196] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0197] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A question-and-answer processing method, characterized in that, The method, applied to a first device equipped with a first application system, includes: In response to a question input operation received on the first application system, question data is obtained; The problem data is processed to obtain first data, which at least includes the slot value corresponding to the problem data; The first data is sent to a second device, which is configured with a second application system, so that the second application system can perform answer retrieval based on the slot value to obtain the second data and convert the second data into a JSON-based data message; In response to the data packet sent by the second application system, the corresponding target program in the first application system is run to obtain the third data output by the target program; The third data is processed to obtain the answer data corresponding to the question data; Before processing the problem data to obtain the first data, the method further includes: Check the answer cache area to see if there is any previous round answer data associated with the question data; If the previous round's answer data associated with the question data is found in the answer cache area, the answer data corresponding to the question data is obtained based on the previous round's answer data and the question data; If no previous round answer data associated with the question data is found in the answer cache area, the following steps are performed: process the question data to obtain the first data; The front-wheel answer data also includes a program identifier, which corresponds to a second candidate identifier; The method further includes: Search the previous round of answer data for a second candidate identifier that matches the question data. If a second candidate identifier that matches the question data exists in the previous round of answer data, run the target program corresponding to the program identifier that matches the question data to obtain the fourth data output by the target program; Based on the fourth data, the answer data corresponding to the question data is obtained.
2. The method according to claim 1, characterized in that, In response to the data packet sent by the second application system, the corresponding target program in the first application system is run to obtain the third data output by the target program, including: The data packets sent by the second application system are parsed to obtain the program address corresponding to the target program; Run the target program according to the program address.
3. The method according to claim 1 or 2, characterized in that, The data message includes at least: the program type of the target program, the program address of the target program, the program name of the target program, the slot value, and the attribute name of the target program.
4. The method according to claim 1 or 2, characterized in that, The third data is processed to obtain the answer data corresponding to the question data, including: Extract at least one answer data item from the third data; The answer data items are encapsulated according to a preset answer template to obtain the answer data corresponding to the question data.
5. The method according to claim 1, characterized in that, The front-wheel answer data includes at least one candidate answer data, and the candidate answer data corresponds to a first candidate identifier; Specifically, obtaining the answer data corresponding to the question data based on the previous round's answer data and the question data includes: Search the previous round of answer data for a first candidate identifier that matches the question data. If there is a first candidate identifier in the previous round of answer data that matches the question data, the candidate answer data corresponding to the first candidate identifier corresponding to the question data is determined as the answer data corresponding to the question data.
6. A question-and-answer processing method, characterized in that, Applied to a second application system, the method includes: The system receives first data sent by a first application system; the first data includes at least slot values corresponding to question data; after receiving a question input operation, the first application system processes the obtained question data to obtain the first data; before processing the obtained question data to obtain the first data, the first application system searches in the answer cache area for previous round answer data associated with the question data; if previous round answer data associated with the question data is found in the answer cache area, the answer data corresponding to the question data is obtained based on the previous round answer data and the question data; if no previous round answer data associated with the question data is found in the answer cache area, the system processes the obtained question data to obtain the first data; the previous round answer data also includes a program identifier, and the program identifier corresponds to a second candidate identifier; the system searches in the previous round answer data for a second candidate identifier that matches the question data; if a second candidate identifier that matches the question data exists in the previous round answer data, the system runs the target program corresponding to the program identifier corresponding to the second candidate identifier that matches the question data to obtain the fourth data output by the target program; the answer data corresponding to the question data is obtained based on the fourth data. At least based on the slot values, an answer is retrieved to obtain the second data; Convert the second data into a JSON-based data message; The data message is sent to the first application system so that the first application system runs the corresponding target program to obtain the third data output by the target program, and processes the third data to obtain the answer data corresponding to the question data.
7. An electronic device, characterized in that, The electronic device includes: The memory is used to store the computer program corresponding to the first application system and the data generated by the operation of the first application system. A processor is configured to execute the first application system to: obtain question data in response to a question input operation received on the first application system; process the question data to obtain first data, the first data containing at least a slot value corresponding to the question data; send the first data to a second device, the second device being configured with a second application system, such that the second application system performs an answer retrieval based at least on the slot value to obtain second data and converts the second data into a JSON-based data message; run a corresponding target program in the first application system in response to the data message sent by the second application system to obtain third data output by the target program; process the third data to obtain answer data corresponding to the question data; wherein, before processing the question data to obtain the first data, a search is performed in an answer cache area to determine if a matching answer exists for the question data. The data includes: previous round answer data associated with the question data; if previous round answer data associated with the question data is found in the answer cache area, the answer data corresponding to the question data is obtained based on the previous round answer data and the question data; if no previous round answer data associated with the question data is found in the answer cache area, the following steps are performed: processing the question data to obtain first data; the previous round answer data also contains a program identifier, and the program identifier corresponds to a second candidate identifier; searching the previous round answer data for a second candidate identifier that matches the question data; if a second candidate identifier that matches the question data exists in the previous round answer data, running the target program corresponding to the program identifier corresponding to the second candidate identifier that matches the question data to obtain fourth data output by the target program; and obtaining the answer data corresponding to the question data based on the fourth data.
8. An electronic device, characterized in that, include: The memory is used to store the computer program corresponding to the second application system and the data generated by the operation of the second application system. A processor is configured to execute the second application system to: receive first data sent by the first device; The first data includes at least the slot values corresponding to the problem data; the first device is equipped with a first application system; After receiving the question input operation, the first application system processes the obtained question data to obtain the first data; The first application system processes the obtained question data. Before obtaining the first data, it searches in the answer cache area to see if there is any previous round answer data associated with the question data. If the previous round answer data associated with the question data is found in the answer cache area, the answer data corresponding to the question data is obtained based on the previous round answer data and the question data; if the previous round answer data associated with the question data is not found in the answer cache area, the obtained question data is processed to obtain the first data; the previous round answer data also contains a program identifier, and the program identifier corresponds to a second candidate identifier; Search the previous round of answer data for a second candidate identifier that matches the question data. If a second candidate identifier that matches the question data exists in the previous round of answer data, run the target program corresponding to the program identifier that matches the question data to obtain the fourth data output by the target program; Based on the fourth data, obtain the answer data corresponding to the question data; At least based on the slot values, an answer is retrieved to obtain the second data; Convert the second data into a JSON-based data message; The data packet is sent to the first device so that the first application system runs the corresponding target program to obtain the third data output by the target program, and processes the third data to obtain the answer data corresponding to the question data.