Answer processing method and device, electronic equipment, storage medium and program product

By assigning multiple questions to multiple threads to process in parallel and outputting answers in the order of questioning, the inefficient problems in the prior art are solved, and more efficient answer processing is achieved.

CN119645576APending Publication Date: 2025-03-18ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411695153.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When dealing with multiple problems, the prior art realizes serial processing by locking, resulting in inefficiency.

Method used

Assign at least two questions to at least two threads, generate their respective answers in parallel, and output the answers in the order of questioning.

Benefits of technology

Parallel processing shortens the total time to answer multiple questions, improves the efficiency of answers, and ensures that the order of answers is consistent with the order of questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645576A_ABST
    Figure CN119645576A_ABST
Patent Text Reader

Abstract

The invention provides an answer processing method and device, electronic equipment, a storage medium and a program product, and the answer processing method comprises the steps: distributing at least two questions to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads; and outputting answers corresponding to the at least two questions according to the questioning sequence of the at least two questions. The problem that the efficiency of answering multiple questions is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of question-answering technology, and in particular to an answer processing method, device, electronic device, storage medium and program product. Background Art

[0002] When answering multiple questions, we currently use locks to ensure that the order of answers is consistent with the order of questions asked. For example, thread A calls the method that generates answers and locks it; thread B calls the same method, and if there is a lock, it waits, and if there is no lock, it executes the method after locking it; the next thread can only execute the method after the previous thread has executed the method. The total time to answer multiple questions is relatively long, and the efficiency is low. Summary of the invention

[0003] The present application provides an answer processing method, device, electronic device, storage medium and program product to solve the problem of low efficiency in answering multiple questions.

[0004] According to a first aspect of an embodiment of the present application, a method for processing an answer is provided, including:

[0005] Assigning at least two questions to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads;

[0006] According to the order in which the at least two questions are asked, answers corresponding to the at least two questions are output.

[0007] Optionally, outputting answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked includes:

[0008] According to the order in which the at least two questions are asked, the identifiers of the threads corresponding to the at least two questions are sorted to generate a thread identifier sorting result;

[0009] Get the ID of the current thread that has generated the answer;

[0010] Determine whether the answer corresponding to the previous thread identifier has been output; wherein the previous thread identifier refers to each thread identifier before the identifier of the current thread in the thread identifier sorting result;

[0011] When the answer corresponding to the previous thread identifier has been output, the answer corresponding to the current thread identifier is output.

[0012] Optionally, the method further comprises:

[0013] In the case that the answer corresponding to the preceding thread identifier has not been output, wait for a preset time period, and after the preset time period has passed, return to execute the step of determining whether the answer corresponding to the preceding thread identifier has been output.

[0014] Optionally, after outputting the answer corresponding to the identifier of the current thread, the method further includes:

[0015] Deleting the identifier of the current thread from the thread identifier sorting result;

[0016] The determining whether the answer corresponding to the preceding thread identifier has been outputted includes:

[0017] It is determined whether the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting result.

[0018] Optionally, the outputting an answer corresponding to the identifier of the current thread includes:

[0019] The large model is called to output the answer segment corresponding to the identifier of the current thread.

[0020] Optionally, the allocating the at least two questions to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads, includes:

[0021] Allocating at least two questions received by the same user device to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads;

[0022] Outputting answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked includes:

[0023] According to the order in which the at least two questions are asked, answers corresponding to the at least two questions are output to the user device.

[0024] According to a second aspect of an embodiment of the present application, there is provided a reply processing device, including:

[0025] An allocating unit, configured to allocate at least two questions to at least two threads, and generate answers corresponding to the at least two questions in parallel through the at least two threads;

[0026] The output unit is used to output the answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked.

[0027] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;

[0028] The memory is connected to the processor and is used to store programs;

[0029] The processor is used to implement the answer processing method as described in the first aspect by running the program in the memory.

[0030] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the answer processing method as described in the first aspect is implemented.

[0031] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, enable the processor to execute the answer processing method as described in the first aspect.

[0032] In the present application, at least two questions are assigned to at least two threads, and the answers corresponding to the at least two questions are generated in parallel by at least two threads, and the answers corresponding to the at least two questions are output according to the order in which the at least two questions are asked. Compared with the prior art in which each thread generates the answers corresponding to each question in a serial manner by locking, the present application generates the answers corresponding to the at least two questions in parallel by at least two threads, which shortens the total time for answering multiple questions and improves the efficiency of answering multiple questions. Moreover, the answers corresponding to the at least two questions are output according to the order in which the at least two questions are asked, ensuring that the order of the answers is consistent with the order in which the questions are asked. By first processing in parallel and then queuing, the queuing is put at the back, and after the answers corresponding to the at least two questions are generated, the answers are queued according to the order in which the questions are asked, and the answers corresponding to the at least two questions are output, the total time for answering multiple questions is shortened and the efficiency of answering multiple questions is improved on the premise of ensuring that the order of the answers is consistent with the order in which the questions are asked. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0034] Figure 1 A flowchart of a method for processing an answer provided in an embodiment of the present application;

[0035] Figure 2 A schematic diagram of a process of step 102 provided in an embodiment of the present application;

[0036] Figure 3 A flowchart of a method for processing an answer provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of an external storage list provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of an external storage list after deleting the identifier of the current thread provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of an answer processing device provided in an embodiment of the present application;

[0040] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] Exemplary Implementation Environment

[0043] According to the answer processing method of the embodiment of the present application, it can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. The present application takes the answer processing method executed by a server as an example for explanation, but does not limit this.

[0044] Exemplary Methods

[0045] See also Figure 1 In an exemplary embodiment, a method for answer processing is provided. Figure 1 As shown, the process of the answer processing method mainly includes:

[0046] Step 101: assign at least two questions to at least two threads, and generate answers corresponding to the at least two questions in parallel through the at least two threads.

[0047] In some embodiments, at least two questions are assigned to at least two threads, which may be one thread corresponding to one question or one thread corresponding to at least two questions, and the present application does not limit this.

[0048] One thread corresponds to one question, which can greatly improve the efficiency of generating answers corresponding to at least two questions.

[0049] One thread corresponds to at least two questions, and the efficiency of generating the answers corresponding to the at least two questions can also be improved. As long as at least two questions are assigned to at least two threads, the answers corresponding to the at least two questions are generated in parallel by at least two threads, and the efficiency of generating the answers corresponding to the at least two questions can be improved. One thread corresponds to at least two questions, and it is necessary to assign several questions asked consecutively to one thread, and the questioning sequence cannot jump. For example, there are 5 questions in total, and the order of questions is question 1, question 2, question 3, question 4, and question 5. Question 1 and question 2 can be assigned to thread A, question 3 can be assigned to thread B, and question 4 and question 5 can be assigned to thread C; but question 1 and question 3 cannot be assigned to thread A, question 2 can be assigned to thread B, and question 4 and question 5 can be assigned to thread C. The answers corresponding to question 1 and question 3 may be output first, and then the answer corresponding to question 2, which may easily cause the order of outputting the answers corresponding to question 1, question 2, and question 3 to be inconsistent with the order of questions.

[0050] In some embodiments, generating answers corresponding to at least two questions in parallel through at least two threads may be calling a large model through at least two threads, and generating answers corresponding to at least two questions in parallel through the large model. The large model may be a model that supports multiple concurrent requests; the large model may also be a cluster, or multiple large models, each of which executes one thread, and this application does not limit this.

[0051] Step 102: outputting answers corresponding to at least two questions respectively according to the order of asking the at least two questions.

[0052] For example, there are 5 questions in total, and the order of asking them is question 1, question 2, question 3, question 4, and question 5. The order of outputting answers is the answer to question 1, the answer to question 2, the answer to question 3, the answer to question 4, and the answer to question 5.

[0053] In some embodiments, the execution subject of the answer processing method may be a user device. The user device obtains at least two questions and the order in which the at least two questions are asked; assigns the at least two questions to at least two threads, generates answers corresponding to the at least two questions in parallel through the at least two threads; and outputs the answers corresponding to the at least two questions according to the order in which the at least two questions are asked.

[0054] For example, the user device may be a vehicle-mounted device. There are three users on the vehicle where the vehicle-mounted device is located. Each user asks a question, and a total of three questions are asked. The three questions have a chronological order in terms of questioning time. The vehicle-mounted device accepts the three questions, records the order in which the three questions are asked, assigns the three questions to three threads, generates answers corresponding to the three questions in parallel through the three threads, and outputs the answers corresponding to the three questions in the order in which the three questions are asked.

[0055] In some embodiments, the execution subject of the answer processing method may be a server. The server obtains at least two questions received by at least two user devices and the order of at least two questions received by the same user device; assigns at least two questions received by the same user device to at least two threads, generates answers corresponding to the at least two questions in parallel through the at least two threads; and outputs the answers corresponding to the at least two questions to the user device according to the order of at least two questions.

[0056] For example, the user device may be a vehicle-mounted device. There are two vehicles in total, each with an on-board device. Vehicle-mounted device a receives two questions, and vehicle-mounted device b receives three questions. The server obtains the two questions received by vehicle-mounted device a and the order in which the two questions are asked, obtains the three questions received by vehicle-mounted device b and the order in which the three questions are asked, assigns the two questions received by vehicle-mounted device a to two threads, generates answers corresponding to the two questions in parallel through the two threads, outputs the answers corresponding to the two questions to vehicle-mounted device a according to the order in which the two questions are asked, and assigns the three questions received by vehicle-mounted device b to three threads, generates answers corresponding to the three questions in parallel through the three threads, and outputs the answers corresponding to the three questions to vehicle-mounted device b according to the order in which the three questions are asked.

[0057] It is possible to achieve, on the server side, based on at least two questions received by each of at least two user devices and the order of asking the at least two questions received by the same user device, generating answers corresponding to the at least two questions received by the same user device in parallel through at least two threads, thereby shortening the total time for answering multiple questions received by the same user device and improving the efficiency of answering multiple questions received by the same user device. Moreover, according to the order of asking the at least two questions received by the same user device, the answers corresponding to the at least two questions are output to the same user device, ensuring that the order of the answers is consistent with the order of the questions.

[0058] In some embodiments, Figure 2 As shown, step 102 includes:

[0059] Step 201 , sorting the thread identifiers corresponding to at least two questions respectively according to the asking order of at least two questions, and generating a thread identifier sorting result.

[0060] In some embodiments, the question order refers to the order in which the questions are asked, which refers to the order in which the questions are asked from the beginning to the end.

[0061] In some embodiments, the thread ID sorting results may be stored in an external storage list, and the structure of the list itself may also indicate the order of the IDs of the various threads.

[0062] In an exemplary embodiment, when the executor of the answer processing method is a server, the server obtains the order of at least two questions received by at least two user devices respectively and at least two questions received by the same user device, the identifier of the external storage list is the identifier of the current user device, the external storage list is used to store the identifier of the thread, and each user device corresponds to an external storage list.

[0063] In some embodiments, the execution order of step 101 in which answers corresponding to at least two questions are generated in parallel by at least two threads and step 201 can be performed simultaneously, or step 201 can be performed first, and then step 101 in which answers corresponding to at least two questions are generated in parallel by at least two threads. The present application does not impose any restrictions on this. The processing time of step 201 is very short and can be ignored.

[0064] Step 202, obtaining the identifier of the current thread that has generated the answer.

[0065] In some embodiments, answers corresponding to at least two questions are generated in parallel by at least two threads. The speed at which each thread generates answers corresponding to questions is different. It is possible that the first thread to generate an answer does not generate an answer corresponding to the first question asked, but generates an answer corresponding to the second question asked. Therefore, it is necessary to obtain the identifier of the current thread that has generated the answer and make a judgment.

[0066] Step 203, determine whether the answer corresponding to the previous thread identifier has been output, if so, execute step 204, otherwise, execute step 205.

[0067] The preceding thread identifier refers to each thread identifier before the identifier of the current thread in the thread identifier sorting result.

[0068] The threads corresponding to the preceding thread identifiers are used to generate answers corresponding to the questions that precede the questions assigned to the current thread in the questioning order.

[0069] Step 204: output the answer corresponding to the identifier of the current thread.

[0070] In some embodiments, when the answer corresponding to the previous thread identifier has been output, it indicates that the answers corresponding to the questions before the question assigned to the current thread have been output. According to the order of questions asked, the answer corresponding to the current thread identifier should now be output. By ensuring that the answers corresponding to the questions before the question assigned to the current thread have been output, the answer corresponding to the current thread identifier is output, which can ensure that the order of answers remains consistent with the order of questions asked.

[0071] Step 205, waiting for a preset time period.

[0072] In an exemplary embodiment, the preset time length may be 50 milliseconds. The preset time length may also be other values ​​as needed, and the present application is not limited thereto.

[0073] After step 205 , the process returns to step 203 .

[0074] In some embodiments, when the answer corresponding to the previous thread identifier is not output, the system waits for a preset time period. After the preset time period has passed, the system returns to the step of determining whether the answer corresponding to the previous thread identifier has been output. When the answers corresponding to the questions before the question assigned to the current thread have not been output, the system waits for a preset time period. Within the preset time period, the answers corresponding to the questions before the question assigned to the current thread may or may not have been output. Therefore, the system needs to return to the step of determining whether the answer corresponding to the previous thread identifier has been output. After ensuring that the answers corresponding to the questions before the question assigned to the current thread have been output, the answer corresponding to the identifier of the current thread is output. This ensures that the order of answers is consistent with the order of questions asked. When the answers corresponding to the questions before the question assigned to the current thread have not been output, the answer corresponding to the identifier of the current thread is not output. Instead, the system waits for a preset time period until the answers corresponding to the questions before the question assigned to the current thread have been output. Then, the answer corresponding to the identifier of the current thread is output. This ensures that the order of answers is consistent with the order of questions asked.

[0075] In some embodiments, after step 204, the answer processing method further includes: deleting the identifier of the current thread from the thread identifier sorting result.

[0076] Step 203 includes: determining whether the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting result.

[0077] Deleting the identifier of the current thread from the thread identifier sorting results can ensure that the identifiers of threads that have not output answers are stored in the thread identifier sorting results. Therefore, when judging whether the answer corresponding to the previous thread identifier has been output, it is only necessary to judge whether the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting results. If the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting results, it indicates that the answers corresponding to the questions before the question assigned to the current thread have been output. If the identifier of the current thread is inconsistent with the first thread identifier in the thread identifier sorting results, it indicates that the answers corresponding to the questions before the question assigned to the current thread have not been output. Deleting the identifier of the current thread from the thread identifier sorting results and judging whether the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting results can improve the efficiency of judging whether the answer corresponding to the previous thread identifier has been output, and further improve the efficiency of answering multiple questions.

[0078] In some embodiments, step 204 includes: calling the large model to output the answer segment corresponding to the identifier of the current thread.

[0079] The large model is called to output the answer segment corresponding to the identifier of the current thread. There is no need to wait until the complete answer is generated. The generated segment can be output on the user device first. While the user device is outputting the generated segment, subsequent segment content can continue to be generated, thereby reducing the reply delay and improving the user experience.

[0080] In some embodiments, Figure 3 As shown, the process of the answer processing method includes:

[0081] Step 301: assign at least two questions to at least two threads.

[0082] Among them, one thread corresponds to one problem.

[0083] Step 302 , writing the identifiers of the threads corresponding to the at least two questions into an external storage list in sequence according to the order in which the at least two questions are asked.

[0084] The identifier of the external storage list is the identifier of the current user device, and the external storage list is used to store the identifier of the thread.

[0085] In an exemplary embodiment, Figure 4 The figure shows a schematic diagram of an external storage list. Figure 4 There are three questions in total, question 1 is assigned to thread A, question 2 is assigned to thread B, and question 3 is assigned to thread C. The order of asking the three questions is to ask question 1 first, then question 2, and finally question 3. The identifier ID_A of thread A, the identifier ID_B of thread B, and the identifier ID_C of thread C are written into the external storage list in sequence.

[0086] Step 303: Generate answers corresponding to at least two questions in parallel through at least two threads.

[0087] Step 304, obtaining the identifier of the current thread that has generated the answer.

[0088] Step 305, read the first thread identifier from the external storage list.

[0089] Step 306, determine whether the identifier of the current thread is consistent with the identifier of the first thread, if so, execute step 307, otherwise, execute step 308.

[0090] Step 307: Call the large model to output the answer segment corresponding to the identifier of the current thread.

[0091] Step 308, waiting for a preset time. After step 308, return to step 305.

[0092] Step 309 , determine whether it is the last clip output, if so, execute step 310 , otherwise, return to execute step 307 .

[0093] Step 310, deleting the identifier of the current thread from the external storage list.

[0094] In an exemplary embodiment, Figure 5 , which is a schematic diagram of the external storage list after deleting the identifier of the current thread. Figure 4 In the example, the identifier ID_A of thread A, the identifier ID_B of thread B, and the identifier ID_C of thread C are sequentially written into the external storage list. Figure 5 In the example, after the answer corresponding to the identifier ID_A of the current thread is output, the identifier ID_A of the current thread is deleted from the external storage list, and the identifier ID_B of thread B and the identifier ID_C of thread C remain in the external storage list.

[0095] In summary, in the present application, at least two questions are assigned to at least two threads, and the answers corresponding to the at least two questions are generated in parallel by at least two threads, and the answers corresponding to the at least two questions are output according to the order in which the at least two questions are asked. Compared with the prior art in which each thread generates the answers corresponding to each question in a serial manner by locking, the present application generates the answers corresponding to the at least two questions in parallel by at least two threads, which shortens the total time for answering multiple questions and improves the efficiency of answering multiple questions. Moreover, the answers corresponding to the at least two questions are output according to the order in which the at least two questions are asked, ensuring that the order of the answers is consistent with the order in which the questions are asked. By first processing in parallel and then queuing, the queuing is put at the back, and after the answers corresponding to the at least two questions are generated, they are queued according to the order in which the questions are asked, and the answers corresponding to the at least two questions are output, the total time for answering multiple questions is shortened and the efficiency of answering multiple questions is improved on the premise of ensuring that the order of the answers is consistent with the order in which the questions are asked.

[0096] Exemplary Devices

[0097] Accordingly, the embodiment of the present application also provides a reply processing device, such as Figure 6 As shown, the answer processing device includes:

[0098] An allocating unit 601 is used to allocate at least two questions to at least two threads, and generate answers corresponding to the at least two questions in parallel through the at least two threads;

[0099] The output unit 602 is used to output the answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked.

[0100] The answer processing device provided in this embodiment belongs to the same application concept as the answer processing method provided in the above embodiments of this application, and can execute the answer processing method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the answer processing method. For technical details not fully described in this embodiment, please refer to the specific processing content of the answer processing method provided in the above embodiments of this application, and will not be repeated here.

[0101] The functions implemented by the above allocation unit 601 and the output unit 602 may be implemented by the same or different processors, respectively, and the embodiment of the present application does not limit this.

[0102] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.

[0103] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.

[0104] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0105] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0106] Exemplary Electronic Devices

[0107] An embodiment of the present application provides an electronic device, see Figure 7 As shown, the device includes:

[0108] Memory 200 and processor 210;

[0109] The memory 200 is connected to the processor 210 and is used to store programs;

[0110] The processor 210 is used to implement the answer processing method disclosed in any of the above embodiments by running the program stored in the memory 200.

[0111] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0112] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.

[0113] A bus may include a pathway that transfers information between components of a computer system.

[0114] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0115] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0116] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0117] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0118] Output device 240 may include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.

[0119] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0120] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any answer processing method provided in the above embodiments of the present application.

[0121] Exemplary computer program products and storage media

[0122] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the answer processing method according to various embodiments of the present application described in any of the above embodiments of this specification.

[0123] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0124] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the answer processing method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:

[0125] Step 101, assigning at least two questions to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads;

[0126] Step 102: outputting answers corresponding to at least two questions respectively according to the order of asking the at least two questions.

[0127] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0128] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0129] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0130] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0131] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0132] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0133] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0134] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0135] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0136] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be 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 the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing an answer, characterized in that: include: Assigning at least two questions to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads; According to the order in which the at least two questions are asked, answers corresponding to the at least two questions are output.

2. The answer processing method according to claim 1, characterized in that: Outputting answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked includes: According to the order in which the at least two questions are asked, the identifiers of the threads corresponding to the at least two questions are sorted to generate a thread identifier sorting result; Get the ID of the current thread that has generated the answer; Determine whether the answer corresponding to the previous thread identifier has been output; wherein the previous thread identifier refers to each thread identifier before the identifier of the current thread in the thread identifier sorting result; When the answer corresponding to the previous thread identifier has been output, the answer corresponding to the current thread identifier is output.

3. The answer processing method according to claim 2, characterized in that: The method further comprises: In the case that the answer corresponding to the preceding thread identifier has not been output, wait for a preset time period, and after the preset time period has passed, return to execute the step of determining whether the answer corresponding to the preceding thread identifier has been output.

4. The answer processing method according to claim 2, characterized in that: After outputting the answer corresponding to the identifier of the current thread, the method further includes: Deleting the identifier of the current thread from the thread identifier sorting result; The determining whether the answer corresponding to the preceding thread identifier has been outputted includes: It is determined whether the identifier of the current thread is consistent with the first thread identifier in the thread identifier sorting result.

5. The answer processing method according to claim 2, characterized in that: The outputting of the answer corresponding to the identifier of the current thread includes: The large model is called to output the answer segment corresponding to the identifier of the current thread.

6. The answer processing method according to claim 1, characterized in that: The step of allocating the at least two questions to at least two threads and generating answers corresponding to the at least two questions in parallel through the at least two threads includes: Allocating at least two questions received by the same user device to at least two threads, and generating answers corresponding to the at least two questions in parallel through the at least two threads; Outputting answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked includes: According to the order in which the at least two questions are asked, answers corresponding to the at least two questions are output to the user device.

7. A response processing device, characterized in that: include: An allocating unit, configured to allocate at least two questions to at least two threads, and generate answers corresponding to the at least two questions in parallel through the at least two threads; The output unit is used to output the answers corresponding to the at least two questions respectively according to the order in which the at least two questions are asked.

8. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is configured to implement the answer processing method according to any one of claims 1 to 6 by running the program in the memory.

9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the answer processing method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the answer processing method according to any one of claims 1 to 6.