Offline voice control method and system, readable storage medium and computer equipment

文档序号:139055 发布日期:2021-10-22 浏览:26次 中文

阅读说明:本技术 离线语音控制方法、系统、可读存储介质及计算机设备 (Offline voice control method and system, readable storage medium and computer equipment ) 是由 骆世臣 于 2021-06-03 设计创作,主要内容包括:本发明公开了一种离线语音控制方法、系统、可读存储介质及计算机设备,所述离线语音控制方法包括:获取用户发出的目标语音指令;在离线语音识别库中对所述目标语音指令进行比对分析,以获取所述语音指令对应的目标识别词ID;通过无线通讯模块判断是否存在与所述目标识别词ID对应的目标控制指令;若存在与所述目标识别词ID对应的目标控制指令,则调用并执行所述目标控制指令,以对相应的目标设备进行控制。本发明能够解决现有技术无法实现离线语音控制的问题。(The invention discloses an off-line voice control method, a system, a readable storage medium and computer equipment, wherein the off-line voice control method comprises the following steps: acquiring a target voice instruction sent by a user; comparing and analyzing the target voice instruction in an offline voice recognition library to obtain a target recognition word ID corresponding to the voice instruction; judging whether a target control instruction corresponding to the target identification word ID exists or not through a wireless communication module; and if the target control instruction corresponding to the target identification word ID exists, calling and executing the target control instruction to control corresponding target equipment. The invention can solve the problem that the prior art can not realize off-line voice control.)

1. An off-line voice control method, the method comprising:

acquiring a target voice instruction sent by a user;

comparing and analyzing the target voice instruction in an offline voice recognition library to obtain a target recognition word ID corresponding to the voice instruction;

judging whether a target control instruction corresponding to the target identification word ID exists or not through a wireless communication module;

and if the target control instruction corresponding to the target identification word ID exists, calling and executing the target control instruction to control corresponding target equipment.

2. The offline voice control method according to claim 1, further comprising:

acquiring a voice learning awakening signal obtained by a user operating on a control panel;

acquiring a first voice instruction sent by a user, distributing a first recognition word ID for the first voice instruction, and storing the corresponding relation between the first voice instruction and the first recognition word ID in the offline voice recognition library;

acquiring a first control instruction which is obtained by a user operating on a control panel and is used for controlling first equipment;

and storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

3. The offline voice control method according to claim 2, wherein after the steps of obtaining a first voice command issued by a user, assigning a first recognized word ID to the first voice command, and storing a correspondence between the first voice command and the first recognized word ID in the offline voice recognition library, the method further comprises:

judging whether a first control instruction obtained by the operation of a user on a control panel is obtained within a preset time;

and if a first control instruction obtained by the operation of a user on a control panel is obtained within a preset time, storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

4. The offline voice control method according to claim 3, after the step of determining whether the first control instruction obtained by the user operating on the control panel is obtained within a preset time, the method further comprising:

and if the first control instruction obtained by the operation of the user on the control panel is not obtained within the preset time, sending prompt information, wherein the prompt information is used for prompting the user to execute the control operation on the control panel.

5. The offline voice control method according to claim 1, wherein the step of invoking and executing the target control instruction to control the corresponding target device specifically comprises:

calling and executing the target control instruction, and controlling the target equipment through a relay, or;

and calling and executing the target control instruction, and sending a control instruction ID to an upper computer for processing in a wireless communication mode so as to control the target equipment.

6. An off-line voice control system, the system comprising:

the first acquisition module is used for acquiring a target voice instruction sent by a user;

the comparison module is used for comparing and analyzing the target voice instruction in an offline voice recognition library so as to obtain a target recognition word ID corresponding to the voice instruction;

the wireless communication module is used for judging whether a target control instruction corresponding to the target identification word ID exists or not;

and the calling module is used for calling and executing the target control instruction to control corresponding target equipment if the target control instruction corresponding to the target identification word ID exists.

7. The offline voice control system of claim 6, further comprising:

the second acquisition module is used for acquiring a voice learning awakening signal obtained by the operation of a user on the control panel;

a third obtaining module, configured to obtain a first voice instruction sent by a user, allocate a first recognition word ID to the first voice instruction, and store a correspondence between the first voice instruction and the first recognition word ID in the offline voice recognition library;

the fourth obtaining module is used for obtaining a first control instruction which is obtained by the operation of the user on the control panel and is used for controlling the first equipment;

and the storage module is used for storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

8. The offline voice control system of claim 7, further comprising:

the judging module is used for judging whether a first control instruction obtained by the operation of a user on the control panel is obtained within a preset time;

the wireless communication module is further used for storing the mapping relation between the first identification word ID and the first control instruction when the first control instruction obtained by the operation of the user on the control panel is obtained within the preset time.

9. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.

10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the program.

Technical Field

The invention relates to the technical field of intelligent household equipment, in particular to an offline voice control method, an offline voice control system, a readable storage medium and computer equipment.

Background

With the progress of science and technology, various intelligent electronic products are rapidly developed and widely applied, such as: the intelligent sweeping robot, the intelligent sound box, the intelligent television, the intelligent switch and the like, which are generally provided with a voice control function, for example, the device can be awakened or controlled to play songs and the like through voice, or the light can be turned on or off through voice.

In the prior art, equipment is required to be accessed to the internet to realize voice control, various functions of the voice control are realized through a network, if the network is in a problem, the equipment is offline, the voice control cannot be realized, and the use experience of a user is influenced.

Disclosure of Invention

Therefore, an embodiment of the present invention provides an offline voice control method to solve the problem that the prior art cannot implement offline voice control.

According to an embodiment of the invention, the method for controlling the off-line voice comprises the following steps:

acquiring a target voice instruction sent by a user;

comparing and analyzing the target voice instruction in an offline voice recognition library to obtain a target recognition word ID corresponding to the voice instruction;

judging whether a target control instruction corresponding to the target identification word ID exists or not through a wireless communication module;

and if the target control instruction corresponding to the target identification word ID exists, calling and executing the target control instruction to control corresponding target equipment.

According to the off-line voice control method provided by the embodiment of the invention, a target voice instruction sent by a user is compared and analyzed in an off-line voice recognition library to obtain a corresponding target recognition word ID, then whether the target control instruction corresponding to the target recognition word ID is prestored is judged through the wireless communication module, and if the target control instruction corresponding to the target recognition word ID is prestored is judged through the wireless communication module, the target control instruction is directly called and executed, so that corresponding target equipment is controlled, therefore, when a network has a problem and the equipment is off-line, voice control can be realized, and the use experience of the user is improved.

In addition, the offline voice control method according to the above embodiment of the present invention may further have the following additional technical features:

further, in one embodiment of the present invention, the method further comprises:

acquiring a voice learning awakening signal obtained by a user operating on a control panel;

acquiring a first voice instruction sent by a user, distributing a first recognition word ID for the first voice instruction, and storing the corresponding relation between the first voice instruction and the first recognition word ID in the offline voice recognition library;

acquiring a first control instruction which is obtained by a user operating on a control panel and is used for controlling first equipment;

and storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

Further, in an embodiment of the present invention, after the steps of acquiring a first voice instruction sent by a user, assigning a first recognition word ID to the first voice instruction, and storing a correspondence between the first voice instruction and the first recognition word ID in the offline voice recognition library, the method further includes:

judging whether a first control instruction obtained by the operation of a user on a control panel is obtained within a preset time;

and if a first control instruction obtained by the operation of a user on a control panel is obtained within a preset time, storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

Further, in an embodiment of the present invention, after the step of determining whether the first control instruction obtained by the user through the operation on the control panel is acquired within a preset time, the method further includes:

and if the first control instruction obtained by the operation of the user on the control panel is not obtained within the preset time, sending prompt information, wherein the prompt information is used for prompting the user to execute the control operation on the control panel.

Further, in an embodiment of the present invention, the step of calling and executing the target control instruction to control the corresponding target device specifically includes:

calling and executing the target control instruction, and controlling the target equipment through a relay, or;

and calling and executing the target control instruction, and sending a control instruction ID to an upper computer for processing in a wireless communication mode so as to control the target equipment.

Another embodiment of the present invention provides an offline voice control system to solve the problem that the prior art cannot implement offline voice control.

According to the off-line voice control system of the embodiment of the invention, the system comprises:

the first acquisition module is used for acquiring a target voice instruction sent by a user;

the comparison module is used for comparing and analyzing the target voice instruction in an offline voice recognition library so as to obtain a target recognition word ID corresponding to the voice instruction;

the wireless communication module is used for judging whether a target control instruction corresponding to the target identification word ID exists or not; (ii) a

And the calling module is used for calling and executing the target control instruction to control corresponding target equipment if the target control instruction corresponding to the target identification word ID exists.

According to the off-line voice control system provided by the embodiment of the invention, a target voice instruction sent by a user is compared and analyzed in an off-line voice recognition library to obtain a corresponding target recognition word ID, then whether the target control instruction corresponding to the target recognition word ID is prestored is judged through the wireless communication module, and if the target control instruction corresponding to the target recognition word ID is prestored is judged through the wireless communication module, the target control instruction is directly called and executed, so that corresponding target equipment is controlled, therefore, when a network has a problem and the equipment is off-line, voice control can be realized, and the use experience of the user is improved.

In addition, the offline voice control system according to the above embodiment of the present invention may further have the following additional technical features:

further, in one embodiment of the present invention, the system further comprises:

the second acquisition module is used for acquiring a voice learning awakening signal obtained by the operation of a user on the control panel;

a third obtaining module, configured to obtain a first voice instruction sent by a user, allocate a first recognition word ID to the first voice instruction, and store a correspondence between the first voice instruction and the first recognition word ID in the offline voice recognition library;

the fourth obtaining module is used for obtaining a first control instruction which is obtained by the operation of the user on the control panel and is used for controlling the first equipment;

and the storage module is used for storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

Further, in one embodiment of the present invention, the system further comprises:

the judging module is used for judging whether a first control instruction obtained by the operation of a user on the control panel is obtained within a preset time;

the wireless communication module is further used for storing the mapping relation between the first identification word ID and the first control instruction when the first control instruction obtained by the operation of the user on the control panel is obtained within the preset time.

Further, in one embodiment of the present invention, the system further comprises:

the prompting module is used for sending out prompting information if a first control instruction obtained by the operation of the user on the control panel is not obtained within the preset time, wherein the prompting information is used for prompting the user to execute the control operation on the control panel.

Further, in an embodiment of the present invention, the invoking module is specifically configured to:

calling and executing the target control instruction, and controlling the target equipment through a relay, or;

and calling and executing the target control instruction, and sending a control instruction ID to an upper computer for processing in a wireless communication mode so as to control the target equipment.

Another embodiment of the invention also proposes a readable storage medium on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.

Another embodiment of the present invention also proposes a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above method when executing the program.

Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.

Drawings

The above and/or additional aspects and advantages of embodiments of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:

FIG. 1 is a flow diagram of a voice control method according to an embodiment of the present invention;

FIG. 2 is a flow chart of a voice control method according to another embodiment of the present invention;

fig. 3 is a schematic structural diagram of a voice control system according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, an off-line voice control method according to an embodiment of the present invention includes steps S101 to S103.

S101, acquiring a target voice instruction sent by a user.

The offline voice control method of the embodiment mainly controls devices such as home appliances, for example, controls a suspended ceiling. The target voice instruction issued by the user is, for example, "open a ceiling lamp". In specific implementation, a control panel can be configured for offline voice control, and a microphone is arranged on the control panel and used for receiving a target voice instruction sent by a user to realize voice recognition. Specifically, the microphone may be in a hole in the front of the control panel, facilitating voice recognition.

S102, comparing and analyzing the target voice command in an offline voice recognition library to obtain a target recognition word ID corresponding to the voice command.

The off-line voice recognition library is pre-established, and off-line voice instructions and corresponding recognition word IDs are pre-stored in the off-line voice recognition library. For example, the target voice instruction issued by the user is, for example, "open a ceiling lamp", and the corresponding target recognition word ID is, for example, "056". Specifically, the corresponding target recognition word ID can be obtained only in the case where the corresponding target recognition word ID is stored in the offline speech recognition library. If the corresponding target recognition word ID is not stored in the offline speech recognition library, the corresponding target recognition word ID cannot be obtained. In this case, the corresponding learning needs to be performed first.

And S103, judging whether a target control instruction corresponding to the target identification word ID exists through a wireless communication module.

The wireless communication module is installed in the control panel, for example, the zigbee3.0 wireless module communicates through a serial port, and the wireless communication module judges whether a target control instruction corresponding to the target identification word ID exists through corresponding logic. For example, it is determined whether or not there is a target control command corresponding to the recognition word ID "056".

And S104, if the target control instruction corresponding to the target identification word ID exists, calling and executing the target control instruction to control corresponding target equipment.

If the wireless communication module judges that a target control instruction corresponding to the target recognition word ID '056' exists and the target control instruction is a control instruction of 'opening the ceiling lamp', corresponding target equipment (namely the ceiling lamp) is controlled to execute the instruction, and therefore the effect of opening the ceiling lamp is achieved. It should be noted that different identification words ID correspond to different control commands, which are mapped and stored in the wireless communication module in advance, for example, the control command corresponding to the identification word ID "057" is "turn off the ceiling lamp".

Specifically, the target control instruction is called and executed to control the corresponding target device, and the following two ways may be implemented.

The first method comprises the following steps:

calling and executing the target control instruction, and controlling the target equipment through a relay, or;

and the second method comprises the following steps:

and calling and executing the target control instruction, and sending a control instruction ID to an upper computer for processing in a wireless communication mode so as to control the target equipment.

In addition, as a specific example, referring to fig. 2, the method further includes:

s201, acquiring a voice learning awakening signal obtained by the operation of a user on a control panel.

Specifically, a function key may be arranged on the control panel, so as to implement a voice learning wake-up signal obtained by a user operating on the control panel. For example, the user can generate the voice learning wake-up signal by pressing the function key for 5 seconds.

S202, a first voice instruction sent by a user is obtained, a first recognition word ID is distributed to the first voice instruction, and the corresponding relation between the first voice instruction and the first recognition word ID is stored in the offline voice recognition library.

Specifically, after the user presses the function key for 5 seconds to generate the voice learning wake-up signal, the user is required to send a first voice instruction for learning, during specific implementation, an indicator lamp can be further arranged on the control panel, and after the user presses the function key for 5 seconds, the indicator lamp flickers to remind the user to send the first voice instruction. If the first voice command issued by the user is "turn on fan", for example, a first recognition word ID is assigned to the first voice command "turn on fan", the assigned first recognition word ID is "061", for example, and then the first voice command "turn on fan" and the first recognition word ID "061" are stored in the offline voice recognition library.

S203, a first control instruction for controlling the first device, which is obtained by the operation of the user on the control panel, is obtained.

After the first voice instruction sent by the user is obtained, a first control instruction for controlling the first device, which is obtained by the user through operation on the control panel, needs to be obtained, for example, after the user says "turn on the fan", a switch special for turning on the electric fan on the control panel is pressed to turn on the electric fan, and the obtained first control instruction is the control instruction for turning on the fan.

S204, storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module.

Specifically, the mapping relationship between the first identification word ID "061" and the control command of turning on the fan is stored in the zigbee3.0 wireless module. Through the steps, the instruction learning effect is achieved.

In addition, specifically, after the steps of acquiring a first voice instruction sent by a user, allocating a first recognition word ID to the first voice instruction, and storing a corresponding relationship between the first voice instruction and the first recognition word ID in the offline voice recognition library, the method further includes:

and judging whether a first control instruction obtained by the operation of a user on the control panel is acquired within a preset time. For example, whether a first control instruction obtained by a user operating on a control panel is acquired within 2 seconds is judged;

and if a first control instruction obtained by the operation of a user on a control panel is obtained within a preset time, storing the mapping relation between the first identification word ID and the first control instruction in the wireless communication module. Specifically, if a first control instruction obtained by a user operating on a control panel is obtained within 2 seconds, the mapping relationship between the first identification word ID and the first control instruction is stored in the wireless communication module.

Otherwise, if the first control instruction obtained by the user through operation on the control panel is not obtained within the preset time, sending a prompt message, wherein the prompt message is used for prompting the user to execute the control operation on the control panel. For example, if a first control instruction obtained by a user operating on the control panel is not obtained within 2 seconds, a prompt message is sent, the prompt message is, for example, a voice prompt message, during specific implementation, a loudspeaker can be arranged on the control panel and used for sending the voice prompt message, and the loudspeaker is specifically positioned at the upper end of the control panel and is provided with a lateral hole, so that voice sound wave air conduction is facilitated; the sent prompt message is, for example, "please press the control key immediately". If the second preset time is exceeded, for example, 10 seconds are exceeded, and the first control instruction obtained by the user operating on the control panel is not obtained, the instruction learning is stopped.

In summary, according to the offline voice control method provided in this embodiment, a target voice instruction sent by a user is compared and analyzed in an offline voice recognition library to obtain a corresponding target recognition word ID, and then the wireless communication module determines whether a target control instruction corresponding to the target recognition word ID is pre-stored, and if the wireless communication module determines that a target control instruction corresponding to the target recognition word ID is pre-stored, the wireless communication module directly calls and executes the target control instruction, so as to control a corresponding target device.

Referring to fig. 3, based on the same inventive concept, an offline voice control system according to an embodiment of the present invention includes:

the first acquisition module 11 is used for acquiring a target voice instruction sent by a user;

a comparison module 12, configured to perform comparison analysis on the target voice instruction in an offline voice recognition library to obtain a target recognition word ID corresponding to the voice instruction;

the wireless communication module 13 is used for judging whether a target control instruction corresponding to the target identification word ID exists or not;

and the calling module 14 is configured to call and execute the target control instruction to control the corresponding target device if the target control instruction corresponding to the target identification word ID exists.

In this embodiment, the system further includes:

a second obtaining module 15, configured to obtain a voice learning wake-up signal obtained by a user operating on a control panel;

a third obtaining module 16, configured to obtain a first voice instruction sent by a user, allocate a first recognition word ID to the first voice instruction, and store a correspondence between the first voice instruction and the first recognition word ID in the offline voice recognition library;

a fourth obtaining module 17, configured to obtain a first control instruction, which is obtained by a user operating on a control panel and is used to control the first device;

a storage module 18, configured to store the mapping relationship between the first identification word ID and the first control instruction in the wireless communication module.

In this embodiment, the system further includes:

the judging module 19 is configured to judge whether a first control instruction obtained by an operation of a user on the control panel is obtained within a preset time;

the wireless communication module 13 is further configured to store a mapping relationship between the first identification word ID and the first control instruction when the first control instruction obtained by the user operating on the control panel is obtained within a preset time.

In this embodiment, the system further includes:

the prompting module 20 is configured to send a prompting message if a first control instruction obtained by a user operating on the control panel is not obtained within a preset time, where the prompting message is used to prompt the user to execute a control operation on the control panel.

In this embodiment, the invoking module 14 is specifically configured to:

calling and executing the target control instruction, and controlling the target equipment through a relay, or;

and calling and executing the target control instruction, and sending a control instruction ID to an upper computer for processing in a wireless communication mode so as to control the target equipment.

In the offline voice control system provided by this embodiment, a target voice instruction sent by a user is compared and analyzed in an offline voice recognition library to obtain a corresponding target recognition word ID, and then it is determined whether a target control instruction corresponding to the target recognition word ID is pre-stored through the wireless communication module, and if the target control instruction corresponding to the target recognition word ID is pre-stored through the wireless communication module, the target control instruction is directly called and executed, so as to control a corresponding target device.

Furthermore, an embodiment of the present invention also proposes a readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the above-mentioned method.

Furthermore, an embodiment of the present invention also provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the above method when executing the program.

The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.

It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种智能语音审批处理方法、装置以及设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!