A scene control method and system based on neural network sensors
By collecting brainwave signals through neuronal sensors and combining them with command recognition models and emotion recognition, the problems of flexibility in smart home scene control and multi-user concurrency conflicts have been solved, achieving stable device operation and improved user experience.
Patent Information
- Application Number
- CN202510574450.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-05-06
AI Technical Summary
Existing smart home scene control methods do not consider the updating and maintenance of preset scene information, which limits the flexibility and scalability of scene control, and fail to effectively handle conflicts in concurrent control by multiple users, resulting in chaotic device control.
It uses neuronal sensors to collect EEG signals, distinguishes between control commands and communication commands through a command recognition model, and combines emotion recognition and a dynamic optimization mechanism based on a preset scene library to handle concurrent control conflicts among multiple users and dynamically update preset scene information.
It enables efficient identification of control and communication commands, avoids conflicts between concurrent control by multiple users, ensures normal equipment operation, improves user experience, and dynamically updates scene control to meet user needs.
Smart Images

Figure CN120428585B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a scene control method and system based on a neuron sensor, belonging to the field of smart home technology. Background Technology
[0002] Smart home refers to the use of advanced computer technology, network communication technology, Internet of Things technology, artificial intelligence technology, automatic control technology, etc., to connect various devices in the home through wired or wireless means, so as to realize the intelligence, automation and convenience of home life. With the continuous development of technology, smart home has become an important part of modern home life.
[0003] A Chinese patent with authorization announcement number CN111665737B discloses a smart home scene control method and system. The method includes: a distributed voice device receiving a scene control command and sending the scene control audio and the identifier of the distributed voice device in the scene control command to a voice server; the voice server performing voice recognition on the scene control audio to obtain the name of the scene to be controlled corresponding to the scene control audio; the voice server determining the target scene information matching the name of the scene to be controlled from the stored preset scene information based on the identifier of the distributed voice device, and returning the target scene information to an IoT server; and the IoT server controlling the smart home device based on the target scene information.
[0004] While existing technologies enable device control in different scenarios via scene controllers even when the internet is disconnected, they do not consider the updating and maintenance of preset scene information, limiting the flexibility and scalability of smart home scene control. Furthermore, they do not address conflict handling in cases of concurrent multi-user control. For example, if family member A issues a "movie viewing scene" control command while family member B issues a "fitness scene" control command, the control requirements of the two scenes may conflict, potentially leading to confusion in smart home device control and failing to meet the user's actual needs. Therefore, this application provides a scene control method and system based on neural network sensors. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a scene control method and system based on neuronal sensors. By collecting electroencephalogram (EEG) signals through neuronal sensors, the method achieves instruction classification and emotion recognition. Combined with a multi-user concurrent control conflict handling strategy and a dynamic optimization mechanism based on a preset scene library, the method solves the problems of insufficient scene control flexibility and device control conflicts in existing technologies.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A scene control method based on a neuron sensor includes:
[0008] Using a neuron sensor, the system continuously collects the user's brainwave signals and converts them into digital brainwave signals, which are then transmitted to the terminal device.
[0009] Feature vectors are extracted from the digital EEG signals, signal categories are determined based on the instruction recognition model, control instructions are saved to the control instruction library, and communication instructions are saved to the communication instruction library; wherein, the signal categories include control instructions and communication instructions.
[0010] Based on an emotion feature database, the emotional state of the communication instruction is determined, and the communication instruction is converted into speech or text.
[0011] The system reads control commands from the control command library, controls relevant devices via IoT protocols, and performs scene switching.
[0012] Furthermore, the specific steps for determining the signal category include:
[0013] Acquire historical data and extract the feature vectors and corresponding signal category labels of the digital EEG signals;
[0014] The feature vector and signal category label are divided into a training set and a test set. The logistic regression model is trained using the training set and validated using the test set. The trained logistic regression model is defined as an instruction recognition model.
[0015] Acquire real-time digital EEG signals and extract real-time feature vector x real And calculate the prediction probability.
[0016] Set the decision threshold as h TH Determine the signal category of the real-time digital EEG signal; if Then the signal type is determined to be a control command; if The signal type is then determined to be a communication command.
[0017] Furthermore, the specific steps for scene switching include:
[0018] Read the control instructions from the control instruction library and parse the control instructions;
[0019] The parsed control commands are categorized according to their target regions and then assigned to the corresponding command sets in order of their timestamps.
[0020] Iterate through the control instructions in the instruction set, determine whether there is multi-user concurrent control, and generate a control strategy;
[0021] The control strategy is executed, feedback data is collected, it is determined whether the control effect of the current scene meets expectations, and the preset scene library is optimized.
[0022] Furthermore, the specific steps for generating a control strategy include:
[0023] Define time error in t int If the issuance time is within the same time frame, then iterate through the instruction set to obtain the instruction set S that is issued at the same time.
[0024] Read the user ID information of the control instructions in the instruction set S to determine whether there is concurrent control by multiple users;
[0025] If U(m)≠U(n), it is determined that there is concurrent control for multiple users, and concurrent control processing is performed; where m and n are any two non-overlapping control instructions in the instruction set S, and U(m) and U(n) are the user IDs of control instructions m and n, respectively;
[0026] Otherwise, it is determined that there is no multi-user concurrency control and real-time conflict handling is performed;
[0027] The set of instructions S, after judgment and processing, is integrated to generate a control strategy.
[0028] Furthermore, the specific steps of concurrency control processing include:
[0029] Extract the associated devices from the instruction set S and store them in a hash table to determine whether the concurrent control of multiple users is for the same device;
[0030] If no associated device is found in the hash table during the storage process, it indicates that there is no concurrent control of the same device by multiple users, and real-time conflict handling is performed on the instruction set S.
[0031] If, during the storage process, it is found that any associated device already exists in the hash table, it indicates that there are multiple users concurrently controlling the same device. The control commands for concurrent control of the same device are then marked, and concurrency conflict adjustment is performed.
[0032] Furthermore, the specific steps for concurrency conflict resolution include:
[0033] Traverse the marked control instructions in the instruction set S, read the user ID, determine the user's level, and classify the control instructions to determine the level of the control instructions.
[0034] The final priority of each control command is determined by comprehensively considering the priority values corresponding to the user ID type and the urgency of the control command.
[0035] The control instructions marked are sorted according to their final priority, the set S is updated, and real-time conflict handling is performed.
[0036] Furthermore, the specific steps for real-time conflict resolution include:
[0037] Construct a mutual exclusion rule base and retrieve the current control time t of a specific device from the timing instructions. start Working status information R S and end time t end Generate a timing sequence {t} start ,t end ,R S};
[0038] Traverse the instruction set S, read the control instructions related to a specific device, and define them as related instructions, namely the first related instruction to the Nth related instruction;
[0039] Read the relevant instructions and generate multiple relevant sequences sequentially according to the control time, namely the first relevant sequence to the Nth relevant sequence, where the first relevant sequence is D1 = {t}. start,1 ,t end,1 ,R S,1};
[0040] The relevant sequences are compared with the timing sequence in turn to determine whether there is a conflict in working state or time between the relevant instructions and the timing instructions;
[0041] like The first related instruction and the timing instruction do not conflict in time, and the original information of the first related instruction is maintained;
[0042] If t start,1 ∈[t start ,t end And R S,1 =R S The first related instruction and the timing instruction overlap in time, let t end =t end,1 ;
[0043] If t start,1 ∈[t start ,t end And R S,1 ≠R S The first related instruction conflicts with the timing instruction, so the delay interval is set to Δt1 = t. end -t start,1 , let t start,1 =t end t end,1 =t end,1 +Δt1;
[0044] After the relevant instructions are evaluated, the set of instructions S after conflict resolution is output.
[0045] Furthermore, the specific steps to optimize the preset scene library include:
[0046] Retrieve preset parameters A for a specific scene from the preset scene library. movie And after the control of the specific scenario ends, the actual parameter A is acquired in real time. end ;
[0047] The allowable error is set to ΔA. The actual parameters are compared with the preset parameters to determine whether the control effect of the specific scenario meets expectations.
[0048] If |A movie -A end If |≤ΔA, the actual parameter fluctuates within the error range allowed by the preset parameter, and the control effect of the specific scenario reaches the expected level;
[0049] If |A movie -A end |>ΔA, the control effect of the specific scenario did not meet expectations, and the preset parameters were adjusted according to the actual parameters.
[0050] Furthermore, the specific steps for determining emotional state include:
[0051] Collect EEG signal data of different emotions, extract feature vectors, and associate and store them with corresponding emotion labels to generate an emotion feature library;
[0052] Calculate the real-time feature vector x of the communication command. real The similarity score d(x) with each emotion feature in the emotion feature library real ,x j ); where x j Let be the feature vector of the j-th emotion in the emotion feature library, where j = 1, ..., l, and l is the number of emotion types in the emotion feature library;
[0053] Set the emotion threshold to d TH To determine the emotional state; if d(x) real ,x j ) <d TH If d(x) is the emotion that matches the communication instruction, then the j-th emotion is determined to be the emotion that matches the communication instruction. real ,x j )≥d TH If the j-th emotion does not match the communication instruction, then it is determined that the j-th emotion does not match the communication instruction.
[0054] Obtain the matching emotion of the communication instruction. If no matching emotion exists, re-acquire the EEG signal. If only one matching emotion exists, define the matching emotion as the emotional state of the communication instruction. If multiple matching emotions exist, define the matching emotion with the highest similarity score as the emotional state of the communication instruction.
[0055] The communication instructions are converted into voice or text, and the voice or text style is dynamically adjusted based on the identified emotional state.
[0056] A scene control system based on a neuron sensor includes: an instruction division module, a communication module, and a control module;
[0057] The instruction segmentation module is used to continuously collect the user's brainwave signals, convert the brainwave signals into digital brainwave signals, determine the signal category based on the instruction recognition model, segment the digital brainwave signals, and save them to the corresponding instruction library.
[0058] The communication module is used to determine the emotional state of a communication instruction by using an emotion feature database, and to convert the communication instruction into speech or text.
[0059] The control module includes a parsing unit, an adjustment unit, and a feedback unit;
[0060] The parsing unit parses the control instructions in the control instruction library;
[0061] The adjustment unit is equipped with a classification strategy and a concurrency control strategy;
[0062] The classification strategy is used to classify the parsed control commands according to the target region, and accurately assign the control commands to the corresponding command sets through preset region mapping rules.
[0063] The concurrency control strategy is used to filter out the set of instructions at the same time based on the defined time error, and to determine whether there is multi-user concurrent control by reading the user ID, and to perform concurrent control processing or real-time conflict processing respectively.
[0064] The feedback unit is configured with a feedback optimization strategy;
[0065] The feedback optimization strategy retrieves preset parameters for a specific scenario from a preset scenario library after the control of a specific scenario ends, sets an allowable error, compares the actual parameters with the preset parameters, and if the actual parameters fluctuate within the allowable error range, the control effect meets expectations; otherwise, the control effect does not meet expectations, and the preset parameters are adjusted based on the actual parameters.
[0066] The beneficial effects of this invention are:
[0067] By classifying and storing brainwave signals, control and communication commands can be efficiently identified, thereby enabling corresponding functions. Emotion judgment helps convert communication commands into voice or text that better matches the user's emotions, improving communication quality. The scene switching process, from command parsing and classification to generating control strategies, effectively avoids conflicts caused by concurrent control from multiple users, ensuring normal device operation and improving user experience. Simultaneously, during scene switching, commands at the same time are filtered to determine if there is concurrent control from multiple users, and targeted processing is performed. When concurrent, a hash table is built to determine if there is a conflict targeting the same device. After marking, commands are sorted by user and command priority. Real-time conflict handling utilizes a mutual exclusion rule base to compare command sequences, adjust conflicts, and avoid misjudgments due to system errors. This efficiently handles multi-user conflicts and command timing conflicts, ensuring normal device operation and improving user experience. Based on device operating status, environmental changes, and user feedback collected by neuronal sensors, preset and actual parameters are compared to determine the scene control effect. The preset scene library is dynamically updated to better meet user needs and provide high-quality services. Attached Figure Description
[0068] Figure 1 This is a schematic diagram of a scene control method based on a neuron sensor;
[0069] Figure 2 A flowchart for scene switching;
[0070] Figure 3 To generate a flowchart of the control strategy;
[0071] Figure 4 To optimize the flowchart of the preset scene library;
[0072] Figure 5 This is a structural diagram of a scene control system based on a neuron sensor. Detailed Implementation
[0073] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0074] Example 1
[0075] refer to Figures 1 to 4 As shown, this embodiment introduces a scene control method based on a neuron sensor, including the following steps:
[0076] Utilizing neuronal sensors deployed in a smart home environment, this system continuously collects users' brainwave signals, including alpha, beta, gamma, delta, and theta waves. It records the emission time of these signals, immediately generates a timestamp, and converts the brainwave signals into digital EEG signals for transmission to the terminal device. In this implementation, the neuronal sensor possesses a series of unique and practical characteristics. In terms of dimensions, it has a diameter of 3cm, a thickness of 5cm, and a weight of 300g, conforming to ergonomic requirements with a small size and rich texture. Functionally, it has a transmission range of 10 square meters, is self-powered by light, requires no external power source, can move freely depending on the target area, and accurately captures users' brainwave signals at all times. It also features a cloud storage structure, supporting free movement for convenient data storage and transmission, ensuring data security and accessibility. In terms of structural design, it employs a magnetic levitation motor to achieve a silent operation, increasing user comfort and quietness. Its compact structure ensures adequate heat dissipation and meets the IEC 62368-1 standard.
[0077] Feature vectors are extracted from digital EEG signals. Based on the constructed command recognition model, the signal category is determined. The signal categories include control commands and communication commands. According to the recognition results of the signal categories, the digital EEG signals are saved to the corresponding command library. Digital EEG signals that are control commands are saved to the control command library, and digital EEG signals that are communication commands are saved to the communication command library.
[0078] The system reads communication instructions from the communication instruction library, compares them with the learned emotional feature library based on feature patterns, determines the user's current emotional state (e.g., tension, calmness, excitement, frustration), and converts the communication instructions into voice or text to enable communication between users. For example, it can convert the emotions (happiness or fear) expressed by children through brainwave signals into voice or text to notify parents, helping parents better understand their children's needs and emotions. It can also convert the needs expressed by patients with speech impairments through brainwave signals into voice or text.
[0079] Read control commands from the control command library, select a suitable mode from the preset scene library, and control relevant devices through the Internet of Things protocol to achieve scene switching.
[0080] Furthermore, the specific steps for determining the signal category include:
[0081] Acquire a large amount of historical data, including digital EEG signals g(e) and corresponding signal category labels. Extract feature vectors of the digital EEG signals and their corresponding signal category labels. Mark control commands as 1 and communication commands as 0. Features include: mean μ g ,variance The peak value is defined as max{g(e)}, the power spectral density P(k), and the wavelet transform coefficients. The peak value is determined by finding local maxima in the digital EEG signal g(e). This involves iterating through the sampling points on the digital EEG signal g(e). If the value of a sampling point is greater than the values of two adjacent points, that sampling point is defined as a preliminary peak value. To avoid misjudgment due to noise interference, the preliminary peak value is compared with a preset peak value threshold. Sampling points where the preliminary peak value is greater than the peak value threshold are defined as peak values. The expression is shown below:
[0082]
[0083] In the formula, since the neuron sensor samples the continuous electroencephalogram (EEG) signal at a certain sampling frequency, it extracts sample values from the continuously changing analog signal at fixed time intervals, thus forming a discrete digital EEG signal g(e) of length E, where E is the number of sampling points and the sampling frequency is f. x , g(i) is the signal value of the i-th sampling point, and G(k) is the discrete Fourier transform (DFT) of the digital EEG signal g(e);
[0084] The feature vectors and signal category labels are divided into training and test sets. The logistic regression model is trained using the training set, and the model parameters are updated by minimizing the loss function. The logistic regression model is validated using the test set. The trained logistic regression model is defined as the instruction recognition model; the expression is shown below:
[0085]
[0086] In the formula, h θ (x) is the prediction function of the logistic regression model, x is the feature vector, and θ is the parameter vector of the model. T Let J(θ) be the transpose of the parameter vector θ, J(θ) be the loss function, r be the number of training samples, and y be the transpose of the parameter vector θ. (q) Let θ be the true label of the q-th sample. p+1 Here is the update formula for parameter θ, where α is the learning rate. h is the partial derivative of the loss function J(θ) with respect to the parameter θ. θ (x (q) ) represents the feature vector x of the q-th sample. (q) The predicted value, Let x be the feature vector of the q-th sample. (q) The p-th component;
[0087] Acquire real-time digital EEG signals and extract real-time feature vector x real The real-time feature vector x real The input is fed into the instruction recognition model to calculate the predicted probability.
[0088] Set the decision threshold as h TH Determine the signal category of the real-time digital EEG signal; if Then the signal type is determined to be a control command; if The signal type is then determined to be a communication command; in this embodiment, h is taken as... TH =0.5.
[0089] Furthermore, the specific steps for determining emotional state include:
[0090] We collect a large amount of EEG signal data from different individuals in various emotional induction scenarios, such as watching sad movies to induce feelings of depression and participating in competitive games to induce feelings of excitement. We extract feature vectors from the collected EEG signals and associate them with corresponding emotion tags to generate an emotion feature library.
[0091] Using Euclidean distance, calculate the real-time feature vector x of the communication command. real The similarity score d(x) with each emotion feature in the emotion feature library real ,x j ), where x j Let be the feature vector of the j-th emotion in the emotion feature library, j = 1, ..., l, where l is the number of emotion types in the emotion feature library. The similarity score provides a basis for judging the user's current emotion. The higher the score, the more similar the current EEG signal features are to the corresponding emotion features, and the greater the likelihood that the user is in the corresponding emotional state.
[0092] Set the emotion threshold to d TH To determine the emotional state; if d(x) real ,x j ) <d TH If d(x) is the emotion that matches the communication instruction, then the j-th emotion is determined to be the emotion that matches the instruction. real ,x j )≥d TH If the j-th emotion does not match the communication instruction, then it is determined that the j-th emotion does not match the communication instruction.
[0093] If a matching emotion is not found, a message is displayed indicating that the emotional state cannot be accurately determined, and it is recommended to re-collect EEG signals or supplement other information. If only one matching emotion exists, the matching emotion is defined as the emotional state of the communication instruction. If multiple matching emotions exist, the matching emotion with the highest similarity score is defined as the emotional state of the communication instruction.
[0094] Different emotional states correspond to different communication styles. Communication instructions are converted into voice or text, and the voice or text style is dynamically adjusted according to the identified emotional state to make the communication more natural and appropriate. For voice conversion, a voice synthesis engine is called to convert text instructions into voice output, which is then played through devices such as speakers. For text conversion, the instructions are displayed as text on the screen (such as mobile apps or smart device displays).
[0095] Furthermore, the specific steps for scene switching include:
[0096] The system reads control commands from the control command library, parses the commands, analyzes them using natural language, extracts key information, and improves the command information, including user ID, operation type, target area, associated device, control action, and parameters. This eliminates format differences between multiple terminals, avoids misjudgments caused by ambiguous descriptions, and improves accuracy and reliability.
[0097] The parsed control commands are categorized according to target regions. Using preset region mapping rules, all control commands are accurately assigned to their corresponding command sets. For example, if a command contains words related to "living room," it is automatically assigned to the living room command set; if it contains "bedroom," it is assigned to the bedroom command set. During the command classification process, the neural network sensor can quickly identify and match regional features within the commands, accelerating the classification process. Each command set is named after its target region for easy management and retrieval. Taking the living room command set as an example, the control commands in the living room command set are sorted according to their timestamps. Each control command is arranged in an orderly manner in the database, awaiting further processing.
[0098] When multiple users operate a smart home environment simultaneously, such as when a user in the living room issues commands for watching a movie and exercising at the same time, device control conflicts can easily occur. These conflicts not only affect the user experience but also damage the normal operation of the devices. To avoid this, the control commands in the command set are periodically traversed. During the traversal, multiple users are carefully checked to see if multiple users send control commands at the same time. This determines whether there is concurrent control by multiple users in the command set and generates control policies for the corresponding areas. This avoids device control conflicts caused by issuing commands for different scenarios (such as watching a movie and exercising) at the same time, protects the normal operation of the devices, and improves the user experience.
[0099] Control policies for the living room area are sent to the corresponding smart home devices to control the smart home environment. After the devices execute the control policies, the neural network sensors monitor the operating status of the devices and environmental changes in real time, and collect user feedback data on the scene control effect, such as user manual adjustments to device parameters. Based on the feedback data, it is determined whether the current scene control effect has met expectations, and the preset scene library is optimized to achieve dynamic updates and maintenance of preset scene information. This allows the smart home environment to continuously adapt to and meet the actual needs of users, providing better services.
[0100] Furthermore, the specific steps to improve control commands include:
[0101] Extract the user ID from the control command to identify the user and determine the operation type, including controlling device operation, querying device status, and configuring devices. Record the timestamp of the control command, specify the target area name (e.g., living room, bedroom, kitchen), organize the list of associated devices, determine which smart home devices are involved in the control command, and parse the specific control action (e.g., turning on a device, turning off a device, adjusting device parameters). If it is an adjustment, specify the specific parameters (e.g., adjusting air conditioner temperature, adjusting light brightness). Taking the voice command "living room movie scene" as an example, accurately identify the user ID, the operation type is "control device operation," the timestamp is the precise time generated when the control command is received, the target area name is "living room," the associated device list includes "projector, curtains, lights," the control action is "adjust," and the specific parameters are preset parameters retrieved from the preset scene library.
[0102] Furthermore, the specific steps for generating a control strategy include:
[0103] Taking the living room instruction set as an example, the time error is defined as t int The issuance time within a certain range is considered the same time to avoid misjudgment due to minor errors such as system processing delays; the control commands in the living room command set are traversed, and for each control command, the timestamp information is extracted. Control commands issued at the same time are filtered out to obtain the command set S of the same time; where t int This is the concurrent error interval;
[0104] For each control instruction in the instruction set S, read the user ID information of each control instruction to determine whether there is concurrent control by multiple users;
[0105] If U(m)≠U(n), it indicates that the control commands at the same time come from different user IDs, which is determined to be multi-user concurrent control, and concurrent control processing is performed.
[0106] Otherwise, it indicates that the control commands at the same time all come from the same user ID, and it is determined that there is no multi-user concurrent control. Real-time conflict handling is performed to check whether a single control command conflicts with the current state of the device in the smart home environment or other queued commands; where m and n are any two non-overlapping control commands in the command set S, and U(m) and U(n) are the user IDs of control commands m and n, respectively.
[0107] The set of instructions S, after judgment and processing, is integrated to generate a control strategy.
[0108] Furthermore, the specific steps of concurrency control processing include:
[0109] In a smart home environment, the control operations of different devices are independent of each other and will not conflict due to multiple users operating different devices simultaneously. Conflicts will only occur when multiple users control the same device at the same time, affecting the normal operation of the device and the user experience. To improve the efficiency of judgment, a hash table is constructed to store the associated devices of different control commands. The associated devices of each control command in the command set S are extracted one by one and stored in the hash table. It is then determined whether the concurrent control of multiple users is aimed at the same device. In the hash table, the key is the associated device, and the value is the relevant information of the corresponding command, such as the command sender and the command content.
[0110] If no associated device is found in the hash table during the storage process, it indicates that there is no concurrent control of multiple users for the same device, and real-time conflict handling is performed on the instruction set S.
[0111] If, during the storage process, it is found that any associated device already exists in the hash table, it indicates that there are multiple users concurrently controlling the same device. The control commands for concurrent control of the same device are then marked, and concurrency conflict adjustment is performed.
[0112] Furthermore, the specific steps for concurrency conflict resolution include:
[0113] Traverse the marked control commands in the command set S, read the user ID to determine the user level, and classify the control commands to determine the command level. The user levels include: ordinary user, advanced user, and privileged user. Different user levels correspond to different priority values, and privileged user a1 > advanced user a2 > ordinary user a3. The command levels include: emergency command, important command, and regular command. Different command levels correspond to different priority values, and emergency command b1 > important command b2 > regular command b3.
[0114] Taking into account both the user ID type and the priority value corresponding to the urgency of the control command, the final priority a+b of each control command is determined; where a is the priority value of the user ID type, including a1, a2, and a3, and b is the priority value of the urgency of the control command, including b1, b2, and b3.
[0115] The control instructions marked are sorted according to their final priority, the instruction set S is updated, and real-time conflict handling is performed.
[0116] Furthermore, the specific steps for real-time conflict resolution include:
[0117] In a smart home environment, multiple devices work together. However, if the execution times of commands from different devices interfere with each other, various conflicts can easily arise, negatively impacting the user experience. For example, if the command to turn on the smart light and the command to turn on the smart curtain overlap, it disrupts the smoothness and convenience of use. Building a mutual exclusion rule library can help provide a basis for resolving such potential conflicts. The mutual exclusion rule library covers various mutual exclusion rules, including predefined mutual exclusion rules and extended mutual exclusion rules. Predefined mutual exclusion rules include basic mutual exclusion, directional conflict, timing conflict, and supplementary conflict. Basic mutual exclusion refers to the mutual exclusion of the device's own operations, such as the on and off operations of a device, to prevent devices from performing opposite actions at the same time. Directional conflict refers to the mutual exclusion of the forward and reverse rotation operations of a motor, such as a smart electric clothes rack, to prevent the motor from entering a chaotic operating state. Timing conflict refers to the mutual exclusion of the device's start and restart operations to prevent device malfunctions caused by forced stops. Supplementary conflict refers to operational conflicts between different devices to avoid incoordination caused by simultaneous execution. Extended rules are custom rules added by the administrator through the console, such as the mutual exclusion of the heating and cooling operations of a device.
[0118] When control commands conflict with the operating status or timing of existing equipment, handling is required to ensure normal equipment operation without affecting the execution of other commands and maintaining efficient system operation. For example, if a specific device in the living room (such as an air conditioner) is currently executing a timed command, the current control time t of that specific device should be retrieved. start and working status information R S This includes whether the device is currently running, paused, or shut down, and the estimated end time t of the task being executed. end Generate a timing sequence {t} start ,t end ,R S};
[0119] Traverse the control instructions in the instruction set S, read the control instructions related to a specific device, and define them as related instructions, namely the first related instruction to the Nth related instruction. Read the information in the related instructions, and generate multiple related sequences in sequence according to the control time, namely the first related sequence to the Nth related sequence, where the first related sequence is D1 = {t}. start,1 ,t end,1 ,R S,1 The relevant sequences are compared with the timing sequences in turn to determine whether there is a conflict in working status or time between the relevant instructions and the timing instructions. Among them, the control instructions related to specific devices include control instructions whose control object is a specific device and control instructions that have a mutual exclusion relationship with a specific device. The control instructions in the instruction set S are traversed, and according to the mutual exclusion rule base, the rate algorithm is used to identify the smart home devices in the control instructions in turn and extract the control instructions that are mutually exclusive with the specific device.
[0120] Taking the first relevant sequence as an example, if There is no time conflict between the first relevant instruction and the timing instruction of the specific device, and the original information of the first relevant instruction is preserved;
[0121] If t start,1 ∈[t start ,t end And R S,1 =R S If the first related instruction and the timing instruction of a specific device overlap in time, the end time of the first related instruction will cover the end time of the timing instruction, and let t end =t end,1 ;
[0122] If t start,1 ∈[t start ,t end And R S,1 ≠R S The first relevant instruction requires the device to execute R S,1 If there is a conflict with the timing instructions of a specific device, the execution time and end time of the first related instruction will be postponed, and the postponement interval will be set to Δt1 = t. end -t start,1 , let t start,1 =t end t end,1 =t end,1 +Δt1;
[0123] After all relevant instructions have been evaluated, the set of instructions S after conflict resolution is output.
[0124] Furthermore, the specific steps to optimize the preset scene library include:
[0125] Taking the living room movie-watching scenario as an example, retrieve the preset parameter A of the living room movie-watching scenario from the preset scene library. movie And after the scene control ends, the actual parameter A is acquired in real time through various sensors. end Preset parameter A movie Including light brightness parameter X1, color temperature parameter Y1, smart air conditioner temperature parameter Z1, fan speed parameter W1, and actual parameter A. end This includes the actual light brightness parameter X2, the actual color temperature parameter Y2, the actual smart air conditioner temperature parameter Z2, and the actual wind speed parameter W2.
[0126] To reasonably judge the control effect, an allowable error of ΔA is set, and the actual parameters are compared with the preset parameters to determine whether the control effect of the current scene has met expectations. The allowable error ΔA includes lighting error ΔX, color temperature error ΔY, temperature error ΔZ, and wind speed error ΔW.
[0127] If |A movie -A end |≤ΔA, the actual parameters all fluctuate within the allowable error range of the preset parameters, and the control effect of the current scene meets expectations; where |A movie -A end |≤ΔA includes |X1-X2|≤ΔX and |Y1-Y2|≤ΔY and |Z1-Z2|≤ΔZ and |W1-W2|≤ΔW;
[0128] If |A movie -A end |>ΔA, the current scene control effect has not met expectations, and the preset parameters have been adjusted according to the actual parameters; where |A movie -A end |>ΔA is the division by |A movie -A end Other cases besides |≤ΔA.
[0129] Example 2
[0130] Please see Figure 5 Another embodiment of the present invention provides: a scene control system based on a neuron sensor, comprising: an instruction division module, a communication module, and a control module;
[0131] The instruction segmentation module is used to continuously collect the user's brainwave signals through neuronal sensors, convert the brainwave signals into digital brainwave signals and transmit them to the terminal device, extract feature vectors from the digital brainwave signals, determine the signal category based on the constructed instruction recognition model, and segment the digital brainwave signals. The signal categories include control instructions and communication instructions. Based on the identification results of the signal categories, the digital brainwave signals are saved to the corresponding instruction library. Digital brainwave signals that are control instructions are saved to the control instruction library, and digital brainwave signals that are communication instructions are saved to the communication instruction library.
[0132] The communication module is used to determine the emotional state of communication instructions in the communication instruction library by using the emotion feature library, and convert the communication instructions into voice or text to enable communication between users.
[0133] The control module is used to read control commands from the control command library, select appropriate modes from the preset scene library, and control relevant devices through the Internet of Things protocol to achieve scene switching.
[0134] Furthermore, the control module includes a parsing unit, an adjustment unit, and a feedback unit;
[0135] The parsing unit is used to parse the control instructions in the control instruction library. It uses natural language to extract key information of the control instructions and improve the information of the control instructions, including user ID, operation type, target area, associated device, control action and parameters. This eliminates the format differences of instructions from multiple terminals, avoids misjudgment caused by ambiguous expression, and improves accuracy and reliability.
[0136] The adjustment unit is used to classify control commands and generate corresponding command sets. It periodically traverses the command set, determines whether there are multiple users controlling concurrently, and generates control strategies for the corresponding areas. This avoids device control conflicts caused by issuing commands from different scenarios at the same time, protects the normal operation of the device, and improves the user experience.
[0137] The feedback unit is used to monitor the operating status of the equipment and environmental changes in real time after the control strategy is executed, collect feedback data, determine whether the control effect of the current scenario has met expectations, optimize the preset scenario library, and realize the dynamic update and maintenance of preset scenario information.
[0138] Furthermore, the adjustment unit is equipped with a classification strategy and a concurrency control strategy;
[0139] The classification strategy is used to classify the parsed control commands according to the target area. Through the preset area mapping rules, all control commands are accurately assigned to the corresponding command sets. Each command set is named after the target area and the control commands are sorted according to the timestamp order.
[0140] The concurrency control strategy is used to filter out the set of instructions issued at the same time based on a defined time error. It determines whether multi-user concurrent control exists by reading the user ID, and performs either concurrent control processing or real-time conflict handling accordingly. The concurrent control processing involves building a hash table to store associated devices, determining whether multi-user concurrent control is targeting the same device, and if a conflict exists, marking the instructions and determining the final priority based on user level and instruction level. After sorting the marked instructions, real-time conflict handling is performed. The real-time conflict handling involves building a mutual exclusion rule base. When an instruction conflicts with device status or time, a timing sequence and related sequences are generated and compared. The instruction execution time is adjusted according to different situations, and the adjusted set is finally output.
[0141] Furthermore, the feedback unit is configured with a feedback optimization strategy. After the control of a specific scenario ends, the feedback optimization strategy retrieves the preset parameters of that specific scenario from the preset scenario library, sets the allowable error, and compares the actual parameters obtained in real time by various sensors with the preset parameters. If the actual parameters fluctuate within the allowable error range, it indicates that the control effect has met expectations; otherwise, it is determined that the control effect has not met expectations, and the preset parameters are adjusted according to the actual parameters to achieve dynamic optimization of the preset scenario library.
[0142] In summary, this invention collects brainwave signals using a neuronal sensor and distinguishes between control commands and communication commands using a command recognition model, storing them in corresponding command libraries. For communication commands, the emotional state is determined by comparing them with an emotion feature library before converting them into speech or text for communication. For control commands, key information is extracted to refine the command, eliminating format differences. The commands are then categorized by target region, named by region, and sorted. The command sets are traversed, and time errors are defined to filter commands at the same time, determining if multiple users are controlling concurrently. If so, a hash table is constructed to determine if there is a conflict for the same device, marking conflicting commands. The final priority ranking is determined by considering user level and command level, followed by real-time conflict handling. A mutual exclusion rule library is constructed, covering predefined and extended rules. When a control command conflicts with the device's operating state or time, the device's timing sequence is retrieved, generating a relevant command sequence for comparison. The command execution time is adjusted according to different situations, and the adjusted set is output to ensure normal device operation and system efficiency. After sending the control strategy to control the device, the device is monitored and feedback is collected. Preset and actual parameters are compared, and allowable errors are set to judge the control effect. If the expected results are not achieved, the preset scenario library is adjusted according to actual parameters to achieve dynamic updates and maintenance, meeting user needs.
[0143] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method of scene control based on neuron sensor, characterized in that, The method comprises the following steps: Collecting brain wave signals of a user continuously by using a neuron sensor, and converting the brain wave signals into digital brain wave signals and transmitting the digital brain wave signals to a terminal device; Extracting feature vectors in the digital brain wave signals, judging a signal category based on an instruction recognition model, saving a control instruction into a control instruction library, and saving a communication instruction into a communication instruction library; the signal category comprises the control instruction and the communication instruction; Judging an emotional state of the communication instruction based on an emotional feature library, and converting the communication instruction into speech or text; Reading the control instruction in the control instruction library, controlling related devices through an Internet of Things protocol, and switching scenes; The specific steps of the scene switching comprise: Reading the control instruction in the control instruction library, and analyzing the control instruction; Classifying the analyzed control instruction according to a target area, and sorting the control instruction into a corresponding instruction set according to a time stamp sequence; Judging whether there is multi-user concurrent control in the control instruction in the instruction set, and generating a control strategy; Executing the control strategy, collecting feedback data, judging whether a current scene control effect reaches an expectation, and optimizing a preset scene library. 2.The scene control method based on neuron sensor according to claim 1, wherein, The specific steps of judging the signal category comprise: Obtaining historical data, extracting feature vectors of the digital brain wave signals and corresponding signal category labels; Dividing the feature vectors and the signal category labels into a training set and a test set, training a logistic regression model by using the training set, verifying the logistic regression model by using the test set, and defining the trained logistic regression model as an instruction recognition model; Obtaining real-time digital electroencephalogram signals, extracting real-time feature vectors and calculating prediction probabilities ; Setting the decision threshold as , judging the signal category of the real-time digital electroencephalogram signal; if , determining that the signal category is a control instruction; if , determining that the signal category is a communication instruction. 3.The scene control method based on neuron sensor according to claim 2, wherein, The specific steps of generating the control strategy comprise: Define the time error in the same time as the time of sending the time error within ± 100 ns ; reading the instruction set user id information of the control instruction, and determining whether there is multi-user concurrent control; like The system was determined to have multi-user concurrency control, and concurrency control measures were implemented. , For any two non-overlapping control instructions in instruction set S, , Control commands , User ID; Otherwise, it is determined that there is no multi-user concurrent control, and real-time conflict processing is performed; the instruction set after judgment and processing integrate to generate a control strategy.
4. The scene control method based on neuron sensor according to claim 3, characterized in that, The specific steps of the concurrent control processing comprise: extracting the associated devices in the instruction set and storing them in a hash table to determine whether the concurrent control of multiple users is for the same device; If during the storing process, it is found that no associated device exists in the hash table, it indicates that there is no concurrent control of the same device by multiple users, and the instruction set is processed in real time for conflict. If any associated device is found to exist in the hash table during the storage process, it is indicated that there is multi-user concurrent control for the same device, the control instructions for the same device are marked, and concurrent conflict adjustment is performed.
5. The scene control method based on neuron sensor according to claim 4, characterized in that, The specific steps of the concurrent conflict adjustment comprise: traversing the set of instructions The control instruction is marked in the middle, the user ID is read, the level of the user is determined, and the control instruction is classified to determine the level of the control instruction. Considering the user ID type and the priority value corresponding to the emergency degree of the control instruction comprehensively, the final priority of each control instruction is determined; ordering the tagged control instructions according to the size of the final priority, updating the instruction set and performing real-time conflict handling.
6. The scene control method based on neuron sensor according to claim 5, wherein, The specific steps of the real-time conflict processing comprise: constructing a library of exclusion rules and invoking a timing command for the current control time of a specific device , working state information , and end time , generating a timing sequence ; traversing the set of instructions , reading control instructions related to a specific device and defined as related instructions, respectively first related instruction to the last related instruction; read the related instructions, according to the control time, sequentially generate a plurality of related sequences, respectively, the first related sequence to the first related sequence, wherein the first related sequence is ; The related sequence is compared with the timing sequence in sequence, and it is judged whether there is a working state conflict or a time conflict between the related instruction and the timing instruction; If , the first related instruction and the timing instruction do not exist time conflict, keep the original information of the first related instruction; If and , the first correlation instruction is time-coincident with the timing instruction, causing ; If and , the first related instruction conflicts with the timing instruction, set the delay interval to , let , ; When the relevant instructions are judged to be complete, output the instruction set after the conflict adjustment .
7. The scene control method based on neuron sensor according to claim 6, wherein, The specific steps of optimizing the preset scene library comprise: retrieve preset parameters of a specific scene in the preset scene library and acquire actual parameters in real time after the specific scene control ends ; The allowable error is set as The actual parameter is compared with the preset parameter to determine whether the specific scene control effect reaches the expectation. If , the actual parameter fluctuates within the error range allowed by the preset parameter, and the specific scene control effect achieves the expectation; If , the specific scene control effect does not reach the expectation, and the preset parameter is adjusted according to the actual parameter. 8.The scene control method based on neuron sensor according to claim 7, wherein, The specific steps of judging the emotional state comprise: Collecting brain wave signal data of different emotions, extracting feature vectors, and associating and storing the feature vectors with corresponding emotional labels to generate an emotional feature library; a real-time feature vector of the communication instruction a similarity score with each emotion feature in the emotion feature library ; wherein, is a feature vector of the th emotion in the emotion feature library, , is a number of emotions in the emotion feature library Setting the emotion threshold value as , the emotion state is determined; if , the first emotion is determined as the matching emotion of the communication instruction; if , the first emotion is determined as not matching the communication instruction; Obtaining a matching emotion of the communication instruction, re-collecting brain wave signals if there is no matching emotion, defining the matching emotion as the emotional state of the communication instruction if there is only one matching emotion, and defining the matching emotion with the largest similarity score as the emotional state of the communication instruction if there are multiple matching emotions; Converting the communication instruction into speech or text, and dynamically adjusting the speech or text style according to the recognized emotional state.
9. A neuron sensor based scene control system for implementing a neuron sensor based scene control method as claimed in any one of the claims 1-8, characterized by The method comprises the following steps: An instruction division module, a communication module, and a control module. The instruction division module is configured to continuously collect the brain wave signals of the user, convert the brain wave signals into digital brain signals, judge the signal category based on an instruction recognition model, divide the digital brain signals, and save them into a corresponding instruction library; The communication module is configured to judge the emotional state of the communication instruction through an emotional feature library, and convert the communication instruction into voice or text; The control module includes an analysis unit, an adjustment unit, and a feedback unit; The analysis unit analyzes the control instructions in the control instruction library; The adjustment unit is configured with a classification strategy and a concurrent control strategy; The classification strategy is configured to classify the analyzed control instructions according to target regions, accurately classify the control instructions into corresponding instruction sets through a preset region mapping rule; The concurrent control strategy is configured to filter out instruction sets at the same time according to a defined time error, judge whether there is multi-user concurrent control by reading the user ID, and perform concurrent control processing or real-time conflict processing respectively; The feedback unit is configured with a feedback optimization strategy; The feedback optimization strategy is configured to adjust the preset parameters according to the actual parameters after the control of a specific scene ends, set the allowable error, compare the actual parameters with the preset parameters, and if the actual parameters fluctuate within the allowable error range, the control effect reaches the expectation; if it is in other conditions, the control effect does not reach the expectation, and the preset parameters are adjusted according to the actual parameters.
Citation Information
Patent Citations
A smart home scene control method and system
CN111665737B
Brain computer interface-based self-adaptive home environment control device and control method thereof
CN106020470A