Universal voice command distribution method, electronic device, and computer-readable storage medium

By defining entity class interfaces and a unified parameter VoiceBeanImpl, the problem of increased R&D costs caused by differences in APIs of different voice engines is solved, enabling flexible access and efficient processing of voice commands.

CN119091907BActive Publication Date: 2026-04-14BEIJING MINGTUO HENGXIN TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The differences in APIs between different voice engines mean that vehicle development teams need to redevelop command processing when changing voice engines, increasing development costs.

Method used

Define an entity class and use it as an interface. Transform and match semantic callback instructions through the unified parameter VoiceBeanImpl, and use dynamic proxies to achieve unified processing for different speech engines.

Benefits of technology

This allows for flexible integration with new engines without altering the vehicle command processing logic, reducing R&D costs and improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091907B_ABST
    Figure CN119091907B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of voice instructions, and specifically discloses a general voice instruction distribution method, an electronic device and a storage medium. The method of the application realizes the API by accessing a voice engine, converts returned semantic callback instructions into unified entity classes, defines two parameter variables, inputs the unified parameters into a semantic executor interface, instantiates the semantic executor interface through dynamic proxy, and the semantic executor interface obtains the callback interface modified by annotation, the semantic callback instruction method and the unified parameters of the semantic callback instruction method through reflection. The parameter variables in the unified parameters are matched with the callback interface modified by annotation and the parameters of the annotation, and it is judged whether to execute. If it is judged to be callback, the callback semantic instruction is executed. Otherwise, it is prompted that the command is not supported. When the voice engine is replaced, the new engine API can be flexibly accessed, the voice instructions of different voice engines are distributed and processed, and the research and development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of voice command technology, specifically relating to a general voice command distribution method, electronic device, and computer-readable storage medium. Background Technology

[0002] With the development of vehicle technology, more and more vehicles are equipped with in-vehicle terminals, allowing users to interact with the vehicle while driving. For a better driving experience, voice control has become an essential option, the proportion of voice interaction is increasing daily, and various voice engines are also proliferating.

[0003] Each speech recognition engine has its own set of APIs, or Application Programming Interfaces, resulting in different semantic formats and methods returned after speech recognition by each engine. When developing subsequent functions, vehicle R&D teams can only execute corresponding instructions based on the APIs provided by the vehicle itself. That is, they can only perform subsequent development based on the semantic formats and methods returned by the APIs. This relatively tight coupling means that if a speech engine is changed, a different set of instructions needs to be executed based on the API of the changed speech engine, increasing R&D costs. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention aims to provide a universal voice command distribution method.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A general voice command distribution method, the method comprising the following steps performed sequentially:

[0007] S1. Define entity classes and define entity classes as interfaces;

[0008] Define all the parameter variables required by all semantic callback directives within the entity class, including the parameter variable 'domain' used to determine the type of the semantic callback directive and the parameter variable 'action' used to determine the method of the semantic callback directive;

[0009] S2. All semantic callback directives are categorized and defined in the form of interfaces to obtain the types of all semantic callback directives, that is, to obtain all callback interfaces and the semantic callback directive methods contained in each callback interface; all the callback interfaces are inherited by entity classes and finally implemented as a unified parameter VoiceBeanImpl, which is used as a unified parameter to be passed to the semantic callback directive methods.

[0010] Define the VoiceArea annotation to decorate the callback interface; define the CallBackMethod annotation to decorate the semantic callback instruction method, and define the ActionName parameter to determine the semantic callback instruction method to be executed;

[0011] Define a semantic executor interface, which is inherited by the callback interface;

[0012] S3. Integrate with the voice engine to implement the voice engine API, convert the returned semantic callback instructions into a unified entity class, and assign values ​​to the parameter variables domain and action according to the type of the semantic callback instructions. The unified parameter VoiceBeanImpl is passed to the semantic executor interface.

[0013] S4. Instantiate the semantic executor interface through dynamic proxy;

[0014] S5. The instantiated semantic executor interface obtains the annotation-decorated callback interface, semantic callback instruction method, and the unified parameter VoiceBeanImpl of the semantic callback instruction method through reflection.

[0015] S6. Match the domain and action parameters in the unified parameter VoiceBeanImpl with the actionName parameter of the callback interface annotated with VoiceArea and the CallBackMethod annotation. The unified parameter VoiceBeanImpl returns a boolean value to determine whether to execute the semantic callback. If it is determined to be a callback, continue to execute the matched callback semantic instruction; otherwise, prompt that this command is not supported.

[0016] As a limitation, the unified parameter VoiceBeanImpl is passed into the semantic callback instruction method that requires parameters, and the unified parameter VoiceBeanImpl is received by the external application that processes the semantic callback instruction.

[0017] As a second limitation, the entity class, all callback interfaces, and semantic executor interfaces all exist in the form of a backend service.

[0018] As a third limitation, the specific process of instantiating the semantic executor interface through dynamic proxy in step S4 is as follows:

[0019] Obtain callback instances from the semantic execution project via AIDL;

[0020] The semantic executor interface is instantiated through a dynamic proxy, and then the obtained callback instance is passed to the semantic executor interface.

[0021] As a fourth limitation, the semantic execution project includes pre-registered semantic execution instructions for the vehicle cockpit, map navigation, music and multimedia applications, system settings, and air conditioning.

[0022] Another object of the present invention is to provide an electronic device including a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of a general voice command distribution method.

[0023] Another object of the present invention is to provide a storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of a general voice command distribution method.

[0024] By adopting the above-described technical solution, the beneficial effects achieved by this invention compared to the prior art are as follows:

[0025] (1) The method of the present invention converts the semantics returned by different speech engines into a unified entity class, and assigns values ​​to the parameter variables used to determine the type of semantic callback instruction and the parameter variables used to determine the method of semantic callback instruction according to the semantic classification, so as to realize the distribution and processing of speech instructions of different speech engines.

[0026] (2) The method of the present invention can flexibly access the API of the new engine without affecting the processing logic of vehicle commands, thereby improving R&D efficiency and reducing R&D costs.

[0027] In summary, when changing a speech engine, this invention can flexibly access the API of the new engine, enabling the distribution and processing of speech commands from different speech engines, thereby reducing development costs. Attached Figure Description

[0028] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0029] Figure 1 This is a flowchart of the method after accessing an external voice engine in Embodiment 1 of the present invention. Detailed Implementation

[0030] To better explain and facilitate understanding of the present invention, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings and specific implementation methods.

[0031] Example 1: A General Voice Command Distribution Method

[0032] like Figure 1 As shown, this embodiment provides a general voice command distribution method, which includes the following steps performed sequentially:

[0033] S1. Define the entity class IVoiceBean and define IVoiceBean as an interface. Within the entity class, define all the parameter variables required by all semantic callback directives, including the parameter variable 'domain' used to determine the type of the semantic callback directive and the parameter variable 'action' used to determine the method of the semantic callback directive.

[0034] All semantic callback commands include commands for the vehicle cockpit, map navigation, music and multimedia applications, system settings, and air conditioning.

[0035] S2. Classify and define all semantic callback instructions in the form of interfaces to obtain the types of all semantic callback instructions, that is, to obtain all callback interfaces and the semantic callback instruction methods contained in each callback interface.

[0036] The types of semantic callback instructions include vehicle cockpit, map navigation, music and multimedia applications, system settings and air conditioning, etc. Each semantic callback instruction type includes multiple semantic callback instruction methods. For example, the control semantics for air conditioning include multiple semantic callback instruction methods such as "turn on air conditioning", "turn off air conditioning", and "adjust air conditioning temperature to 26℃".

[0037] All callback interfaces are inherited by the entity classes and ultimately implemented as a unified parameter, VoiceBeanImpl, which serves as the unified parameter passed to the semantic callback instruction method. The unified parameter VoiceBeanImpl is passed to the semantic callback instruction method that requires a parameter, and is received by the external application handling the semantic callback instruction. For example, the instruction "adjust the air conditioning temperature to 26℃" has the numerical parameter "26℃," therefore it is a semantic callback instruction that requires a parameter, while instructions like "turn on the air conditioning" and "turn off the air conditioning" are semantic callback instructions that do not require parameters. Here, "external application" refers to in-vehicle applications such as the vehicle's cockpit, map navigation, music and multimedia applications, system settings, and air conditioning.

[0038] Define the annotation VoiceArea to decorate the callback interface; define the annotation CallBackMethod to decorate the semantic callback instruction method, and define the parameter ActionName to determine the semantic callback instruction method to be executed.

[0039] Define a semantic executor interface, which is inherited by the callback interface, so that dynamic proxies and reflections can be used in subsequent steps.

[0040] S3. Integrate with the voice engine to implement the voice engine API, convert the returned semantic callback instructions into a unified entity class, assign values ​​to the parameter variables domain and action according to the type of the semantic callback instructions, and pass them to the semantic executor interface through the unified parameter VoiceBeanImpl.

[0041] S4. Instantiate the semantic executor interface through dynamic proxy. The specific process is as follows:

[0042] Obtain callback instances from the semantic execution project using AIDL (Android Interface Definition Language), instantiate the semantic executor interface using dynamic proxy, and then pass the obtained instances into the semantic executor interface.

[0043] The semantic execution project includes pre-registered semantic execution commands for the vehicle cockpit, map navigation, music and multimedia applications, system settings, and air conditioning.

[0044] S5. The instantiated semantic executor interface obtains the annotation-decorated callback interface, semantic callback instruction method, and the unified parameter VoiceBeanImpl of the semantic callback instruction method through reflection.

[0045] S6. Match the domain and action parameters in the unified parameter VoiceBeanImpl with the actionName parameter of the callback interface annotated with VoiceArea and the CallBackMethod annotation. The unified parameter VoiceBeanImpl returns a boolean value, i.e., "0" or "1", to determine whether to execute the semantic callback. If it is determined to be a callback, continue to execute the matched callback semantic instruction; if it is determined not to be a callback, prompt that this command is not supported.

[0046] In this embodiment, the entity class IVoiceBean, all callback interfaces, and semantic executor interfaces all exist in the form of a backend service.

[0047] Example 2: A general-purpose voice command distribution electronic device and computer-readable storage medium

[0048] The electronic device in this embodiment is a computer device, which mainly includes one or more processors and a memory. This embodiment takes one processor as an example.

[0049] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof. The general-purpose processor can be a microprocessor or any conventional processor. The memory stores a computer program; when the processor executes the computer program, it can implement the steps of the general voice command distribution method described in Example 1.

[0050] A computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the general voice command distribution method of Embodiment 1. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium includes: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

Claims

1. A universal voice command distribution method, characterized in that, The method includes the following steps performed sequentially: S1. Define entity classes and define entity classes as interfaces; Define all the parameter variables required by all semantic callback directives within the entity class, including the parameter variable 'domain' used to determine the type of the semantic callback directive and the parameter variable 'action' used to determine the method of the semantic callback directive; S2. Classify and define all semantic callback instructions in the form of interfaces to obtain the types of all semantic callback instructions, that is, to obtain all callback interfaces and the semantic callback instruction methods contained in each callback interface. All of the aforementioned callback interfaces are inherited by the entity classes and are ultimately implemented as a unified parameter VoiceBeanImpl, which serves as the unified parameter passed to the semantic callback instruction method. Define the VoiceArea annotation to decorate the callback interface; define the CallBackMethod annotation to decorate the semantic callback instruction method, and define the ActionName parameter to determine the semantic callback instruction method to be executed; Define a semantic executor interface, which is inherited by the callback interface; S3. Integrate with the voice engine to implement the voice engine API, convert the returned semantic callback instructions into a unified entity class, and assign values ​​to the parameter variables domain and action according to the type of the semantic callback instructions. The unified parameter VoiceBeanImpl is passed to the semantic executor interface. S4. Instantiate the semantic executor interface through dynamic proxy; S5. The instantiated semantic executor interface obtains the annotation-decorated callback interface, semantic callback instruction method, and the unified parameter VoiceBeanImpl of the semantic callback instruction method through reflection. S6. Match the domain and action parameters in the unified parameter VoiceBeanImpl with the actionName parameter of the callback interface annotated with VoiceArea and the CallBackMethod annotation. The unified parameter VoiceBeanImpl returns a boolean value to determine whether to execute the semantic callback. If it is determined to be a callback, continue to execute the matched callback semantic instruction; otherwise, prompt that this command is not supported.

2. The general voice command distribution method according to claim 1, characterized in that, The unified parameter VoiceBeanImpl is passed into the semantic callback instruction method that requires parameters, and the unified parameter VoiceBeanImpl is received by the external application that processes the semantic callback instruction.

3. The general voice command distribution method according to claim 2, characterized in that, The entity classes, all callback interfaces, and semantic executor interfaces all exist in the form of backend services.

4. The general voice command distribution method according to any one of claims 1-3, characterized in that, The specific process of instantiating the semantic executor interface through dynamic proxy in step S4 is as follows: Obtain callback instances from the semantic execution project via AIDL; The semantic executor interface is instantiated through a dynamic proxy, and then the obtained callback instance is passed to the semantic executor interface.

5. The general voice command distribution method according to claim 4, characterized in that, The semantic execution project includes pre-registered semantic execution instructions for the vehicle cockpit, map navigation, music and multimedia applications, system settings, and air conditioning.

6. An electronic device, characterized in that, The method includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of the method described in any one of claims 1-5.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Voice interaction method and device of application program, equipment and medium

    CN110647305A

  • Voice processing method and device and distributed system

    CN111833857A