A method, system and storage medium for intelligent home control and alarm integration
Through the method of smart home control and alarm integration, the ideal usage mode is generated based on the historical data of smart home appliances, and the location where users may be located is eliminated, solving the problem of video surveillance leaking personal privacy in the existing technology, and achieving security and privacy protection. balance.
Patent Information
- Application Number
- CN202410376337.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-03-29
AI Technical Summary
In the prior art, intrusion detection systems rely on video surveillance and may disclose the user's personal privacy.
Through the method of smart home control and alarm integration, clustering is done based on the historical data of smart home appliances, ideal usage modes are generated, detection rules are set, and the locations that users may be in are excluded, so as to avoid being shot by surveillance videos.
It reduces the content that monitors surveillance videos involve user privacy, and while maintaining the safety of home, it greatly reduces the risk of user personal privacy leakage.
Smart Images

Figure CN118282793B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things, and in particular relates to a method, system and storage medium for smart home control and alarm integration. Background Art
[0002] With the rapid development of science and technology, the means of home security protection have gradually become more diverse and precise. Among them, more and more people choose to install intrusion monitoring systems. At present, the mainstream intrusion detection systems on the market rely on video surveillance, and use face recognition and target tracking algorithms to identify abnormal personnel to protect family safety. For example, Chinese patent document CN107122743B discloses a security monitoring method, device and electronic equipment, which detects a target object in a sequence of images of a collected monitoring scene; in response to detecting a target object in a specific image frame in the image sequence, determines the pixel position of the target object in the specific image frame; determines the area type of the specific location area where the target object is located according to the pixel position; this can facilitate users to quickly locate the time point and area where the abnormality occurs in the video.
[0003] For another example, Chinese patent document CN117014585B discloses a method and system for automatically switching home monitoring scenes based on intelligent video analysis. The method first collects and decodes real-time video streams, and stores the decoded frames in a video frame cache queue; sequentially fetches frames from the video frame cache queue, and marks frames with activity values greater than an activity value threshold as frames to be identified; after inputting the frames to be identified into a scene recognition module in batches, the frames to be identified corresponding to the same scene type are aggregated to obtain multiple aggregated frame combinations; candidate scenes are obtained based on the aggregated frame combinations; scenes to be switched are formed based on the candidate scenes; and scene switching is performed. This method only processes frames with larger activities, reduces computational redundancy, and improves the operating efficiency, real-time performance, and accuracy of the system.
[0004] Then, both of the above methods require setting up video capture equipment to record video around the clock for monitoring, which will inevitably capture video footage of the user's own activities. After the video footage is uploaded to the cloud, once data leakage occurs, personal privacy may be leaked. Summary of the invention
[0005] To solve the above problems, the present invention provides a method and system for integrating smart home control and alarm to solve the problem in the prior art that surveillance videos may leak personal privacy.
[0006] In order to achieve the above-mentioned invention object, the present invention proposes a method for smart home control and alarm integration, comprising:
[0007] Generate a first list based on device identifiers connected to the local area network, the first list including the names and functions of the smart home appliances, add the floor location of each of the smart home appliances to the first list, and obtain a second list;
[0008] Acquire historical data in the second list at intervals of a first duration, wherein the historical data includes a start time and a shut down time of each smart home appliance within the first duration;
[0009] Clustering the historical data to generate multiple ideal usage patterns, marking time tags of the ideal usage patterns, and generating detection rules and control rules for each of the ideal usage patterns;
[0010] determining a future time, matching the corresponding ideal usage pattern based on the time tag, and enabling intrusion detection at a predetermined location based on the detection rule;
[0011] Continuously acquiring the actual usage pattern at the future time, updating and calculating the similarity value between the ideal usage pattern and the actual usage pattern, and maintaining the current detection rule when the similarity value is greater than or equal to a trigger threshold, otherwise rematching and updating the detection rule;
[0012] If an abnormal situation is detected, an alarm notification is generated, and the designated smart home appliance is controlled to perform a predetermined operation based on the corresponding control rule.
[0013] Furthermore, clustering the historical data comprises the following steps:
[0014] Splitting the first duration into multiple second durations, presetting multiple action modes, and converting the historical data into initial data based on the function and floor location of the smart home appliance, wherein the initial data includes the number of occurrences and floor location of each action mode in each second duration, as well as the start time and end time of each action mode;
[0015] Preprocessing the initial data to obtain first data, performing first clustering on the first data to obtain a plurality of first clustering results, wherein the first data in the same first clustering result include the action modes of the same type and the same floor position;
[0016] Based on the start time and the end time of the action mode, converting the first data into second data, the second data including the time distribution of each action mode in each second duration, performing second clustering on the first clustering results to split each first clustering result into a plurality of second clustering results, wherein the time distribution of each action mode of the second data in the same second clustering result is the same;
[0017] Generate sequence data based on the occurrence order of the action mode in the second data, divide the sequence data with similarity values greater than the first threshold into the same category, perform a third clustering on the second clustering results, obtain the third clustering results, and use the third clustering results with the number of data greater than the second threshold as the ideal usage mode.
[0018] Furthermore, preprocessing the initial data includes the following steps:
[0019] Divide the second time duration into a plurality of third time durations, divide the action mode into corresponding third time durations according to the start time of the action mode, and count the first frequency of occurrence of each action mode in each third time duration based on the division result;
[0020] Each of the action modes is sorted and encoded according to the first frequency from large to small, and the first frequencies of the action modes are sequentially extracted according to the sorting and substituted into the first formula to calculate and obtain the screening threshold λ, and the first formula is: Wherein, m is the maximum code of the action mode that makes the screening threshold less than or equal to 1, P m is the first frequency of the nth action mode among the M action modes, Z is the sum of the first frequencies of all the action modes, A is a preset basic value, and the occurrence frequency corresponding to the number M is defined as the first screening frequency;
[0021] According to the end time of the action mode, the action mode is divided into the corresponding third time length to obtain the second frequency of each action mode, and the second filtering frequency of the second frequency is obtained based on the step of filtering the first frequency, and the action modes in the third time length whose first frequency is lower than the first filtering frequency and whose second frequency is lower than the second filtering frequency are deleted to obtain the first data.
[0022] Further, converting the first data into the second data comprises the following steps:
[0023] Assign a unique number to each of the third durations, and assign the corresponding number to the action mode according to the third duration where the start time and the end time of the action mode are located, and use the number as the first mark and the second mark, and combine the first mark and the second mark into the time distribution of the action mode.
[0024] Further, calculating the similarity value of the sequence data comprises the following steps:
[0025] The sequence data to be compared are defined as a first sequence and a second sequence, and the similarity value α of the two sequence data is calculated based on a second formula, where the second formula is: Among them, MAX(a,b) returns the larger value of the numerical value a or the numerical value b, X is the number of the same occurrence order of the action modes in the first sequence and the second sequence, T1 and T2 are the number of the action modes in the first sequence and the second sequence respectively, and ω is a preset weight.
[0026] Furthermore, generating control rules for each of the ideal usage modes comprises the following steps:
[0027] Security rules are set, and the security rules include conservative rules and intimidation rules. When the ideal usage mode indicates that the user is at home, the security rules are the conservative rules. After the alarm notification is triggered, the power of the smart home appliance with the first function and the first position is controlled to be turned off. When the ideal usage mode indicates that the user is away from home, the security rules are the intimidation rules. After the alarm notification is triggered, the power of the smart home appliance with the second function and the second position is controlled to be turned on, and an alarm sounds.
[0028] Furthermore, the first function includes lighting function, environmental adjustment function and entertainment function, and the target floor of the ideal usage mode is determined, and the first position is other floors except the target floor. The second function includes lighting function and entertainment function, and the second position is all floors.
[0029] Furthermore, if the preset object cancels the alarm notification, the cancellation will be included in the corresponding ideal usage mode. If the number of cancellations is greater than a critical threshold, the intrusion detection in the corresponding ideal usage mode will be canceled.
[0030] The present invention also provides a system for intelligent home control and alarm integration, which is used to implement the above-mentioned method for intelligent home control and alarm integration, and the system includes:
[0031] A network module, wherein the network module generates a first list based on device identifiers connected to the local area network, wherein the first list includes the names and functions of the smart home appliances, and adds the floor location of each of the smart home appliances to the first list to obtain a second list;
[0032] A collection module, for acquiring historical data in the second list at intervals of a first time, wherein the historical data includes a start time and a shut down time of each of the smart home appliances within the first time;
[0033] A clustering module clusters the historical data to generate multiple ideal usage patterns, annotates time tags of the ideal usage patterns, and generates detection rules and control rules for each of the ideal usage patterns;
[0034] A matching module determines a future time, matches the corresponding ideal usage pattern based on the time tag, enables intrusion detection at a predetermined location based on the detection rule, continuously obtains the actual usage pattern at the future time, updates and calculates a similarity value between the ideal usage pattern and the actual usage pattern, and maintains the current detection rule when the similarity value is greater than or equal to a trigger threshold, otherwise rematches and updates the detection rule;
[0035] The alarm module generates an alarm notification if an abnormal situation is detected, and controls the specified smart home appliance to perform a predetermined operation based on the corresponding control rule.
[0036] The present invention also discloses a computer storage medium, characterized in that the computer storage medium stores program instructions, wherein when the program instructions are executed, the device where the computer storage medium is located is controlled to execute the above-mentioned method.
[0037] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0038] The present invention first automatically generates a first list through device identification, and then only requires the user to fill in the location of the home appliance, which reduces the complexity of system operation. Then, the historical data of the home appliance included in the second list is obtained, and the ideal usage mode, that is, the user's daily and hourly living habits, is obtained by analyzing the historical data, so as to predict future living habits; on this basis, corresponding detection rules are set, and according to the detection rules and prediction results, the possible location of the user is excluded in advance to avoid being captured by the surveillance video, thereby reducing the content of the surveillance video involving the user's privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of the steps of the method for intelligent home control and alarm integration of the present invention;
[0040] Figure 2 It is a structural schematic diagram of the intelligent home control and alarm integration system of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0042] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0043] like Figure 1 As shown, a method for integrating smart home control and alarm includes:
[0044] Step S1: Generate a first list based on the device identifiers connected to the local area network, the first list including the names and functions of the smart home appliances, add the floor location of each smart home appliance to the first list, and obtain a second list.
[0045] Specifically, the smart home appliances in this embodiment are home appliances with Internet functions, such as Figure 2 The smart TV, washing machine and vacuum cleaner in the home can be connected to the wireless LAN arranged in the home; after the smart home appliances are connected to the LAN, the router used to build the LAN will identify the device identification of the smart home appliances, and then generate a first list based on the device identification, and generate corresponding functions based on the name of the smart home appliances, such as the smart home appliance named washing machine will be identified as washing clothes, and the function of the sweeper will be identified as sweeping the floor. After that, the user manually adds the floor location of the smart home appliances in the room, such as air conditioner 1 is on the first floor, marked as L1, and air conditioner 2 is on the second floor, marked as L2.
[0046] Step S2: acquiring historical data in the second list at intervals of a first time period, wherein the historical data includes the start time and the shut down time of each smart home appliance within the first time period.
[0047] This embodiment sets the first time period to one month, and then obtains the historical data of the second list, which includes the start time and end time of various smart appliances within these 29 to 31 days. For example, the start time of the washing machine is 9:00 on Saturday, February 21, and the shutoff time is 10:30 on Saturday, February 21. In addition, since the appliances used in this embodiment are all smart appliances, the start time and shutoff time of each time will be recorded and uploaded by themselves, and no additional statistics are required.
[0048] Step S3: Cluster the historical data to generate multiple ideal usage patterns, mark the time tags of the ideal usage patterns, and generate detection rules and control rules for each ideal usage pattern.
[0049] By clustering, the usage patterns of electrical appliances are classified, that is, the user's life pattern is classified, which can help predict the user's future lifestyle; the ideal usage pattern is the usage pattern of each household appliance in the third period of each day, and the third period will be introduced later; for example, through clustering, it is found that the user will turn on the washing machine after 9:00 every Saturday in February, and then turn on the range hood and turn off the range hood; then it can be predicted that the user will have a similar life pattern on future Saturdays, which is the ideal usage pattern; after obtaining the ideal usage pattern, the ideal usage pattern is marked with a time label, such as the time label is February, Saturday, rest day, 6:00-7:00. The detection rule is to turn on intrusion detection at other locations in the house except the user's location. The control rule includes rules for controlling the opening and closing of various household appliances.
[0050] Step S4: Determine a future time, match the corresponding ideal usage pattern based on the time tag, and enable intrusion detection at a predetermined location based on the detection rule.
[0051] For example, if the future time is 6:00-7:00 on February 21, and it corresponds to Monday, a weekday, then the ideal usage pattern with the time tag of February, Monday, weekday, 6:00-7:00 is obtained. In the ideal usage pattern, between 7:00-8:00 on February, Monday, weekday, the bedroom light 1 and the living room light 2 will be turned on. The corresponding detection rule is to turn off the video camera of the room where the light 1 and the living room are located between 7:00-8:00 to protect the user's privacy. In addition, the cameras in other rooms remain turned on to achieve intrusion detection.
[0052] Step S5: Continuously obtain the actual usage pattern in the future, update and calculate the similarity value between the ideal usage pattern and the actual usage pattern, and when the similarity value is greater than or equal to the trigger threshold, maintain the current detection rule, otherwise rematch and update the detection rule.
[0053] Continuing with the above example, after 7 o'clock, the ideal usage mode is that the user turns on the bedroom light 1, and continues to turn on the living room light 2, and the kitchen light 3, indicating that the user gets up and walks from the bedroom to the living room, and then to the kitchen. After actually reaching 7 o'clock, the user's actual usage mode is to turn on the bedroom light 1, and continue to turn on the living room light 2, then between 7:00-8:00, turn off the cameras in the bedroom 1, the living room, and the kitchen; in reality, the user did not turn on the light 3, that is, did not walk to the kitchen, but the similarity value at this time is greater than the trigger threshold, indicating that the user has been following the ideal usage mode before, and the user's behavior may change temporarily, such as forgetting to turn on the light, but it does not affect the overall behavior, then it is still in accordance with the preset detection rules, that is, turn off the kitchen camera; continue to operate according to the detection rules of the ideal working mode at a later time; however, if the similarity value is less than the trigger threshold, it indicates that the user's behavior has changed significantly, so the corresponding detection rules are no longer applicable, and at this time it is necessary to match the new ideal usage mode according to the current actual usage mode. It is specially noted that when the user leaves home, the cameras in all rooms will be turned on.
[0054] Step S6: If an abnormal situation is detected, an alarm notification is generated, and the designated smart home appliance is controlled to perform a predetermined operation based on the corresponding control rules.
[0055] If the intrusion detection finds an abnormal situation, an alarm notification will be generated and sent to the user's mobile terminal. In addition, the home appliances will be controlled accordingly based on the control rules. The control rules have two control methods, and the selection method is determined based on whether there is someone at home or no one at home. This will be introduced later.
[0056] The present invention first automatically generates a first list through device identification, and then only requires the user to fill in the location of the home appliance, which reduces the complexity of system operation. Then, the historical data of the home appliance included in the second list is obtained, and the ideal usage mode, that is, the user's daily and hourly living habits, is obtained by analyzing the historical data, so as to predict future living habits; on this basis, corresponding detection rules are set, and according to the detection rules and prediction results, the possible location of the user is excluded in advance to avoid being captured by the surveillance video, thereby reducing the content of the surveillance video involving the user's privacy.
[0057] It is particularly noteworthy that, through the technical solution of the present invention, while maintaining family safety, the risk of user personal privacy leakage can be greatly reduced.
[0058] In this embodiment, clustering historical data includes the following steps:
[0059] The first duration is split into multiple second durations, multiple action modes are preset, and historical data is converted into initial data based on the functions and floor locations of smart home appliances. The initial data includes the number of occurrences and floor locations of each action mode in each second duration, as well as the start time and end time of each action mode.
[0060] The second duration of this embodiment is in days. Since the first duration is in months, the first duration is divided into 29 to 31 second durations. The action modes include cooking, cleaning, lighting, entertainment, etc. This allows the household appliances in the historical data to be classified, which is convenient for subsequent clustering. For example, if the range hood is turned on at 9:00, the wall breaker is turned on at 9:10, the range hood is turned off at 9:20, and the wall breaker is turned off at 9:40, then the actions of turning on and off the range hood and the wall breaker will be classified into the cooking action mode, and the start time of the action mode is 9:00 and the end time is 9:40. After conversion, the number of occurrences and floor positions of each action mode can be obtained. For example, on February 1, the cooking action mode occurred three times, all of which occurred in floor L1.
[0061] The initial data is preprocessed to obtain first data, and the first data is first clustered to obtain a plurality of first clustering results, wherein the first data in the same first clustering result include action modes of the same type and the same floor position.
[0062] Through preprocessing, action patterns with low frequency in the initial data are eliminated, because such action patterns have low frequency of occurrence and are more accidental. The specific method of preprocessing will be introduced later. After obtaining the first data, the first data is clustered, so that dates with the same type of action patterns are clustered into one category; for example, on February 1, there are two action patterns in the order of cooking, entertainment, cooking, and entertainment in the L1 layer, and on February 2, there are two action patterns in the order of entertainment, cooking, entertainment, and cooking in the L1 layer. Although the order of occurrence is different, there are only cooking and entertainment in them, so in the first clustering, the two will be classified into one category.
[0063] Based on the start time and end time of the action mode, the first data is converted into second data, the second data includes the time distribution of each action mode in each second time length, and the first clustering results are subjected to second clustering to split each first clustering result into multiple second clustering results, wherein the time distribution of each action mode in the second data located in the same second clustering result is the same.
[0064] The first data is converted based on the start time and the end time. The specific conversion method is as follows: first, the second duration is split into third durations of unequal lengths, such as the third time is 00:00-7:00, 7:00-8:00, 8:00-10:00, etc. every day; then each third duration is assigned a corresponding number, such as 1-10, and the start time and end time of each action mode in the first data are obtained after the numbering. For example, the start time of the first cooking on February 1 is 9:00 and the end time is 9:40, then the first mark for the first cooking is generated, which is 9:00-10:00. The number 3 is also 3. The start time of the second cooking is 17:30 and the end time is 18:20, so the first mark and the second mark generated are 7 and 8. Finally, the time distribution of the action mode cooking on February 1 is (3,3) and (7,8).
[0065] According to the above conversion, when performing the second clustering, the time distribution of each action mode of the second data in the same second clustering result is the same. For example, the second data 1 and the second data 2 both include the action mode of cooking, wherein the time distribution of cooking of the second data 1 is (3, 3), (7, 8), and the time distribution of cooking of the second data 2 is (3, 3), and (7, 8). The distributions of the two are the same, so they will be divided into the same second clustering result.
[0066] Generate sequence data based on the occurrence order of action patterns in the second data, divide sequence data with similarity values greater than a first threshold into the same category, perform a third clustering on the second clustering results, obtain a third clustering result, and take the third clustering result with the number of data greater than the second threshold as an ideal usage mode.
[0067] In the clustering to obtain the second clustering result, because the evaluation range of the time distribution was expanded before, even if the two second data have the same time distribution, the order of occurrence is different. For example, the time distribution of cooking and cleaning in the second data 1 is (3,3), but the user turns on the washing machine at 9:05 and starts cooking at 9:10. The time distribution of cooking and cleaning in the second data 1 is also (3,3), and the user starts cooking at 9:05 and turns on the washing machine at 9:10. Therefore, relying solely on the second clustering result cannot fit the user's habits, so the sequence data is regenerated according to the user's action sequence. For example, the sequence data of the second data 1 is cooking-washing, and the sequence data of the second data 2 is washing-cooking. The sequence data of the two are completely different and will not be classified into the same category. Finally, the number of each data in the third clustering result is counted. For example, there are 20 data in the third clustering result 1 and only one data in the third clustering result 2. Then only the clustering result in the third clustering result 1 is used as the ideal usage mode. The result in the third clustering result 2 indicates that the user behavior is accidental. For example, the user is accustomed to turning on the washing machine first and then starting to cook. If this happens once, the user turns on the washing machine first and then starts to cook. This will not be regarded as an ideal usage mode.
[0068] The ideal usage pattern obtained through the above clustering process is more in line with user habits, and the action pattern is generated based on the simplified functions of smart home appliances, and the specific start time and end time are converted into time distribution, thereby realizing fuzzy clustering. The results obtained in this way have greater fault tolerance.
[0069] The initial data preprocessing includes the following steps:
[0070] The second duration is divided into a plurality of third durations, the action modes are divided into corresponding third durations according to the start time of the action modes, and the first frequency of occurrence of each action mode in each third duration is counted based on the division result.
[0071] The relationship between the second time period and the third time period, as well as the process of dividing the action modes into the third time period have been introduced before and will not be repeated here. After the division is completed, the first frequency of occurrence of each action mode in each third time period is counted. For example, from 8:00 to 10:00, if the entertainment action mode has 4 start times in this time period and the cleaning action mode has 6 start times in this time period, then the first frequency of the entertainment action mode is 4, and the first frequency of the cleaning action mode is 6.
[0072] Each action mode is sorted and encoded according to the first frequency from large to small, and the first frequency of the action mode is extracted in sequence according to the sorting and substituted into the first formula to calculate and obtain the screening threshold λ. The first formula is: Where m is the maximum code of the action mode that makes the screening threshold less than or equal to 1, Pm is the first frequency of the nth action mode among M action modes, Z is the sum of the first frequencies of all action modes, A is a preset basic value, and the occurrence frequency corresponding to the number M is defined as the first screening frequency.
[0073] First, sort by the first frequency. The first frequency of the entertainment action mode is 4, and the first frequency of the cleaning action mode is 6. For the rest, if there are action modes 1, 2 and 3, the corresponding first frequencies are 1, 8 and 5, then the sorting starts from the first frequency of the cleaning action mode being 865411. The first formula is explained below. In the first formula, according to the above introduction, the comprehensive Z of the sum of the first frequencies of all action modes is 8+6+5+4+1+1=25, and A is preset to 0.1. First, substitute 8 into the first formula to obtain 8 / 25+0.1=0.42, which is less than 1, so continue to substitute 6. At this time, the calculated screening threshold is (8+6) / 25+0.1=0.66, which is still less than 1. Continue to substitute and substitute 4. The calculated screening threshold is greater than 1, so the maximum code is 3. According to the sorting, code 3 corresponds to action mode 3, and the first frequency is 5, so frequency 5 is used as the first screening frequency.
[0074] According to the end time of the action mode, the action mode is divided into the corresponding third time length to obtain the second frequency of each action mode, and the second filtering frequency of the second frequency is obtained based on the step of filtering the first frequency, and the action mode whose first frequency is lower than the first filtering frequency and whose second frequency is lower than the second filtering frequency in the third time length is deleted to obtain the first data.
[0075] The second screening frequency is obtained in the same way as the first screening frequency. Finally, the action patterns whose first frequency is lower than the first screening frequency and whose second frequency is lower than the second screening frequency in the third duration are deleted, so that the frequencies retained are frequently occurring action patterns, and the more frequently occurring action patterns are, the more they can represent the user's living habits. Therefore, the first data after the step screening not only eliminates the accidental data, but also makes the subsequent clustering results more able to reflect the user's lifestyle.
[0076] In this embodiment, converting the first data into the second data includes the following steps:
[0077] Assign a unique number to each third duration, assign the corresponding number to the action mode according to the third duration where the start time and end time of the action mode are located and use it as the first mark and the second mark, and combine the first mark and the second mark into the time distribution of the action mode.
[0078] This step has been introduced in detail in the clustering process above and will not be explained here.
[0079] In this embodiment, calculating the similarity value of sequence data includes the following steps:
[0080] The sequence data to be compared are defined as the first sequence and the second sequence, and the similarity value α of the two sequence data is calculated based on the second formula. The second formula is: Wherein, MAX(a,b) returns the larger value of a or b, X is the number of action patterns in the first sequence and the second sequence that have the same occurrence order, T1 and T2 are the numbers of action patterns in the first sequence and the second sequence, respectively, and ω is the preset weight.
[0081] Assuming that the first sequence has action modes 1, 2, 1, 3, 4 in order, and the first sequence is subsequently abbreviated as 12134, then T1 is 5, and the second sequence has action modes 1, 2, 1, 5, 4, 3, 1 in order, abbreviated as 1215231, and T2 is 7. It can be seen that the first sequence and the second sequence have the same numbers in the first position, the second position, the third position, and the fifth position, that is, the corresponding action modes are the same, then the value of X is 4, and the similarity value of the two can be obtained by substituting it into the second formula. The principle of the second formula is to use the first sequence and the second sequence that include more action modes as the denominator, and the action modes that appear in the same order and of the same type as the numerator to obtain the value on the left side of the second formula, and the right side is the difference in the number of action modes included in the first sequence and the second sequence. It can be seen that the larger the numerator, the larger the similarity value obtained, and the larger the difference on the right side, the smaller the similarity value obtained. The preset weight is a value less than 1, and when the calculated result is less than 0, the second formula outputs a result of 0, indicating that the two are completely different.
[0082] In this embodiment, generating control rules for each ideal usage mode includes the following steps:
[0083] Set security rules, which include conservative rules and intimidation rules. When the ideal usage pattern indicates that the user is at home, the security rule is a conservative rule. After the alarm notification is triggered, the power of the smart appliances with the first function and the first position is turned off. When the ideal usage pattern indicates that the user is away from home, the security rule is an intimidation rule. After the alarm notification is triggered, the power of the smart appliances with the second function and the second position is turned on and an alarm sounds.
[0084] The first function includes lighting function, environmental adjustment function and entertainment function. The target floor of the ideal usage mode is determined, and the first position is the other floors except the target floor. The second function includes lighting function and entertainment function, and the second position is all floors.
[0085] The conservative rule is to protect the personal safety of the user. When the matched ideal usage pattern indicates that the user should be at home at this time, the security rule is adjusted to the conservative rule. When the intrusion detection finds that a stranger has invaded, the smart home appliances with the first function are first turned off. In this embodiment, the first function includes the lighting function, the environmental adjustment function and the entertainment function. Then, the target floor of the ideal usage pattern is determined, that is, the floor where the user may currently be active. When the matched ideal usage pattern indicates that the user is away from home at this time, the security rule is adjusted to the intimidation rule. When the intrusion detection finds that a stranger has invaded, the smart home appliances with the second position and the second function are turned on.
[0086] The functions to be achieved by the above steps are that when an intrusion is detected and the user may be at home, the lights, air conditioners and televisions in the user's activity area are turned off to protect the user's personal safety and reduce the chance of the intruder discovering the user; when the user may not be at home, the lights in the home are controlled to light up and a sound is emitted through the TV to warn the intruder.
[0087] If the preset object cancels the alarm notification, the cancellation will be counted into the corresponding ideal usage mode. If the number of cancellations is greater than the critical threshold, the intrusion detection in the corresponding ideal usage mode will be canceled.
[0088] If the user cancels the alarm notification, it indicates that the alarm is a false alarm. Then the alarm notification will be counted as a false alarm and included in the corresponding ideal usage mode. For example, in February, Saturday, weekend, 11:00-12:00, the number of false alarms is 11, and the number of false alarms exceeds the critical threshold of 10, indicating that this time period is a time period with frequent human activities. If intrusion detection is performed, false alarms will easily occur. Therefore, the intrusion detection in the ideal usage mode is canceled. That is, intrusion detection will no longer be performed from 11:00 to 12:00 on Saturdays in February. The present invention also automatically adjusts the detection rules every hour according to the number of false alarms, and does not perform detection during the time when the user is frequently active, thereby avoiding frequent false alarms that affect the user's life.
[0089] like Figure 2 As shown, the present invention also provides a system for intelligent home control and alarm integration, which is used to implement the above-mentioned method for intelligent home control and alarm integration, and the system includes:
[0090] A network module, wherein the network module generates a first list based on device identifiers connected to the local area network, wherein the first list includes the names and functions of the smart home appliances, and adds the floor location of each smart home appliance to the first list to obtain a second list;
[0091] A collection module, for acquiring historical data in the second list at intervals of a first time period, wherein the historical data includes a start time and a shut down time of each smart home appliance within the first time period;
[0092] The clustering module clusters historical data to generate multiple ideal usage patterns, annotates the time tags of the ideal usage patterns, and generates detection rules and control rules for each ideal usage pattern;
[0093] The matching module determines the future time, matches the corresponding ideal usage pattern based on the time tag, and enables intrusion detection at the predetermined location based on the detection rule, continuously obtains the actual usage pattern at the future time, updates and calculates the similarity value between the ideal usage pattern and the actual usage pattern, and maintains the current detection rule when the similarity value is greater than or equal to the trigger threshold, otherwise rematches and updates the detection rule;
[0094] The alarm module generates an alarm notification if an abnormal situation is detected, and controls the specified smart home appliance to perform a predetermined operation based on the corresponding control rules.
[0095] The present invention also discloses a computer storage medium, characterized in that the computer storage medium stores program instructions, wherein when the program instructions are executed, the device where the computer storage medium is located is controlled to execute the above method.
[0096] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0097] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0099] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for intelligent home control and alarm integration, characterized in that: include: Generate a first list based on device identifiers connected to the local area network, the first list including the names and functions of the smart home appliances, add the floor location of each of the smart home appliances to the first list, and obtain a second list; Acquire historical data in the second list at intervals of a first duration, wherein the historical data includes a start time and a shut down time of each smart home appliance within the first duration; Clustering the historical data to generate multiple ideal usage patterns, where the ideal usage patterns are the user's daily and hourly living habits, marking the ideal usage patterns with time tags, and generating detection rules and control rules for each of the ideal usage patterns; Determine a future time, match the ideal usage pattern corresponding to the time tag based on the time tag, and enable intrusion detection at a predetermined location based on the detection rule, wherein the detection rule is to enable intrusion detection at other locations in the house except the user's location; Continuously acquiring the actual usage pattern at the future time, updating and calculating the similarity value between the ideal usage pattern and the actual usage pattern, and maintaining the current detection rule when the similarity value is greater than or equal to a trigger threshold, otherwise rematching and updating the detection rule; If an abnormal situation is detected, an alarm notification is generated, and the designated smart home appliance is controlled to perform a predetermined operation based on the corresponding control rule.
2. The method according to claim 1, characterized in that Clustering the historical data comprises the following steps: Splitting the first duration into multiple second durations, presetting multiple action modes, and converting the historical data into initial data based on the function and floor location of the smart home appliance, wherein the initial data includes the number of occurrences and floor location of each action mode in each second duration, as well as the start time and end time of each action mode; Preprocessing the initial data to obtain first data, performing first clustering on the first data to obtain a plurality of first clustering results, wherein the first data in the same first clustering result include the action modes of the same type and the same floor position; Based on the start time and the end time of the action mode, converting the first data into second data, the second data including the time distribution of each action mode in each second duration, performing second clustering on the first clustering results to split each first clustering result into a plurality of second clustering results, wherein the time distribution of each action mode of the second data in the same second clustering result is the same; Generate sequence data based on the occurrence order of the action mode in the second data, divide the sequence data with similarity values greater than the first threshold into the same category, perform a third clustering on the second clustering results, obtain the third clustering results, and use the third clustering results with the number of data greater than the second threshold as the ideal usage mode.
3. The method according to claim 2, characterized in that Preprocessing the initial data includes the following steps: Divide the second time duration into a plurality of third time durations, divide the action mode into corresponding third time durations according to the start time of the action mode, and count the first frequency of occurrence of each action mode in each third time duration based on the division result; According to the first frequency, each of the action modes is sorted and encoded from large to small, and the first frequency of the action mode is sequentially extracted according to the sorting and substituted into the first formula for calculation to obtain a screening threshold , the first formula is: : Wherein, m is the maximum code of the action mode that makes the screening threshold less than or equal to 1, is the first frequency of the nth action mode among the M action modes, Z is the sum of the first frequencies of all the action modes, A is a preset basic value, and the occurrence frequency corresponding to the number M is defined as the first screening frequency; According to the end time of the action mode, the action mode is divided into the corresponding third time length to obtain the second frequency of each action mode, and the second filtering frequency of the second frequency is obtained based on the step of filtering the first frequency, and the action modes in the third time length whose first frequency is lower than the first filtering frequency and whose second frequency is lower than the second filtering frequency are deleted to obtain the first data.
4. The method according to claim 3, characterized in that Converting the first data into the second data comprises the following steps: Assign a unique number to each of the third durations, and assign the corresponding number to the action mode according to the third duration where the start time and the end time of the action mode are located, and use the number as the first mark and the second mark, and combine the first mark and the second mark into the time distribution of the action mode.
5. The method according to claim 4, characterized in that Calculating the similarity value of the sequence data comprises the following steps: The sequence data to be compared are defined as a first sequence and a second sequence, and the similarity values of the two sequence data are calculated based on a second formula. , the second formula is: , wherein MAX (a, b) returns the larger value of the value a or the value b, and X is the number of the same occurrence order of the action patterns in the first sequence and the second sequence, and are the numbers of the action modes in the first sequence and the second sequence, respectively, The preset weights.
6. The method according to claim 1, characterized in that Generating control rules for each of the desired usage patterns comprises the following steps: Security rules are set, and the security rules include conservative rules and intimidation rules. When the ideal usage mode indicates that the user is at home, the security rules are the conservative rules. After the alarm notification is triggered, the power of the smart home appliance with the first function and the first position is controlled to be turned off. When the ideal usage mode indicates that the user is away from home, the security rules are the intimidation rules. After the alarm notification is triggered, the power of the smart home appliance with the second function and the second position is controlled to be turned on, and an alarm sounds.
7. The method according to claim 6, characterized in that The first function includes lighting function, environmental adjustment function and entertainment function. The target floor of the ideal usage mode is determined, and the first position is other floors except the target floor. The second function includes lighting function and entertainment function, and the second position is all floors.
8. The method according to claim 1, characterized in that If the preset object cancels the alarm notification, the cancellation will be included in the corresponding ideal usage mode. If the number of cancellations is greater than the critical threshold, the intrusion detection in the corresponding ideal usage mode will be canceled.
9. A smart home control and alarm integrated system, used to implement the method according to any one of claims 1 to 8, characterized in that: include: A network module, wherein the network module generates a first list based on device identifiers connected to the local area network, wherein the first list includes the names and functions of the smart home appliances, and adds the floor location of each of the smart home appliances to the first list to obtain a second list; A collection module, for acquiring historical data in the second list at intervals of a first time, wherein the historical data includes a start time and a shut down time of each of the smart home appliances within the first time; A clustering module clusters the historical data to generate multiple ideal usage patterns, where the ideal usage patterns are the user's daily and hourly living habits, annotate the ideal usage patterns with time tags, and generate detection rules and control rules for each of the ideal usage patterns; A matching module determines a future time, matches the corresponding ideal usage pattern based on the time tag, and enables intrusion detection at a predetermined location based on the detection rule, wherein the detection rule is to enable intrusion detection at other locations in the house except the user's location, continuously obtain the actual usage pattern at the future time, update and calculate the similarity value between the ideal usage pattern and the actual usage pattern, and maintain the current detection rule when the similarity value is greater than or equal to the trigger threshold, otherwise rematch and update the detection rule; The alarm module generates an alarm notification if an abnormal situation is detected, and controls the specified smart home appliance to perform a predetermined operation based on the corresponding control rule.
10. A computer storage medium, characterized in that: The computer storage medium stores program instructions, wherein when the program instructions are executed, the device where the computer storage medium is located is controlled to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Security monitoring methods, devices and electronic equipment
CN107122743B
Method and system for automatic switching of home monitoring scenes based on intelligent video analysis
CN117014585B
Eating behavior identification method and apparatus, and home gateway
CN106919888A
Generation and implementation of household policies for the smart home
WO2016141199A1