Voice control method, electronic device and storage medium

文档序号:193345 发布日期:2021-11-02 浏览:34次 中文

阅读说明:本技术 语音控制方法、电子设备及存储介质 (Voice control method, electronic device and storage medium ) 是由 张宝宁 刘华东 梁石杨 于 2021-07-30 设计创作,主要内容包括:本发明公开一种语音控制方法、电子设备及存储介质,方法包括:启动语音适配服务和语音识别应用;当语音识别应用检测到声音输入,对所述声音输入进行语音识别得到语音指令;所述语音识别应用对所述语音指令进行判断,如果所述语音指令为控制指令,则所述语音识别应用将所述控制指令发送到语音适配服务;所述语音适配服务查找所述控制指令对应的执行应用作为指令执行应用;所述语音适配服务将所述控制指令发送到所述指令执行应用,所述指令执行应用执行所述控制指令所指示的操作。本发明取消第三方应用对语音Jar包或语音识别应用对控制jar包的依赖,使得第三方应用实现语音控制无需集成定制语音jar包或控制jar包。(The invention discloses a voice control method, electronic equipment and a storage medium, wherein the method comprises the following steps: starting a voice adaptation service and a voice recognition application; when voice recognition application detects voice input, performing voice recognition on the voice input to obtain a voice command; the voice recognition application judges the voice instruction, and if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service; the voice adaptation service searches an execution application corresponding to the control instruction as an instruction execution application; the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction. The method and the device eliminate the dependence of the third-party application on the voice Jar package or the control Jar package of the voice recognition application, so that the third-party application realizes the voice control without integrating and customizing the voice Jar package or the control Jar package.)

1. A voice control method, comprising:

starting a voice adaptation service and a voice recognition application;

when voice recognition application detects voice input, performing voice recognition on the voice input to obtain a voice command;

the voice recognition application judges the voice instruction, and if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service;

the voice adaptation service searches an execution application corresponding to the control instruction as an instruction execution application;

the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction.

2. The voice control method according to claim 1, characterized in that:

the starting of the voice adaptation service and the voice recognition application specifically includes: starting voice adaptation service and voice recognition application, wherein the voice adaptation service and the voice recognition application acquire voice customization requirements from a server, and the voice customization requirements are uploaded to the server by one or more execution applications;

the voice recognition application judges the control instruction, and specifically includes: the voice recognition application determines the voice instruction based on the voice customization needs.

3. The voice control method according to claim 2, characterized in that:

the sending, by the speech recognition application, the control instruction to a speech adaptation service specifically includes:

the voice recognition application determines an execution application corresponding to the control instruction based on the voice customization requirement, sets an execution application identifier corresponding to the control instruction in a preset field of the control instruction, and sends the control instruction to a voice adaptation service;

the searching, by the speech adaptation service, of the execution application corresponding to the control instruction as an instruction execution application specifically includes:

and the voice adaptation service reads an execution application identifier of a preset field in the control instruction, and determines that the execution application corresponding to the execution application identifier is the instruction execution application corresponding to the control instruction.

4. The voice control method according to claim 2, wherein the voice adaptation service sends the control instruction to the instruction execution application, specifically comprising:

the voice adaptation service searches the execution application corresponding to the control instruction from the voice customization requirement;

if the control instruction corresponds to an execution application, taking the execution application corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application;

and if the control instruction corresponds to a plurality of execution applications, taking the execution application with the highest priority in the execution applications corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application.

5. The voice control method according to claim 1, wherein the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, specifically including:

if the instruction execution application is started, the voice adaptation service sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application;

and the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

6. The voice control method according to claim 1, wherein the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, specifically including:

if the execution application is not started, the voice adaptation service judges whether the control instruction is a starting instruction, if so, the voice adaptation service calls a starting interface of the instruction execution application, and otherwise, the voice adaptation service discards the control instruction.

7. The voice control method according to claim 1, wherein the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, specifically including:

if the execution application is not started, the voice adaptation service judges whether the control instruction is a starting instruction;

if the command is a starting command, calling a starting interface of the command execution application to start the command execution application, otherwise, calling the starting interface of the command execution application to start the command execution application

The voice adaptation service calls a starting interface of the instruction execution application, and sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application after detecting that the instruction execution application is started, and the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

8. The speech control method according to any one of claims 1 to 7, wherein the speech recognition application determines the speech instruction, and if the speech instruction is a control instruction, the speech recognition application sends the control instruction to a speech adaptation service, specifically comprising:

the voice recognition application judges the voice instruction, if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service, otherwise, the voice recognition application judges whether the voice instruction is an instruction which can be executed by the voice recognition application;

and if the voice instruction is an instruction which can be executed by the voice recognition application, the voice recognition application executes the voice instruction.

9. An electronic device, comprising:

at least one processor; and the number of the first and second groups,

a memory communicatively coupled to at least one of the processors; wherein the content of the first and second substances,

the memory stores instructions executable by at least one of the processors to enable the at least one processor to perform a speech control method according to any one of claims 1 to 8.

10. A storage medium storing computer instructions for performing all the steps of the voice control method according to any one of claims 1 to 8 when the computer instructions are executed by a computer.

Technical Field

The present invention relates to the field of automotive technologies, and in particular, to a voice control method, an electronic device, and a storage medium.

Background

The existing software (App) has the following two schemes:

as shown in fig. 1, scheme 1: the third party application 11 ', 12' puts forward self-customized voice customization requirements to a voice recognition application developer, the voice developer customizes and develops an application 11 'voice jar package and an application 12' voice jar package corresponding to different applications according to the requirements, and the third party integrates the voice jar to realize a voice control function.

During operation, the third-party applications 11 ' and 12 ' integrate the voice jar packages, the voice recognition application 13 ' issues the control instruction to the third-party applications 11 ' and 12 ' through jar, and the applications 11 ' and 12 ' actively execute corresponding actions.

Scheme 2: the third party application 11 ', 12' puts forward the customized voice customization requirement to the voice recognition application developer, the third party application provides a voice control function jar package to the voice application, and the voice application integrates the third party jar to realize the voice control function.

During operation, the voice recognition application 13 ' integrates the third-party application jar package, when the voice recognition application recognizes the control instruction, the method of the third-party application jar is called, and the third-party applications 11 ' and 12 ' passively execute actions.

However, the two existing solutions face the following problems:

1. the third party application or the voice recognition application needs to integrate the jar package of the other party to realize the voice control function.

2. Third party applications or voice recognition applications need to integrate a jar package customized by a voice control function, and have no general jar.

3. When the voice control protocol is updated (voice provider change + voice provider platform protocol update), all jar packets need to be updated.

Therefore, when the existing voice control function is implemented on the third-party software, due to the fact that the coupling of the voice control function and the third-party software is too high, only the customized voice control function can be implemented, once any one of the voice control function and the third-party software needs to be changed, the two aspects are changed together, and the updating cost of the software is too high.

Disclosure of Invention

In view of the above, it is necessary to provide a voice control method, an electronic device, and a storage medium for solving the technical problem caused by too high coupling when the voice control function is implemented on third-party software in the prior art.

The invention provides a voice control method, which comprises the following steps:

starting a voice adaptation service and a voice recognition application;

when voice recognition application detects voice input, performing voice recognition on the voice input to obtain a voice command;

the voice recognition application judges the voice instruction, and if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service;

the voice adaptation service searches an execution application corresponding to the control instruction as an instruction execution application;

the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction.

Further:

the starting of the voice adaptation service and the voice recognition application specifically includes: starting voice adaptation service and voice recognition application, wherein the voice adaptation service and the voice recognition application acquire voice customization requirements from a server, and the voice customization requirements are uploaded to the server by one or more execution applications;

the voice recognition application judges the control instruction, and specifically includes: the voice recognition application determines the voice instruction based on the voice customization needs.

Further:

the sending, by the speech recognition application, the control instruction to a speech adaptation service specifically includes:

the voice recognition application determines an execution application corresponding to the control instruction based on the voice customization requirement, sets an execution application identifier corresponding to the control instruction in a preset field of the control instruction, and sends the control instruction to a voice adaptation service;

the searching, by the speech adaptation service, of the execution application corresponding to the control instruction as an instruction execution application specifically includes:

and the voice adaptation service reads an execution application identifier of a preset field in the control instruction, and determines that the execution application corresponding to the execution application identifier is the instruction execution application corresponding to the control instruction.

Further, the sending, by the voice adaptation service, the control instruction to the instruction execution application specifically includes:

the voice adaptation service searches the execution application corresponding to the control instruction from the voice customization requirement;

if the control instruction corresponds to an execution application, taking the execution application corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application;

and if the control instruction corresponds to a plurality of execution applications, taking the execution application with the highest priority in the execution applications corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application.

Further, the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, including:

if the instruction execution application is started, the voice adaptation service sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application;

and the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

Further, the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, including:

if the execution application is not started, the voice adaptation service judges whether the control instruction is a starting instruction, if so, the voice adaptation service calls a starting interface of the instruction execution application, and otherwise, the voice adaptation service discards the control instruction.

Further, the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, including:

if the execution application is not started, the voice adaptation service judges whether the control instruction is a starting instruction;

if the command is a starting command, calling a starting interface of the command execution application to start the command execution application, otherwise, calling the starting interface of the command execution application to start the command execution application

The voice adaptation service calls a starting interface of the instruction execution application, and sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application after detecting that the instruction execution application is started, and the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

Still further, the determining, by the speech recognition application, the speech instruction, and if the speech instruction is a control instruction, sending, by the speech recognition application, the control instruction to a speech adaptation service specifically include:

the voice recognition application judges the voice instruction, if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service, otherwise, the voice recognition application judges whether the voice instruction is an instruction which can be executed by the voice recognition application;

and if the voice instruction is an instruction which can be executed by the voice recognition application, the voice recognition application executes the voice instruction.

The present invention provides an electronic device, including:

at least one processor; and the number of the first and second groups,

a memory communicatively coupled to at least one of the processors; wherein the content of the first and second substances,

the memory stores instructions executable by at least one of the processors to enable the at least one of the processors to perform a voice control method as previously described.

The present invention provides a storage medium storing computer instructions for performing all the steps of the voice control method as described above when the computer executes the computer instructions.

The method and the device eliminate the dependence of the third-party application on the voice Jar package or the control Jar package of the voice recognition application, so that the third-party application realizes the voice control without integrating and customizing the voice Jar package or the control Jar package. By reducing the coupling degree of the third-party application and the voice recognition application, after the voice control protocol is changed, only the voice adaptation service is required to be updated, and the third-party application is not required to be changed. And finally, reducing the voice control difficulty, and using an optimized voice control mode according to the definition of each application function module.

Drawings

FIG. 1 is a schematic diagram of a voice control implementation method in the prior art;

FIG. 2 is a schematic diagram of another speech control implementation of the prior art;

FIG. 3 is a flowchart illustrating a voice control method according to the present invention;

FIG. 4 is a flowchart illustrating a voice control method according to an embodiment of the present invention;

FIG. 5 is a flowchart illustrating a voice recognition method of a mobile terminal according to a preferred embodiment of the present invention;

FIG. 6 is a flowchart of the instruction checking operation in accordance with the preferred embodiment of the present invention;

FIG. 7 is a flowchart of the voice command interface invocation of the preferred embodiment of the present invention;

FIG. 8 is a system schematic of a preferred embodiment of the present invention;

fig. 9 is a schematic diagram of a hardware structure of an electronic device according to the present invention.

Detailed Description

The invention is described in further detail below with reference to the figures and specific examples.

Example one

Fig. 3 is a flowchart illustrating a voice control method according to the present invention, which includes:

step S301, starting a voice adaptation service and a voice recognition application;

step S302, when the voice recognition application detects voice input, performing voice recognition on the voice input to obtain a voice command;

step S303, the voice recognition application judges the voice command, and if the voice command is a control command, the voice recognition application sends the control command to a voice adaptation service;

step S304, the voice adaptation service searches the executive application corresponding to the control instruction as an instruction executive application;

step S305, the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction.

In particular, the invention can be applied to mobile terminals. The mobile terminal includes but is not limited to a car terminal or a mobile phone terminal. In particular terminals using the android system. And configuring voice adaptation service and voice recognition application in the mobile terminal system. When the mobile terminal is started, step S301 is executed to start the voice adaptation service and the voice recognition application.

Step S302 is then performed by the speech recognition application, detecting the voice input, and performing speech recognition on the voice input. The obtained control command is recognized, step S303 is executed, the voice recognition application performs judgment, and the control command judged as the control command is sent to the voice adaptation service. Step S304 and step S305 are executed by the voice adaptation service, and the control instruction is searched and sent to the corresponding execution application.

A plurality of executing applications, i.e., third-party applications, are installed in the mobile terminal. Through the method, one voice recognition application carries out voice input recognition, then the voice adaptation service installed in the mobile terminal system distributes the recognized control instruction to the corresponding execution application, and the execution application executes the corresponding instruction. Therefore, the voice recognition application and the execution application are completely decoupled, and after the voice control protocol is changed, only the voice adaptation service is updated, and the execution application is not required to be changed.

The method and the device eliminate the dependence of the third-party application on the voice Jar package or the control Jar package of the voice recognition application, so that the third-party application realizes the voice control without integrating and customizing the voice Jar package or the control Jar package. By reducing the coupling degree of the third-party application and the voice recognition application, after the voice control protocol is changed, only the voice adaptation service is required to be updated, and the third-party application is not required to be changed. And finally, reducing the voice control difficulty, and using an optimized voice control mode according to the definition of each application function module.

Example two

Fig. 4 is a flowchart illustrating a voice control method according to an embodiment of the present invention, including:

step S401, starting a voice adaptation service and a voice recognition application, wherein the voice adaptation service and the voice recognition application acquire a voice customization requirement from a server, and the voice customization requirement is uploaded to the server by one or more execution applications;

step S402, when the voice recognition application detects voice input, performing voice recognition on the voice input to obtain a voice command;

step S403, the voice recognition application judges the voice instruction based on the voice customization requirement, if the voice instruction is a control instruction, the voice recognition application sends the control instruction to a voice adaptation service, and step S404 is executed, otherwise, whether the voice instruction is an instruction which can be executed by the voice recognition application is judged, and if the voice instruction is an instruction which can be executed by the voice recognition application, the voice recognition application executes the voice instruction;

step S404, the voice recognition application determines an execution application corresponding to the control instruction based on the voice customization requirement, sets an execution application identifier corresponding to the control instruction in a preset field of the control instruction, and sends the control instruction to a voice adaptation service;

step S405, the voice adaptation service reads an execution application identifier of a preset field in the control instruction, and determines that the execution application corresponding to the execution application identifier is an instruction execution application corresponding to the control instruction;

step S406, if the instruction execution application is started, the voice adaptation service sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application;

step S407, the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction;

step S408, if the execution application is not started, the voice adaptation service judges whether the control instruction is a start instruction, if so, the start interface of the instruction execution application is called, otherwise, the control instruction is discarded.

In one embodiment, the voice adaptation service sends the control instruction to the instruction execution application, and the instruction execution application executes the operation indicated by the control instruction, specifically including:

if the execution application is not started, the voice adaptation service judges whether the control instruction is a starting instruction;

if the command is a starting command, calling a starting interface of the command execution application to start the command execution application, otherwise, calling the starting interface of the command execution application to start the command execution application

The voice adaptation service calls a starting interface of the instruction execution application, and sends the control instruction to a monitoring voice adaptation service interface of the instruction execution application after detecting that the instruction execution application is started, and the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

Specifically, one or more executing applications upload voice customization requirements to a server, and a plurality of voice customization requirements may form a voice control configuration file. The voice control configuration file can adopt an xml format, and a richer data format is realized. The voice control configuration file content comprises the name of the execution application and the control instruction contained in the execution application. The control instruction is a voice control instruction.

When the mobile terminal is started, step S401 is triggered to be executed, and the voice customization requirement is downloaded from the server while the voice adaptation service and the voice recognition application are started. Step S402 is then performed by the speech recognition application, detecting the sound input, and performing speech recognition on the sound input. In the voice customization requirement, the execution application provides the control instruction supported by the execution application, for example, the control instruction that the music application can support is "play", "next", "pause", and the like. In step S403, the voice recognition application determines the voice command based on the voice customization requirement. If the control command is recognized, it is sent to the voice adaptation service, and step S404 is executed. If the voice command is a non-control command, judging whether the voice command is a command which can be executed by the voice recognition application, and if the voice command is a command which can be executed by the voice recognition application, executing the voice command by the voice recognition application. For example, for a general query instruction, a background query display may be performed by the speech recognition application, and for other speech instructions, the background query display may be discarded, and the following prompt may be broadcasted: "not yet available".

Because the control instruction supported by each execution application is defined in the voice customization requirement, after the voice recognition application recognizes the voice instruction as the control instruction, the execution application corresponding to the control instruction can be determined. Therefore, in step S404, the speech recognition application determines an execution application corresponding to the control instruction based on the speech customization requirement, sets an execution application identifier corresponding to the control instruction in a preset field of the control instruction, and sends the control instruction to the speech adaptation service. The execution application identification may be an application identification of the execution application, such as an app id, or an application name of the execution application. The voice recognition application writes the execution application identification into a preset field of the control instruction, for example, into a focus field.

The voice adaptation service executes step S405, which reads an execution application identifier from a preset field of the control instruction, for example, a focus field, and by using the execution application identifier, the voice adaptation service can determine that the execution application corresponding to the received control instruction is an instruction execution application.

When the mobile terminal is started, part of important applications are started simultaneously. While another part of the application is started by the user. Thus, the control instructions are sent to the instruction execution application, which may or may not have been launched. If the instruction execution Application is already started, step S408 is triggered, and when the execution Application is started, the execution Application registers its monitoring voice adaptation service Interface in the system, so that the voice adaptation service sends the control instruction to the monitoring voice adaptation service Interface (API) of the instruction execution Application, and the instruction execution Application executes step S409 to perform corresponding operations.

If the instruction execution application is not started, step S410 is triggered, first, whether the control instruction is a start instruction is determined, and if the control instruction is the start instruction, a start interface of the instruction execution application is called, where the start interface is reserved in the system in advance when the execution application is installed in the system. And starting the instruction execution application by calling the starting interface. And if the instruction is not a start instruction, the instruction is an internal instruction for executing the application, and the internal instruction is discarded at the moment.

In another embodiment, if the instruction execution application is not launched, a launch interface of the instruction execution application may be called by the voice adaptation service to launch the instruction execution application. For a start instruction, only the instruction execution application needs to be started, for a non-start instruction, after the instruction execution application is started, a monitoring voice adaptation service interface is registered in the system, the voice adaptation service sends the control instruction to the monitoring voice adaptation service interface of the instruction execution application, and then the instruction execution application responds to the control instruction and executes the operation indicated by the control instruction.

The method and the device eliminate the dependence of the third-party application on the voice Jar package or the control Jar package of the voice recognition application, so that the third-party application realizes the voice control without integrating and customizing the voice Jar package or the control Jar package. By reducing the coupling degree of the third-party application and the voice recognition application, after the voice control protocol is changed, only the voice adaptation service is required to be updated, and the third-party application is not required to be changed. And finally, reducing the voice control difficulty, and using an optimized voice control mode according to the definition of each application function module. Meanwhile, in the embodiment, the third-party application can send the voice customization requirement to the server, and the voice adaptation service and the voice recognition application acquire the voice customization requirement from the server, so that the third-party application can conveniently and rapidly increase the voice recognition function. And finally, aiming at whether the third-party application is started or not, different logics are adopted for realizing, and more working scenes are covered.

In one embodiment, the sending, by the voice adaptation service, the control instruction to the instruction execution application specifically includes:

the voice adaptation service searches the execution application corresponding to the control instruction from the voice customization requirement;

if the control instruction corresponds to an execution application, taking the execution application corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application;

and if the control instruction corresponds to a plurality of execution applications, taking the execution application with the highest priority in the execution applications corresponding to the control instruction as an instruction execution application, and sending the control instruction to the instruction execution application.

In this embodiment, the voice adaptation service determines which application is executed by the control command. The focus field is a padding field for speech recognition applications.

Among the instructions of each App, there are unique instructions of its own, and there are also instructions common among a plurality of applications. The control commands such as "pause", "play", "collect", etc. are common commands for applications such as music, video, listening to books, KTV, etc. Unique instructions are well distinguished, and the corresponding relation is very clear. Therefore, it can be determined by the speech recognition application and fill the corresponding application ID information in the issued focus field.

However, for a common instruction, the instruction needs to be sent to an application in the foreground, but the application state information of the application in the foreground or the background is only known by the voice adaptation service of the system application, and the voice recognition application cannot know the information, so that the issuing objects of the common instruction are determined by the voice adaptation service, and the id information of the app does not need to be attached to the control instruction issued by the semantic recognition application.

For example, a navigation instruction, which must be issued to the navigation, is attached to the issue field with id of the navigation application. The instructions of opening the air conditioner, the skylight and the like are necessarily sent to the vehicle body service application. These instructions may also be accompanied by id of the body service application.

However, the instructions of last, next, play, pause, etc. do not accompany the id information of the app.

Therefore, in this embodiment, the speech recognition service searches the execution application corresponding to the control instruction from the speech customization requirement, and selects one execution application as the instruction execution application according to the priority. Wherein the priority of executing the application located in the foreground is highest. The priority of the common application is higher than the priority of the extraordinary application. The specific priority may be set by the system or by the user.

Fig. 5 is a flowchart illustrating a voice recognition method of a mobile terminal according to a preferred embodiment of the present invention, which includes:

step S501, starting a voice adaptation service on a mobile terminal system platform, and starting a mobile terminal voice recognition application at the same time;

step S502, the voice adaptation service inquires whether the voice control instruction is updated, if so, the voice adaptation service sends a request for acquiring a configuration file, acquires the voice control configuration file from the cloud and executes step S503, otherwise, the voice adaptation service directly executes step S503;

step S503, the voice adaptation service is started and finished, and waits for receiving a control instruction;

step S504, the voice recognition application inquires whether the voice control instruction is updated, if so, a request for obtaining a configuration file is sent out, the voice control configuration file is obtained from the cloud, and step S505 is executed, otherwise, the step S505 is directly executed;

step S505, completing the starting of the voice recognition application;

step S506, the voice recognition application carries out voice recognition on the voice input;

step S507, if the voice recognition application judges the input voice to be a control instruction, the voice recognition application sends the voice to a voice adaptation service, the voice adaptation service is issued, and step S509 is triggered, otherwise, step S508 is executed;

step S508, determine whether it is a general query instruction, if yes, then query and display through the speech recognition application background, otherwise, broadcast by voice: "not yet present", end.

Step S509, the voice adaptation service performs instruction verification on the received control instruction, if the instruction verification passes, step S510 is executed, otherwise, if the instruction verification fails, the control instruction is discarded, and the process is ended;

step S510, issuing a voice adaptation service execution instruction, if the third party application is not started, executing step S511, and if the third party application is started, executing step S512;

step S511, the voice adaptation service judges whether the control instruction is a start instruction, if the control instruction is the start instruction, the start API provided by the third party application is called, otherwise, the control instruction is discarded;

step S512, the voice adaptation service sends the control instruction to the monitoring voice adaptation service API of the third party application, and the third party application executes the control instruction.

Specifically, the present embodiment presets a voice adaptation service in the car machine system, and the service provides a voice control interface to the outside. The third party application uploads the voice customization requirement to the cloud, and the voice adaptation service and the voice recognition application acquire the voice control range through the cloud configuration file.

Fig. 8 is a schematic diagram of a system according to a preferred embodiment of the present invention, in which a speech recognition application 81 and third-party applications 82 and 83 invoke an application interface provided by a speech adaptation service 84 to implement sending and receiving of speech data. The voice recognition application 81 calls the interface to issue a voice command to obtain a voice execution result, and the third-party application 82 calls the interface to obtain a voice control command to feed back the execution result.

FIG. 6 is a flowchart of the instruction checking operation according to the preferred embodiment of the present invention, which includes:

step S601, inputting voice information into the voice recognition application 61, issuing the analysis result of the voice recognition application 61, and issuing the analysis result to the voice adaptation service 62 through an application interface;

step S602, the voice adaptation service 62 obtains a voice instruction;

step S603, reading a focus field in the voice command;

step S604, inquiring an application name corresponding to the focus field;

step S605, inquiring validity of the command from the configuration form;

step S606, the IBinder objects of the execution applications 63 and 64 are called, and the analysis result is issued to the custom information interfaces of the execution applications 63 and 64 through the application interfaces;

step S607, the execution applications 63 and 64 return the status to the speech adaptation service 62 through the application interface, and the speech adaptation service 62 obtains the feedback of the IBinder object of the execution applications 63 and 64;

step S608, reading information of the execution applications 63, 64;

step S609, saving the information of the execution applications 63, 64, and synchronously executing the information of the applications 63, 64;

in step S610, the speech adaptation service 62 uploads information of the execution applications 63, 64 from the application interface to the speech recognition application 61.

Fig. 7 is a flowchart of the voice command interface call according to the preferred embodiment of the present invention, which includes:

step S701, the speech recognition application 71 sends the speech recognition result to the speech adaptation service of the system 72 through the customized interface set;

step S702, the voice adaptation service carries out system analysis;

step S703, a semantic instruction dispatch, which dispatches the instruction to the execution application 73, the execution application 74, or the execution application 75;

step S704, the execution application parses and executes the instruction, and sends execution feedback back to the voice adaptation service of the system 72;

step S705, the voice adaptation service of the system 72 forwards the feedback to the voice recognition application 71;

in step S706, the speech recognition application 71 broadcasts the received feedback.

EXAMPLE six

Fig. 9 is a schematic diagram of a hardware structure of an electronic device according to the present invention, which includes:

at least one processor 901; and the number of the first and second groups,

a memory 902 communicatively coupled to at least one of the processors 901; wherein the content of the first and second substances,

the memory 902 stores instructions executable by at least one of the processors to enable the at least one of the processors to perform a voice control method as previously described.

Fig. 9 illustrates an example of a processor 901.

The electronic device is preferably a mobile terminal, including but not limited to a car terminal or a mobile phone terminal. The electronic device may further include: an input device 903 and a display device 904.

The processor 901, the memory 902, the input device 903, and the display device 904 may be connected by a bus or other means, and are illustrated as being connected by a bus.

The memory 902, which is a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the voice control method in the embodiment of the present application, for example, the method flow shown in fig. 1. The processor 901 executes various functional applications and data processing, i.e., implements the voice control method in the above-described embodiments, by executing nonvolatile software programs, instructions, and modules stored in the memory 902.

The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the voice control method, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 902 may optionally include memory located remotely from the processor 901, which may be connected via a network to a device that performs voice control methods. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input device 903 may receive an input of a user click and generate signal inputs related to user settings of a voice control method and function control. The display device 904 may include a display screen or the like.

When the one or more modules are stored in the memory 902, and when executed by the one or more processors 901, perform the voice control method in any of the above-described method embodiments.

The method and the device eliminate the dependence of the third-party application on the voice Jar package or the control Jar package of the voice recognition application, so that the third-party application realizes the voice control without integrating and customizing the voice Jar package or the control Jar package. By reducing the coupling degree of the third-party application and the voice recognition application, after the voice control protocol is changed, only the voice adaptation service is required to be updated, and the third-party application is not required to be changed. And finally, reducing the voice control difficulty, and using an optimized voice control mode according to the definition of each application function module.

An embodiment of the present invention provides a storage medium storing computer instructions for performing all the steps of the voice control method as described above when the computer executes the computer instructions.

The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:语音处理方法、遥控器及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!