Speech recognition method, device, speech interaction device and storage medium
By dynamically generating and loading executable files associated with the user interface, and combining static and dynamic recognition resources, the problem of low generalization in the voice interaction system is solved, and the user experience and system efficiency are improved.
Patent Information
- Application Number
- CN202210420727.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-04-20
AI Technical Summary
The low degree of generalization in existing voice interaction systems results in poor user experience and is prone to problems such as false arousal and overlapping vocabulary responses.
By dynamically generating execution files associated with the current user interface and loading these files in the speech recognition engine, generalized recognition of user input audio is achieved, and static and dynamic recognition resource files are combined to improve the degree of generalization and system efficiency.
It achieves a higher degree of generalization of voice interaction, reduces system performance consumption, improves user experience and system stability, and can trigger corresponding execution actions based on different user statements.
Smart Images

Figure CN114758658B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent speech technology, and in particular to a speech recognition method and an intelligent speech system. Background Art
[0002] With the rapid development of voice interaction technology, seeing and speaking has become an unstoppable development trend because it can conveniently provide services to users. Under this trend, the operation trend of third-party applications has developed from the current manual operation to operation based on voice commands, which will become the mainstream. However, traditional voice interaction mostly uses the wake-up method to realize the see-and-speak function. The wake-up solution mainly responds to and executes the corresponding action through voice input and matching built-in fixed command words, that is, when the wake-up word is received, the instruction corresponding to the wake-up word is executed. This method can respond to and execute the corresponding action as long as the corresponding wake-up word appears in the audio. The wake-up solution is detected based on pinyin and thresholds. The thresholds of each response vocabulary set in the wake-up solution are different, and the thresholds need to be calculated dynamically. In the wake-up solution, if you want to solve the generalization problem, you need to set a corresponding wake-up word for each statement of the response vocabulary, but this method will make it particularly easy to cause false wake-ups and affect the normal operation of the system. At the same time, the wake-up solution cannot solve the response problem of overlapping vocabulary.
[0003] In the prior art, there are also solutions that use hot word recognition to replace the wake-up solution as a response, but it can only solve the unsolvable response problem of overlapping words in the wake-up solution, and cannot solve the problem of low generalization. Therefore, it is necessary to seek a visible and speakable solution that can effectively solve the technical problem of low generalization in the prior art. Summary of the invention
[0004] The embodiments of the present invention provide a speech recognition method, an apparatus, a speech interaction device and a storage medium to solve the problems of low generalization, rigid interaction mode and poor user experience in speech interaction in a see-and-speak system in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a speech recognition method, comprising:
[0006] When a preset condition is met, dynamically generating a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a preset first preset rule, wherein the preset condition includes detecting a change in the currently displayed user interface;
[0007] Restart the speech recognition engine to dynamically load the first execution file, wherein the speech recognition engine is loaded with a second execution file, and the second execution file is pre-generated according to preset second interface content and second preset rules and loaded into the speech recognition engine.
[0008] In a second aspect, an embodiment of the present invention provides a speech recognition device, including:
[0009] A speech recognition engine, configured to recognize received audio to be recognized according to an execution file loaded therein, wherein the execution file includes a first straight line file and a second execution file, the second execution file is pre-generated according to the second interface content and the second preset rule and pre-loaded in an initialization phase, and the first execution file is dynamically generated according to a first execution file generation module and dynamically loaded through a first execution file loading module;
[0010] A first execution file generation module is configured to dynamically generate a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a first preset rule when a preset condition is met, wherein the preset condition includes detecting a change in the currently displayed user interface;
[0011] The first execution file loading module is configured to restart the speech recognition engine to dynamically load the first execution file.
[0012] In the third aspect, an embodiment of the present invention provides a voice interaction device, comprising a first voice recognition module and a second voice recognition module. When the voice interaction device receives audio to be recognized, the audio to be recognized is recognized by the first voice recognition module and the second voice recognition module at the same time, and two independent recognition results are output. The first voice recognition module implements the steps of the above method when executed.
[0013] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0014] The beneficial effect of the embodiment of the present invention is that: the method provided by the embodiment of the present invention dynamically generates a first execution file corresponding to the currently displayed user interface according to the first interface content in the currently displayed user interface and the preset first preset rule in real time as the currently displayed user interface changes, and enables the speech recognition engine to dynamically load the dynamically generated first execution file, so that when the user speaks the corresponding trigger audio according to the content in the currently displayed user interface, the system can execute the execution action corresponding to the content of the currently displayed user interface according to the audio to be recognized input by the user, and realize the function of seeing and speaking. Among them, when the first execution file is dynamically generated, the first interface content can be fully generalized through the preset first preset rule, so that after the speech recognition engine loads the first execution file, it can perform speech recognition on the input audio data to be recognized according to the generalized corresponding content in the first execution file, thereby enabling the user to trigger the speech recognition engine with various different generalized statements, so that the speech interaction system can execute the execution content corresponding to the semantics of the generalized statement according to the recognition result of the speech recognition engine, so as to realize the generalized function of seeing and speaking. At the same time, the speech recognition engine of the embodiment of the present invention only dynamically generates and loads the first execution file according to the content of the currently displayed user interface, and pre-generates the second execution file according to the second interface content and the second preset rule for other recognition resources, and pre-loads the second execution file in the initialization stage. It not only realizes the full generalization of all contents in all user interfaces of the current application through the combination of the first execution file and the second execution file to effectively improve the generalization degree of voice interaction, but also realizes the dynamic generation and loading of resources corresponding to the current user interface content only when the currently displayed user interface changes, which can effectively reduce the performance consumption of the system due to compiling and loading execution files and improve the operation efficiency of the speech recognition engine. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0016] Figure 1 A flowchart of a speech recognition method according to an embodiment of the present invention;
[0017] Figure 2 A flowchart of generating a first execution file of a speech recognition method according to an embodiment of the present invention;
[0018] Figure 3 A flowchart of generating a second execution file of a speech recognition method according to an embodiment of the present invention;
[0019] Figure 4 is a functional block diagram of a speech recognition device according to an embodiment of the present invention;
[0020] Figure 5 This is a principle block diagram of a voice interaction device according to an embodiment of the present invention;
[0021] Figure 6 It is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0024] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0025] In the present invention, "module", "device", "system" and the like refer to related entities applied to computers, such as hardware, a combination of hardware and software, software or software in execution, etc. In detail, for example, an element can be, but is not limited to, a process, a processor, an object, an executable element, an execution thread, a program and / or a computer running on a processor. In addition, an application or script program running on a server, a server can all be an element. One or more elements can be in an execution process and / or thread, and an element can be localized on a computer and / or distributed between two or more computers, and can be operated by various computer-readable media. An element can also communicate through local and / or remote processes according to a signal with one or more data packets, for example, a signal from a data that interacts with another element in a local system, a distributed system, and / or a network on the Internet through a signal to interact with other systems.
[0026] 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" and "comprise" include not only those elements, but also other elements that are not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.
[0027] The speech recognition method in the embodiment of the present invention can be applied to an intelligent device with a speech interaction function, so that a user can use the speech recognition method adopted in the present invention in the intelligent device to realize the corresponding speech function. For example, the intelligent device with a speech interaction function includes but is not limited to a smart phone, a smart tablet, a personal PC, a computer, a cloud server, etc. In particular, the speech recognition method in the embodiment of the present invention can also be applied to a vehicle-mounted device with a speech interaction function, so that the driver can control the system interface in the vehicle by a visible and verbal method when driving the vehicle, thereby improving the safety and convenience of driving.
[0028] Figure 1 The method of speech recognition according to one embodiment of the present invention is schematically shown, and the method is applicable to the configuration of intelligent speech systems such as smart phones, personal computers, cloud servers, and automobile intelligent systems, so that the intelligent speech systems of these devices can realize the function of seeing and speaking. Figure 1 , the method of the embodiment of the present invention includes:
[0029] Step S101: when a preset condition is met, dynamically generating a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a preset first preset rule, wherein the preset condition includes detecting a change in the currently displayed user interface;
[0030] Step S102: Restart the speech recognition engine to dynamically load the first execution file, wherein the speech recognition engine is loaded with a second execution file, and the second execution file is pre-generated according to a preset second interface content and a second preset rule and loaded into the speech recognition engine.
[0031] In the embodiment of the present invention, the user interface can be the display interface of any terminal application or the display interface of the system. The currently displayed user interface refers to the display interface that is currently in the display state and where the user focuses, that is, the display interface that is currently being paid attention to or operated by the user and is in an active state.
[0032] In step S101, the change of the currently displayed user interface refers to the change of the display interface currently displayed to the user from one user interface to another different user interface, or from one user interface state to another user interface state, that is, it can refer to the switching of the user interface (jump of the user interface), the switching of the application, the sliding of the user interface, the updating of the interface content, etc. Among them, the detection of the change of the currently displayed user interface can be realized by monitoring the system event, such as when the current user interface changes, the system will notify the corresponding application of the currently displayed user interface, so the change of the currently displayed user interface can be learned by monitoring such system notification events. In other embodiments, the change of the currently displayed user interface can also be learned by monitoring the user's operation event, such as the change of the user interface is generally based on the user's click or voice event, that is, the interface is updated or switched through the user's operation, so the change of the currently displayed user interface can also be learned by monitoring such events. Of course, in other embodiments, other existing technologies can also be used to realize the detection of the change event of the currently displayed user interface, as long as the change of the currently displayed user interface can be detected in real time. The first interface content refers to the content in the user interface that needs to be voice-triggered by the visible-to-speak function, such as the singer name, song name, etc. in the music list that appears in the first user interface displayed in a certain music application, and the setting option button, login option button, etc. that appear in the user interface displayed. The first preset rule refers to a pre-set rule for semantic generalization and generalization of the first interface content, which is preferably composed of at least one extended rule. For example, for a certain interface content in the currently displayed interface that needs to be voice-triggered, the extended rule can be a rule for generalization based on the semantics of the first interface content, or a rule for supplementing the first interface content with pre-modal particles, verbs, post-modal particles, etc. to form a generalized statement that is more in line with user habits, etc. In the embodiment of the present invention, the first preset rule composed of at least one extended rule is pre-set according to the desired effect to generalize the corresponding interface content. In actual application, the currently displayed user interface may include the first interface content composed of at least one interface content option, and the first preset rule may correspond to each interface content option one by one, or may correspond to the first interface content, that is, it is shared by all interface content options in the first interface content. In the embodiment of the present invention, the first execution file refers to the sub-recognition resource file that the speech recognition engine relies on when performing speech recognition processing, and is dynamically generated according to the first interface content and the first preset rule.Specifically, the first execution file can be a slot.bin format file loaded by the speech recognition engine. The speech recognition engine can recognize the audio data to be recognized input by the user according to the trigger words and corresponding statements stored in the first execution file, the corresponding execution action content and other resources. Since the currently displayed user interface will change, the first interface content in the user interface may also change accordingly. Therefore, the first execution file in the embodiment of the present invention needs to be dynamically generated according to the change of the currently displayed user interface. For example, taking the user interface of a certain music application as an example, the currently displayed user interface contains the first interface content such as the singer name, setting option button, login option button, etc. At this time, the first execution file corresponding to the currently displayed user interface is generated according to the first interface content and the preset first preset rule; and when the user switches, slides, etc. on the currently displayed user interface, so that the currently displayed user interface changes, such as the changed currently displayed user interface contains the first interface content such as the song name, setting option button, login option button, etc., at this time, the first execution file corresponding to the currently displayed user interface is generated again according to the first interface content in the currently displayed user interface after the change and the preset first preset rule, so as to realize the dynamic generation of the first execution file. Therefore, in an embodiment of the present invention, the first execution file is preferably associated with the currently displayed user interface, that is, it changes accordingly with changes in the currently displayed user interface. In particular, changes made to the first execution file in response to changes in the currently displayed user interface may include changes in the content of the first execution file brought about by changes in the content of the first interface, and may also include changes in the first preset rule corresponding to the first execution file caused by changes in the content of the first interface and / or the associated user interface, etc.
[0033] In step S102, the speech recognition engine is restarted to load the first execution file, so that the speech recognition engine can recognize the audio data to be recognized input by the user according to the recognition resources provided in the first execution file. When a new first execution file is dynamically generated, the speech recognition engine will be restarted again to load the newly generated first execution file, so that the speech recognition engine can dynamically load the first execution file to dynamically update the recognition resources it depends on according to changes in the currently displayed user interface. Since the compilation and loading of the execution file containing the recognition resources of the speech recognition engine is relatively time-consuming and performance-intensive, in the embodiment of the present invention, it is preferred to design a dual recognition resource file architecture for the speech recognition engine, that is, the speech recognition engine is designed to include a sub-recognition resource file (referred to as the first execution file in the embodiment of the present invention) having dynamic recognition resources relied on when performing speech recognition processing and a main recognition resource file (referred to as the second execution file in the embodiment of the present invention) having static recognition resources relied on when performing speech recognition processing, and in the embodiment of the present invention, the sub-recognition resource file, i.e., the first execution file, which the speech recognition engine relies on is dynamically loaded, while the main recognition resource file, i.e., the second execution file, is preloaded in the initialization stage and will not change with the changes in the currently displayed user interface, i.e., it is static. Preferably, the second execution file is a recognition resource file generated according to the second interface content and the second preset rule. For the second execution file, unlike the first execution file, the second interface content based on which the second execution file is generated is pre-configured according to user needs or user expectations, and the second execution file is an execution file pre-generated and loaded in the speech recognition engine during the initialization phase of the speech recognition engine, and is not dynamically generated according to the changes in the currently displayed user interface, so it can be used for a wider range of speech recognition that is consistent with user needs or expectations, and is not limited to being a reinforcement and supplement to the recognition resources of the currently displayed interface content, that is, compared with the first execution file, the second execution file has stronger versatility and contains wider recognition resources. Therefore, the speech recognition engine of the embodiment of the present invention can not only ensure more accurate recognition of the currently displayed interface content and realize more generalized see-and-speak voice interaction by dynamically updating and loading the sub-recognition resource files associated with the currently displayed user interface and pre-loading the main recognition resource files with stronger versatility, but also ensure the efficiency and performance of the initialization and loading of the speech recognition engine by reducing the data volume of the dynamically updated and loaded recognition resource files, and will not cause excessive performance consumption to the system, so it has higher feasibility and system stability.
[0034] As a preferred embodiment, the content in the second execution file can be an identification resource that will not change. Therefore, preferably, the second interface content corresponding to the second execution file can be set to be a preset static content in the user interface that will not change with the change of the user interface, wherein the static content is relative to the dynamically loaded content. For the user interfaces of different applications, they all include fixed interface content preset through interface design and real-time changing interface content dynamically loaded according to the running status of the application. For example, for a certain music application, its user interface includes interface content that is always fixedly displayed during the running stage of the music application after being determined in the interface design stage, such as content corresponding to interface options such as "Play All" and "Personal Center", and includes interface content that changes in real time according to real-time data dynamic loading during the running of the application, such as specific tracks displayed under the "Play All" option. In the embodiment of the present invention, the preset static content in the user interface that will not change with the change of the user interface is used as the basis for generating the second execution file, and the dynamic content that will change with the change of the user interface is used as the basis for generating the first execution file. In particular, the dynamic content on the current display interface is used as the basis for generating the first execution file, so that the generated first execution file is a sub-identification resource file that can reflect the interface content currently displayed, and the second execution file can be used as a main identification resource file that contains all the interface content of all applications or desired applications. Of course, in other embodiments, it is not limited to the application program, but the corresponding resource extraction is performed for the user interface of the system. For example, the second interface content can also be only the content that will not change in the system interface, etc., which can be customized according to actual user needs. For the second preset rule, it is a pre-set rule for semantic generalization and statement generalization of the second interface content. It can be the same as the first preset rule or different from the first preset rule. Since the second preset rule is a rule for semantic generalization and statement generalization of the second interface content, it can also be based on the particularity of the second interface content. Set the corresponding rule for the corresponding interface content. Preferably, the second preset rule is composed of at least one extended rule, and the extended rule can be a rule such as a synonym, an interjection, etc. that can realize the required generalization of the second interface content. Since the second execution file is preloaded in the speech recognition engine, when the first execution file is generated, it can omit the generalization step of the content related to the second interface content according to the relevant content in the second execution file, thereby complementing the second execution file. This setting can not only effectively improve the generalization coverage of the visible, i.e., triggering content of the overall system, but also effectively reduce the system load when the first execution file is dynamically generated.
[0035] In an embodiment of the present invention, through the above method, a first execution file corresponding to the currently displayed user interface can be dynamically generated according to the changes of the currently displayed user interface, and when generating the first execution file, the first interface content in the currently displayed user interface is fully generalized according to the corresponding first preset rule, and the first execution file is dynamically loaded by restarting the speech recognition engine, so that the visible-to-speak voice interaction can be effectively performed according to the content of the currently displayed user interface. At the same time, the speech recognition engine is also preloaded with a second execution file in the initialization stage. By combining the first execution file with the second execution file, the generalized coverage of the visible-to-speak trigger content of the overall voice interaction system can be effectively improved, and the generalization performance of the voice interaction can be improved.
[0036] In some embodiments, the first interface content may be only the content in the currently displayed user interface that changes dynamically as the user interface changes. By setting it in this way, it can be combined with the second execution file to reduce the overall load of the system when generating the first execution file. Among them, the content that changes dynamically as the user interface changes can specifically be the content that will be dynamically loaded in the application, such as the singer name in the singer name list in a certain music application, the name of the song in the song list, etc. These contents are all content that will change in the currently displayed user interface as the user operates the application.
[0037] In some embodiments, the second interface content may include all static content of all desired user interfaces. Specifically, the static content is the interface content that is preset when the interface of the application program is designed and will not disappear or appear with the change of the current display interface, and will be triggered by voice. It should be noted that the content that will not disappear or appear with the change of the current display interface here refers to the change of the user interface in the same application program, or the change of the user interface in the system interface. The desired user interfaces refer to the user interface of the application program configured by the system when setting up to trigger the response through the visible-to-speak voice recognition method, or the system user interface to trigger the response through the visible-to-speak voice recognition method. That is, the second interface content is the user interface of all or at least part of the application programs that need to be configured to trigger the response through the visible-to-speak function in the overall system, and all the interface content in the system user interface that will not disappear or appear with the change of the current display interface, so as to effectively avoid the need to regenerate and load the second execution file when switching applications, exiting applications and returning to the system interface, etc., and improve the fluency of the overall system when performing visible-to-speak voice interaction. For example, there are setting option buttons, login option buttons, etc. in a music application, and setting option buttons, next page option buttons, previous page option buttons, etc. in the system interface. By setting in this way, combined with the design of the first interface content above, the content in the user interface can be separated into dynamically changing content and static content. By generating a second execution file based on the static content and preloading it in the speech recognition engine, and generating a first execution file based on the dynamic content so that the speech recognition engine dynamically loads the corresponding content, the generalized coverage of the visible, i.e., triggering content of the overall voice interaction system can be effectively improved, and the generalized performance of voice interaction can be improved.
[0038] Figure 2 The method for generating the first execution file in step S101 of the speech recognition method according to one embodiment of the present invention is schematically shown. Figure 2 Specifically, the method for generating the first execution file can be implemented as follows:
[0039] Step S201: loading first interface content obtained from the currently displayed user interface into a preset first grammar file corresponding to the currently displayed user interface and containing a first preset rule;
[0040] Step S202: compile and generate a first execution file according to the first grammar file loaded with the first interface content.
[0041] In step S201, the first grammar file is a file containing preset format content formed according to the first preset rule. Specifically, the xbnf grammar file can be used as the first grammar file. The xbnf grammar file uses ebnf grammar as the basic grammar. The developer edits the file to limit the recognition scope and specify the output semantic item format. Specifically, according to the extension rule included in the first preset rule, the first grammar file can include the relevant content of the pre-mood particles, verbs, and post-mood particles in the first preset rule to supplement the first interface content, and can also include the preset generalized statement content corresponding to the dynamic content in the common user interface. Then, when the first interface content obtained from the currently displayed user interface is loaded in the first grammar file, the first grammar file corresponding to the currently displayed user interface according to the first preset rule can be obtained, which has the generalized first interface content and its corresponding execution action. For example, the first interface content of a certain music application's current display interface that needs to be voice-triggered in response through the visible-and-speakable function is "Kiss Goodbye", and the corresponding action to be executed is "Play the song Kiss Goodbye". At this time, after "Kiss Goodbye" is loaded in the first grammar file, corresponding generalized statements will be obtained, including "Play Kiss Goodbye", "Please Play Kiss Goodbye", "Play Kiss Goodbye", "Andy Lau's Kiss Goodbye", etc., which are generalized according to the first preset rules for "Kiss Goodbye", and the execution actions corresponding to the above-mentioned various generalized statements are all "Play the song Kiss Goodbye".
[0042] In step S202, since the first grammar file loaded with the first interface content in step S201 already contains the generalized statement corresponding to the first interface content, i.e., the corresponding execution action, the first execution file corresponding to the currently displayed user interface can be directly generated according to the first grammar file.
[0043] Figure 3 The method for generating the second execution file in the speech recognition method according to one embodiment of the present invention is schematically shown. Figure 3 Specifically, the method for generating the second execution file can be implemented as follows:
[0044] Step S301: pre-configure and compile to generate a second grammar file including a second preset rule and a second interface content;
[0045] Step S302: compile and generate a second executable file according to the second grammar file.
[0046] In step S301, since the second interface content is pre-configured like the second preset rule, it is the interface content that will not change with the change of the currently displayed user interface, and since the second execution file needs to be pre-generated and loaded into the speech recognition engine, the second grammar file can be compiled and generated directly according to the preset second interface content and the preset second preset rule. The second grammar file is similar to the first grammar file and can be an xbnf grammar file. Therefore, the specific steps of compiling and generating the second grammar file in step S301 can operate the corresponding content in step S201. Similarly, step S203 is similar to step S202, and can also refer to the relevant content in step S202, which will not be repeated here.
[0047] In some other embodiments, the preset conditions described in step S101, in addition to detecting changes in the currently displayed user interface in step S101, may also include any one of the following conditions or a combination of two or more of them: detecting that the voice recognition engine is initialized. When the voice recognition engine is initialized, the voice recognition engine is ready to work, and this is when the first execution file is generated and loaded for the first time; detecting that audio recognition is completed. When the recognition of the audio data to be recognized input by the user is completed, one recognition is completed, and the currently displayed user interface may change; detecting that there is no voice input after a preset time period. When there is still no voice input after the preset time period, it is necessary to promptly regenerate the first execution file for the currently displayed user interface to avoid the situation where the first execution file does not correspond to the currently displayed user interface. The preset time period can be a fixed time length such as 5 seconds or 10 seconds, and the specific setting time can be customized according to actual conditions. Specifically, the above-mentioned audio recognition is completed, which should be understood as including the two situations that the speech recognition engine recognizes that the audio to be recognized contains content that is triggered by the visible and speakable function in the currently displayed user interface and the speech recognition engine does not recognize that the audio to be recognized contains content that is triggered by the visible and speakable function in the currently displayed user interface. In this way, when the speech recognition engine recognizes that the audio to be recognized contains content that triggers the visible and speakable function in the currently displayed user interface, the interface displayed by the current scene may switch, so the first execution file is regenerated at this time, which can timely detect whether the user interface displayed by the current scene has switched, and timely generate the first execution file for the user interface displayed by the current scene after the switch; when the speech recognition engine does not recognize that the audio to be recognized contains content that responds to the visible and speakable function in the currently displayed user interface, the first execution file should also be regenerated to also detect whether the currently displayed user interface has switched, and timely update the first execution file for the currently displayed user interface after the switch, so as to avoid the currently displayed user interface switching due to other operation methods (such as touch, etc.) or the user interface switching method of the system, causing the visible and speakable function to fail. By setting such a configuration, by adding a preset condition, it is possible to avoid the currently displayed user interface from switching due to other operation modes (such as touch, etc.) or the user interface switching mode of the system itself, causing the see-and-speak function to fail. Among them, the detection of the completion of the initialization of the speech recognition engine, the completion of the audio recognition, and the absence of speech input after a preset period of time can be implemented with reference to the relevant existing technology, and the embodiments of the present invention will not be described in detail.
[0048] Figure 4 The present invention schematically shows a speech recognition device according to an embodiment of the present invention, comprising:
[0049] A speech recognition engine 1, configured to recognize received audio to be recognized according to an execution file loaded therein, wherein the execution file includes a first execution file and a second execution file, the second execution file is pre-generated according to the second interface content and the second preset rule and pre-loaded in the initialization stage, and the first execution file is dynamically generated according to the first execution file generation module 2 and dynamically loaded through the first execution file loading module 3;
[0050] A first execution file generating module 2 is configured to dynamically generate a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a first preset rule when a preset condition is met, wherein the preset condition includes detecting a change in the currently displayed user interface;
[0051] The first execution file loading module 3 is configured to restart the speech recognition engine 1 to dynamically load the first execution file, preferably restarting the speech recognition engine after the first execution file is generated.
[0052] In some embodiments, the first interface content includes content in a currently displayed user interface that changes dynamically as the user interface changes; and / or
[0053] The second interface content includes all static content in all desired user interfaces, and the static content is preset during interface design of the corresponding user interface.
[0054] It should be noted that the implementation principle of the speech recognition device of the embodiment of the present invention can be specifically referred to the corresponding description of the above method embodiment, such as the corresponding description of the method for generating the first execution file and the second execution file in the method embodiment, so it will not be repeated here. Exemplarily, the speech recognition device of the embodiment of the present invention can be any intelligent device using an intelligent speech system, including but not limited to computers, smart phones, personal computers, robots, cloud servers, etc.
[0055] Figure 5 A voice interaction device according to an embodiment of the present invention is schematically shown, comprising:
[0056] A first speech recognition module 4, configured to implement the speech recognition method of any one of the above embodiments when executed;
[0057] A second speech recognition module 5, configured to perform any speech wake-up or speech recognition method;
[0058] When receiving the audio to be recognized, the voice interaction device recognizes the audio to be recognized through the first voice recognition module and the second voice recognition module at the same time, and outputs two independent recognition results.
[0059] Specifically, when the second voice recognition module executes any voice wake-up or voice recognition method, it can execute an existing method different from the voice recognition method of the present invention, such as a see-and-speak method based on a wake-up engine trigger, or a traditional voice recognition method using a single fixed recognition resource file, etc. The embodiment of the present invention does not limit this. The embodiment of the present invention sets a two-way recognition mode, and sets one of the recognition modes to the architecture of the two-way recognition resource file mentioned in the embodiment of the present invention to achieve dynamic acquisition and dynamic loading and updating of recognition resources, thereby ensuring effective realization of see-and-speak voice interaction. The recognition resources of the embodiment of the present invention are generalized recognition resources, so the voice recognition coverage is wider, and it can better reflect the user's interaction habits, and the user experience is better.
[0060] It should be noted that the voice interaction device in the embodiment of the present invention can be an intelligent voice device or computer, smart phone, personal computer, robot, cloud server installed in any car. The specific implementation process and implementation principle of the see-and-speak function involved in the embodiment of the present invention can be found in the corresponding description of the above method embodiment, which will not be repeated here.
[0061] In some embodiments, an embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the speech recognition method of any of the above embodiments of the present invention.
[0062] In some embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the speech recognition method of any one of the above embodiments.
[0063] In some embodiments, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the speech recognition method of any of the above embodiments.
[0064] In some embodiments, an embodiment of the present invention further provides a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the speech recognition method of any of the above embodiments.
[0065] Figure 6 is a schematic diagram of the hardware structure of an electronic device for executing a speech recognition method provided by another embodiment of the present application, such as Figure 6 As shown, the device includes:
[0066] One or more processors 610 and memory 620, Figure 6 A processor 630 is taken as an example.
[0067] The device for executing the speech recognition method may further include: an input device 33 and an output device 640 .
[0068] The processor 610, the memory 620, the input device 630 and the output device 640 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0069] The memory 620 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the speech recognition method in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, the speech recognition method of the above method embodiment is implemented.
[0070] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the speech recognition method, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0071] The input device 630 may receive input digital or character information and generate signals related to user settings and function control of the image processing device. The output device 640 may include a display device such as a display screen.
[0072] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, the speech recognition method in any of the above method embodiments is executed.
[0073] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0074] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0075] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0076] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0077] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0078] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0079] (5) Other electronic devices with data interaction functions.
[0080] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A speech recognition method, characterized in that: include: When a preset condition is met, a first execution file associated with the currently displayed user interface is dynamically generated according to the first interface content in the currently displayed user interface and a preset first preset rule, wherein the preset condition includes detecting a change in the currently displayed user interface; the speech recognition engine recognizes the received audio to be recognized by loading the execution file; Restart the speech recognition engine to dynamically load the first execution file, wherein the speech recognition engine is loaded with a second execution file, and the second execution file is pre-generated and loaded into the speech recognition engine according to a preset second interface content and a second preset rule; when the speech recognition engine dynamically loads the first execution file, it executes an execution action corresponding to the content of the currently displayed user interface according to the audio to be recognized input by the user.
2. The method according to claim 1, characterized in that The first interface content includes content in the currently displayed user interface that changes dynamically as the user interface changes.
3. The method according to claim 1, characterized in that The second interface content includes all static content in all desired user interfaces, and the static content is preset during interface design of the corresponding user interface.
4. The method according to claim 1, characterized in that: The method of dynamically generating a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a preset first preset rule includes: Loading the first interface content obtained from the currently displayed user interface into a preset first grammar file corresponding to the currently displayed user interface and containing a first preset rule; A first execution file is generated by compiling the first grammar file loaded with the first interface content.
5. The method according to claim 1, characterized in that The method for generating the second execution file includes: Preconfigure and compile to generate a second grammar file containing second preset rules and second interface content; A second executable file is generated by compiling the second grammar file.
6. The method according to claim 1, characterized in that The preset conditions also include detecting that the speech recognition engine is initialized, detecting that the audio recognition is completed, and detecting that there is no speech input after a preset period of time.
7. A speech recognition device, characterized in that include: A speech recognition engine, configured to recognize received audio to be recognized according to an execution file loaded therein, wherein the execution file includes a first execution file and a second execution file, the second execution file is pre-generated according to the second interface content and the second preset rule and pre-loaded in an initialization phase, and the first execution file is dynamically generated according to a first execution file generation module and dynamically loaded through a first execution file loading module; A first execution file generating module is configured to dynamically generate a first execution file associated with the currently displayed user interface according to the first interface content in the currently displayed user interface and a first preset rule when a preset condition is met, wherein the preset condition includes detecting a change in the currently displayed user interface; The first execution file loading module is configured to restart the speech recognition engine to dynamically load the first execution file; when the speech recognition engine dynamically loads the first execution file, it executes an execution action corresponding to the content of the currently displayed user interface according to the audio to be recognized input by the user.
8. The device according to claim 7, characterized in that The first interface content includes content in the currently displayed user interface that changes dynamically as the user interface changes; and / or The second interface content includes all static content in all desired user interfaces, and the static content is preset during interface design of the corresponding user interface.
9. A voice interaction device, characterized in that: The invention comprises a first voice recognition module and a second voice recognition module. When the voice interaction device receives the audio to be recognized, the audio to be recognized is recognized by the first voice recognition module and the second voice recognition module at the same time, and two independent recognition results are output. When the first voice recognition module is executed, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
