Voice interaction method, device and readable storage medium
By adopting the 9P protocol and unified file system between voice interaction devices and voice processing devices, the problems of inconsistent interfaces and poor cross-language portability are solved, and logical operations are simplified and cross-platform adaptability is improved.
Patent Information
- Application Number
- CN202111497316.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-12-09
Smart Images

Figure CN114242050B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a voice interaction method, device, and readable storage medium. Background Art
[0002] At present, voice interaction between an intelligent terminal that can collect voice (i.e., a voice interaction device) and a voice processing device is generally required to perform operations corresponding to the user's voice. For example, when a speaker receives the user's voice, it needs to send the voice to the cloud for processing, and then perform corresponding operations based on the processing results of the cloud. Currently, different intelligent terminals use different interfaces and different languages when interacting with the cloud. From this, it can be seen that the current solution has the following shortcomings: inconsistent interfaces, weak cross-language portability, etc.
[0003] For example, if an interactive process is implemented in C and another product wants to reuse this process in Java, developers will need to analyze the C logic code and redevelop it. However, the differences between languages are significant, requiring developers to have a clear understanding of each language and spend a considerable amount of time studying the C logic code. As a result, existing technologies suffer from poor cross-language portability. Summary of the Invention
[0004] The embodiments of the present application provide a voice interaction method, device, electronic device and readable storage medium, which can simplify the complexity of logical operations, uniformly use file reading and writing interfaces for communication, and are more convenient for cross-language reuse, and can also enhance scalability and cross-platform capabilities.
[0005] The embodiments of the present application can be implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a voice interaction method, which is applied to a voice interaction device connected to a voice processing device, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device is the same, and the method includes:
[0007] When a voice stream is received, writing target voice data corresponding to the voice stream into a first target file of the voice processing device;
[0008] In a case where the target processing result corresponding to the target voice data is written into the second target file by the voice processing device, the target processing result is read from the second target file, and a target operation corresponding to the target processing result is performed.
[0009] In a second aspect, an embodiment of the present application provides a voice interaction method, which is applied to a voice processing device connected to a voice interaction device, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device is the same, and the method includes:
[0010] In a case where the first target file is written by the voice processing device with target voice data corresponding to the received voice stream, reading the target voice data;
[0011] The target voice data is processed, and the obtained target processing result is written into a second target file of the voice interaction device, so that the voice interaction device reads the target processing result from the second target file and performs a target operation corresponding to the target processing result.
[0012] In a third aspect, an embodiment of the present application provides a voice interaction method, which is applied to a communication-connected voice interaction device and a voice processing device, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device is the same, and the method includes:
[0013] When receiving the voice stream, the voice interaction device writes the target voice data corresponding to the voice stream into the first target file of the voice processing device;
[0014] The voice processing device reads the target voice data corresponding to the received voice stream when the first target file is written by the voice processing device, processes the target voice data, and writes the obtained target processing result into the second target file of the voice interaction device;
[0015] When the target processing result is written into the second target file by the voice processing device, the voice interaction device reads the target processing result from the second target file and performs a target operation corresponding to the target processing result.
[0016] In a fourth aspect, an embodiment of the present application provides a voice interaction device, which is applied to a voice interaction device connected to a voice processing device, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device is the same, and the device includes:
[0017] A first service processing module is configured to, upon receiving a voice stream, write target voice data corresponding to the voice stream into a first target file of the voice processing device;
[0018] a first file monitoring module configured to, when a target processing result corresponding to the target voice data is written into a second target file by the voice processing device, read the target processing result from the second target file and send the target processing result to the first business processing module;
[0019] The first business processing module is further configured to execute a target operation corresponding to the target processing result.
[0020] In a fifth aspect, an embodiment of the present application provides a voice interaction device, which is applied to a voice processing device that is communicatively connected to a voice interaction device, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device is the same, and the device includes:
[0021] a second file monitoring module, configured to read the target voice data corresponding to the received voice stream when the first target file is written by the voice processing device;
[0022] The second business processing module is used to receive the target voice data sent by the second file monitoring module, process the target voice data, and write the obtained target processing result into the second target file of the voice interaction device, so that the voice interaction device reads the target processing result from the second target file and performs the target operation corresponding to the target processing result.
[0023] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the voice interaction method as described in the aforementioned embodiment.
[0024] In a seventh aspect, an embodiment of the present application provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the voice interaction method as described in the aforementioned embodiment is implemented.
[0025] The voice interaction method, device, electronic device and readable storage medium provided by the embodiment of the present application, the voice interaction device and the voice processing device communicate based on the 9P protocol, the file directory of the file system of the voice interaction device and the voice processing device is the same, and when the voice interaction device receives the voice stream, the target voice data corresponding to the voice stream is written into the first target file of the voice processing device; and when the target processing result corresponding to the target voice data is written into the second target file by the voice processing device, the target processing result is read from the second target file, and the target operation corresponding to the target processing result is performed. In this way, by adopting the 9P protocol as the underlying protocol architecture, the voice interaction between the voice processing device and the voice interaction device is performed in the form of a unified file interface, thereby simplifying the complexity of logical operations, uniformly using file read and write interfaces for communication, and making cross-language reuse more convenient, and also enhancing scalability and cross-platform capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;
[0028] Figure 2 One of the flow charts of a voice interaction method provided in an embodiment of the present application;
[0029] Figure 3 Schematic diagram of the file system of the speaker and cloud server provided in the embodiment of the present application;
[0030] Figure 4 The second flowchart of a voice interaction method provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of communication between a voice interaction device and a cloud server provided in an embodiment of the present application;
[0032] Figure 6 Schematic diagram of the interaction process between the voice interaction device and the cloud server provided in the embodiment of the present application;
[0033] Figure 7 A flowchart of another voice interaction method provided in an embodiment of the present application;
[0034] Figure 8A flowchart of another voice interaction method provided in an embodiment of the present application;
[0035] Figure 9 This is a block diagram of a voice interaction device provided in an embodiment of the present application;
[0036] Figure 10 A second block diagram of a voice interaction device provided in an embodiment of the present application;
[0037] Figure 11 One of the block diagrams of another voice interaction device provided in an embodiment of the present application;
[0038] Figure 12 The second block diagram of another voice interaction device provided in an embodiment of the present application.
[0039] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 (300) - voice interaction device; 210 - first business processing module; 220 - first file monitoring module; 230 - first file management module; 310 - second business processing module; 320 - second file monitoring module; 330 - second file management module. DETAILED DESCRIPTION
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of 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. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0041] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present application.
[0042] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0043] Please refer to Figure 1 , Figure 1 A block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a cloud device (such as a cloud server) or a non-cloud device (such as a speaker, etc.). The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0044] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0045] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a voice interaction device, which includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the voice interaction device in the embodiment of the present application, thereby implementing the voice interaction method in the embodiment of the present application.
[0046] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.
[0047] The electronic device 100 can function as a voice interaction device or a voice processing device. The voice interaction device is used to perform corresponding operations based on the user's voice, and the voice processing device is used to analyze the voice. It is understood that when the electronic device 100 functions as a voice interaction device, the electronic device 100 may also include a voice acquisition unit for acquiring voice.
[0048] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0049] Please refer to Figure 2 , Figure 2 This is one of the flowcharts of a voice interaction method provided in an embodiment of the present application. The method is applied to a voice interaction device in communication with a voice processing device. The specific process of the voice interaction method is described in detail below. In this embodiment, the method may include steps S110 to S120.
[0050] Step S110 : when a voice stream is received, writing target voice data corresponding to the voice stream into a first target file of the voice processing device.
[0051] In this embodiment, the voice interaction device and the voice processing device communicate using the 9P protocol as the underlying protocol architecture. The voice interaction device can be a cloud server or a non-cloud device, such as a speaker. Similarly, the voice processing device can be a cloud server or a non-cloud device. That is, the voice processing device and the voice interaction device can operate in an end-to-end, device-to-cloud, or cloud-to-cloud scenario.
[0052] The voice interaction device and the voice processing device each include a file system. The file directory of the file system of the voice interaction device is the same as that of the file system of the voice processing device. This facilitates subsequent communication based on files. The file directory of the file system can be determined based on the services involved in the actual application and is not specifically limited here. The files in the file systems of the voice interaction device and the voice processing device can support text format, binary format, etc.
[0053] like Figure 3 As shown, assuming that the voice interaction device is a speaker and the voice processing device is a cloud server, the file directory of the file system of the speaker may include: / AudioStream / up, / AudioStream / down, / Directive / AudioPlayer / play, / Directive / AudioPlayer / Pause, Directive / AudioPlayer / Stop, / Directive / Bluetooth / play, / event / AudioPlayer / Started, etc. Correspondingly, the file system of the cloud server also includes the same file directory.
[0054] In this embodiment, upon receiving a voice stream, the voice interaction device can obtain target voice data based on the voice stream and write the target voice data to the first target file of the voice processing device via the 9P protocol. For example, if a speaker is constantly monitoring voice and detects a user's voice, it can obtain a voice stream through voice acquisition, convert the voice stream into target voice data that can be easily stored in a file, and then write the target voice data to the first target file of the voice processing device.
[0055] Optionally, in this embodiment, upon detecting a voice stream, the voice interaction device may first determine a file corresponding to the voice stream and use the file as the first target file, and then write the target voice data corresponding to the voice stream into the first target file of the voice processing device. For example, the voice interaction device may write the target voice data into the file / AudioStream / up of the voice processing device.
[0056] Optionally, if the file system contains only one file, that file can be directly used as the first target file. If the file system contains multiple files, the voice interaction device can analyze the voice stream to determine the target scenario corresponding to the voice stream, and then, based on the correspondence between different scenarios and files, determine the file corresponding to the target scenario and use that file as the first target file. The specific correspondence between scenarios and files can be set based on actual business conditions and is not specifically limited here.
[0057] In this embodiment, the voice processing device can monitor its own file system, so that when it detects that a file in its own file system is operated, it can extract the file content corresponding to the operation and perform corresponding processing.
[0058] When the voice interaction device writes the target voice processing to the first target file of the voice processing device, the voice processing device can monitor the operation and read the target voice data written by the voice interaction device from the first target file in its own file system, and then process the target voice data according to its own pre-set business logic to obtain the target processing result of the target voice data. The voice processing device can write the target processing result to the second target file of the voice interaction device through the 9P protocol. The voice processing device and the voice interaction device can determine the target file in the same way. The first target file and the second target file can be specifically determined according to actual conditions.
[0059] For example, when the voice interaction device writes the target voice data into the / AudioStream / up file of the voice processing device, the voice processing device may write the corresponding target processing result into the / AudioStream / down file of the voice interaction device.
[0060] Step S120 , when the target processing result corresponding to the target voice data is written into the second target file by the voice processing device, the target processing result is read from the second target file, and a target operation corresponding to the target processing result is performed.
[0061] In this embodiment, the voice interaction device can monitor its own file system, so that when it monitors that a file in its own file system is operated, it can extract the file content corresponding to the operation and then perform corresponding processing.
[0062] When the voice processing device writes the target processing result to the second target file of the voice interaction device, the voice interaction device can monitor the operation and read the target processing result written by the voice processing device from the second target file in its own file system, and then determine the target operation corresponding to the target processing result according to its own pre-set business logic, and then execute the target operation.
[0063] The target operation may be an operation of playing the target processing result, or may not be an operation of playing the target processing result, such as a pause operation, a start operation, etc., which may be determined based on actual conditions.
[0064] For example, when it is monitored that the second target file of the voice interaction device is operated by the voice processing device, that is, when the target processing result is written by the voice processing device, the voice interaction device can read the target processing result corresponding to the operation from the second target file. If, in combination with the pre-set business logic, it is determined that the target operation corresponding to the target processing result is to play related voice information, the voice response information corresponding to the target processing result can be played through the player. For example, the voice stream is: How is the weather today? The target processing result is: The weather in Beijing is sunny, then the target operation can be to play the voice information that the weather in Beijing is sunny.
[0065] The embodiment of the present application uses a file approach to solve the problem of inconsistent interfaces and the problem of cross-language readability. For example, although there are significant differences between C and Python, Go, and other languages, the file operations are unified. If a set of interactive processes was previously implemented in C, when reusing it, you only need to look at the logic of the C language operating files. After understanding the order (that is, the logical order) of the C language operating files, you can easily write the corresponding logic in another language (for example, Java), thereby quickly achieving reuse.
[0066] Please refer to Figure 4 , Figure 4This is a second flow chart of a voice interaction method provided in an embodiment of the present application. In this embodiment, the method may further include step S101.
[0067] Step S101: Manage files in the file system of the voice interaction device according to the received management instruction.
[0068] In this embodiment, both the voice interaction device and the voice processing device can manage files in their own file systems based on received management instructions. These management instructions can be directly input by the user or sent by another device, and can be configured based on actual needs. This management includes creating and / or deleting files. In this manner, 9P files in the file system can be managed.
[0069] The following combination Figure 5 and Figure 6 , the above-mentioned voice interaction method is illustrated with examples. In the following examples, the voice interaction device is a voice device, and the voice processing device is a cloud server.
[0070] The voice device and the cloud server both include: a 9P communication module, a file system, a file monitoring module, a business processing module and a 9P file management module.
[0071] The 9P communication module is the standard Linux 9P protocol implementation layer. The file system is a Linux file system. The business processing module is used to process business processes based on different services. Communication primarily involves file operations. Because communication is file-based, business logic can be written in any language, and it has excellent portability. The business processing module is compatible with various languages such as C / C++ / Java. The file monitoring module, upon receiving a file operation from the other party, immediately reads the file content and passes it to the business module for processing.
[0072] The file system directory for the voice device and the cloud server is the same. Files in the file system support both text and binary formats. For example, / AudioStream / up represents the upstream binary voice stream. The voice device writes voice data to this file, and the cloud server's / AudioStream / up is read and processed immediately by the file monitoring module.
[0073] The voice interaction process is described below.
[0074] When the voice device receives the voice stream, it writes the target voice data corresponding to the voice stream into the determined first target file / AudioStream / up. That is, the voice device writes the voice binary stream to the / AudioStream / up of the cloud server, for example, what is the weather like today?
[0075] The cloud server's / AudioStream / up receives this audio binary stream. The cloud server's file monitoring module reads the audio data from / AudioStream / up and passes it to the cloud server's business processing module. After processing, the cloud server's business processing module writes the result (i.e., the target processing result) to the audio device's / AudioStream / down; in other words, the response is written to the audio device's / AudioStream / down. For example, the result might read: "Beijing is sunny, xxxxxx."
[0076] The audio device's / AudioStream / down receives the audio binary stream (i.e., the result content). The audio device's file monitoring module reads the audio data in / AudioStream / down and passes it to the audio device's service processing module. The service processing module plays the audio stream through a player: "Beijing weather is sunny, xxxxxx."
[0077] In the embodiments of this application, the 9P protocol is used as the underlying protocol architecture, and the voice interaction between the voice interaction device and the voice processing device is carried out in a unified file interface format. This simplifies the complexity of logical operations and uniformly uses a file read and write interface for communication. In addition, due to the use of a file format, language dependencies are greatly reduced, making cross-language communication more convenient. At the same time, scalability and cross-platform performance are enhanced.
[0078] Please refer to Figure 7 , Figure 7 A flowchart of another voice interaction method provided in an embodiment of the present application. In this embodiment, the voice interaction method can be applied to a voice processing device that is communicatively connected to a voice interaction device. The voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the voice processing device are the same. The method may include steps S210 and S220.
[0079] Step S210 : When the target voice data corresponding to the received voice stream is written into the first target file by the voice processing device, the target voice data is read.
[0080] Step S220, processing the target voice data, and writing the obtained target processing result into the second target file of the voice interaction device, so that the voice interaction device reads the target processing result from the second target file and performs the target operation corresponding to the target processing result.
[0081] Optionally, in this embodiment, the voice processing device may further manage files in the file system of the voice processing device according to the received management instruction, wherein the management includes generating files and / or deleting files.
[0082] In this embodiment, for the specific description of the voice interaction method applied to the voice processing device, reference can be made to the above description of the voice interaction method applied to the voice interaction device, and no further details will be given here.
[0083] Please refer to Figure 8 , Figure 8 A flowchart of another voice interaction method provided in an embodiment of the present application. In this embodiment, the method can be applied to a voice interaction device and a voice processing device that are in communication connection, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, and the file system of the voice interaction device and the voice processing device have the same file directory. The method may include steps S310 to S330.
[0084] Step S310: When receiving a voice stream, the voice interaction device writes target voice data corresponding to the voice stream into a first target file of the voice processing device.
[0085] Step S320: When the first target file is written with target voice data corresponding to the received voice stream by the voice processing device, the voice processing device reads the target voice data, processes the target voice data, and writes the obtained target processing result into the second target file of the voice interaction device.
[0086] Step S330: When the target processing result is written into the second target file by the voice processing device, the voice interaction device reads the target processing result from the second target file and performs a target operation corresponding to the target processing result.
[0087] Optionally, in this embodiment, the voice interaction device manages files in the file system of the voice interaction device according to the received management instruction, and the voice processing device manages files in the file system of the voice processing device according to the received management instruction. The management includes generating files and / or deleting files.
[0088] In this embodiment, for the specific description of the voice interaction method, please refer to the above description of the voice interaction method applied to the voice interaction device, and will not be repeated here.
[0089] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a voice interaction device is given below. Optionally, the voice interaction device can adopt the above Figure 1 It should be noted that the basic principle and technical effects of the voice interaction device provided in this embodiment are the same as those of the above embodiments. For the sake of simplicity, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments.
[0090] Please refer to Figure 9 , Figure 9 This is a block diagram of a voice interaction device 200 provided in an embodiment of the present application. In this embodiment, the voice interaction device 200 can be applied to a voice interaction device that is communicatively connected to a voice processing device. The voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directory of the file system of the voice interaction device and the file system of the voice processing device are the same. The voice interaction device 200 may include: a first service processing module 210 and a first file monitoring module 220.
[0091] The first service processing module 210 is configured to, upon receiving a voice stream, write target voice data corresponding to the voice stream into a first target file of the voice processing device.
[0092] The first file monitoring module 220 is used to read the target processing result from the second target file and send the target processing result to the first business processing module 210 when the target processing result corresponding to the target voice data is written into the second target file by the voice processing device.
[0093] The first business processing module 210 is further configured to execute a target operation corresponding to the target processing result.
[0094] Optionally, in this embodiment, the voice interaction apparatus 200 may further include a first 9P communication module, and the first 9P communication module is used to implement communication between the voice interaction device and the voice processing device.
[0095] Please refer to Figure 10 , Figure 10 This is a second block diagram of a voice interaction device 200 provided in an embodiment of the present application. In this embodiment, the voice interaction device 200 may further include a first file management module 230 .
[0096] The first file management module 230 is configured to manage files in the file system of the voice interaction device according to received management instructions, wherein the management includes generating files and / or deleting files.
[0097] Please refer to Figure 11 , Figure 11 This is a block diagram of another voice interaction device 300 provided in an embodiment of the present application. In this embodiment, the voice interaction device 300 can be applied to a voice processing device that is communicatively connected to a voice interaction device. The voice interaction device and the voice processing device communicate based on the 9P protocol, and the file directories of the file systems of the voice interaction device and the voice processing device are the same. The voice interaction device 300 can include: a second service processing module 310 and a second file monitoring module 320.
[0098] The second file monitoring module 320 is configured to read the target voice data when the first target file is written by the voice processing device into the target voice data corresponding to the received voice stream.
[0099] The second business processing module 310 is used to receive the target voice data sent by the second file monitoring module, process the target voice data, and write the obtained target processing result into the second target file of the voice interaction device, so that the voice interaction device reads the target processing result from the second target file and performs the target operation corresponding to the target processing result.
[0100] Optionally, in this embodiment, the voice interaction device 300 may further include a second 9P communication module, and the second 9P communication module is used to realize communication between the voice processing device and the voice interaction device.
[0101] Please refer to Figure 12 , Figure 12 This is a second block diagram of another voice interaction device 300 provided in an embodiment of the present application. In this embodiment, the voice interaction device 300 may further include a second file management module 330 .
[0102] The second file management module 330 is configured to manage files in the file system of the voice processing device according to the received management instruction, wherein the management includes generating files and / or deleting files.
[0103] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in FIG. 110 or the operating system (OS) of the electronic device 100 may be fixed and may be used by Figure 1Meanwhile, the data, program codes, etc. required to execute the above modules may be stored in the memory 110.
[0104] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the voice interaction method is implemented.
[0105] In summary, the embodiments of the present application provide a voice interaction method, device, electronic device and readable storage medium, wherein the voice interaction device and the voice processing device communicate based on the 9P protocol, the file directory of the file system of the voice interaction device and the voice processing device is the same, and when the voice interaction device receives the voice stream, the target voice data corresponding to the voice stream is written into the first target file of the voice processing device; and when the target processing result corresponding to the target voice data is written into the second target file by the voice processing device, the target processing result is read from the second target file, and the target operation corresponding to the target processing result is performed. In this way, by adopting the 9P protocol as the underlying protocol architecture, the voice interaction between the voice processing device and the voice interaction device is performed in the form of a unified file interface, thereby simplifying the complexity of logical operations, uniformly using file read and write interfaces for communication, and making cross-language reuse more convenient, and also enhancing scalability and cross-platform capabilities.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0107] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0108] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0109] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A voice interaction method, characterized in that: Applied to a voice interaction device in communication with a voice processing device, the voice interaction device and the voice processing device communicating based on the 9P protocol, the file directory of the file system of the voice interaction device and the voice processing device being the same, the method comprising: When a voice stream is received, target voice data corresponding to the voice stream is written into a first target file of the voice processing device through the 9P protocol; When the target processing result corresponding to the target voice data is written into the second target file by the voice processing device through the 9P protocol, the target processing result is read from the second target file, and a target operation corresponding to the target processing result is performed.
2. The method according to claim 1, characterized in that When a voice stream is received, writing target voice data corresponding to the voice stream into a first target file of the voice processing device through the 9P protocol includes: In the case where a voice stream is detected, determining a first target file corresponding to the voice stream; The target voice data corresponding to the voice stream is written into a first target file of the voice processing device through the 9P protocol.
3. The method according to claim 2, characterized in that In a case where the file system includes a plurality of files, when a voice stream is detected, determining a first target file corresponding to the voice stream includes: Analyzing the voice stream to determine a target scenario corresponding to the voice stream; According to the correspondence between different scenes and files, the first target file corresponding to the target scene is determined.
4. The method according to claim 1, wherein When the target processing result corresponding to the target voice data is written into the second target file by the voice processing device through the 9P protocol, reading the target processing result from the second target file and performing the target operation corresponding to the target processing result include: When it is detected that the second target file of the voice interaction device is operated by the voice processing device, reading the target processing result corresponding to the operation; When it is determined that the target processing result needs to be played, the voice response information corresponding to the target processing result is played through the player.
5. The method according to claim 1, wherein The method further comprises: The files in the file system of the voice interaction device are managed according to the received management instruction, wherein the management includes generating files and / or deleting files.
6. A voice interaction method, characterized in that: A method for a speech processing device connected to a speech interaction device, wherein the speech interaction device and the speech processing device communicate based on a 9P protocol, and the file directory of the file system of the speech interaction device and the speech processing device are the same, includes: When the target voice data corresponding to the received voice stream is written into the first target file by the voice processing device through the 9P protocol, reading the target voice data; The target voice data is processed, and the obtained target processing result is written into the second target file of the voice interaction device through the 9P protocol, so that the voice interaction device reads the target processing result from the second target file and performs the target operation corresponding to the target processing result.
7. A voice interaction method, characterized in that: Applicable to a voice interaction device and a voice processing device in communication connection, the voice interaction device and the voice processing device communicate based on the 9P protocol, the file directory of the file system of the voice interaction device and the voice processing device is the same, the method comprising: When the voice interaction device receives the voice stream, the target voice data corresponding to the voice stream is written into the first target file of the voice processing device through the 9P protocol; The voice processing device reads the target voice data corresponding to the received voice stream when the first target file is written by the voice processing device through the 9P protocol, processes the target voice data, and writes the obtained target processing result into the second target file of the voice interaction device through the 9P protocol; When the target processing result is written into the second target file by the voice processing device through the 9P protocol, the voice interaction device reads the target processing result from the second target file and performs a target operation corresponding to the target processing result.
8. A voice interaction device, characterized in that: A voice interaction device is applied to a voice processing device in communication connection with the voice interaction device, the voice interaction device and the voice processing device communicate based on the 9P protocol, the file directory of the file system of the voice interaction device and the voice processing device is the same, and the device includes: A first service processing module is configured to, upon receiving a voice stream, write target voice data corresponding to the voice stream into a first target file of the voice processing device through a 9P protocol; a first file monitoring module configured to, when a target processing result corresponding to the target voice data is written into a second target file by the voice processing device through the 9P protocol, read the target processing result from the second target file and send the target processing result to the first business processing module; The first business processing module is further configured to execute a target operation corresponding to the target processing result.
9. A voice interaction device, characterized in that: A device for processing speech that is connected to a speech interaction device, wherein the speech interaction device and the speech processing device communicate based on the 9P protocol, and the file directory of the file system of the speech interaction device and the speech processing device is the same, comprising: a second file monitoring module, configured to read the target voice data when the target voice data corresponding to the received voice stream is written into the first target file by the voice processing device through the 9P protocol; The second business processing module is used to receive the target voice data sent by the second file monitoring module, process the target voice data, and write the obtained target processing result into the second target file of the voice interaction device through the 9P protocol, so that the voice interaction device reads the target processing result from the second target file and performs the target operation corresponding to the target processing result.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the voice interaction method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Information processing apparatus, conference system and information processing method
CN101998107A
Voice interaction method, device and system, storage medium and processor
CN110491383A