Disclosure of Invention
The present invention is directed to a blockchain-based anomaly detection method, so as to solve the problems set forth in the background art.
In order to solve the technical problems, the invention provides the following technical scheme: a blockchain-based anomaly detection method, the method comprising the steps of:
Step one: establishing an information collection library, and presetting voice instruction data of each family member;
step two: identifying the family membership when the smart home device is awakened;
Step three: when a main family member sends out a voice command, judging whether the voice command is within a preset range of the member;
Step four: when the voice command is not in the preset range, judging the operation risk level based on the operation record of the family member;
step five: alarming abnormal operation according to the risk assessment;
step six: when the equipment is in a working state under abnormal operation, the equipment performs self-checking.
According to the above technical solution, the step of establishing the information collection library and presetting voice instruction data of each family member includes:
the intelligent home system presets a voice instruction range of each family member, establishes a corresponding data account for each family member, and records a normal control instruction range of each intelligent home device of the family member.
According to the above technical solution, when the smart home device is awakened, the step of identifying the family membership includes:
when a family member wakes up the intelligent household device through a voice instruction, the intelligent household device collects voice data of the family member, recognizes the identity of the family member through a voice recognition module and logs in a family member data account;
when family members sound, the intelligent home equipment extracts acoustic characteristics, the voice command recognition module can match the sound model of each family member, and the identity with the highest matching degree with the model is selected as the identity of the sender of the voice command.
According to the above technical scheme, when the main family member sends out the voice command, the step of judging whether the voice command is within the preset range of the member includes:
The intelligent equipment preset range comprises time, a switch, gears and functions, when a main family member sends out a voice instruction, whether the current time is within the preset time range or not is detected, whether the equipment is opened to the current family member or not is detected, whether the current gears are located between the preset gears or not is detected, and whether the current functions accord with the preset functions or not is detected;
When the voice command is within the whole preset range, judging that the family member normally operates the intelligent home equipment; when any one of the voice commands exceeds the preset range, the family member is judged to possibly execute abnormal operation, and the current voice command is detected later.
According to the above technical solution, when the voice command is not within the preset range, the step of determining the operation risk level based on the operation record of the family member includes:
s1, reading a family member operation log to obtain an operation record of a family member;
S2, extracting records of on/off, gear, function and service time of the intelligent equipment in the operation records;
s3, taking the extracted record as the characteristic for judging abnormal operation, and setting characteristic values as s1, s2 and sn;
And S4, distributing a weight for each feature, automatically setting the weights w1, w2, and..wn through machine learning, multiplying the value of each feature by the corresponding weight, and adding the products to obtain the risk level s=w1+w2+s2+ … +wn of the operation.
According to the above technical solution, the step of alarming abnormal operation according to risk assessment includes:
When the risk level exceeds the risk assessment threshold level within 60%, alarming the action, and sending out a voice prompt to confirm whether the operation is to be executed or not again; when the threshold value is over 60%, alarming the action and giving out a voice prompt, confirming whether the operation is to be executed again, and sending the operation to the APP for alarming, wherein the APP end can stop the operation;
According to the risk assessment of abnormal operation, the intelligent home equipment does not immediately execute the operation, but warns that the operation possibly has abnormality, and executes the operation of the voice instruction after confirming again to obtain a reply; when the operation risk assessment level is higher, the intelligent household equipment also warns that the operation is possibly abnormal, and executes the operation of the voice instruction after being confirmed again to obtain a response.
According to the above technical solution, when the device is in a working state under abnormal operation, the step of performing self-checking by the device includes:
when the device judges that the operation is abnormal operation, marking the current state as an abnormal state;
Under an abnormal state, the equipment starts self-checking, and according to the preset upper limit of the working time of the abnormal state of the equipment, when the operation time of the equipment reaches the upper limit, the equipment is stopped and locked, an abnormal log is sent to an APP, and the APP end receives the alarm and decides whether to unlock the equipment.
According to the above technical scheme, the abnormality detection system based on blockchain includes:
the voice command recognition module is used for recognizing the voice command of the family member and converting the voice command into a text form;
The information collection library module is used for storing voice instruction data of each family member;
the membership identification module is used for identifying the identity of the current family member according to the voice command;
the preset range judging module is used for judging whether the current voice instruction is within the preset range of the current family member;
The risk assessment module is used for assessing the operation risk according to the behavior records and the use frequency of the family members;
The alarm module is used for sending an alarm prompt to family members when abnormal operation is found;
The self-checking module is used for carrying out self-checking when the equipment is in an abnormal operation state so as to ensure the normal operation of the equipment;
And the equipment control module is used for controlling operations such as switching, adjustment, setting and the like of the intelligent household equipment.
According to the above technical scheme, the preset range judging module includes:
The model matching unit is used for matching the voice command of the family member with a preset model and judging whether the voice command is within a preset range or not;
and the threshold setting unit is used for setting a corresponding threshold according to the requirements or the use habits of family members so as to judge whether the voice instruction belongs to abnormal operation.
According to the above technical solution, the risk assessment module includes:
the log recording unit is used for recording the operation behaviors and the use frequency of family members when the intelligent household equipment is used;
The data processing unit is used for processing and analyzing the recorded family member behavior data so as to find out the rule of abnormal operation;
And the risk assessment algorithm unit is used for assessing the operation risk by using a related risk assessment algorithm according to the data obtained through processing and analysis.
Compared with the prior art, the invention has the following beneficial effects: in the present invention, the number of the components,
(1) The membership of the current family is recognized through voice through the membership recognition module, so that the identity is accurately recognized;
(2) Judging whether the current voice command is within the preset range of the current family member or not through the preset range judging module, so that the use safety of the equipment is improved;
(3) Through the risk assessment module, the operation risk is assessed according to the behavior records and the use frequency of family members, and abnormal operation is intelligently judged;
(4) The alarm module is arranged to send an alarm prompt to family members when abnormal operation is found, so that the use safety of equipment is improved;
(5) When the equipment is in an abnormal operation state, the self-detection module is arranged to perform self-detection so as to ensure the normal operation of the equipment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one: fig. 1 is a flowchart of a blockchain-based anomaly detection method according to an embodiment of the present invention, where the embodiment is applicable to a smart home scenario, and the method may be performed by a blockchain-based anomaly detection system according to the embodiment, as shown in fig. 1, and the method specifically includes the following steps:
Step one: establishing an information collection library, and presetting voice instruction data of each family member;
In the embodiment of the invention, the intelligent home system is preset with the voice instruction range of each family member. Establishing a corresponding data account for each family member, and recording the normal control instruction range of each intelligent household device of the family member;
Illustratively, family members include grandfather, grandmother, father, mother, son, daughter. The intelligent home system presets the voice control instruction range of each person, such as son: the lamps in the room can be controlled, including the switch of the lamps, all brightness gears and all light modes; the air conditioner of the room can be controlled, the air conditioner comprises a switch of the air conditioner, all air conditioning functions are realized, the air conditioner refrigerates 20-30 ℃, and the air conditioner heats 22-28 ℃.
Step two: identifying the family membership when the smart home device is awakened;
In the embodiment of the invention, when a family member wakes up the intelligent household equipment through a voice instruction, the intelligent household equipment collects the voice data of the family member, and the family member identity is identified through the voice identification module and logs in the family member data account. The family members need to acquire and register sound firstly, namely, a sound model is built in the system, when the family members sound, the intelligent household equipment extracts acoustic characteristics, the voice command recognition module can be matched with the sound model of each family member, and the identity with the highest matching degree with the model is selected as the identity of the sender of the voice command;
illustratively, a grandfather in the family members wakes up the lamp of the living room through voice instructions, collects voice data of the grandfather and recognizes that the family members are the grandfather through a voice recognition module, and the system automatically logs in the account of the grandfather.
Step three: when a main family member sends out a voice command, judging whether the voice command is within a preset range of the member;
In the embodiment of the invention, the preset range of the intelligent equipment comprises time, a switch, a gear and a function. When the main family member sends out a voice command, detecting whether the current time is within a preset time range; detecting whether the device is open to the current family member; detecting whether the current gear is located between preset gears; and detecting whether the current function accords with a preset function. When the voice command is within the whole preset range, judging that the family member normally operates the intelligent home equipment; when any one of the voice commands exceeds the preset range, the family member is judged to possibly execute abnormal operation, and the current voice command is detected later. Through the steps, the difference between the voice command of the main family member and the preset voice command is preliminarily screened, and whether the voice command is a normal command or not is judged through presetting the normal use condition of each family member, so that the subsequent abnormal detection is facilitated;
Illustratively, the range of grandparents in a preset family member to control the lights is: the switch of the electric lamp can be controlled at any time, and the brightness is changed from second to fourth, and all electric lamp modes are adopted. When the grandfather uses the voice command to turn on the lamp in the living room and controls the lamp gear to be at three gears through the voice command, the fact that the voice command of the grandfather is within a preset range is detected, and the voice command is judged to be normal. If the grandfather detects that the grandfather voice command is out of the preset range when the grandfather adjusts the electric lamp to five gears, the voice command is judged to be abnormal.
Step four: when the voice command is not in the preset range, judging the operation risk level based on the operation record of the family member;
In the embodiment of the invention, when the voice command is not within the preset range, the abnormal operation of the family member sending the command is judged. Based on the operation record of the family member, the risk of the abnormal operation can be judged, and the steps are as follows:
s1, reading a family member operation log to obtain an operation record of a family member;
S2, extracting records of on/off, gear, function and service time of the intelligent equipment in the operation records;
s3, taking the extracted record as the characteristic for judging abnormal operation, and setting characteristic values as s1, s2 and sn;
S4, a weight is allocated to each feature, the weight is automatically set through machine learning, and the weights are w1, w2 and. Then multiplying the value of each feature with the corresponding weight, and adding the products to obtain a risk level s=w1, s1+w2, s2+ … +wn, sn of the operation;
the step can judge the risk level of the family member in abnormal operation conditions by analyzing the data of the intelligent household equipment used by the family member, so as to give an alarm to the abnormal operation, and prevent the abnormal operation of the family member by inquiring and confirming the abnormal operation;
Illustratively, the voice command risk assessment threshold for one smart home device is 10. For the speech control operation of the device, the following three features are considered: on/off: presetting; start time: presetting the ratio of 7:00-17:00; gear position: 2-4 gears are preset; setting different weights for each feature according to actual conditions, multiplying the feature values by the weights, and adding the products to obtain the discovery evaluation of the time of 14.1; since the risk evaluation value exceeds 10, it can be judged that there is an abnormal operation risk for this operation.
Step five: alarming abnormal operation according to the risk assessment;
In the embodiment of the invention, the risk assessment is carried out on the abnormal operation behaviors according to the risk level. When the risk level exceeds the risk assessment threshold level within 60%, alarming the action, and sending out a voice prompt to confirm whether the operation is to be executed or not again; when the threshold value is over 60%, alarming the action and giving out a voice prompt, confirming whether the operation is to be executed again, and sending the operation to the APP for alarming, wherein the APP end can stop the operation;
The smart home device does not immediately execute the operation according to the risk assessment of the abnormal operation, but warns that the operation may have an abnormality and executes the operation of the voice command after confirming the reply again. When the operation risk assessment level is higher, the intelligent home equipment also warns that the operation is possibly abnormal, and executes the operation of the voice instruction after being confirmed again to obtain a response;
Illustratively, the voice command risk assessment threshold of one smart home device is 10, and when the voice command risk level is 15, the voice operation is alerted and inquired whether to continue operation. When the risk level is 19, alarming the voice operation, inquiring whether to continue the operation, sending the operation to the APP for alarming, and determining whether to terminate the operation by the family member at the APP end according to the judgment of the family member at the APP end.
Step six: when the equipment is in a working state under abnormal operation, the equipment performs self-checking;
in the embodiment of the invention, when the device determines that the operation is abnormal, the device marks the current state as an abnormal state. In an abnormal state, the equipment starts self-checking, and according to the preset upper limit of the working time of the abnormal state of the equipment, stopping and locking the equipment when the operation time of the equipment reaches the upper limit, and sending an abnormal log to an APP (application), wherein the APP receives the alarm and decides whether to unlock the equipment;
For example, when it is determined that the operation of the main family member is an abnormal operation, the smart home device marks the current state as an abnormal state, and in the abnormal state, the device starts self-checking, and detects the upper limit of the working time of the current device in the abnormal state according to the current gear. When the device operation time reaches the upper limit, the device stops operating and locks the device, and subsequent voice commands require unlocking the device to be effective. And when the abnormal log of the abnormal operation is sent to the APP, the APP end can receive an alarm, and the family member at the APP end decides whether to unlock the equipment according to the judgment of the family member at the APP end.
Embodiment two: an embodiment II of the present invention provides an abnormality detection system based on blockchain, and FIG. 2 is a schematic diagram of module composition of the abnormality detection system based on blockchain provided in the embodiment II of the present invention, as shown in FIG. 2, the system includes:
the voice command recognition module is used for recognizing the voice command of the family member and converting the voice command into a text form;
The information collection library module is used for storing voice instruction data of each family member;
the membership identification module is used for identifying the identity of the current family member according to the voice command;
the preset range judging module is used for judging whether the current voice instruction is within the preset range of the current family member;
The risk assessment module is used for assessing the operation risk according to the behavior records and the use frequency of the family members;
The alarm module is used for sending an alarm prompt to family members when abnormal operation is found;
The self-checking module is used for carrying out self-checking when the equipment is in an abnormal operation state so as to ensure the normal operation of the equipment;
And the equipment control module is used for controlling operations such as switching, adjustment, setting and the like of the intelligent household equipment.
In some embodiments of the invention, the voice instruction recognition module comprises:
the recording unit is used for collecting audio signals of voice instructions of family members through a microphone;
The signal processing unit is used for denoising, reducing noise and enhancing sound of the collected voice signals, and aims to improve the accuracy of voice instructions;
The feature extraction unit is used for extracting features of the preprocessed voice signals and extracting acoustic features which are significant for voice recognition;
and the voice recognition unit is used for converting the preprocessed voice signal into a text form.
In some embodiments of the present invention, the preset range determining module includes:
the model matching unit is used for matching the voice instruction of the family member with a preset model and judging whether the voice instruction is within a preset range or not;
and the threshold setting unit is used for setting a corresponding threshold according to the requirements or the use habits of family members so as to judge whether the voice instruction belongs to abnormal operation.
In some embodiments of the invention, the risk assessment module comprises:
the log recording unit is used for recording the operation behaviors and the use frequency of family members when the intelligent household equipment is used;
The data processing unit is used for processing and analyzing the recorded family member behavior data so as to find out the rule of abnormal operation;
And the risk assessment algorithm unit is used for assessing the operation risk by using a related risk assessment algorithm according to the data obtained through processing and analysis.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: the foregoing description is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art, although the present invention has been described in detail with reference to the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.