Background
At present, a general household appliance can realize the on-off action through an on-off button on a remote controller or a touch panel. In order to improve the convenience of controlling the household appliance, a piezoelectric sensor arranged in a knocking switch is used for detecting the deformation of a panel of the knocking switch so as to detect a knocking event in the related technology, and then the on-off operation of the household appliance is realized according to the detection result of the knocking event. In this way, on one hand, false triggering caused by false collision is easy to happen; on the other hand, when the switch panel is knocked, corresponding deformation is generated along with temperature change or time lapse, so that the piezoelectric sensor receives an error signal, and the probability of false triggering is further increased.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method and an apparatus for controlling a sound-controlled tap switch, a household electrical appliance, and a storage medium, which can reduce false triggering operations of turning on or off the tap switch.
According to an embodiment of a first aspect of the present invention, there is provided a control device for a voice-activated tap switch, the control device including:
the sound sensor is used for acquiring an audio signal generated by the sound-controlled knocking switch;
and the control processing part is connected with the sound sensor and is used for controlling the on or off of the sound control knocking switch according to the zero crossing rate and the short-time energy of the audio signal.
The control device according to the embodiment of the invention has at least the following beneficial effects: according to the sound control knocking switch, the audio signals generated after the sound control knocking switch is knocked are obtained through the sound sensor, the knocking area and the knocking strength can be respectively determined by the control processing part according to the zero-crossing rate and the short-time energy of the audio signals by utilizing the principle that the zero-crossing rate of the obtained audio signals changes along with the change of the knocking area and the principle that the short-time energy of the obtained audio signals changes along with the change of the knocking strength, and then the opening or closing of the sound control knocking switch is controlled more accurately, so that the false triggering of the sound control knocking switch is reduced.
Optionally, the voice-operated knocking switch is provided with a panel, and the voice sensor is installed in the center of the panel. The sound sensor is arranged at the center of the panel, audio signals acquired from all directions at the center are more uniform, the strength is higher, the presented rule is more obvious, the subsequent audio signals are more accurately and simply processed, and the false triggering operation of the sound control knocking switch is further reduced.
Optionally, the voice-operated knocking switch is provided with a panel, the panel is divided into an effective knocking area and an ineffective knocking area, and the sound sensor is installed in the center of the effective knocking area. The knocking in the range of the effective knocking area is easier to identify, and the knocking in the range of the ineffective knocking area is not easy to identify, so that the false triggering operation caused by the ineffective knocking area is further reduced; the sound sensor is arranged at the center of the effective knocking area, audio signals acquired from all directions at the center are more uniform, the strength is higher, the presented rule is more obvious, the subsequent audio signals are more accurately and simply processed, and the false triggering operation of the sound control knocking switch is further reduced.
Optionally, the sound sensor is attached to the back of the sound-controlled tap switch panel. The sound sensor is tightly attached to the back of the sound control knocking switch panel, under the condition, the sound sensor receives audio signals in a solid conduction mode, and the sound control knocking switch panel is not required to be provided with a honeycomb receiving hole, so that the received audio signals are not distorted as much as possible, and meanwhile, the integrity and the attractiveness of the sound control knocking switch panel can be kept.
Optionally, the control device further comprises:
and the vibration sensor is connected with the control processing part and is used for acquiring a vibration signal generated by the voice-operated knocking switch.
Whether the sound control knocking switch panel vibrates or not is detected through the vibration sensor, the fact that the audio signals are from the sound control knocking switch panel is determined, false triggering caused by the audio signals generated by other sound sources except the sound control knocking switch panel is reduced, and false triggering operation is further reduced.
According to a second aspect of the present invention, there is provided a control method for a voice-controlled tap switch, the control method including:
acquiring an audio signal detected by the sound sensor;
determining zero crossing rate and short-time energy according to the audio signal;
and controlling the sound control knocking switch to be turned on or off according to the zero crossing rate and the short-time energy.
The control method provided by the embodiment of the invention has at least the following beneficial effects: when the voice-operated knocking switch is knocked, the voice sensor receives an audio signal generated by knocking of the voice-operated knocking switch, and determines the knocking area and the knocking strength according to the zero-crossing rate and the short-time energy of the audio signal by utilizing the principle that the zero-crossing rate of the obtained audio signal changes along with the change of the knocking area and the principle that the short-time energy of the obtained audio signal changes along with the change of the knocking strength, so that the opening or closing of the voice-operated knocking switch is controlled more accurately, and the false triggering operation is reduced.
Optionally, the controlling the on or off of the voice-operated knock switch according to the zero crossing rate and the short-time energy includes:
inputting the zero crossing rate and the short-time energy into a preset audio classifier to obtain a classification result of whether the audio signal is an effective signal;
and when the classification result is that the audio signal is an effective signal, controlling the on or off of the voice-operated knocking switch.
Whether the audio signal is an effective signal is determined by adopting a preset audio classifier, and the preset audio classifier is obtained by training and learning according to training data of a known classification result, so that the method is applicable to the condition that the classification rule is obvious or not, wider in application range and more accurate in result.
Optionally, the preset audio classifier is constructed by:
collecting and marking the audio signal of the voice-operated knocking switch to obtain a data collecting sample;
and taking the zero crossing rate and the short-time energy of the audio signal as input parameters of training, and training the data sampling sample by adopting a support vector machine to construct and obtain the preset audio classifier.
The data sampling samples are trained by adopting a support vector machine method, and when the training samples of the audio signals are relatively few or present linear irresistibility, a more accurate training result can be obtained.
Optionally, the control method further includes:
and controlling the sound control knocking switch to be turned on or off according to the times of the effective signals and the time interval of the effective signals.
By increasing the number of times of detecting the effective signals and limiting the time interval of the effective signals, the false triggering operation caused by false collision is further reduced.
Optionally, the determining the zero-crossing rate and the short-time energy according to the audio signal includes:
acquiring a vibration signal detected by a vibration sensor;
and when the amplitude of the vibration signal exceeds a preset amplitude value, determining the zero crossing rate and the short-time energy according to the audio signal.
When the sound-control knocking switch is knocked, the vibration sensor and the sound sensor respectively receive a vibration signal and an audio signal generated by the sound-control knocking switch due to knocking, when the amplitude of the vibration signal is larger than a preset amplitude value, the fact that knocking occurs in a panel area or an effective knocking area of the sound-control knocking switch is indicated, then the sound-control knocking switch is controlled to be turned on or turned off according to the zero crossing rate and short-term energy of the audio signal, and the false start operation of the sound-control knocking switch caused by the audio signal generated by a sound source in an area except the sound-control knocking switch panel is reduced; when the amplitude of the vibration signal is smaller than the preset amplitude, the knocking occurs outside the panel area of the voice-operated knocking switch or the effective knocking area, subsequent operation is not executed, namely the voice-operated knocking switch is not required to be controlled to be turned on or turned off according to the zero crossing rate and the short-time energy of the audio signal, the execution process is simple, and the operation is easy.
According to a third aspect of the present invention, there is provided a control device for a voice-activated tap switch, including: the control method comprises a memory, a control processor and a computer program stored on the memory and capable of running on the control processor, wherein the control processor realizes the control method of the second aspect embodiment when executing the computer program.
The control device according to the embodiment of the invention has at least the following beneficial effects: according to the sound control knocking switch, the audio signals generated after the sound control knocking switch is knocked are obtained through the sound sensor, the knocking area and the knocking strength can be respectively determined by the control processing part according to the zero-crossing rate and the short-time energy of the audio signals by utilizing the principle that the zero-crossing rate of the obtained audio signals changes along with the change of the knocking area and the principle that the short-time energy of the obtained audio signals changes along with the change of the knocking strength, and then the opening or closing of the sound control knocking switch is controlled more accurately, so that the false triggering of the sound control knocking switch is reduced.
According to a fourth aspect of the present invention, there is provided a household appliance, comprising the control device of the first aspect or the control device of the third aspect.
The household appliance provided by the embodiment of the invention at least has the following beneficial effects: according to the sound control knocking switch, the audio signals generated after the sound control knocking switch is knocked are obtained through the sound sensor, the knocking area and the knocking strength can be respectively determined by the control processing part according to the zero-crossing rate and the short-time energy of the audio signals by utilizing the principle that the zero-crossing rate of the obtained audio signals changes along with the change of the knocking area and the principle that the short-time energy of the obtained audio signals changes along with the change of the knocking strength, and then the opening or closing of the sound control knocking switch is controlled more accurately, so that the false triggering of the sound control knocking switch is reduced.
According to a fifth aspect of the present invention, there is provided a computer-readable storage medium storing a computer-executable program for causing a computer to execute the control method according to the second aspect.
Through executing a program executable by a processor, an audio signal generated after the sound control knocking switch is knocked is obtained according to a sound sensor, the knocking area and the knocking force can be respectively determined by a control processing part according to the zero-crossing rate and the short-time energy of the audio signal by utilizing the principle that the zero-crossing rate of the obtained audio signal changes along with the change of the knocking area and the principle that the short-time energy of the obtained audio signal changes along with the change of the knocking force, and then the opening or closing of the sound control knocking switch is more accurately controlled, so that the false triggering of the sound control knocking switch is reduced.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, and the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood to exclude the essential numbers. If there is a description to first, second, third etc. for the purpose of distinguishing between technical features, it is not intended to indicate or imply relative importance or to implicitly indicate the number of technical features indicated or to implicitly indicate the precedence of technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
The embodiment of the invention provides a control method and a control device of a voice-operated knocking switch and a household appliance. The control device includes: the sound sensor is used for acquiring an audio signal generated by the sound-controlled knocking switch; and the control processing part is connected with the sound sensor and is used for controlling the on or off of the sound control knocking switch according to the zero crossing rate and the short-time energy of the audio signal. The household appliance is provided with the sound sensor, the sound sensor is utilized to receive the audio signal generated by the sound control knocking switch, under the condition, the control processing part utilizes the principle that the zero-crossing rate of the obtained audio signal changes along with the change of the knocking area and the short-time energy of the obtained audio signal changes along with the change of the knocking force, the knocking area and the knocking force can be respectively determined according to the zero-crossing rate and the short-time energy of the audio signal, so that the household appliance is controlled to be opened or closed more accurately, and the false triggering of the sound control knocking switch is reduced. Wherein, the zero crossing rate refers to the number of times that the audio signal passes through the zero point, namely, the number of times that the audio signal changes from positive to negative or from negative to positive; the short-term energy refers to the energy of the audio signal in a short time, and the short time is usually one frame, i.e. the short-term energy represents the energy of the audio signal in one frame time. The embodiments of the present invention will be further explained with reference to the drawings.
Referring to fig. 1, fig. 1 is a schematic structural diagram of acontrol device 110 of a voice-activated tap switch according to an embodiment of the present invention. Thecontrol device 110 of the voice-controlled knocking switch comprises avoice sensor 112 and acontrol processing part 111, wherein thevoice sensor 112 is installed on the voice-controlled knockingswitch 120, and thevoice sensor 112 is connected with thecontrol processing part 111.
It should be noted that thesound sensor 112 may be installed on different positions on the front surface of the panel of the voice-controlledtapping switch 120, or may be installed on different positions on the back surface of the panel of the voice-controlledtapping switch 120, and the embodiment is not particularly limited thereto.
It will be understood by those skilled in the art that thesound sensor 112 may be a microphone sensor, or may be a sound wave wireless receiver, and the present embodiment is not limited thereto.
It should be noted that thecontrol processing unit 111 may be electrically connected to thesound sensor 112, or may be wirelessly connected, and this embodiment is not particularly limited thereto.
It will be understood by those skilled in the art that thecontrol processing part 111 may be a stand-alone device or a module device used in cooperation with a home appliance. When thecontrol processing part 111 is a separate device, thecontrol processing part 111 may be wirelessly connected with thesound sensor 112, and when thecontrol processing part 111 is provided on the home appliance, thecontrol processing part 111 may be electrically connected with thesound sensor 112.
Thesound sensor 112 is installed on the sound-controlled knockingswitch 120, and an audio signal generated after the sound-controlled knockingswitch 120 is knocked is acquired by using thesound sensor 112; thecontrol processing part 111 can respectively determine the knocking area and the knocking strength according to the zero crossing rate and the short-time energy of the audio signal by using the principle that the zero crossing rate of the acquired audio signal changes along with the change of the knocking area and the principle that the short-time energy of the acquired audio signal changes along with the change of the knocking strength, so that the on or off of the voice-operated knockingswitch 120 is controlled more accurately, and the false triggering of the voice-operated knocking switch is reduced.
Optionally, the voice-operatedtapping switch 120 is provided with a panel, thesound sensor 112 is installed at the center of the panel of the voice-operatedtapping switch 120, and the shape of the panel of the voice-operatedtapping switch 120 may be regular, such as a circle, a square, a diamond, etc., or irregular. Thesound sensor 112 is installed at the center of the panel of the sound-control knocking switch 120, so that the audio signals acquired from all directions at the center are more uniform, the intensity is higher, the presented rule is more obvious, the subsequent audio signals are more accurately and simply processed, and the false triggering operation of the sound-control knocking switch 120 is further reduced. The panel of the soundcontrol knocking switch 120 is set to be in a regular shape, so that audio signals generated by knocking on the panel of the soundcontrol knocking switch 120 are distributed more uniformly, the subsequent audio signals are processed more accurately, and the false triggering operation is further reduced.
Optionally, voice-activatedtap switch 120 is provided with a faceplate, andsound sensor 112 is affixed to the back of the faceplate of voice-activatedtap switch 120. In this case, thesound sensor 112 receives the audio signal generated by the knocking of the sound-controlled knockingswitch 120 through solid conduction, and the panel of the sound-controlled knockingswitch 120 does not need to be provided with a honeycomb-shaped receiving hole, so that the received audio signal is not distorted as much as possible, and the integrity and the aesthetic property of the panel of the sound-controlled knockingswitch 120 are maintained.
Referring to fig. 2, fig. 2 is a schematic structural diagram of acontrol device 110 of a voice-activated tap switch according to another embodiment of the present invention. The voice-controlled knockingswitch 120 is provided with a panel, thesound sensor 112 is installed on the panel of the voice-controlled knockingswitch 120, the panel of the voice-controlled knockingswitch 120 is divided into an effective knockingarea 121 and an ineffective knockingarea 122, and the rest of the panel of the voice-controlled knockingswitch 120 except the effective knockingarea 121 is the ineffective knockingarea 122; theacoustic sensor 112 is installed at the center of theeffective tapping area 121.
It should be noted that the shape of theeffective tapping area 121 is not limited, and may be a regular shape or an irregular shape, and the regular shape includes a square, a rectangle, a diamond, a circle, and the like; the effective knockingarea 121 is set to be in a regular shape, so that audio signals generated by knocking in the effective knockingarea 121 are distributed more uniformly, the subsequent audio signals are processed more accurately, and the false triggering is further reduced; if the effective knockingarea 121 is set to be circular, the audio signals generated by the same knocking at the same position in different directions and at the same distance from the center of the circle have the same size, and the presented rule is more obvious.
Taps within the range of theeffective tap region 121 are more easily recognized, and taps within the range of theineffective tap region 122 are less easily recognized, thereby further reducing false triggering operations caused by theineffective tap region 122; thesound sensor 112 is installed at the center of the effective knockingarea 121, so that the audio signals acquired from all directions at the center are more uniform, the intensity is higher, the presentation rule is more obvious, the subsequent audio signals are more accurately and simply processed, and the false triggering operation of the soundcontrol knocking switch 120 is further reduced.
Alternatively, thesound sensor 112 may be held against the back of theactive tap region 121. In this case, thesound sensor 112 receives the audio signal generated by the knocking of the sound-control knocking region 121 through solid conduction, and the panel of the sound-control knocking switch 120 does not need to be provided with a honeycomb-shaped receiving hole, so that the received audio signal is not distorted as much as possible, and the integrity and the aesthetic property of the panel of the sound-control knocking switch 120 are maintained.
Referring to fig. 3, fig. 3 is a schematic structural diagram of acontrol device 110 of a voice-activated tap switch according to another embodiment of the present invention. Thecontrol device 110 of the voice-controlled knockingswitch 120 comprises asound sensor 112, avibration sensor 113 and acontrol processing part 111, the voice-controlled knockingswitch 120 is provided with a panel, thesound sensor 112 and thevibration sensor 113 are both arranged on the panel of the voice-controlled knockingswitch 120, and thesound sensor 112 and thevibration sensor 113 are both connected with thecontrol processing part 111.
It should be noted that thesound sensor 112 and thevibration sensor 113 may be installed at different positions on the front surface of the panel of the voice-operatedtapping switch 120, or may be installed at different positions on the back surface of the panel of the voice-operatedtapping switch 120, and the embodiment is not particularly limited thereto.
It will be understood by those skilled in the art that thesound sensor 112 may be a microphone sensor, or may be a sound wave wireless receiver, and the present embodiment is not limited thereto. Thevibration sensor 113 may be an angular velocity sensor, such as a gyroscope, or may be a displacement sensor, and this embodiment is not particularly limited thereto.
Thecontrol processing unit 111 may be electrically connected to thesound sensor 112 and thevibration sensor 113, or may be wirelessly connected to the sound sensor and the vibration sensor, and the present embodiment is not particularly limited thereto.
It will be understood by those skilled in the art that thecontrol processing part 111 may be a stand-alone device or a module device used in cooperation with a home appliance. When thecontrol processing part 111 is a separate device, thecontrol processing part 111 may be wirelessly connected with thesound sensor 112 and thevibration sensor 113, and when thecontrol processing part 111 is provided on the home appliance, thecontrol processing part 111 may be electrically connected with thesound sensor 112 and thevibration sensor 113.
Thevibration sensor 113 is installed on the panel of the soundcontrol knocking switch 120, whether the panel of the soundcontrol knocking switch 120 vibrates or not is detected by using thevibration sensor 113, and an audio signal is determined to be from the panel of the soundcontrol knocking switch 120, so that false triggering caused by the audio signal generated by other sound sources except the panel of the soundcontrol knocking switch 120 is reduced. Asound sensor 112 is arranged on the panel of the sound-controlled knockingswitch 120, and an audio signal generated by the panel of the sound-controlled knockingswitch 120 is acquired by using thesound sensor 112; thecontrol processing part 111 can respectively determine the knocking area and the knocking strength according to the zero crossing rate and the short-time energy of the audio signal by using the principle that the zero crossing rate of the acquired audio signal changes along with the change of the knocking area and the principle that the short-time energy of the acquired audio signal changes along with the change of the knocking strength, so that the on or off of the voice-operated knockingswitch 120 is controlled more accurately, and the false triggering operation is reduced.
Optionally, thevibration sensor 113 is mounted on the face of the voice activatedtap switch 120. Thevibration sensor 113 is installed at the center of the panel of the voice-operatedknock switch 120 to better detect the vibration generated in each direction, so that the detection result is more accurate.
Optionally, the voice-operatedtapping switch 120 is provided with a panel, the panel of the voice-operatedtapping switch 120 is divided into aneffective tapping area 121 and anineffective tapping area 122, the rest of the panel of the voice-operatedtapping switch 120 except for theeffective tapping area 121 is theineffective tapping area 122, and thevibration sensor 113 is installed at the center position of theeffective tapping area 121. Taps within the range of theeffective tap region 121 are more easily recognized, and taps within the range of theineffective tap region 122 are less easily recognized, thereby further reducing false triggering operations caused by theineffective tap region 122; thevibration sensor 113 is installed at the center of the effective knockingarea 121 to better detect the vibration generated in each direction, so that the detection result is more accurate.
Optionally, thevibration sensor 113 is closely attached to the back of the effective knockingarea 121, in this case, thevibration sensor 113 receives the vibration signal generated by knocking the voice-operated knockingswitch 120 through solid conduction, and the panel of the voice-operated knockingswitch 120 does not need to be provided with a honeycomb-shaped receiving hole, so that the intensity of the received vibration signal is as large as possible, and the integrity and the attractiveness of the panel of the voice-operated knockingswitch 120 are maintained.
An embodiment of the present invention further provides a control method for a voice-operated tapping switch, which is applied to a control device disposed in a household appliance in the foregoing embodiment, wherein a structure or a component structure of the control device has been described in detail in the foregoing embodiment, and is not described herein again. Referring to fig. 4, the control method according to the embodiment of the present invention includes, but is not limited to, step S110, step S120, and step S130.
Step S110, acquiring an audio signal detected by a sound sensor;
step S120, determining zero crossing rate and short-time energy according to the audio signal;
and S130, controlling the sound control knocking switch to be turned on or off according to the zero crossing rate and the short-time energy.
Step S130 is to perform centering processing on the acquired audio signal, and then perform peak signal extraction on the audio signal after the centering processing to calculate the zero crossing rate and the short-term energy, which can be specifically calculated by the following formulas (1) and (2).
Wherein, sgn [ alpha ], [ alpha ]]Representing a symbolic function, i.e.
ZnDenotes the zero-crossing rate, EnRepresenting short-time energy, N representing the frame length of the audio signal, N representing the number of frames, m representing the number of samples, xn(m) represents the m-th sample value of the n-th frame.
Because the structure and the material of the panel and the back plate of different sound control knocking switches are different, the back of some parts is hollow, and the back of some parts is solid; some panels are planes, and some panels are cambered surfaces; some materials are plastics, some are metals, etc. The zero-crossing rate and the short-time energy of the audio signal generated by different voice-controlled knocking switches can show different rules, so that the method for controlling the on or off of the voice-controlled knocking switch according to the zero-crossing rate and the short-time energy is not limited.
When the voice-operated knocking switch is knocked, the voice sensor receives an audio signal generated by knocking of the voice-operated knocking switch, obtains zero-crossing rate and short-time energy according to the audio signal, and controls the on/off of the voice-operated knocking switch according to the zero-crossing rate and the short-time energy; the principle that the zero crossing rate of the obtained audio signal changes along with the change of the knocking area and the short-time energy of the obtained audio signal changes along with the change of the knocking strength is utilized; the knocking area and the knocking force are respectively determined according to the zero crossing rate and the short-time energy of the audio signal, so that the opening or closing of the voice-operated knocking switch is controlled more accurately, and the false triggering operation is reduced.
Alternatively, as shown in fig. 5, fig. 5 is a step flow diagram of an embodiment of the refinement flow of step S130 in fig. 4, where step S130 includes, but is not limited to, step S1300.
And S1300, when the zero crossing rate is within a preset range and the short-time energy is larger than a preset value, controlling the on or off of the voice-operated knocking switch.
It should be noted that the preset range of the zero-crossing rate and the preset value of the short-time energy need to be determined according to the material and the structure of the voice-operated knocking switch, and this embodiment does not specifically limit this.
When the zero crossing rate of the audio signal received by the sound sensor is linearly changed along with the distance between the knocking point and the sound sensor, the zero crossing rate is in a preset range, namely the distance between the knocking point and the sound sensor is in the preset range; the short-time energy is larger than a preset value, namely the knocking force is larger than a set threshold value; and determining that the knocking distance is within a preset range according to the zero crossing rate, and determining that the knocking force is greater than a set threshold value through the short-time energy being greater than the preset value, so that false triggering operation is reduced.
Alternatively, as shown in fig. 6, fig. 6 is a flowchart of steps of another embodiment of the refinement process of step S130 in fig. 4, and the step S130 includes, but is not limited to, step S1301 and step S1302.
S1301, inputting the zero crossing rate and the short-time energy into a preset audio classifier to obtain a classification result of whether the audio signal is an effective signal;
and S1302, when the audio signal is an effective signal according to the classification result, controlling the sound control knocking switch to be turned on or off.
The preset audio classifier is a prediction model obtained by training according to a certain number of audio signal acquisition samples, and the more the acquisition samples are, the more accurate the prediction result is; the input quantity of the preset audio classifier is the zero crossing rate and the short-time energy of the audio signal, and the output result is an effective signal or an invalid signal. The training method of the preset audio classifier can adopt a machine learning method or a deep learning method, the preset audio classifier can adopt an off-line training method, namely, the training is finished before use, the updating is not carried out in the use process, and the off-line training method is simpler to operate; the preset audio classifier can also adopt an online training method, even if the preset audio classifier is trained before use, the preset audio classifier is continuously updated according to the actual situation in the use process, and the result of the online training method is more accurate.
The zero-crossing rate of the audio signal received by the sound sensor is linearly or nonlinearly changed along with the distance from the knocking point to the sound sensor, and a preset audio classifier can be adopted to determine whether the audio signal is an effective signal or not, so that the opening or closing of the sound control knocking switch is controlled, and the probability of misoperation is reduced. Whether the audio signal is an effective signal is determined by adopting a preset audio classifier, and the preset audio classifier is obtained by training and learning according to training data of a known classification result, so that the method is applicable to the condition that the classification rule is obvious or not, wider in application range and more accurate in result.
Alternatively, as shown in fig. 7, fig. 7 is a flowchart illustrating steps of an embodiment of a preset audio classifier construction method, including, but not limited to, step S210 and step S220.
S210, collecting and marking an audio signal of the voice-operated knocking switch to obtain a data collecting sample;
and S220, training the data acquisition sample by using the zero crossing rate and the short-time energy of the audio signal as input parameters of training and adopting a support vector machine to construct and obtain a preset audio classifier.
Respectively marking the collected audio signals of the voice-operated knocking switch panel as valid audio signals and invalid audio signals according to actual conditions to form a data collection sample; training a data acquisition sample based on a support vector machine, wherein the data acquisition sample is divided into a training sample and a testing sample, the training sample and the testing sample both comprise valid audio signals and invalid audio signal samples, the input quantity is the zero crossing rate and the short-time energy of the audio signals, and the output quantity is valid signals or invalid signals.
The data sampling samples are trained by adopting a support vector machine method, and when the training samples of the audio signals are relatively few or present linear irresistibility, a more accurate training result can be obtained.
Optionally, the sound control knocking switch is controlled to be turned on or off according to the number of the effective signals and the time interval of the effective signals.
It should be noted that the number of valid signals may be 1, 2, or 3, and this embodiment does not specifically limit the number.
The interval time of the effective signal may be 200ms, 300ms, or 500ms, and may be set appropriately according to actual use needs, and this embodiment is not particularly limited thereto.
Optionally, the number of valid signals is set to 2, and the interval time of the valid signals is set to 200 ms; when the effective audio signal is detected, the number of times of the effective signal is set to be 1 and timing is started, the effective audio signal is continuously detected within 200ms, and when the effective signal is not detected within 200ms, the number of times of the effective signal is set to be 0 and detection is restarted; when the effective signal is detected within 200ms, the number of the effective signals is set to 2, and the sound control knocking switch is controlled to be turned on or off.
By increasing the number of times of detecting the effective signals and limiting the time interval of the effective signals, the false triggering operation caused by false collision is further reduced.
Optionally, as shown in fig. 8, fig. 8 is a flowchart illustrating steps of another method for controlling a voice-controlled tapping switch according to an embodiment of the present invention, including, but not limited to, step S310, step S320, and step S330.
Step S310, acquiring a vibration signal detected by a vibration sensor and an audio signal detected by a sound sensor;
step S320, when the amplitude of the vibration signal is larger than a preset amplitude, calculating zero crossing rate and short-term energy according to the audio signal; otherwise, the audio signal is not processed;
and step S330, controlling the on or off of the sound control knocking switch according to the zero crossing rate and the short-time energy.
When the sound-control knocking switch is knocked, the vibration sensor and the sound sensor respectively detect a vibration signal and an audio signal of the sound-control knocking switch, which are generated by knocking, when the amplitude of the vibration signal is larger than a preset amplitude value, the fact that knocking occurs in a panel area or an effective knocking area of the sound-control knocking switch is indicated, then the sound-control knocking switch is controlled to be turned on or turned off according to the zero crossing rate and short-term energy of the audio signal, and the false start operation of the sound-control knocking switch caused by the audio signal generated by a sound source in an area except the sound-control knocking switch panel is reduced; when the amplitude of the vibration signal is smaller than the preset amplitude, the knocking occurs outside the panel area of the voice-operated knocking switch or the effective knocking area, subsequent operation is not executed, namely the voice-operated knocking switch is not required to be controlled to be turned on or turned off according to the zero crossing rate and the short-time energy of the audio signal, the execution process is simple, and the operation is easy.
Referring to fig. 9, fig. 9 is a schematic structural diagram of acontrol device 110 according to an embodiment of the present invention. Thecontrol device 110 according to the embodiment of the present invention is built in a home appliance, and includes one ormore control processors 1101 and amemory 1102, and fig. 9 illustrates onecontrol processor 1101 and onememory 1102 as an example.
Thecontrol processor 1101 and thememory 1102 may be connected by a bus or other means, such as the bus connection shown in FIG. 9.
Thememory 1102, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, thememory 1102 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, thememory 1102 may optionally includememory 1102 located remotely from thecontrol processor 1101, and theremote memory 1102 may be coupled to thecontrol device 110 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Those skilled in the art will appreciate that the device configuration shown in fig. 9 does not constitute a limitation ofcontrol device 110, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
Non-transitory software programs and instructions required to implement the control method applied to thecontrol device 110 in the above-described embodiment are stored in thememory 1102, and when executed by thecontrol processor 1101, perform the control method applied to thecontrol device 110 in the above-described embodiment, for example, perform the method steps S110 to S130 in fig. 4, the method step S1300 in fig. 5, the method steps S1301 and S1302 in fig. 6, and the method steps S210 and S220 in fig. 7 described above.
Referring to fig. 10, fig. 10 is a schematic structural diagram of ahousehold appliance 100 according to an embodiment of the present invention, and thehousehold appliance 100 includes thecontrol device 110 according to the above embodiment. Thehousehold appliance 100 includes an air conditioner, a refrigerator, a water heater, a washing machine, and the like, and the embodiment is not particularly limited thereto.
A sound sensor is arranged on a sound control knocking switch panel of thehousehold appliance 100, and the principle that the zero crossing rate of the obtained audio signal changes along with the change of a knocking area and the short-time energy of the obtained audio signal changes along with the change of knocking strength is utilized; thecontrol device 110 can determine the knocking area and the knocking strength according to the zero crossing rate and the short-time energy of the audio signal, so as to more accurately control the on/off of thehousehold appliance 100, thereby reducing the false triggering operation.
A vibration sensor and a sound sensor are arranged on a sound-control knocking switch panel of thehousehold appliance 100, the vibration sensor detects whether the sound-control knocking switch panel region or the effective knocking region vibrates, and determines that an audio signal comes from the sound-control knocking switch panel region or the effective knocking region; when the knocking occurs outside the panel area of the voice-operated knocking switch or outside the effective knocking area, subsequent operation is not executed, namely, the voice-operated knocking switch is not required to be controlled to be turned on or turned off according to the zero crossing rate and the short-time energy of the audio signal, and the execution process is simple and easy to operate.
Since thehousehold appliance 100 in this embodiment has thecontrol device 110 in any embodiment, thehousehold appliance 100 in this embodiment has the hardware structure of thecontrol device 110 in the above embodiment, and the control processor in thecontrol device 110 can call the control program of thehousehold appliance 100 stored in the memory to realize control over thecontrol device 110.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer-executable program, which is executed by one or more control processors, for example, by one of thecontrol processors 1101 in fig. 9, and can cause the one ormore control processors 1101 to execute the control method in the above-described method embodiment, such as executing the above-described method steps S110 to S130 in fig. 4, the method step S1300 in fig. 5, the method steps S1301 and S1302 in fig. 6, and the method step S210 and S220 in fig. 7.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.