A bathroom heater switch control method and system based on sound recognition
By using sound detection unit and mean filtering technology in a bathroom noise environment, the accurate speech start and end time is obtained, combined with voice characteristics and speech speed generation reference speech, and using voice models to recognize voice content, the problem of low speech recognition accuracy in the prior art is solved, and the precise control of the bathroom heater switch is realized.
Patent Information
- Application Number
- CN202410928695.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-07-11
AI Technical Summary
The existing speech recognition technology is difficult to accurately recognize speech signals in bathroom noise environments, especially when acquiring the speech start time and end time, resulting in a reduced accuracy of speech signal recognition.
The sound detection unit detects real-time sound in the target area in real time, and then removes the noise and obtains the target voice, and obtains the starting time and end time points of the voice through mean filtering, and deletes the interval time period to obtain continuous voices to be identified. Then, the user's voice characteristics and speech speed are extracted, the reference speech is generated, the voice content is recognized through the voice model, and the bathroom heater operation is finally controlled based on the recognition results.
It improves the accuracy of voice recognition, ensures that the voice signal can be accurately recognized in the noise environment of the bathroom, and realizes accurate control of the bathroom heater switch.
Smart Images

Figure CN118918891B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of speech recognition technology, and more specifically to a bathroom heater switch control method and system based on sound recognition. Background Art
[0002] With the development of voice recognition technology and intelligent bathroom heater products, users can easily control bathroom heaters through simple voice commands without manual buttons, which is convenient and efficient. However, due to the relatively large noise in the bathroom, the accuracy is not enough when obtaining voice signals. For example: Chinese patent CN112786038A, this invention belongs to the field of voice control technology, specifically relates to a voice control method, device, server and bathing system for a bathing system, and aims to solve the problem of poor flexibility of voice control of existing bathing systems. The provided voice control method for a bathing system includes: obtaining a voice reservation signal; determining a bathing time and a bathing scene according to the voice reservation signal; when the bathing scene is a preset bathing scene, generating a control instruction of the bathing system according to the preset bathing scene and bathing time, so as to control the bathing system according to the control instruction, and realizing different parameter control of the bathing system according to different bathing scenes corresponding to the user's voice reservation signal, thereby improving the flexibility of voice control of the bathing system and improving the comfort of the user's bathing. For example: US Patent US10379507B2 discloses a voice-controlled bathing system and its operation method. The voice-controlled bathing system is used for a massage bath device, comprising at least one attachment device for actuating the massage bath device, a voice receiving unit for receiving at least one voice signal, a voice analysis module for analyzing at least one voice to generate at least one control command signal; a main control device, which is used to control the at least one attachment device according to the at least one control command to actuate the massage bath device and / or to control the actuation of the at least one attachment device according to the at least one control command. Both of the above patents realize the function of controlling the bathroom heater by voice, but the accuracy of voice recognition is not high, and the start time and end time of the voice cannot be accurately recognized, and the complete voice information cannot be continuously obtained, thereby reducing the accuracy of voice signal recognition. Summary of the invention
[0003] In order to better solve the above problems, the present invention provides a bathroom heater switch control method based on sound recognition, the method comprising the following steps:
[0004] Step S1: Detecting real-time sound in a target area in real time by a sound detection unit, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collecting real-time speech corresponding to the real-time sound, and denoising the real-time speech and saving it as the target speech in a storage unit;
[0005] Step S2: reading the target speech from the storage unit, and obtaining a first curve of the speech state of the target speech with respect to time, obtaining a second curve based on the first curve through mean filtering, obtaining a starting time point and an ending time point of the target speech through the second curve, taking the time period between the starting time point and the ending time point as a speech time period, obtaining an interval time period of the speech time period, deleting the interval time period within the speech time period in the target speech, and obtaining the speech to be recognized;
[0006] Step S3: extracting the user's voice features and speech rate from the to-be-recognized voice, and generating a plurality of reference voices having the same set contents as the user's voice features and speech rate through a reference generation unit;
[0007] Step S4: inputting the speech to be recognized and the multiple reference speech into a speech model, and outputting the similarity between the speech to be recognized and the multiple reference speech through the speech model, and obtaining the recognition result of the recognized speech based on the control content of the reference speech with the highest similarity;
[0008] Step S5: Control the operation of the target bathroom heater based on the control content.
[0009] As a preferred technical solution of the present invention, in step S1, the real-time sound includes background noise, the preset frequency range is the frequency range of human voice, and denoising the real-time speech includes filtering out the background noise in the real-time speech, wherein the frequency range of human voice is different from the frequency of the background noise.
[0010] As a preferred technical solution of the present invention, step S2 includes the following steps:
[0011] Step S21: Based on the target speech being divided into a plurality of first time periods in chronological order, the speech state in each of the first time periods is determined. When a sound in the preset frequency range is detected in the first time period, the speech state value corresponding to the first time period is set to a first threshold value. Otherwise, the speech state value is set to a second threshold value. The speech state values of all the first time periods are connected to obtain the first curve.
[0012] Step S22: performing mean filtering on the first curve with a preset window to obtain the second curve, and taking the time point when the corresponding value in the second curve changes from less than the first set threshold to greater than or equal to the first set threshold as the first time point, and taking the inflection point closest to the first time point as the starting time point, the inflection point being the point at which the value change trend changes from unchanged or decreasing to increasing, and taking the time point after the starting time point when the value changes from greater than or equal to the second set threshold to less than the second set threshold as the second time point, and when the value continues to be less than the second set threshold for at least a preset time after the second time point, the second time point is the ending time point, otherwise, the second time point is an interval time point, wherein the first set threshold is greater than the second set threshold;
[0013] Step S23: Obtain the third time point before the interval time point when the value changes from an increasing trend to a decreasing trend, take the time period between the second time point and the interval time point as the interval time period, delete the second voice corresponding to the multiple interval time periods in the target voice, and obtain the voice to be recognized, wherein the duration of each time period is the same.
[0014] As a preferred technical solution of the present invention, step S2 also includes the duration of the first time period being less than or equal to the minimum duration of the unit morpheme in the speech to be recognized, and the window of the mean filter is the duration of N first time periods, where the value of N is a positive integer greater than or equal to 2 and less than or equal to 5.
[0015] As a preferred technical solution of the present invention, step S3 includes:
[0016] The voice features and speech rate of the user are extracted from the voice to be recognized, wherein the voice features include the user's timbre, voice frequency and sound intensity; and a plurality of reference voices are generated by the reference generation unit based on a plurality of the set contents and the voice features and speech rate of the user.
[0017] As a preferred technical solution of the present invention, step S4 includes the following steps:
[0018] Step S41: inputting the speech to be recognized and a plurality of reference speech into the speech model, wherein the speech model is a trained machine learning model;
[0019] Step S42: the speech model outputs the similarity between the speech to be recognized and each of the reference speech, and takes the control content corresponding to the reference speech with the highest similarity and the similarity greater than a set threshold as the recognition result of the speech to be recognized.
[0020] As a preferred technical solution of the present invention, step S4 also includes: when the similarity between the speech to be recognized and multiple reference speeches is less than the set similarity, or the similarity difference between at least two reference speeches and the speech to be recognized is greater than or equal to the set similarity and the difference between the two is less than or equal to the set difference, repeating the method of step S2 and adjusting the window of the mean filter to re-acquire the speech to be recognized.
[0021] As a preferred technical solution of the present invention, the step S5 also includes: comparing the control content with the current state of the target bathroom heater, and when the control content conflicts with the state of the target bathroom heater, prompting the user to reissue the voice command.
[0022] The present invention provides a bathroom heater switch control system based on sound recognition, the system is used to implement the above method, and is characterized in that the system includes:
[0023] A sound detection unit is used to detect real-time sound in a target area in real time, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collect the real-time speech corresponding to the real-time sound, and remove noise from the real-time speech as the target speech;
[0024] The storage unit is used to store the target speech;
[0025] The processing unit is configured to: read the target speech from the storage unit, and obtain a first curve of the speech state of the target speech with respect to time, obtain a second curve based on the first curve through mean filtering, obtain a starting time point and an ending time point of the target speech through the second curve, take the time period between the starting time point and the ending time point as a speech time period, obtain an interval time period of the speech time period, delete the interval time period within the speech time period in the target speech, and obtain the speech to be recognized;
[0026] A reference generation unit, configured to extract the voice features and speech rate of the user from the speech to be recognized, and generate reference speech with the same set contents as the voice features and speech rate of the user;
[0027] A recognition unit, configured to input the speech to be recognized and the plurality of reference speech into a speech model, and output the similarity between the speech to be recognized and the plurality of reference speech through the speech model, and obtain a recognition result of the recognized speech based on the control content of the reference speech with the highest similarity;
[0028] An execution unit is used to control the operation of the target bathroom heater based on the control content.
[0029] The present invention also provides a computer storage medium, wherein the storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute the above method.
[0030] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0031] The present invention detects the real-time speech in the target area in real time through a sound detection unit, and obtains the target speech after denoising, divides the target speech into a plurality of first time periods of equal duration, obtains the speech state in each of the first time periods in the target speech, and sets the speech state value according to the speech state in each of the first time periods, quantifies the target speech state, and obtains the first curve of the speech state corresponding to the target speech, the first curve reflects the distribution state of speech time and interval time, and obtains the second curve by performing mean filtering on the first curve with the preset window, so as to more accurately obtain the starting time point and the ending time point of the speech to be recognized, thereby improving the recognition accuracy of the speech to be recognized. Since the interval time period lasts for a long time, it affects the continuity of the target speech. Therefore, by deleting the second speech corresponding to the interval time period from the target speech, the continuous speech to be recognized is obtained, thereby improving the recognition accuracy of the speech to be recognized. Since the speech characteristics and speech speed of each user are different, the same reference speech cannot be used to recognize the speech of different users. Therefore, by extracting the voice features and speech rate of the user from the above-mentioned voice to be recognized by the user, a plurality of the above-mentioned reference voices based on the voice features and speech rate of the user and a plurality of set control contents are generated, by inputting the above-mentioned voice to be recognized and the plurality of reference voices into the above-mentioned voice model, outputting the similarity between the above-mentioned voice to be recognized and each of the above-mentioned reference voices, and taking the control content corresponding to the above-mentioned reference voice with the highest similarity and greater than the set threshold as the control content of the above-mentioned voice to be recognized, when the similarity between the above-mentioned voice to be recognized and the plurality of the above-mentioned reference voices is output through the above-mentioned voice model, when the similarity between the above-mentioned voice to be recognized and the plurality of the above-mentioned reference voices is less than the above-mentioned set similarity, or when the similarity between the above-mentioned voice to be recognized and the plurality of the above-mentioned reference voices is relatively large, it may be that the window size of the above-mentioned mean filter is not appropriately set, so that the above-mentioned voice to be recognized is not complete or accurate enough, therefore, repeating the above-mentioned step S2, by adjusting the window size of the above-mentioned mean filter, reacquiring the above-mentioned voice to be recognized, and re-recognizing the above-mentioned reacquired voice to be recognized, the above-mentioned technical solutions cooperate with each other, and the accuracy of voice recognition is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a flow chart of a method for controlling a bathroom heater switch based on sound recognition according to the present invention;
[0033] Figure 2This is a structural diagram of a bathroom heater switch control system based on sound recognition according to the present invention;
[0034] Figure 3 Schematic diagram of the first curve and the second curve in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] The present invention provides a method for controlling a bathroom heater switch based on sound recognition, such as Figure 1 As shown, the method comprises the following steps:
[0037] Step S1: Detecting real-time sound in a target area in real time by a sound detection unit, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collecting real-time speech corresponding to the real-time sound, and denoising the real-time speech and saving it as the target speech in a storage unit;
[0038] Specifically, the real-time sound in the target area is detected in real time by the sound detection unit. The target area may be a bathroom. The sounds in the bathroom are mainly the sound of flowing water and the sound of people talking. The frequencies of the sound of flowing water and the sound of people talking are different. When the real-time sound includes the target sound in the preset frequency range, the preset frequency range is the frequency of human talking sound. That is, when the sound of someone talking is detected and the sound intensity is greater than the set sound intensity, the real-time speech is denoised as the target speech and saved in the storage unit to facilitate further processing to obtain the speech to be recognized.
[0039] Step S2: reading the target speech from the storage unit, and obtaining a first curve of the speech state of the target speech with respect to time, obtaining a second curve based on the first curve through mean filtering, obtaining a starting time point and an ending time point of the target speech through the second curve, taking the time period between the starting time point and the ending time point as a speech time period, obtaining an interval time period of the speech time period, deleting the interval time period within the speech time period in the target speech, and obtaining the speech to be recognized;
[0040] Specifically, the target speech is divided into a plurality of first time periods of equal duration, the speech state in each of the first time periods in the target speech is obtained, and the speech state value is set according to the speech state in each of the first time periods, the target speech state is quantified, and a first curve of the speech state corresponding to the target speech is obtained. The first curve reflects the distribution state of speech time and interval time, and lays a foundation for obtaining the starting time point and the ending time point of the speech. The first curve is mean filtered with the preset window, the square wave waveform of the first curve is smoothed, and the second curve is obtained. Figure 3 As shown, the solid square wave is the first curve, the dotted line is the second curve, the time point corresponding to the t1 moment is the first time point, and the t0 moment is the inflection point. Although the value at t1 moment is greater than the first set threshold, wherein the value of the first set threshold is greater than or equal to 1 / 2 of the difference between the first threshold and the second threshold, since the value at t1 moment begins to accumulate after t0 moment, t0 moment is the real speech start time point. Figure 3 In the figure, both the moment t5 and the moment t3 are the above-mentioned second time points. Since the above-mentioned numerical value is continuously less than the above-mentioned second set threshold value after the above-mentioned moment t5, and the duration is greater than the above-mentioned preset time, the above-mentioned moment t5 is the end time point. Since the duration for which the above-mentioned numerical value is continuously less than the above-mentioned second set threshold value after the above-mentioned moment t3 is less than the above-mentioned preset time, the above-mentioned moment t3 is the interval time point. Through the above-mentioned technical scheme, the starting time point and the ending time point of the above-mentioned speech to be recognized can be obtained more accurately, thereby improving the recognition accuracy of the above-mentioned speech to be recognized. The moment t3 is the above-mentioned interval time point, the moment t2 is the above-mentioned third time point, and the time period between the moment t2 and the moment t3 is the above-mentioned interval time period. Since the duration of the interval time period is relatively long, it affects the continuity of the above-mentioned target speech. Therefore, by deleting the second speech corresponding to the above-mentioned interval time period from the target speech, the continuous above-mentioned speech to be recognized is obtained, thereby improving the recognition accuracy of the above-mentioned speech to be recognized.
[0041] Step S3: extracting the user's voice features and speech speed from the speech to be recognized, and generating a plurality of reference voices with the same set control contents as the user's voice features and speech speed through a reference generation unit;
[0042] Specifically, since each user has different voice features and speaking speed, the same reference voice cannot be used to recognize the voices of different users. Therefore, the voice features and speaking speed of the user are extracted from the user's voice to be recognized, where the voice features include the user's timbre, voice frequency and sound intensity. The generation unit generates multiple reference voices based on the user's voice features and speaking speed and multiple set control contents, thereby laying a foundation for accurately recognizing the voice to be recognized based on the reference voice.
[0043] Step S4: inputting the speech to be recognized and the plurality of reference speech into a speech model, outputting the similarity between the speech to be recognized and the plurality of reference speech through the speech model, and acquiring the control content of the recognized speech based on the similarity;
[0044] Specifically, the above-mentioned speech to be recognized and multiple reference speech are input into the above-mentioned speech model, wherein the above-mentioned speech model is a trained machine learning model, and the training of the machine learning model is a prior art and will not be repeated here. The above-mentioned speech model can output the similarity between the above-mentioned speech to be recognized and each of the above-mentioned reference speech, and take the control content corresponding to the above-mentioned reference speech with the highest similarity and greater than the set threshold as the control content of the above-mentioned speech to be recognized. Through the above-mentioned technical solution, the above-mentioned control content corresponding to the above-mentioned speech to be recognized can be accurately identified.
[0045] Step S5: Control the operation of the target bathroom heater based on the control content.
[0046] Specifically, the operation of the target bathroom heater is controlled through the control content, thereby achieving hands-free operation.
[0047] Further, in step S1, the real-time sound includes background noise, the preset frequency range is a human voice frequency range, and denoising the real-time speech includes filtering out the background noise in the real-time speech, wherein the human voice frequency range is different from the frequency of the background noise.
[0048] Specifically, since there may be water flow sound, i.e. background noise, and human voices, i.e. sounds within the preset frequency range, in the bathroom, by filtering out the background noise and retaining the human voices, i.e. the target voice, foundation is laid for obtaining accurate control content by processing the target voice.
[0049] Furthermore, the step S2 comprises the following steps:
[0050] Step S21: reading the target speech from the storage unit, and dividing the target speech into a plurality of first time periods in chronological order, determining the speech state in each of the first time periods, and when a sound in the preset frequency range is detected in the first time period, setting the speech state value corresponding to the first time period to a first threshold value, otherwise, setting the speech state value to a second threshold value, and connecting the speech state values of all the first time periods to obtain the first curve;
[0051] Specifically, by obtaining the speech state of each of the above-mentioned first time periods in the above-mentioned target speech, and setting the speech state value according to the speech state of each of the above-mentioned first time periods, when there is human voice in the above-mentioned first time period, the corresponding speech state value is set to a first threshold value, and the first threshold value is a positive integer greater than 0; conversely, when there is no human voice in the above-mentioned first time period, the corresponding speech state value is set to a second threshold value, and the second threshold value is 0. Through the above-mentioned technical solution, the above-mentioned target speech state is quantified, and the first curve of the speech state corresponding to the above-mentioned target speech is obtained. The above-mentioned first curve reflects the distribution state of speech time and interval time, laying a foundation for obtaining the starting time point and the ending time point of the speech.
[0052] Step S22: performing mean filtering on the first curve with a preset window to obtain the second curve, and taking the time point when the corresponding value in the second curve changes from less than the first set threshold to greater than or equal to the first set threshold as the first time point, and taking the inflection point closest to the first time point as the starting time point, the inflection point being the point at which the value change trend changes from unchanged or decreasing to increasing, and taking the time point after the starting time point when the value changes from greater than or equal to the second set threshold to less than the second set threshold as the second time point, and when the value continues to be less than the second set threshold for at least a preset time after the second time point, the second time point is the ending time point, otherwise, the second time point is an interval time point, wherein the first set threshold is greater than the second set threshold;
[0053] Specifically, the square wave waveform of the first curve is smoothed by performing mean filtering on the first curve with the preset window, and the second curve is obtained, such as Figure 3 As shown, the solid square wave is the first curve, the dotted line is the second curve, the time point corresponding to the t1 moment is the first time point, and the t0 moment is the inflection point. Although the value at t1 moment is greater than the first set threshold, wherein the value of the first set threshold is greater than or equal to 1 / 2 of the difference between the first threshold and the second threshold, since the value at t1 moment begins to accumulate after t0 moment, t0 moment is the real speech start time point. Figure 3 Both the moment t5 and the moment t3 are the above-mentioned second time points. Since after the above-mentioned moment t5, the above-mentioned numerical value is continuously less than the above-mentioned second set threshold value, and the duration is greater than the above-mentioned preset time, the above-mentioned moment t5 is the end time point. Since after the above-mentioned moment t3, the duration that the above-mentioned numerical value is continuously less than the above-mentioned second set threshold value is less than the above-mentioned preset time, the above-mentioned moment t3 is the interval time point. Through the above-mentioned technical solution, the start time point and the end time point of the above-mentioned speech to be recognized can be obtained more accurately, thereby improving the recognition accuracy of the above-mentioned speech to be recognized.
[0054] Step S23: Obtain the third time point before the interval time point when the value changes from an increasing trend to a decreasing trend, take the time period between the second time point and the interval time point as the interval time period, delete the second voice corresponding to the multiple interval time periods in the target voice, and obtain the voice to be recognized, wherein the duration of each time period is the same.
[0055] Specifically, in Figure 3 In the figure, moment t3 is the above-mentioned interval time point, moment t2 is the above-mentioned third time point, and the time period between moment t2 and moment t3 is the above-mentioned interval time period. Since the interval time period lasts for a long time, it affects the continuity of the above-mentioned target speech. Therefore, by deleting the above-mentioned interval time period from the second speech corresponding to the above-mentioned interval time period, the above-mentioned continuous speech to be recognized is obtained, thereby improving the recognition accuracy of the above-mentioned speech to be recognized.
[0056] Furthermore, the step S2 also includes: the duration of the first time period is less than or equal to the minimum duration of the unit morpheme in the speech to be recognized, and the window of the mean filter is the duration of N first time periods, where the value of N is a positive integer greater than or equal to 2 and less than or equal to 5.
[0057] Specifically, by setting the above-mentioned first time period, the speech state at each time point in the above-mentioned speech to be recognized can be accurately obtained, and then a more accurate above-mentioned first curve can be obtained. By setting the window of the above-mentioned mean filter and obtaining a smooth second curve based on the above-mentioned first curve, it is possible to lay the foundation for extracting more accurate starting time points and ending time points of the above-mentioned target speech, thereby obtaining accurate speech to be recognized, and then improving the recognition accuracy of the above-mentioned speech to be recognized.
[0058] Furthermore, the step S3 comprises:
[0059] The voice features and speech rate of the user are extracted from the voice to be recognized, wherein the voice features include the user's timbre, voice frequency and sound intensity; and a plurality of reference voices are generated by the reference generation unit based on a plurality of the set control contents and the voice features and speech rate of the user.
[0060] Specifically, since each user has different voice features and speaking speeds, the same reference voice cannot be used to identify the voices of different users. Therefore, by extracting the voice features and speaking speed of the user from the voice to be identified, the reference generation unit generates multiple reference voices based on the voice features and speaking speed of the user and multiple set control contents, thereby laying the foundation for accurately identifying the voice to be identified based on the reference voice.
[0061] Furthermore, the step S4 comprises the following steps:
[0062] Step S41: inputting the speech to be recognized and a plurality of reference speech into the speech model, wherein the speech model is a trained machine learning model;
[0063] Step S42: the speech model outputs the similarity between the speech to be recognized and each of the reference speech, and takes the control content corresponding to the reference speech with the highest similarity and the similarity greater than the set similarity as the recognition result of the speech to be recognized.
[0064] Specifically, the above-mentioned speech to be recognized and multiple reference speech are input into the above-mentioned speech model, wherein the above-mentioned speech model is a trained machine learning model, and the above-mentioned speech model can output the similarity between the above-mentioned speech to be recognized and each of the above-mentioned reference speech, and take the control content corresponding to the above-mentioned reference speech with the highest similarity and greater than the similarity as the control content of the above-mentioned speech to be recognized. Through the above-mentioned technical solution, the above-mentioned control content corresponding to the above-mentioned speech to be recognized can be accurately identified, thereby improving the recognition accuracy.
[0065] Furthermore, the step S4 also includes: when the similarity between the speech to be recognized and the multiple reference speeches is less than the set similarity, or the similarity difference between at least two of the reference speeches and the speech to be recognized is greater than or equal to the set similarity and the difference between the two is less than or equal to the set difference, repeating the method of step S2 and adjusting the window of the mean filter to re-acquire the speech to be recognized.
[0066] Specifically, when the similarity between the above-mentioned speech to be recognized and the multiple reference speech is output through the above-mentioned speech model, when the similarity between the above-mentioned speech to be recognized and the multiple reference speech is less than the above-mentioned set similarity, or when the similarity with the two reference speech is relatively large, it may be that the window size setting of the above-mentioned mean filter is inappropriate, so that the above-mentioned speech to be recognized is not complete or accurate enough. Therefore, repeat the above-mentioned step S2, by adjusting the window size of the above-mentioned mean filter, increasing M of the above-mentioned first time periods or reducing M of the above-mentioned first time periods as the new above-mentioned mean filter window, M is a positive integer greater than or equal to 1 and less than or equal to 3, wherein the above-mentioned first time period is the judgment time unit of the above-mentioned first curve, re-acquire the above-mentioned speech to be recognized, and re-recognize the above-mentioned re-acquired speech to be recognized, so as to improve the recognition accuracy.
[0067] Furthermore, the step S5 also includes: comparing the control content with the current state of the target bathroom heater, and when the control content conflicts with the state of the target bathroom heater, prompting the user to reissue the voice command.
[0068] Specifically, by comparing the control content recognized by the voice to be recognized with the state of the target bathroom heater, for example, when the bathroom heater is in the on state and the control content is also an on command, the user is prompted by voice to reissue the voice command.
[0069] The present invention also provides a bathroom heater switch control system based on sound recognition, the system is used to implement the above method, such as Figure 2 As shown, the system comprises:
[0070] A sound detection unit is used to detect real-time sound in a target area in real time, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collect the real-time speech corresponding to the real-time sound, and remove noise from the real-time speech as the target speech;
[0071] The storage unit is used to store the target speech;
[0072] The processing unit is configured to: read the target speech from the storage unit, and obtain a first curve of the speech state of the target speech with respect to time, obtain a second curve based on the first curve through mean filtering, obtain a starting time point and an ending time point of the target speech through the second curve, take the time period between the starting time point and the ending time point as a speech time period, obtain an interval time period of the speech time period, delete the interval time period within the speech time period in the target speech, and obtain the speech to be recognized;
[0073] A reference generation unit, configured to extract the voice features and speech rate of the user from the speech to be recognized, and generate reference speech with the same set contents as the voice features and speech rate of the user;
[0074] A recognition unit, configured to input the speech to be recognized and the plurality of reference speech into a speech model, and output the similarity between the speech to be recognized and the plurality of reference speech through the speech model, and obtain a recognition result of the recognized speech based on the control content of the reference speech with the highest similarity;
[0075] An execution unit is used to control the operation of the target bathroom heater based on the control content.
[0076] The present invention also provides a computer storage medium, wherein the storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute the above method.
[0077] In summary, the present invention detects real-time speech in a target area in real time through a sound detection unit, and obtains the target speech after denoising, divides the target speech into a plurality of first time periods of equal duration, obtains the speech state in each of the first time periods in the target speech, and sets a speech state value according to the speech state in each of the first time periods, quantifies the target speech state, and obtains a first curve of the speech state corresponding to the target speech, the first curve reflects the distribution state of speech time and interval time, and obtains the second curve by performing mean filtering on the first curve with the preset window, so as to more accurately obtain the starting time point and the ending time point of the speech to be recognized, thereby improving the recognition accuracy of the speech to be recognized. Since the interval time period lasts for a long time, it affects the continuity of the target speech. Therefore, by deleting the second speech corresponding to the interval time period from the target speech, the continuous speech to be recognized is obtained, thereby improving the recognition accuracy of the speech to be recognized. Since the speech characteristics and speech speed of each user are different, the same reference speech cannot be used to recognize different users. Therefore, by extracting the voice features and speech speed of the user from the user's voice to be recognized, generating multiple reference voices based on the user's voice features and speech speed and multiple set control contents, inputting the voice to be recognized and multiple reference voices into the voice model, outputting the similarity between the voice to be recognized and each of the reference voices, and taking the control content corresponding to the reference voice with the highest similarity and greater than the set threshold as the control content of the voice to be recognized, when the similarity between the voice to be recognized and the multiple reference voices is output through the voice model, when the similarity between the voice to be recognized and the multiple reference voices is less than the set similarity, or when the similarity between the voice to be recognized and the two reference voices is relatively large, it may be that the window size of the mean filter is not properly set, so that the voice to be recognized is not complete or accurate enough, therefore, repeating the step S2, reacquiring the voice to be recognized by adjusting the window size of the mean filter, and re-recognizing the re-acquired voice to be recognized, the accuracy of voice recognition is improved through the cooperation of the above technical solutions.
[0078] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0079] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0080] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for controlling a bathroom heater switch based on sound recognition, characterized in that: The method comprises the following steps: Step S1: Detecting real-time sound in a target area in real time by a sound detection unit, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collecting real-time speech corresponding to the real-time sound, and denoising the real-time speech and saving it as the target speech in a storage unit; Step S2: reading the target speech from the storage unit, and obtaining a first curve of the speech state of the target speech with respect to time, obtaining a second curve based on the first curve through mean filtering, obtaining a starting time point and an ending time point of the target speech through the second curve, taking the time period between the starting time point and the ending time point as a speech time period, obtaining an interval time period of the speech time period, deleting the interval time period within the speech time period in the target speech, and obtaining the speech to be recognized; Step S3: extracting the user's voice features and speech rate from the to-be-recognized voice, and generating a plurality of reference voices having the same set contents as the user's voice features and speech rate through a reference generation unit; Step S4: inputting the speech to be recognized and the multiple reference speech into a speech model, and outputting the similarity between the speech to be recognized and the multiple reference speech through the speech model, and obtaining the recognition result of the recognized speech based on the control content of the reference speech with the highest similarity; Step S5: controlling the operation of the target bathroom heater based on the control content; Wherein, the step S2 comprises the following steps: Step S21: Based on the target speech being divided into a plurality of first time periods in chronological order, the speech state in each of the first time periods is determined. When a sound in the preset frequency range is detected in the first time period, the speech state value corresponding to the first time period is set to a first threshold value. Otherwise, the speech state value is set to a second threshold value. The speech state values of all the first time periods are connected to obtain the first curve. Step S22: performing mean filtering on the first curve with a preset window to obtain the second curve, and taking the time point when the corresponding value in the second curve changes from less than the first set threshold to greater than or equal to the first set threshold as the first time point, and taking the inflection point closest to the first time point as the starting time point, the inflection point being the point at which the value change trend changes from unchanged or decreasing to increasing, and taking the time point after the starting time point when the value changes from greater than or equal to the second set threshold to less than the second set threshold as the second time point, and when the value continues to be less than the second set threshold for at least a preset time after the second time point, the second time point is the ending time point, otherwise, the second time point is an interval time point, wherein the first set threshold is greater than the second set threshold; Step S23: Obtain the third time point before the interval time point when the value changes from an increasing trend to a decreasing trend, take the time period between the second time point and the interval time point as the interval time period, delete the second voice corresponding to the multiple interval time periods in the target voice, and obtain the voice to be recognized, wherein the duration of each time period is the same.
2. The method according to claim 1, characterized in that In step S1, the real-time sound includes background noise, the preset frequency range is a human voice frequency range, and denoising the real-time speech includes filtering out the background noise in the real-time speech, wherein the human voice frequency range is different from the frequency of the background noise.
3. The method according to claim 1, characterized in that The step S2 also includes that the duration of the first time period is less than or equal to the minimum duration of the unit morpheme in the speech to be recognized, and the window of the mean filter is N times the duration of the first time period, where the value of N is a positive integer greater than or equal to 2 and less than or equal to 5.
4. The method according to claim 1, characterized in that The step S3 comprises: The voice features and speech rate of the user are extracted from the voice to be recognized, wherein the voice features include the user's timbre, voice frequency and sound intensity; and a plurality of reference voices are generated by the reference generation unit based on a plurality of the set contents and the voice features and speech rate of the user.
5. The method according to claim 1, characterized in that The step S4 comprises the following steps: Step S41: inputting the speech to be recognized and a plurality of reference speech into the speech model, wherein the speech model is a trained machine learning model; Step S42: the speech model outputs the similarity between the speech to be recognized and each of the reference speech, and takes the control content corresponding to the reference speech with the highest similarity and the similarity greater than a set threshold as the recognition result of the speech to be recognized.
6. The method according to claim 1, characterized in that The step S4 also includes: when the similarity between the speech to be recognized and the multiple reference speeches is less than the set similarity, or the similarity difference between at least two of the reference speeches and the speech to be recognized is greater than or equal to the set similarity and the difference between the two is less than or equal to the set difference, repeating the method of step S2 and adjusting the window of the mean filter to reacquire the speech to be recognized.
7. The method according to claim 1, characterized in that The step S5 also includes: comparing the control content with the current state of the target bathroom heater, and when the control content conflicts with the state of the target bathroom heater, prompting the user to reissue the voice command.
8. A bathroom heater switch control system based on sound recognition, the system is used to implement the method according to any one of claims 1 to 7, characterized in that: The system comprises: A sound detection unit is used to detect real-time sound in a target area in real time, and when the real-time sound includes sound in a preset frequency range and the sound intensity of the real-time sound is greater than the set sound intensity, collect the real-time speech corresponding to the real-time sound, and remove noise from the real-time speech as the target speech; The storage unit is used to store the target speech; The processing unit is configured to: read the target speech from the storage unit, and obtain a first curve of the speech state of the target speech with respect to time, obtain a second curve based on the first curve through mean filtering, obtain a starting time point and an ending time point of the target speech through the second curve, take the time period between the starting time point and the ending time point as a speech time period, obtain an interval time period of the speech time period, delete the interval time period within the speech time period in the target speech, and obtain the speech to be recognized; A reference generation unit, configured to extract the voice features and speech rate of the user from the speech to be recognized, and generate reference speech with the same set contents as the voice features and speech rate of the user; A recognition unit, configured to input the speech to be recognized and the plurality of reference speech into a speech model, and output the similarity between the speech to be recognized and the plurality of reference speech through the speech model, and obtain a recognition result of the recognized speech based on the control content of the reference speech with the highest similarity; An execution unit is used to control the operation of the target bathroom heater based on the control content.
9. A computer storage medium, characterized in that: The storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Voice control method and device of bathing system, server and bathing system
CN112786038A
Voice control type bath system and operating method thereof
US10379507B2
Audio processing method and device, and equipment
CN114078464A
Morse signal detection and identification method
CN114553639A