Gas concentration prediction method, device and refrigerator based on collaborative filtering
Through a collaborative filtration method, a linear regression equation is established using the gas leakage data of historical users, predicting the gas leakage situation of the current user, and implementing emergency measures when the warning value is reached, solving the problem of insufficient gas leakage prediction in the existing technology. Improves safety and preventive effects.
Patent Information
- Application Number
- CN202010475559.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-05-29
AI Technical Summary
The existing technology is difficult to effectively predict and prevent gas leakage, which has led to the threat of the safety of life and property.
Using a gas concentration prediction method based on collaborative filtration, the scene information similarity between the current user and the historical user is calculated by obtaining the scene information of historical users, establishing a linear regression equation, predicting gas leakage, and sending warnings and execution when the warning value is reached Emergency closure measures.
It improves the prediction accuracy and preventive effect of gas leakage, and reduces the damage to the human body and property losses caused by gas.
Smart Images

Figure CN113743637B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of household appliance control, and in particular to a method, device and refrigerator for predicting gas concentration based on collaborative filtering. Background Art
[0002] In daily life, gas provides great convenience for people's lives, but at the same time, gas leakage also greatly endangers people's lives and property safety.
[0003] Nowadays, technology is developing faster and faster, and various recommendation or prediction algorithms are emerging one after another, and the most commonly used algorithm is collaborative filtering. Collaborative filtering is a recommendation system technology. With the rapid development of the Internet, it has been increasingly used in various websites and e-commerce systems. Collaborative filtering can be divided into the following three types: user-based collaborative filtering, project-based collaborative filtering, and model-based collaborative filtering. The basic idea of user-based collaborative filtering is to calculate user groups with similar interests and hobbies to the user, and then find the products that the user does not have from the user groups with similar interests and make recommendations. The principle of project-based collaborative filtering is similar. Model-based collaborative filtering uses a machine learning method to train and generate a recommendation model using historical data, and then use this model to make recommendations.
[0004] How to use collaborative filtering to predict gas leaks and thus reduce the losses caused by gas leaks is the problem we want to solve. Summary of the invention
[0005] The object of the present invention is to provide a method, device and refrigerator for predicting gas concentration based on collaborative filtering.
[0006] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a method for predicting gas concentration based on collaborative filtering, the method comprising:
[0007] Obtain gas-related scenario information of multiple historical users of gas leaks;
[0008] Obtaining the scene information of the current user, and calculating the similarity between the scene information of multiple historical users and the scene information of the current user according to a collaborative filtering algorithm;
[0009] Selecting historical users whose similarity exceeds a threshold to obtain a first user set, and obtaining a gas leakage prediction equation for the current user based on the gas leakage data of the historical users in the first user set;
[0010] The gas leakage prediction equation is used to predict the gas leakage of the current user.
[0011] As a further improvement of an embodiment of the present invention, the similarity between the scene information of two users is calculated according to the collaborative filtering algorithm, specifically including:
[0012] Calculate the similarity w through the sets N(u) and N(v) of the scene information of two users u and v uv :
[0013]
[0014] Among them, M(i) refers to the set of users with the same i-th data in the scene information of multiple users;
[0015] The scenario information of each user includes the region L, the material P of the gas pipeline, the kitchen volume V, and the gas installation time T.
[0016] As a further improvement of an embodiment of the present invention, the “obtaining a gas leakage prediction equation for the current user based on the gas leakage data of historical users in the first user set” specifically includes:
[0017] Performing linear regression on the gas leakage data of each historical user in the first user set, and obtaining a linear regression equation for each historical user;
[0018] According to the type of the linear regression equation, the first user set is divided into a plurality of second user sets;
[0019] A linear regression equation of a historical user with the greatest similarity to the current user in the second user set with the largest number is selected as the gas leakage prediction equation for the current user.
[0020] As a further improvement of an embodiment of the present invention, the “using the gas leakage prediction equation to predict the gas leakage of the current user” specifically includes:
[0021] Get the gas concentration Ct of the current user's kitchen;
[0022] When it is detected that the gas concentration Ct in the kitchen reaches a predetermined lower limit value Ct0, the warning time t1 when the gas concentration reaches the warning value Ct1 is calculated according to the gas leakage prediction equation;
[0023] The warning time t1 is sent to the user.
[0024] As a further improvement of an implementation mode of the present invention, the “sending the warning time t1 to the user” specifically includes:
[0025] Calculate the priority users to be reminded according to the relevant information of multiple users and different weights of different relevant information, wherein the relevant information includes the user's age, role, physical fitness and distance from the kitchen;
[0026] The warning time t1 is sent to the priority reminded user.
[0027] As a further improvement of an embodiment of the present invention, the method further includes:
[0028] When it is detected that the gas concentration Ct reaches the warning value Ct1, a signal to close the main gas switch is sent to the gas emergency shut-off device, and a start signal is sent to the kitchen ventilation device;
[0029] According to the relevant information of multiple users and different weights of different relevant information, users who are given priority to be reminded are calculated, and reminder information is sent to the users who are given priority to be reminded.
[0030] As a further improvement of an embodiment of the present invention, the method further includes:
[0031] After sending a signal to close the main gas switch to the gas emergency shut-off device, if it is detected that the gas concentration of the user continues to rise, an alarm is sent to the priority user.
[0032] To achieve one of the above-mentioned purposes of the invention, one embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, it implements the steps of any one of the above-mentioned collaborative filtering-based gas concentration prediction methods.
[0033] To achieve one of the above-mentioned objects of the invention, one embodiment of the present invention provides a refrigerator, which includes the above-mentioned electronic device.
[0034] Compared with the prior art, the gas concentration prediction method of the present invention uses a collaborative filtering algorithm to find users with historical gas leakage information similar to the scene information of the current user, performs linear fitting on the gas leakage data of this historical user to obtain a linear regression equation, and uses the linear regression equation to predict the gas leakage data of the current user. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of the gas concentration prediction method based on collaborative filtering of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0037] like Figure 1As shown, the present invention provides a method for predicting gas concentration based on collaborative filtering, the method comprising:
[0038] Step S100: Obtain gas-related scene information of multiple historical users of gas leakage.
[0039] Scenario information of historical users who have experienced gas leaks can be collected on the Internet. The scenario information is related to gas and preferably includes the area L where the user's gas leak is located, the material P of the gas pipeline, the kitchen volume V, the gas installation time T, etc.
[0040] Step S200: Obtain the scenario information of the current user, and calculate the similarity between the scenario information of multiple historical users and the scenario information of the current user according to a collaborative filtering algorithm.
[0041] Calculate the similarity w through the sets N(u) and N(v) of the scene information of two users u and v uv :
[0042]
[0043] Among them, M(i) refers to the set of users with the same i-th data in the scene information of multiple users. The more users with the same data, the larger M(i) is, which indicates that the contribution of this data to the similarity between two users is smaller.
[0044] In a specific implementation, the user's scene information includes the area L where the user's gas leak is located, the material P of the gas pipeline, the kitchen volume V, and the gas installation time T. Therefore, the sets N(u) and N(v) of the scene information of user u and user v are respectively:
[0045] N(u)={L u ,P u ,V u ,T u}
[0046] N(v)={L v ,P v ,V v ,T v}
[0047] The area of users u and v is the same as the material of the gas pipeline, that is, L u =L v =A, while P u =P v = B, while the kitchen volume and gas installation time are different. Among the 100 sampled users, 19 users are from area A and 5 users have gas pipelines made of B. Therefore, according to the above similarity calculation formula, w is calculated. uc for:
[0048]
[0049] According to the above method, the similarity between the scene information of multiple historical users and the scene information of the current user is calculated.
[0050] Step S300: historical users whose similarity exceeds a threshold are selected to obtain a first user set, and a gas leakage prediction equation of the current user is obtained based on the gas leakage data of the historical users in the first user set.
[0051] Assuming that the similarity threshold is 75%, all historical users with a similarity of more than 75% to the current user are selected and put into the first user set. Based on the gas leakage data of historical users in the first user set, the gas leakage prediction equation of the current user is obtained, which specifically includes:
[0052] Step S310: Perform linear regression on the gas leakage data of each historical user in the first user set, and obtain a linear regression equation for each historical user.
[0053] Obtain the data of the gas concentration of each historical user increasing with the leakage time, and perform linear regression on these data to obtain the corresponding linear regression equation. The linear regression equation includes regression line equation and regression curve equation types.
[0054] Step S320: Divide the first user set into multiple second user sets according to the type of the linear regression equation.
[0055] By analyzing the historical data, it is found that the gas concentration increases linearly with the increase of leakage time in most cases, and increases in a curve in a few cases. Therefore, according to the type of the linear regression equation, the first user set is divided into multiple second user sets. For example, according to the type of the linear regression equation, the first user set is divided into two second user sets C and D, the type of the linear regression equation of the second user set C is a regression line equation, and the type of the linear regression equation of the second user set D is a regression curve equation.
[0056] Step S330: Select the linear regression equation of the historical user with the greatest similarity to the current user in the second user set with the largest number as the gas leakage prediction equation for the current user.
[0057] First, select the second user set with the largest number of users. For example, if the second user set C has the largest number of users, then select C.
[0058] Then, the linear regression equation of the historical user with the greatest similarity to the current user in the selected second user set is used as the gas leakage prediction equation for the current user. For example, the type of the second user set C is a regression line equation, the historical user with the greatest similarity to the current user in the second user set C is E, and the linear regression equation of gas leakage of historical user E is Ct=w*t+b. Therefore, Ct=w*t+b is selected as the gas leakage prediction equation for the current user.
[0059] Step S400: using the gas leakage prediction equation to predict the gas leakage of the current user.
[0060] The step S400 specifically includes the following:
[0061] Step S410: Obtain the gas concentration Ct in the current user's kitchen.
[0062] The gas concentration Ct in the current user's kitchen can be detected by a sensor.
[0063] Step S420: When it is detected that the gas concentration Ct in the kitchen reaches a predetermined lower limit value Ct0, the warning time t1 when the gas concentration reaches the warning value Ct1 is calculated according to the gas leakage prediction equation.
[0064] The historical gas concentration data of normal period and gas leakage period are obtained to determine the predetermined lower limit value Ct0 of gas concentration, which will not affect the human body and indicates that the gas is not within the normal range and gas leakage has occurred. The warning value Ct1 is the gas concentration value that will cause slight harm to the human body.
[0065] According to the gas leakage prediction equation, the warning time t1 when the gas concentration reaches the warning value Ct1 is calculated. Specifically, assuming that the gas leakage prediction equation is Ct=w*t+b, the warning time t1 is calculated according to the linear regression equation and the time t0 when the lower limit value Ct0 is reached:
[0066] t1 = (Ct1 - Ct0) / w + t0.
[0067] It should be noted that if the gas leakage prediction equation is a regression curve equation, after detecting that the gas concentration Ct in the kitchen reaches a predetermined lower limit Ct0, data of several more time nodes can be obtained, so as to calculate the warning time t1.
[0068] Step S430: Send the warning time t1 to the user.
[0069] Then the warning time t1 is sent to the user, reminding the user that at time t1, the gas concentration in the kitchen will reach the warning value Ct1. The user can make preparations based on the above information.
[0070] In a preferred embodiment, the “sending the warning time t1 to the user” specifically includes:
[0071] According to the relevant information of multiple users and different weights of different relevant information, the priority users are calculated, and the warning time t1 is sent to the priority users.
[0072] Furthermore, the "calculating the priority users to be reminded based on the relevant information of multiple users and the different weights of different relevant information" includes: the relevant information includes the user's age, role, physical fitness and distance from the kitchen, and the total weight of each user is calculated based on the relevant information of each user, and the top N users in terms of total weight are taken as the priority users to be reminded.
[0073] The “calculating the total weight of each user according to the relevant information of each user” specifically includes:
[0074] Get each user's actual age a, role r, physical strength b, and distance l from the kitchen;
[0075] The corresponding age weight Wa is selected according to the age a, wherein if a<=30, the larger a is, the larger the weight Wa is, otherwise, the smaller a is, the smaller Wa is. A weight can also be set for each age group, and the corresponding age weight is selected according to the age group that the specific age falls into.
[0076] Different role weights Wr are selected according to different roles r, where the role weights are ranked from large to small as follows: father, mother, children, housekeeper or nanny, security guard or property.
[0077] According to different physical fitness b, different physical fitness weights Wb are selected, where the physical fitness weights are ranked from large to small as follows: strong, normal, thin, sick, and disabled.
[0078] According to the distance l from the kitchen, a corresponding distance weight Wl is selected, wherein the larger l is, the smaller Wl is. The distance l can also be divided into segments, a weight is set for each segment, and the corresponding distance weight is selected according to the distance segment into which the specific distance l falls.
[0079] The total weight W of each user is equal to the sum of the age weight Wa, role weight Wr, physical fitness weight Wb and distance weight Wl corresponding to each user, that is, W = Wa + Wr + Wb + Wl.
[0080] Furthermore, the “obtaining each user's actual age a, role r, physical strength b, and distance l from the kitchen” specifically includes:
[0081] By pre-entering the age of each user, calculate the age a of each user according to the input time and the current time;
[0082] By inputting the role and physical health status of each user in advance, the user's actual role r and physical health status b are obtained;
[0083] The distance l between the user and the kitchen is obtained through the pre-bound positioning terminal.
[0084] If the user does not receive the warning within the time t1, or receives it but does not have time to process it, the gas concentration needs to be controlled. Therefore, in a preferred embodiment, the method further includes:
[0085] First, when it is detected that the gas concentration Ct reaches the warning value Ct1, a signal to close the main gas switch is sent to the gas emergency shut-off device, and a start signal is sent to the kitchen ventilation device.
[0086] Turning off the main gas switch is used to control the rise in gas concentration, and turning on the ventilation device is used to dredge the gas in the kitchen, reduce the gas concentration, and prevent the gas concentration from further rising and causing irreparable losses.
[0087] Then, based on the relevant information of multiple users and different weights of different relevant information, the priority users to be reminded are calculated, and reminder information is sent to the priority users to be reminded.
[0088] The reminder information includes: the gas concentration has reached the warning value Ct1, and a signal for closing the main gas switch and starting the ventilation device has been sent.
[0089] It should be noted that, since the main gas switch may fail to shut down, in order to remind the user to handle it with caution, the method further includes:
[0090] After sending a signal to close the main gas switch to the gas emergency shut-off device, if it is detected that the gas concentration of the user continues to rise, an alarm is sent to the priority user.
[0091] The alarm is used to remind the user that the main gas switch has failed to be turned off and the gas concentration is still rising, and the user needs to prepare countermeasures.
[0092] In a specific implementation, the refrigerator system of the current user collects scene information of historical users who have experienced gas leakage through the network, and the scene information includes the area L where the user's gas leakage is located, the material P of the gas pipeline, the kitchen volume V, and the gas installation time T. Then the scene information of the current user is obtained, and the similarity between the scene information of multiple historical users and the scene information of the current user is calculated according to the collaborative filtering algorithm. The historical users whose similarity exceeds the threshold are selected to obtain the first user set, and the gas leakage data of the historical users in the first user set are linearly regressed. Each historical user obtains a regression equation, and the historical users in the first user set are divided into multiple subsets according to the type of regression equation, and then the linear regression equation of the historical user with the greatest similarity to the current user in the subset with the largest number is selected as the gas leakage prediction equation of the current user. Finally, the gas leakage equation is used to predict the gas leakage of the current user.
[0093] The gas concentration prediction method of the present invention uses a collaborative filtering algorithm to find users with historical gas leakage similar to the scene information of the current user, performs linear fitting on the gas leakage data of the historical user to obtain a linear regression equation, and uses the linear regression equation to predict the gas leakage data of the current user. Then, the relevant prediction information is sent to the user to prevent further leakage of gas concentration and reduce the harm of gas to the human body.
[0094] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, it implements any one of the steps in the above-mentioned method for predicting gas concentration based on collaborative filtering, that is, it implements the steps in any one of the technical solutions in the above-mentioned method for predicting gas concentration based on collaborative filtering.
[0095] The present invention also provides a refrigerator, which comprises the electronic device described above.
[0096] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0097] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting gas concentration based on collaborative filtering, characterized in that: The method comprises: Obtain gas-related scenario information of multiple historical users of gas leaks; The scenario information of the current user is obtained, and the similarity between the scenario information of multiple historical users and the scenario information of the current user is calculated according to the collaborative filtering algorithm, specifically including: According to the collaborative filtering algorithm, the similarity between the scene information of two users is calculated. The similarity w is calculated by the sets N(u) and N(v) of the scene information of two users u and v. uv : Among them, M(i) refers to the set of users with the same i-th data in the scene information of multiple users; Selecting historical users whose similarity exceeds a threshold to obtain a first user set, and obtaining a gas leakage prediction equation for the current user based on the gas leakage data of the historical users in the first user set; Use the gas leakage prediction equation to predict the gas leakage of the current user; The scenario information of each user includes the region L, the material P of the gas pipeline, the kitchen volume V, and the gas installation time T.
2. The method for predicting gas concentration based on collaborative filtering according to claim 1, characterized in that: The “obtaining a gas leakage prediction equation for the current user based on the gas leakage data of historical users in the first user set” specifically includes: Performing linear regression on the gas leakage data of each historical user in the first user set, and obtaining a linear regression equation for each historical user; According to the type of the linear regression equation, the first user set is divided into a plurality of second user sets; A linear regression equation of a historical user with the greatest similarity to the current user in the second user set with the largest number is selected as the gas leakage prediction equation for the current user.
3. The method for predicting gas concentration based on collaborative filtering according to claim 1, characterized in that: The “using the gas leakage prediction equation to predict the gas leakage of the current user” specifically includes: Get the gas concentration Ct of the current user's kitchen; When it is detected that the gas concentration Ct in the kitchen reaches a predetermined lower limit value Ct0, the warning time t1 when the gas concentration reaches the warning value Ct1 is calculated according to the gas leakage prediction equation; The warning time t1 is sent to the user.
4. The method for predicting gas concentration based on collaborative filtering according to claim 3 is characterized in that: The "sending the warning time t1 to the user" specifically includes: Calculate the priority users to be reminded according to the relevant information of multiple users and different weights of different relevant information, wherein the relevant information includes the user's age, role, physical fitness and distance from the kitchen; The warning time t1 is sent to the priority reminded user.
5. The method for predicting gas concentration based on collaborative filtering according to claim 3 is characterized in that: The method further comprises: When it is detected that the gas concentration Ct reaches the warning value Ct1, a signal to close the main gas switch is sent to the gas emergency shut-off device, and a start signal is sent to the kitchen ventilation device; According to the relevant information of multiple users and different weights of different relevant information, users who are given priority to be reminded are calculated, and reminder information is sent to the users who are given priority to be reminded.
6. The method for predicting gas concentration based on collaborative filtering according to claim 5, characterized in that: The method further comprises: After sending a signal to close the main gas switch to the gas emergency shut-off device, if it is detected that the gas concentration of the user continues to rise, an alarm is sent to the priority user.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method for predicting gas concentration based on collaborative filtering according to any one of claims 1 to 6 are implemented.
8. A refrigerator, characterized in that: The refrigerator comprises the electronic device according to claim 7.
Citation Information
Patent Citations
Method for analyzing hidden safety trouble of dangerous chemical gas
CN105486807A
Internet electricity consumption body similar user identification method
CN106257503A
Disadvantaged family monitoring method and system based on panoramic image correlation analysis
CN107977669A
Refrigerator with gas leakage detection function
CN203810840U