Method and system for switching working modes of electrical appliances based on voice interaction

By extracting the command audio data and user emotions in the smart home system, combined with the appliance topology model, the appliance working mode is automatically adjusted, which solves the problem of insufficient accuracy in switching the appliance working mode under voice interaction in the smart home system, and improves the user experience and system Intelligence.

CN118136010BActive Publication Date: 2024-09-27ZHEJIANG BAHE KITCHENWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410282967.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-13
Publication Date
2024-09-27
Estimated Expiration
2044-03-13

AI Technical Summary

Technical Problem

Existing smart home systems have insufficient accuracy in switching electrical working modes under voice interaction, especially in complex emotional states, which are difficult to accurately capture, resulting in inconvenient user experience.

Method used

By obtaining the user's command audio data, extracting command keywords and audio features, constructing an appliance topology model, combining user emotional data for coding fusion, and inputting the appliance working mode analysis model to automatically adjust the appliance working mode.

Benefits of technology

It improves the accuracy of electrical appliance working mode switching in smart home systems under voice interaction, reduces user manual intervention, and provides more convenient home environment management and personalized experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118136010B
    Figure CN118136010B
Patent Text Reader

Abstract

The present invention relates to the field of speech recognition technology, and discloses a method and system for switching the working mode of an electrical appliance based on speech interaction, which is used to improve the accuracy of switching the working mode of an electrical appliance based on speech interaction. The method includes: performing correlation analysis on multiple target electrical appliances preset in the Internet of Things to obtain the correlation degree between each two target electrical appliances; performing network topology model construction on multiple target electrical appliances to obtain an electrical appliance topology model; performing related electrical appliance matching on the electrical appliance topology model to obtain at least two first candidate electrical appliances; performing user emotion recognition on the target user to obtain user emotion data, performing electrical appliance screening on at least two candidate electrical appliances to obtain at least one second candidate electrical appliance; performing encoding fusion on the user emotion data and the target instruction keywords to obtain an encoding fusion vector, and inputting the encoding fusion vector into the electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech recognition technology, and in particular to a method and system for switching working modes of an electrical appliance based on speech interaction. Background Art

[0002] As smart home technology continues to develop, researchers and engineers have been working hard to improve the user experience and automation capabilities of smart home systems. Traditional smart home systems mainly rely on manual control by users, which can cause inconvenience to users, especially when they are busy or emotionally unstable. Therefore, researchers have begun to explore how to achieve a more intelligent and personalized smart home system by combining technologies such as speech recognition, emotion analysis, and smart appliance control.

[0003] Traditional smart home systems mainly rely on manual control by users, which can cause inconvenience in some situations. At the same time, although the current emotion recognition model can analyze the user's emotions, its accuracy still has room for improvement. Some emotions, especially complex emotional states, are difficult to capture accurately. Therefore, the existing solutions are not accurate enough when switching the working mode of electrical appliances based on voice interaction. Summary of the invention

[0004] The present invention provides a method and system for switching working modes of an electrical appliance based on voice interaction, which are used to improve the accuracy of switching working modes of an electrical appliance based on voice interaction.

[0005] A first aspect of the present invention provides a method for switching an electrical appliance working mode based on voice interaction, the method for switching an electrical appliance working mode based on voice interaction comprising:

[0006] Acquire command audio data of a target user, extract command keywords from the command audio data, and obtain target command keywords;

[0007] Extracting audio features from the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data;

[0008] Performing correlation analysis on a plurality of target electrical appliances preset in a preset Internet of Things, and obtaining a correlation degree between every two target electrical appliances;

[0009] Based on the association degree between each two target electrical appliances, a network topology model is constructed for the plurality of target electrical appliances to obtain an electrical appliance topology model;

[0010] Matching related electrical appliances to the electrical appliance topology model using the target instruction keyword to obtain at least two first candidate electrical appliances;

[0011] Performing user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, performing appliance screening on at least two of the candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance;

[0012] The user emotion data and the target instruction keywords are encoded and fused to obtain an encoding fusion vector, and the encoding fusion vector is input into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and at least one of the second candidate electrical appliances is controlled to switch the electrical appliance working mode through the working mode data.

[0013] In combination with the first aspect, in a first implementation of the first aspect of the present invention, the step of acquiring instruction audio data of a target user, extracting instruction keywords from the instruction audio data, and obtaining target instruction keywords includes:

[0014] Acquire the instruction audio data, and perform noise reduction processing on the instruction audio data to obtain noise-reduced audio data;

[0015] Performing audio segmentation processing on the noise reduction audio data to obtain a plurality of segmented audio data;

[0016] Extracting key audio data from the plurality of segmented audio data to obtain key audio data;

[0017] Performing principal component analysis on the key audio data to obtain principal component audio data corresponding to the key audio data;

[0018] Performing audio data encoding on the main component audio data to obtain corresponding encoded audio data;

[0019] The encoded audio data is vectorized to obtain a corresponding audio vector matrix, and the audio vector matrix is ​​input into a preset keyword extraction model for keyword extraction to obtain corresponding target instruction keywords, wherein the target instruction keywords include electrical switch instructions and mode adjustment instructions.

[0020] In combination with the first aspect, in a second implementation of the first aspect of the present invention, the audio feature extraction is performed on the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data, including:

[0021] Performing time series extraction on the instruction audio data to obtain time series data corresponding to the instruction audio data;

[0022] Calculating the number of audio segmentation frames for the time series data to obtain a target number of audio segmentation frames;

[0023] Performing audio frame processing on the instruction audio data according to the target audio segmentation frame number to obtain a plurality of audio frame data;

[0024] Performing short-time energy calculation on each of the audio frame data respectively to obtain short-time energy data corresponding to each of the audio frame data;

[0025] Calculating the zero-crossing rate of each audio frame data respectively to obtain zero-crossing rate data corresponding to each audio frame data;

[0026] Based on the short-time energy data corresponding to each of the audio frame data and the zero-crossing rate data corresponding to each of the audio frame data, calculating the speech rate of each of the audio frame data to obtain the speech rate data corresponding to each of the audio frame data;

[0027] According to the speech rate data corresponding to each of the audio frame data, performing speech rate feature analysis on the instruction audio data to obtain the speech rate feature data;

[0028] Tone feature extraction is performed on each of the audio frame data to obtain the tone feature data, and the speech rate feature data and the tone feature data are merged to obtain the audio feature set.

[0029] In combination with the second implementation manner of the first aspect, in a third implementation manner of the first aspect of the present invention, the step of extracting tone features from each of the audio frame data to obtain the tone feature data, and merging the speech rate feature data and the tone feature data to obtain the audio feature set includes:

[0030] Performing frequency domain data conversion on each of the audio frame data respectively to obtain frequency domain signal data corresponding to each of the audio frame data;

[0031] Constructing a frequency spectrum of the plurality of audio frame data using the frequency domain signal data corresponding to each of the audio frame data to obtain a target frequency spectrum;

[0032] Calculating the fundamental frequency of the target frequency spectrum to obtain target fundamental frequency data;

[0033] Performing pitch calculation on the target fundamental frequency data to obtain corresponding initial tone data;

[0034] The initial tone data is subjected to data standardization processing to obtain corresponding tone feature data, and the speech rate feature data and the tone feature data are combined to obtain the audio feature set.

[0035] In combination with the first aspect, in a fourth implementation of the first aspect of the present invention, the step of performing user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, performing appliance screening on at least two of the candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance includes:

[0036] Expanding the speech rate feature set in the audio feature set by time steps to obtain a first input sequence;

[0037] Expanding the tone feature set in the audio feature set by time steps to obtain a second input sequence;

[0038] Performing data fusion on the first input sequence and the second input sequence to obtain a fused input sequence;

[0039] Inputting the fused input sequence into a preset recurrent neural network for emotion label recognition to obtain a corresponding target emotion label;

[0040] Collecting emotion data from a preset emotion database through the target emotion tag to obtain the user emotion data;

[0041] At least two of the candidate electrical appliances are screened using the user emotion data to obtain at least one second candidate electrical appliance.

[0042] In combination with the fourth implementation of the first aspect, in a fifth implementation of the first aspect of the present invention, the step of screening at least two candidate electrical appliances by using the user emotion data to obtain at least one second candidate electrical appliance includes:

[0043] Calculating the emotion score of the user emotion data to obtain a corresponding emotion score value;

[0044] Performing sentiment classification on the sentiment score values ​​through a preset score range table to obtain corresponding sentiment classification results;

[0045] Collecting electrical appliance parameters of the plurality of target electrical appliances to obtain an electrical appliance parameter set;

[0046] Matching the electrical appliance trigger parameters of the plurality of target electrical appliances by using the electrical appliance parameter set to obtain the electrical appliance trigger parameter corresponding to each of the target electrical appliances;

[0047] Based on a preset sentiment score mapping table, at least two candidate electrical appliances are screened according to the electrical appliance triggering parameters corresponding to each target electrical appliance and the sentiment classification result to obtain at least one second candidate electrical appliance.

[0048] In combination with the first aspect, in a sixth implementation of the first aspect of the present invention, encoding and fusing the user emotion data and the target instruction keyword to obtain an encoding and fusion vector, inputting the encoding and fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and controlling at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data, including:

[0049] Calibrate the encoding vector length of the user emotion data to obtain a first encoding vector length;

[0050] Based on the first coding vector length, segmentally encode the user emotion data to obtain a plurality of first coding data, and perform data fusion on the plurality of first coding data to obtain first target data;

[0051] Calibrate the encoding vector length of the target instruction keyword to obtain a second encoding vector length;

[0052] Based on the second encoding vector length, segmentally encode the target instruction keyword to obtain a plurality of second encoding data, and perform data fusion on the plurality of second encoding data to obtain second target data;

[0053] Performing fusion vector conversion on the first target data and the second target data to obtain the encoded fusion vector;

[0054] The encoding fusion vector is input into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and at least one of the second candidate electrical appliances is controlled to switch the electrical appliance working mode through the working mode data.

[0055] A second aspect of the present invention provides an electrical appliance working mode switching system based on voice interaction, the electrical appliance working mode switching system based on voice interaction comprising:

[0056] An acquisition module is used to acquire instruction audio data of a target user, extract instruction keywords from the instruction audio data, and obtain target instruction keywords;

[0057] An extraction module, used for performing audio feature extraction on the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data;

[0058] An analysis module is used to perform association analysis on a plurality of target electrical appliances preset in a preset Internet of Things, and obtain an association degree between every two target electrical appliances;

[0059] A construction module, used to construct a network topology model for the plurality of target electrical appliances based on the association relationship between each two target electrical appliances, to obtain an electrical appliance topology model;

[0060] A matching module, configured to match the electrical appliances in the electrical appliance topology model with related electrical appliances by using the target instruction keywords to obtain at least two first candidate electrical appliances;

[0061] an identification module, configured to perform user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, perform appliance screening on at least two of the candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance;

[0062] A fusion module is used to encode and fuse the user emotion data and the target instruction keywords to obtain an encoding fusion vector, and input the encoding fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and control at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data.

[0063] The third aspect of the present invention provides an appliance working mode switching device based on voice interaction, comprising: a memory and at least one processor, wherein instructions are stored in the memory; the at least one processor calls the instructions in the memory so that the appliance working mode switching device based on voice interaction executes the above-mentioned appliance working mode switching method based on voice interaction.

[0064] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned method for switching the working mode of an electrical appliance based on voice interaction.

[0065] In the technical solution provided by the present invention, the command audio data of the target user is obtained, the command audio data is subjected to command keyword extraction to obtain the target command keyword; the command audio data is subjected to audio feature extraction to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data; the association relationship analysis is performed on multiple target electrical appliances preset in the preset Internet of Things, and the association degree between every two target electrical appliances is obtained; a network topology model is constructed for multiple target electrical appliances based on the association degree between every two target electrical appliances, and an electrical appliance topology model is obtained; the electrical appliance topology model is matched with related electrical appliances through the target command keyword to obtain at least two first candidate electrical appliances; the target user's user emotion is identified through the audio feature set to obtain user emotion data, and at the same time, at least two candidate electrical appliances are screened through the user emotion data to obtain at least one second candidate electrical appliance; the user emotion data and the target command keyword are coded and fused to obtain a coded fusion vector, and the coded fusion vector is input into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and at least one second candidate electrical appliance is controlled to switch the electrical appliance working mode through the working mode data. In the present application scheme, by analyzing the emotions and instructions of the target user, the working mode of the electrical equipment can be automatically adjusted according to the user's emotions and needs to provide a personalized experience. This method can enable the smart home to automatically recognize the user's instructions and control the electrical equipment according to the user's emotional state. This reduces the user's manual intervention and provides more convenient home environment management. Through electrical appliance association analysis and network topology model construction, multiple electrical appliances can be managed more intelligently. The combination of voice commands and emotional data provides a richer way of smart home interaction. Users can convey instructions through voice commands, and can understand the user's emotional needs based on emotional data. Through association analysis, topology model construction and emotion recognition, it becomes smarter, can understand the user's intentions, and respond accordingly. Improve automation and intelligence to further improve the accuracy of electrical appliance working mode switching based on voice interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 Schematic diagram of an embodiment of a method for switching working modes of an electrical appliance based on voice interaction in an embodiment of the present invention;

[0067] Figure 2 This is a flow chart of extracting audio features from instruction audio data in an embodiment of the present invention;

[0068] Figure 3 A flowchart of extracting tone features from each audio frame data in an embodiment of the present invention;

[0069] Figure 4This is a flow chart of performing user emotion recognition on a target user through an audio feature set in an embodiment of the present invention;

[0070] Figure 5 Schematic diagram of an embodiment of a system for switching working modes of an electrical appliance based on voice interaction in an embodiment of the present invention;

[0071] Figure 6 Schematic diagram of an embodiment of an appliance working mode switching device based on voice interaction in an embodiment of the present invention. DETAILED DESCRIPTION

[0072] The embodiments of the present invention provide a method and system for switching the working mode of an electrical appliance based on voice interaction, which are used to improve the accuracy of switching the working mode of an electrical appliance based on voice interaction.

[0073] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0074] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the method for switching the working mode of an electrical appliance based on voice interaction in an embodiment of the present invention includes:

[0075] S101, obtaining instruction audio data of a target user, extracting instruction keywords from the instruction audio data, and obtaining target instruction keywords;

[0076] It is understandable that the execution subject of the present invention may be a system for switching working modes of an electrical appliance based on voice interaction, or may be a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as an execution subject as an example.

[0077] Specifically, the server obtains the target user's command audio data, which is recorded by a microphone or other audio acquisition device. These audio data contain the user's verbal commands, such as turning on / off electrical equipment or adjusting its working mode. The acquired command audio data is subjected to noise reduction processing. The purpose of this step is to remove background noise and interference in the audio data to improve the accuracy of subsequent speech recognition. Noise reduction processing can be achieved by using digital signal processing technology, such as filters and other methods. Audio segmentation processing is performed. This step divides the audio data into multiple segmented audio data segments, each of which contains an independent user command. The purpose of audio segmentation is to process each command independently to ensure accuracy and reliability. Key audio data is extracted from each segmented audio data segment. This process involves the use of speech recognition and signal processing technology to identify key command information in the audio data, such as operation type (on / off) and operation object (light, air conditioner, etc.). Then, principal component analysis is performed on the key audio data. Principal component analysis is a dimensionality reduction technique that helps to extract the main features of audio data to reduce the complexity of the data while retaining key information. The principal component audio data is encoded. This step converts the main component audio data into numerical or symbolic representations for further computer processing. Common encoding methods include converting audio data into feature vectors. Perform vector conversion and construct the encoded audio data into an audio vector matrix. Each vector represents an audio command. The audio vector matrix is ​​input into a preset keyword extraction model to extract the target command keywords. These keywords include electrical switch commands (such as "turn on the light") and mode adjustment commands (such as "adjust the temperature").

[0078] S102, extracting audio features from the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data;

[0079] Specifically, time series data is extracted from the acquired instruction audio data. This is to represent the audio signal as a sequence of amplitude values ​​that vary with time. By calculating the number of audio frames in the audio signal, it is determined how the audio data should be divided into small time periods. This is achieved by dividing the audio signal into small continuous time periods. Using the target audio segmentation frame number, the instruction audio data is divided into multiple audio frame data. These audio frames represent different time segments of the instruction audio and are usually divided in an overlapping manner. For each audio frame data, short-time energy is calculated. Short-time energy represents the amplitude of the audio signal in each audio frame and can be used to characterize the intensity of the audio frame. Similarly, the zero-crossing rate is calculated for each audio frame data. The zero-crossing rate refers to the number of times the zero point is crossed in each audio frame, which is used to describe the frequency characteristics of the audio signal. Based on the short-time energy and zero-crossing rate data corresponding to each audio frame data, the speech rate is calculated. The speech rate represents the speed or rhythm of the speech and is one of the important speech features of the instruction audio. According to the speech rate data corresponding to each audio frame data, the speech rate feature analysis of the instruction audio data is performed. This includes techniques such as statistical analysis, feature extraction, and pattern recognition to obtain feature data related to speech rate. Pitch feature extraction is performed on each audio frame data. Pitch represents the pitch of a sound and is another important speech feature. The speech rate feature data and the pitch feature data are merged to obtain an audio feature set. This set contains data related to the speech rate and pitch characteristics of the command audio data, providing a basis for subsequent analysis and processing. For example, suppose a user controls home lights through voice commands, and the command audio data includes the command "turn on the living room lights." The server first converts the audio data into time series data, then calculates the number of audio segmentation frames, and divides the audio data into multiple audio frames. Short-time energy calculation and zero-crossing rate calculation are performed on each audio frame to obtain the corresponding short-time energy and zero-crossing rate data. Based on these data, speech rate data is calculated to describe the speech speed of the user's command. At the same time, pitch feature extraction is performed to capture the pitch information of the voice. The speech rate feature and the pitch feature are merged to form an audio feature set, which is used for further command recognition and appliance control.

[0080] Among them, frequency domain data conversion is performed on each audio frame data. This is usually achieved by performing Fourier transform or other frequency domain analysis methods. Frequency domain data represents the distribution of audio signals at different frequencies, including pitch information. Spectrograms of multiple audio frame data are constructed using the frequency domain signal data corresponding to each audio frame data. A spectrogram is a visual representation that shows the energy distribution of an audio signal at different frequencies. The frequency domain characteristics of an audio signal can be better understood through a spectrogram. The target spectrogram is analyzed to calculate the fundamental frequency, also known as the fundamental frequency. The fundamental frequency refers to the main frequency component of a sound, which usually corresponds to the pitch of the sound. Based on the calculated fundamental frequency data, a pitch calculation is performed. Pitch represents the pitch of a sound and is an important feature in music and speech. The calculated initial pitch data is subjected to data normalization. Normalization usually includes scaling the data to ensure that it has a uniform range and distribution. This helps to eliminate differences between different audio frames. The standardized pitch data is obtained to form pitch feature data. These feature data are used to describe the pitch characteristics of the audio, such as the average value and variance of the pitch. The pitch feature data is combined with the previously extracted speech rate feature data to obtain an audio feature set. This set contains data related to the speech rate and pitch characteristics of the command audio data, providing a basis for subsequent analysis and processing.

[0081] S103, performing association analysis on a plurality of target electrical appliances preset in the preset Internet of Things, and obtaining an association degree between every two target electrical appliances;

[0082] Specifically, the server pre-configures or presets multiple target electrical devices in the Internet of Things. These electrical devices may include various smart devices such as lights, air conditioners, televisions, and audio in smart homes. Each device should have identification information related to it so that it can be identified in the association analysis. For each target electrical device, the server obtains data related to it, such as sensor information, status information, device attributes, etc. These data can be collected by the Internet of Things device itself or other sensor devices and used as input for the association analysis. The server establishes a device relationship model to describe the relationship between various electrical devices. This model can be built based on multiple factors such as physical location, functional complementarity, and user habits. For example, if two lighting devices are close to each other and often turned on at the same time, the server infers that there is an association between them. Using the collected device data and the established relationship model, the server performs data analysis and relationship degree calculation. By comparing the physical location information of the devices, the server calculates the distance relationship between the devices. Devices that are closer have stronger associations. Analyze the function and attribute information of the devices to identify whether there is functional complementarity. For example, audio and television can have complementary audio output functions. Analyze the usage pattern and frequency of collaborative use of the devices. If two devices are often used at the same time, it can be considered that there is a collaborative relationship between them. Consider the user's behavior habits, such as turning on the TV and stereo at a specific time, to determine the association between devices. For each two target electrical devices, the server quantifies the degree of association between them by comprehensively considering the above factors. The degree of association can be expressed as a numerical value, reflecting the degree of correlation between devices. This can be achieved using various methods and algorithms, such as weight assignment, similarity measurement, etc.

[0083] S104, constructing a network topology model for multiple target electrical appliances based on the association relationship between each two target electrical appliances to obtain an electrical appliance topology model;

[0084] Specifically, to perform association analysis, the server pre-configures or presets multiple target electrical devices, including various intelligent devices such as lights, air conditioners, televisions, and audio equipment. Each device must have unique identification information so that it can be identified in subsequent analysis. The server will obtain data related to each target electrical device, including device status information, sensor data, device attributes, etc. This information helps to analyze the association relationship between devices. The core of association analysis is to calculate the degree of association between each two electrical devices. This degree of association can be calculated based on a variety of factors, including the proximity of physical locations, the complementarity of device functions, the frequency of collaborative use, etc. The specific calculation method involves mathematical models and algorithms, the purpose of which is to quantify the relationship into numerical values. These numerical values ​​can be used to construct a relationship matrix, in which each element in the matrix represents the degree of association between two electrical devices. Once the relationship matrix is ​​established, the server can start to build an electrical topology model. The electrical topology model is a graphical representation in which nodes represent electrical devices and edges represent the relationship between devices. The process of building the model includes creating nodes, establishing edges, and determining the topological structure. The weight of the edge is usually related to the relationship value, and a higher weight indicates a closer association. Through the appliance topology model, the server better understands the relationship between devices. For example, if the user issues a command to turn on the TV in the living room, the server automatically turns on the speakers according to the topology model to provide a better viewing experience. This appliance topology model provides the basis for the automation and collaborative operation of the smart home system, enabling the server to respond to user needs more intelligently.

[0085] S105, matching related electrical appliances to the electrical appliance topology model using the target instruction keywords to obtain at least two first candidate electrical appliances;

[0086] Specifically, first, target instruction keywords are extracted from the user's instructions. These keywords usually include the name of the appliance, operating instructions (such as turn on, turn off, adjust, etc.), and the mode or setting. Target instruction keyword extraction usually involves natural language processing (NLP) technology, such as word segmentation, part-of-speech tagging, and entity recognition. In the server, an appliance topology model is pre-built to represent the connections and relationships between various electrical devices. This model is usually a graph in which nodes represent different electrical devices and edges represent physical or functional associations between devices. The appliance topology model helps the server understand the connections and functional relationships between devices. Once the target instruction keyword extraction is completed and the appliance topology model is available, the server begins to match related appliances. The server matches the extracted target instruction keywords with the device names in the appliance topology model. For example, if the user says "execute instruction A", the server will recognize the keyword "instruction A". The server will then perform a path search in the appliance topology model to find devices related to the target instruction keywords. This includes finding nodes that match the keywords and other devices connected to these nodes. The path search uses graph algorithms such as depth-first search (DFS) or breadth-first search (BFS). Once the device nodes related to the keywords are found, the server will extract these devices as the first candidate appliances. Usually, the server will obtain a list of candidate appliances, which includes the devices most related to the instruction. For example, suppose the user issues an instruction: "Execute instruction A". The server will first extract the target instruction keywords, including "instruction A". The server will look up the appliance topology model to find the device nodes and connection relationships related to "instruction A". In this topology model, appliance 1, appliance 2, and appliance 3 are all related to instruction A. Therefore, the server will extract these three devices as the first candidate appliances so that the devices related to instruction A can be considered when executing the instruction.

[0087] S106, performing user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, performing appliance screening on at least two candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance;

[0088] Specifically, the server obtains the user's command audio data and extracts audio features. This includes the extraction of speech rate features and pitch features. The two feature sets are expanded according to the time step to obtain two input sequences. These sequences will be used as inputs for emotion tag recognition. Then, the two expanded feature sequences are data fused to obtain a fused input sequence. The data fusion method may include simple concatenation, weighted addition, etc., so as to integrate speech rate and pitch information together to provide more comprehensive information for emotion tag recognition. The server inputs the fused input sequence into a preset recurrent neural network (RNN) model to identify the emotion tag. RNN is a deep learning model suitable for processing time series data, which can capture the time dependency and context information in audio data. The RNN model will analyze the audio data and output the corresponding target emotion tag, such as "happy", "angry", "calm" and other emotion categories. The server uses the tag to collect emotion data from the preset emotion database. The emotion database contains user behavior and preference information under various emotional states. These data will be used to identify the user's current emotional state, such as whether the user is in a happy, nervous or relaxed mood. Using the user's emotional data, the server will screen at least two candidate electrical appliances to obtain at least one second candidate electrical appliance. The screening process can match and recommend electrical appliances based on the user's emotional state and the properties of the electrical appliances. For example, if the user is happy, the server recommends turning on pleasant music or colorful lights to enhance the user's pleasant feeling.

[0089] Among them, the server obtains the emotional data of the target user. Emotional data can be obtained in many ways, such as voice analysis, facial expression recognition, heart rate monitoring, etc. These data can be used to determine the user's emotional state, such as happiness, anger, frustration, etc. The server calculates the emotional score. The emotional score is usually a numerical value that indicates the degree of the user's current emotional state. This can be achieved through sentiment analysis algorithms, such as sentiment vocabulary analysis or deep learning models, which can map sentiment data to sentiment score values. The server will classify the user's emotional state according to the sentiment score value. The sentiment classification result can be a discrete sentiment label, such as "happy", "angry", "calm", etc. This step helps the server better understand the user's emotional state. Before performing appliance screening, the server obtains appliance parameters of multiple target appliances. Appliance parameters include device characteristics, status, and executable operations. These parameters can be obtained from the device's sensors, control interfaces, or smart home systems. The server will use the user's emotional data and appliance parameters to match appliance trigger parameters. The server will analyze the user's emotional state and the parameters of each target appliance to determine which appliance device is most suitable for meeting the user's emotional needs. Based on the preset emotion score mapping table, the server will screen at least two candidate appliances according to the appliance trigger parameters and emotion classification results of each target appliance. This step will determine which appliance is most suitable to match the user's current emotional state. The server will select at least one second candidate appliance to perform the corresponding operation. For example, suppose the user's emotion data shows that they are in a happy emotional state, the emotion score is calculated to be 0.8, and the emotion classification result is "happy". The server has collected the appliance parameters of two target appliances, namely appliance A and appliance B. The appliance trigger parameters of appliance A are very consistent with the happy emotional state, and the emotion score mapping table shows that the matching degree of appliance A is 0.9. The appliance trigger parameters of appliance B are less consistent with the happy emotional state, and the emotion score mapping table shows that the matching degree of appliance B is 0.4. According to the emotion score mapping table, the server will select appliance A as the second candidate appliance because it is more suitable for the user's current happy emotional state. The server then performs the corresponding operation, such as turning on appliance A, to meet the user's emotional needs.

[0090] S107, encode and fuse the user emotion data and the target instruction keywords to obtain an encoding fusion vector, and input the encoding fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and control at least one second candidate electrical appliance to switch the electrical appliance working mode through the working mode data.

[0091] It should be noted that the server encodes the user's emotional data. To achieve this step, the server first measures the vector length of the emotional data, that is, the first encoding vector length. This can be achieved by determining the number or dimension of features in the emotional data. Then, the server divides the emotional data into multiple paragraphs, each of which is no longer than the first encoding vector length. Each paragraph can be represented as the first encoding data. Similarly, the server encodes the target instruction keyword. The server measures the length of the keyword vector, that is, the second encoding vector length. Then, the server divides the target instruction keyword into multiple paragraphs, each of which is no longer than the second encoding vector length. Each paragraph can be represented as the second encoding data. The server fuses multiple first encoding data and multiple second encoding data. The goal of data fusion is to combine emotional data and instruction data from different sources to obtain more comprehensive and integrated information. The data fusion method may include vector merging, weighted averaging or other data integration techniques to generate first target data and second target data. The server merges the first target data and the second target data into a coding fusion vector. This vector will contain key information from the emotional data and instruction data to describe the user's emotional state and instruction content. The generated coding fusion vector will be input into the preset electrical appliance working mode analysis model. This model can be a machine learning model, a deep learning neural network, or other algorithm that analyzes the user's emotional state and the content of the instruction to determine the appropriate electrical appliance working mode. Ultimately, the working mode analysis model will generate working mode data to guide at least one second candidate electrical appliance to perform the corresponding working mode switching operation. This can include turning on, off, adjusting the electrical device, or performing other operations to meet the user's needs.

[0092] In an embodiment of the present invention, command audio data of a target user is obtained, command keywords are extracted from the command audio data to obtain target command keywords; audio features are extracted from the command audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data; correlation analysis is performed on multiple target electrical appliances preset in a preset Internet of Things to obtain a correlation degree between every two target electrical appliances; a network topology model is constructed for multiple target electrical appliances based on the correlation degree between every two target electrical appliances to obtain an electrical appliance topology model; the electrical appliance topology model is matched with related electrical appliances through the target command keywords to obtain at least two first candidate electrical appliances; user emotion recognition is performed on the target user through the audio feature set to obtain user emotion data, and at the same time, electrical appliance screening is performed on at least two candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance; encoding fusion is performed on the user emotion data and the target command keywords to obtain an encoding fusion vector, and the encoding fusion vector is input into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and at least one second candidate electrical appliance is controlled to switch the electrical appliance working mode through the working mode data. In the present application scheme, by analyzing the emotions and instructions of the target user, the working mode of the electrical equipment can be automatically adjusted according to the user's emotions and needs to provide a personalized experience. This method can enable the smart home to automatically recognize the user's instructions and control the electrical equipment according to the user's emotional state. This reduces the user's manual intervention and provides more convenient home environment management. Through electrical appliance association analysis and network topology model construction, multiple electrical appliances can be managed more intelligently. The combination of voice commands and emotional data provides a richer way of smart home interaction. Users can convey instructions through voice commands, and can understand the user's emotional needs based on emotional data. Through association analysis, topology model construction and emotion recognition, it becomes smarter, can understand the user's intentions, and respond accordingly. Improve automation and intelligence to further improve the accuracy of electrical appliance working mode switching based on voice interaction.

[0093] In a specific embodiment, the process of executing step S101 may specifically include the following steps:

[0094] (1) obtaining command audio data, and performing noise reduction processing on the command audio data to obtain noise-reduced audio data;

[0095] (2) performing audio segmentation processing on the noise reduction audio data to obtain a plurality of segmented audio data;

[0096] (3) extracting key audio data from the multiple segmented audio data to obtain key audio data;

[0097] (4) performing principal component analysis on the key audio data to obtain principal component audio data corresponding to the key audio data;

[0098] (5) performing audio data encoding on the main component audio data to obtain corresponding encoded audio data;

[0099] (6) Performing vector conversion on the encoded audio data to obtain a corresponding audio vector matrix, and inputting the audio vector matrix into a preset keyword extraction model to extract keywords to obtain corresponding target instruction keywords, wherein the target instruction keywords include electrical switch instructions and mode adjustment instructions.

[0100] Specifically, the server obtains instruction audio data from the user's voice input or other audio source. This can be achieved through a microphone, voice recognition software or other audio capture device. The acquired audio data contains noise, so noise reduction processing is required to extract a clear voice signal. Noise reduction processing techniques may include filtering, noise suppression and noise reduction algorithms to reduce the impact of background noise and obtain noise-reduced audio data. The noise-reduced audio data contains multiple voice segments or instructions. Therefore, the audio data needs to be segmented and divided into multiple independent audio segments. Audio segmentation can be implemented based on silent segments, volume changes or other features to obtain multiple segmented audio data. In each segmented audio data, key audio data needs to be extracted, which contains the user's instruction information. Key audio data extraction can use audio feature extraction technology, such as acoustic feature extraction or speech signal processing methods, to capture important information in the audio. For the extracted key audio data, principal component analysis (PCA) or other dimensionality reduction techniques can be performed to reduce the dimension of the data and retain the most important information. This will help improve the efficiency and accuracy of subsequent processing and obtain principal component audio data. The principal component audio data can be further encoded and converted into a digital representation for computer processing. The encoding can use various audio coding algorithms, such as linear predictive coding (LPC) or Mel-frequency cepstral coefficients (MFCC). The encoded audio data can be represented in vector form. Each audio clip will correspond to an audio vector, which will contain a digital representation of the audio data. Vector conversion can be achieved through matrix operations or vectorization technology. The audio vector matrix is ​​input into a preset keyword extraction model. This model can be a natural language processing (NLP) model or a deep learning model, which is used to extract target command keywords from audio data, such as electrical switch commands or mode adjustment commands.

[0101] In a specific embodiment, if Figure 2 As shown, the process of executing step S102 may specifically include the following steps:

[0102] S201, extracting the time series of the instruction audio data to obtain the time series data corresponding to the instruction audio data;

[0103] S202, calculating the number of audio segmentation frames for the time series data to obtain a target number of audio segmentation frames;

[0104] S203, performing audio frame processing on the instruction audio data according to the target audio segmentation frame number to obtain multiple audio frame data;

[0105] S204, respectively calculating the short-time energy of each audio frame data to obtain the short-time energy data corresponding to each audio frame data;

[0106] S205, calculating the zero-crossing rate of each audio frame data respectively to obtain zero-crossing rate data corresponding to each audio frame data;

[0107] S206, based on the short-time energy data corresponding to each audio frame data and the zero-crossing rate data corresponding to each audio frame data, calculating the speech rate of each audio frame data to obtain the speech rate data corresponding to each audio frame data;

[0108] S207, performing speech rate feature analysis on the instruction audio data according to the speech rate data corresponding to each audio frame data to obtain speech rate feature data;

[0109] S208: extract tone features from each audio frame data to obtain tone feature data, and merge the speech rate feature data and the tone feature data to obtain an audio feature set.

[0110] It should be noted that the server converts the instruction audio data into time series data. This can be achieved by sampling the change in the amplitude of the audio data over time, thereby obtaining a time series representation of the audio. The server determines the number of audio segmentation frames, that is, the number of frames into which the audio data is segmented. This can be calculated based on the sampling rate and frame rate to ensure that the audio data is properly segmented. Using the determined number of audio segmentation frames, the server performs frame processing on the instruction audio data and divides the audio data into multiple audio frames. Each audio frame represents a small time period of the audio data. For each audio frame, the server calculates its short-time energy, that is, the energy level within the time period. This can be achieved by squaring and summing the amplitude values ​​within the audio frame. Short-time energy calculation can help determine the sound intensity within the audio frame. Also for each audio frame, the server calculates its zero-crossing rate, that is, the number of times the signal crosses the zero point. Zero-crossing rate calculation can be used to detect changes and periodicity of the sound waveform within the audio frame. Based on the short-time energy and zero-crossing rate data of each audio frame, the server calculates the speech rate of each audio frame, that is, the speed of speech or the speed of speaking. This can be achieved by analyzing the ups and downs of the sound and the periodicity of the waveform. For the speech rate data of all audio frames, the server performs speech rate feature analysis to obtain the overall speech rate features of the audio. This can include information such as average speech rate and speech rate changes. For each audio frame, the server performs pitch feature extraction to capture the tone of the audio or the pitch information of the sound. This can be achieved by analyzing the frequency components within the audio frame. The server merges the speech rate feature data and the pitch feature data to form an audio feature set. This set will include various features of the audio data, including speech rate and pitch information.

[0111] In a specific embodiment, if Figure 3 As shown, the process of executing step S208 may specifically include the following steps:

[0112] S301, performing frequency domain data conversion on each audio frame data respectively to obtain frequency domain signal data corresponding to each audio frame data;

[0113] S302, constructing a frequency spectrum of multiple audio frame data using frequency domain signal data corresponding to each audio frame data to obtain a target frequency spectrum;

[0114] S303, calculating the fundamental frequency of the target spectrum to obtain target fundamental frequency data;

[0115] S304, performing pitch calculation on the target fundamental frequency data to obtain corresponding initial tone data;

[0116] S305: Perform data standardization processing on the initial tone data to obtain corresponding tone feature data, and merge the speech rate feature data and the tone feature data to obtain an audio feature set.

[0117] It should be noted that Fourier transform or other frequency domain data conversion techniques are performed on each audio frame data to convert the audio signal from the time domain to the frequency domain. This will generate frequency domain signal data for each audio frame, representing the frequency components of the audio signal. Based on the frequency domain signal data corresponding to each audio frame data, a spectrogram can be constructed, and the spectrum information of multiple audio frames can be superimposed together to obtain a target spectrogram. The spectrogram shows the intensity of the audio signal at different frequencies. From the target spectrogram, the server calculates the fundamental frequency, that is, the frequency value of the main frequency component. This is usually the basic frequency of the sound, and for speech, it corresponds to the pitch of the sound. Based on the fundamental frequency data, the server performs pitch calculation and converts the frequency value into pitch. The pitch is usually expressed in musical notes, such as "C", "D", "E", etc. The calculated pitch data has different ranges and units. In order to improve the consistency and comparability of the data, the pitch data can be standardized and mapped to a fixed range, such as between 0 and 1. The standardized pitch data will be used as pitch feature data. These features can be used to describe the pitch information of the audio to help the server understand the pitch characteristics of the sound. The speech rate feature data and the pitch feature data are merged to form an audio feature set, which includes various features of the audio data, including speech rate and pitch information.

[0118] In a specific embodiment, if Figure 4 As shown, the process of executing step S106 may specifically include the following steps:

[0119] S401, expanding a speech rate feature set in an audio feature set by time steps to obtain a first input sequence;

[0120] S402, expanding the tone feature set in the audio feature set by time steps to obtain a second input sequence;

[0121] S403, performing data fusion on the first input sequence and the second input sequence to obtain a fused input sequence;

[0122] S404, inputting the fused input sequence into a preset recurrent neural network for emotion label recognition to obtain a corresponding target emotion label;

[0123] S405, collecting emotion data from a preset emotion database through a target emotion tag to obtain user emotion data;

[0124] S406: Screen at least two candidate electrical appliances according to the user emotion data to obtain at least one second candidate electrical appliance.

[0125] Specifically, speech rate features and pitch features are extracted from the audio feature set. These features usually change over time, so they need to be expanded by time steps to convert them into time series data. This will generate a first input sequence and a second input sequence. The first input sequence (speech rate features) and the second input sequence (pitch features) are fused. This can be achieved by simple splicing or more complex fusion methods. The fused data will form a fused input sequence. The fused input sequence will be input into a preset recurrent neural network (RNN) for emotion tag recognition. RNN is a deep learning model suitable for processing sequence data, which can understand the context and association in time series data. The recurrent neural network will analyze the fused input sequence to identify the user's emotional state. This can be an emotional label, such as "happy", "angry", etc. The server will obtain the corresponding target emotional label. Based on the target emotional label, the server collects emotional data from a preset emotional database. This database contains relevant information under different emotional states, such as text descriptions, images, sounds, etc. Based on the collected user emotional data, the server screens at least two candidate electrical appliances. This screening process can select appropriate electrical appliances based on the emotional state to meet the user's emotional needs.

[0126] In a specific embodiment, the process of executing step S406 may specifically include the following steps:

[0127] (1) Calculate the sentiment score of the user's sentiment data to obtain the corresponding sentiment score value;

[0128] (2) sentiment classification is performed on the sentiment score values ​​using a preset score range table to obtain corresponding sentiment classification results;

[0129] (3) Collecting electrical appliance parameters of multiple target electrical appliances to obtain an electrical appliance parameter set;

[0130] (4) matching the electrical appliance trigger parameters of multiple target electrical appliances through the electrical appliance parameter set to obtain the electrical appliance trigger parameters corresponding to each target electrical appliance;

[0131] (5) Based on a preset sentiment score mapping table, at least two candidate electrical appliances are screened using the electrical appliance trigger parameters corresponding to each target electrical appliance and the sentiment classification result to obtain at least one second candidate electrical appliance.

[0132] Specifically, the emotion score of the user emotion data is calculated. This can be achieved through an emotion analysis model, an emotion dictionary or a machine learning model, and the user emotion is mapped to an emotion score value. This score can represent the intensity of the user emotion, usually within a range. The obtained emotion score value is compared with a preset emotion score range table to classify the emotion score value into different emotion categories. For example, the emotion score can be divided into emotion categories such as "happy", "sad", "angry", etc. The electrical appliance parameters are collected for multiple target electrical appliances, and these parameters include information related to the user's emotion, such as the state, energy consumption, brightness, etc. of the electrical appliances. These parameters can be collected through sensors, device interfaces or other methods. According to the user emotion classification results, the user's emotion is mapped to the electrical appliance trigger parameters related to each target electrical appliance. These parameters describe how the electrical appliance should respond to meet the user's emotional needs. Based on the preset emotion score mapping table, at least two candidate electrical appliances are screened by the electrical appliance trigger parameters corresponding to each target electrical appliance and the emotion classification results. The server will select at least one second candidate electrical appliance based on these parameters and the emotion classification results to meet the user's emotional needs. For example, assume that the user's emotion score value is 0.8, indicating a positive emotion. The server uses the preset emotion score range table to classify this score as "happy". Then, the server collects parameters of multiple target appliances, such as the status and energy consumption of appliances A and B. For appliances A and B, the server matches the user's emotion classification result "happy" with a preset emotion score mapping table, and selects at least one second candidate appliance to meet the user's emotional needs based on the emotion classification result and parameters.

[0133] In a specific embodiment, the process of executing step S107 may specifically include the following steps:

[0134] (1) Calibrate the encoding vector length of the user emotion data to obtain a first encoding vector length;

[0135] (2) based on the length of the first coding vector, segmentally encode the user emotion data to obtain a plurality of first coded data, and perform data fusion on the plurality of first coded data to obtain first target data;

[0136] (3) Calibrate the encoding vector length of the target instruction keyword to obtain a second encoding vector length;

[0137] (4) Based on the length of the second encoding vector, segmentally encode the target instruction keyword to obtain a plurality of second encoding data, and perform data fusion on the plurality of second encoding data to obtain second target data;

[0138] (5) performing fusion vector conversion on the first target data and the second target data to obtain a coded fusion vector;

[0139] (6) Inputting the coded fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and controlling at least one second candidate electrical appliance to switch the electrical appliance working mode through the working mode data.

[0140] Specifically, determine the length of the encoding vector, which can be selected according to the server requirements or model configuration. It is called the first encoding vector length and the second encoding vector length, and the user emotion data and the target instruction keyword are calibrated respectively. The user emotion data and the target instruction keyword are segmented and encoded according to the first encoding vector length and the second encoding vector length, respectively, to generate a plurality of first encoding data and a plurality of second encoding data. Data fusion is performed on the plurality of first encoding data and the plurality of second encoding data. This can adopt various fusion techniques, such as average, weighted average, feature splicing, etc., to generate the first target data and the second target data. The first target data and the second target data are converted into a fusion vector to generate an encoding fusion vector. This process may involve mapping the data to an appropriate space, performing feature transformation, or using a neural network model. The encoding fusion vector is input into a preset electrical appliance working mode analysis model. This model will analyze the emotion data and instruction keyword data to determine the user's emotional needs and instructions for the electrical appliance working mode. The model can be trained and predicted using machine learning, deep learning or other technologies. Based on the results of the working mode analysis, the server will decide how to control the working mode of at least one second candidate electrical appliance to meet the needs of the user. For example, assume that the length of the first encoding vector is 100 and the length of the second encoding vector is 50. The user's emotional data and the target instruction keywords are encoded into 100-dimensional and 50-dimensional vectors, respectively. After these vectors are fused, a 150-dimensional encoding fusion vector is generated and input into the appliance working mode analysis model. Based on the analysis results, the server decides how to adjust the working mode of at least one second candidate appliance to meet the user's emotional needs and instructions.

[0141] Through the above steps, by analyzing the emotions and instructions of the target user, the working mode of the electrical equipment can be automatically adjusted according to the user's emotions and needs to provide a personalized experience. This method can enable the smart home to automatically recognize the user's instructions and control the electrical equipment according to the user's emotional state. This reduces the user's manual intervention and provides more convenient home environment management. Through electrical appliance association analysis and network topology model construction, multiple electrical appliances can be managed more intelligently. The combination of voice instructions and emotional data provides a richer way of smart home interaction. Users can convey instructions through voice instructions, and the user's emotional needs can be understood based on emotional data. Through association analysis, topology model construction and emotion recognition, it becomes smarter, can understand the user's intentions, and respond accordingly. Improve automation and intelligence to further improve the accuracy of electrical appliance working mode switching based on voice interaction.

[0142] The above describes the method for switching the working mode of an electrical appliance based on voice interaction in an embodiment of the present invention. The following describes the system for switching the working mode of an electrical appliance based on voice interaction in an embodiment of the present invention. Figure 5 In one embodiment of the present invention, an electrical appliance working mode switching system based on voice interaction includes:

[0143] The acquisition module 501 is used to acquire the target user's instruction audio data, extract instruction keywords from the instruction audio data, and obtain target instruction keywords;

[0144] An extraction module 502 is used to extract audio features from the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data;

[0145] The analysis module 503 is used to perform association analysis on a plurality of target electrical appliances preset in the preset Internet of Things, and obtain the association degree between every two target electrical appliances;

[0146] A construction module 504 is used to construct a network topology model for the plurality of target electrical appliances based on the association relationship between each two target electrical appliances to obtain an electrical appliance topology model;

[0147] A matching module 505 is used to match the electrical appliances in the electrical appliance topology model with related electrical appliances by using the target instruction keywords to obtain at least two first candidate electrical appliances;

[0148] The recognition module 506 is used to perform user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, perform appliance screening on at least two candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance;

[0149] The fusion module 507 is used to encode and fuse the user emotion data and the target instruction keywords to obtain a coding fusion vector, and input the coding fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and control at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data.

[0150] Through the collaboration of the above components, by analyzing the emotions and instructions of the target user, the working mode of the electrical equipment can be automatically adjusted according to the user's emotions and needs to provide a personalized experience. This method can enable the smart home to automatically recognize the user's instructions and control the electrical equipment according to the user's emotional state. This reduces the user's manual intervention and provides more convenient home environment management. Through the analysis of electrical appliance associations and the construction of network topology models, multiple electrical appliances can be managed more intelligently. The combination of voice commands and emotional data provides a richer way of smart home interaction. Users can convey instructions through voice commands, and the user's emotional needs can be understood based on emotional data. Through association analysis, topology model construction and emotion recognition, it becomes smarter, can understand the user's intentions, and respond accordingly. Improve automation and intelligence to further improve the accuracy of electrical appliance working mode switching based on voice interaction.

[0151] above Figure 5 The electrical appliance working mode switching system based on voice interaction in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the electrical appliance working mode switching device based on voice interaction in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0152] Figure 6 1 is a schematic diagram of the structure of an electrical appliance working mode switching device based on voice interaction provided by an embodiment of the present invention. The electrical appliance working mode switching device 600 based on voice interaction may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (for example, one or more processors) and a memory 620, and one or more storage media 630 (for example, one or more mass storage devices) storing application programs 633 or data 632. Among them, the memory 620 and the storage medium 630 may be short-term storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the electrical appliance working mode switching device 600 based on voice interaction. Furthermore, the processor 610 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the electrical appliance working mode switching device 600 based on voice interaction.

[0153] The device 600 for switching the working mode of an electrical appliance based on voice interaction may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input and output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It can be understood by those skilled in the art that Figure 6 The structure of the electrical appliance working mode switching device based on voice interaction shown does not constitute a limitation of the electrical appliance working mode switching device based on voice interaction, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0154] The present invention also provides an appliance working mode switching device based on voice interaction, the appliance working mode switching device based on voice interaction includes a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the appliance working mode switching method based on voice interaction in the above-mentioned embodiments.

[0155] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the method for switching the working mode of an electrical appliance based on voice interaction.

[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0157] If the integrated unit is implemented in the form of a software functional unit and sold or passed as an independent product, it can be stored in a computer-readable storage medium. Based on the understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0158] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for switching working modes of an electrical appliance based on voice interaction, characterized in that: The method for switching the working mode of an electrical appliance based on voice interaction includes: Acquire command audio data of a target user, extract command keywords from the command audio data, and obtain target command keywords; Extracting audio features from the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data; Performing correlation analysis on a plurality of target electrical appliances preset in a preset Internet of Things, and obtaining a correlation degree between every two target electrical appliances; Based on the association degree between each two target electrical appliances, a network topology model is constructed for the plurality of target electrical appliances to obtain an electrical appliance topology model; Matching related electrical appliances to the electrical appliance topology model using the target instruction keyword to obtain at least two first candidate electrical appliances; Performing user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, performing appliance screening on at least two of the first candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance; The user emotion data and the target instruction keyword are coded and fused to obtain a coded fusion vector, and the coded fusion vector is input into a preset electrical appliance working mode analysis model for working mode analysis to obtain working mode data, and at least one of the second candidate electrical appliances is controlled to switch the electrical appliance working mode through the working mode data; specifically, the method includes: calibrating the length of the coding vector of the user emotion data to obtain a first coding vector length; based on the first coding vector length, segmentally coding the user emotion data to obtain a plurality of first coding data, and performing data fusion on the plurality of first coding data to obtain a first target data; calibrating the length of the coding vector of the target instruction keyword to obtain a second coding vector length; based on the second coding vector length, segmentally coding the target instruction keyword to obtain a plurality of second coding data, and performing data fusion on the plurality of second coding data to obtain a second target data; performing fusion vector conversion on the first target data and the second target data to obtain the coding fusion vector; inputting the coding fusion vector into a preset electrical appliance working mode analysis model for working mode analysis to obtain working mode data, and controlling at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data.

2. The method for switching working modes of an electrical appliance based on voice interaction according to claim 1, characterized in that: The step of acquiring the target user's instruction audio data and extracting instruction keywords from the instruction audio data to obtain target instruction keywords includes: Acquire the instruction audio data, and perform noise reduction processing on the instruction audio data to obtain noise-reduced audio data; Performing audio segmentation processing on the noise reduction audio data to obtain a plurality of segmented audio data; Extracting key audio data from the plurality of segmented audio data to obtain key audio data; Performing principal component analysis on the key audio data to obtain principal component audio data corresponding to the key audio data; Performing audio data encoding on the main component audio data to obtain corresponding encoded audio data; The encoded audio data is vectorized to obtain a corresponding audio vector matrix, and the audio vector matrix is ​​input into a preset keyword extraction model for keyword extraction to obtain corresponding target instruction keywords, wherein the target instruction keywords include electrical switch instructions and mode adjustment instructions.

3. The method for switching working modes of an electrical appliance based on voice interaction according to claim 1, characterized in that: The audio feature extraction is performed on the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data, including: Performing time series extraction on the instruction audio data to obtain time series data corresponding to the instruction audio data; Calculating the number of audio segmentation frames for the time series data to obtain a target number of audio segmentation frames; Performing audio frame processing on the instruction audio data according to the target audio segmentation frame number to obtain a plurality of audio frame data; Performing short-time energy calculation on each of the audio frame data respectively to obtain short-time energy data corresponding to each of the audio frame data; Calculating the zero-crossing rate of each audio frame data respectively to obtain zero-crossing rate data corresponding to each audio frame data; Based on the short-time energy data corresponding to each of the audio frame data and the zero-crossing rate data corresponding to each of the audio frame data, calculating the speech rate of each of the audio frame data to obtain the speech rate data corresponding to each of the audio frame data; According to the speech rate data corresponding to each of the audio frame data, performing speech rate feature analysis on the instruction audio data to obtain the speech rate feature data; Tone feature extraction is performed on each of the audio frame data to obtain the tone feature data, and the speech rate feature data and the tone feature data are merged to obtain the audio feature set.

4. The method for switching working modes of an electrical appliance based on voice interaction according to claim 3, characterized in that: The step of extracting the tone feature of each of the audio frame data to obtain the tone feature data, and merging the speech rate feature data and the tone feature data to obtain the audio feature set includes: Performing frequency domain data conversion on each of the audio frame data respectively to obtain frequency domain signal data corresponding to each of the audio frame data; Constructing a frequency spectrum of the plurality of audio frame data using the frequency domain signal data corresponding to each of the audio frame data to obtain a target frequency spectrum; Calculating the fundamental frequency of the target frequency spectrum to obtain target fundamental frequency data; Performing pitch calculation on the target fundamental frequency data to obtain corresponding initial tone data; The initial tone data is subjected to data standardization processing to obtain corresponding tone feature data, and the speech rate feature data and the tone feature data are combined to obtain the audio feature set.

5. The method for switching working modes of an electrical appliance based on voice interaction according to claim 1, characterized in that: The step of performing user emotion recognition on the target user through the audio feature set to obtain user emotion data, and simultaneously performing appliance screening on at least two of the first candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance, comprises: Expanding the speech rate feature set in the audio feature set by time steps to obtain a first input sequence; Expanding the tone feature set in the audio feature set by time steps to obtain a second input sequence; Performing data fusion on the first input sequence and the second input sequence to obtain a fused input sequence; Inputting the fused input sequence into a preset recurrent neural network for emotion label recognition to obtain a corresponding target emotion label; Collecting emotion data from a preset emotion database through the target emotion tag to obtain the user emotion data; At least two of the first candidate electrical appliances are screened using the user emotion data to obtain at least one second candidate electrical appliance.

6. The method for switching working modes of an electrical appliance based on voice interaction according to claim 5, characterized in that: The step of screening at least two of the first candidate electrical appliances by using the user emotion data to obtain at least one second candidate electrical appliance includes: Calculating the emotion score of the user emotion data to obtain a corresponding emotion score value; Performing sentiment classification on the sentiment score values ​​through a preset score range table to obtain corresponding sentiment classification results; Collecting electrical appliance parameters of the plurality of target electrical appliances to obtain an electrical appliance parameter set; Matching the electrical appliance trigger parameters of the plurality of target electrical appliances by using the electrical appliance parameter set to obtain the electrical appliance trigger parameter corresponding to each of the target electrical appliances; Based on a preset sentiment score mapping table, at least two of the first candidate electrical appliances are screened according to the electrical appliance triggering parameters corresponding to each of the target electrical appliances and the sentiment classification result to obtain at least one second candidate electrical appliance.

7. An electrical appliance working mode switching system based on voice interaction, characterized in that: The electrical appliance working mode switching system based on voice interaction includes: An acquisition module is used to acquire instruction audio data of a target user, extract instruction keywords from the instruction audio data, and obtain target instruction keywords; An extraction module, used for performing audio feature extraction on the instruction audio data to obtain an audio feature set, wherein the audio feature set includes speech rate feature data and tone feature data; An analysis module is used to perform association analysis on a plurality of target electrical appliances preset in a preset Internet of Things, and obtain an association degree between every two target electrical appliances; A construction module, used to construct a network topology model for the plurality of target electrical appliances based on the association relationship between each two target electrical appliances, to obtain an electrical appliance topology model; A matching module, configured to match the electrical appliances in the electrical appliance topology model with related electrical appliances by using the target instruction keywords to obtain at least two first candidate electrical appliances; an identification module, configured to perform user emotion recognition on the target user through the audio feature set to obtain user emotion data, and at the same time, perform appliance screening on at least two of the first candidate electrical appliances through the user emotion data to obtain at least one second candidate electrical appliance; A fusion module is used to encode and fuse the user emotion data and the target instruction keyword to obtain an encoding fusion vector, and input the encoding fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and control at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data; specifically comprising: calibrating the encoding vector length of the user emotion data to obtain a first encoding vector length; based on the first encoding vector length, segmentally encoding the user emotion data to obtain multiple first encoding data, and performing data fusion on the multiple first encoding data to obtain first target data; calibrating the encoding vector length of the target instruction keyword to obtain a second encoding vector length; based on the second encoding vector length, segmentally encoding the target instruction keyword to obtain multiple second encoding data, and performing data fusion on the multiple second encoding data to obtain second target data; performing fusion vector conversion on the first target data and the second target data to obtain the encoding fusion vector; inputting the encoding fusion vector into a preset electrical appliance working mode analysis model to perform working mode analysis to obtain working mode data, and controlling at least one of the second candidate electrical appliances to switch the electrical appliance working mode through the working mode data.

8. An electrical appliance working mode switching device based on voice interaction, characterized in that: The device for switching the working mode of an electrical appliance based on voice interaction comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the device for switching the working mode of an electrical appliance based on voice interaction executes the method for switching the working mode of an electrical appliance based on voice interaction as described in any one of claims 1-6.

9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the method for switching the working mode of an electrical appliance based on voice interaction as described in any one of claims 1 to 6 is implemented.