Disclosure of Invention
The invention aims to provide an automatic air conditioner temperature determining method and system, which can improve the energy saving property and intelligence of air conditioning equipment under the condition of ensuring the thermal comfort.
In order to achieve the purpose, the invention provides the following scheme:
an automatic determination method for air conditioner temperature comprises the following steps:
acquiring historical moment data of an air conditioner to be controlled, environmental data of corresponding historical moments and real-time environmental data; the environmental data includes outdoor air temperature, outdoor relative humidity, indoor relative humidity, and indoor temperature; the historical moment data comprises working conditions, working states and set temperatures of the air conditioning equipment at the corresponding moment under the environment data; the working condition comprises heating or cooling; the working state comprises opening or closing;
determining the current working condition of the air conditioner to be controlled according to the working condition temperature range; the working condition temperature range comprises a heating temperature range and a cooling temperature range;
determining the working state of the air conditioner to be controlled at the next moment by adopting a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environmental data;
when the working state at the next moment is on, determining a plurality of set temperatures at the next moment of the air conditioner to be controlled according to the data at the historical moment, the environmental data at the corresponding historical moment and the real-time environmental data;
determining an energy consumption value of each set temperature;
determining a target set temperature of the air conditioner to be controlled at the next moment according to the energy consumption value and the indoor comfort level of each set temperature; the target set temperature is a set temperature with a low energy consumption value and a high indoor comfort level.
Optionally, the determining, according to the current working condition, the historical time data, and the corresponding historical time environmental data, a random forest model of the air conditioner to be controlled at a next time includes:
determining a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environmental data; the random forest model comprises 20 base learners; and each base learner takes the data according to the current working condition and the historical moment and the environmental data of the corresponding historical moment as input and takes the working state of the air conditioner to be controlled at the next moment as output.
Optionally, the determining, according to the current working condition, the historical time data, and the corresponding historical time environmental data, a random forest model of the air conditioner to be controlled at a next time is performed, and then the method further includes:
judging whether the working state of the air conditioner to be controlled at the next moment is open or not;
if the working state of the air conditioner to be controlled at the next moment is not the opening state, automatically closing the air conditioner;
if the working state of the air conditioner to be controlled at the next moment is started, acquiring the working state of the air conditioner to be controlled at the current moment and the working state of the air conditioner to be controlled at the previous moment;
judging whether the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on or not;
if the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on, controlling the working state at the next moment of the air conditioner to be controlled to be off; controlling the air conditioner to be controlled to be started until the working state of the air conditioner to be controlled is determined to be started again;
and if the working state at the previous moment, the working state at the current moment and the working state at the next moment are not on-off-on, controlling the air conditioner to be controlled to be started.
Optionally, when the operating state at the next time is on, determining a plurality of set temperatures at the next time of the air conditioner to be controlled according to the historical time data, the environmental data at the corresponding historical time, and the real-time environmental data, specifically includes:
constructing a plurality of decision trees based on a C4.5 algorithm according to the data of the historical time, the environmental data of the corresponding historical time and the real-time environmental data; the decision tree is used for determining the set temperature of the air conditioner to be controlled at the next moment;
determining a plurality of set temperatures from a plurality of the decision trees;
judging whether any two set temperatures are the same;
if the two set temperatures are the same, deleting any one set temperature;
and if the two set temperatures are different, keeping the two set temperatures.
An automatic determination system for air conditioner temperature, comprising:
the data acquisition module is used for acquiring data of historical moments of the air conditioner to be controlled, environmental data of corresponding historical moments and real-time environmental data; the environmental data includes outdoor air temperature, outdoor relative humidity, indoor relative humidity, and indoor temperature; the historical moment data comprises working conditions, working states and set temperatures of the air conditioning equipment at the corresponding moment under the environment data; the working condition comprises heating or cooling; the working state comprises opening or closing;
the working condition determining module is used for determining the current working condition of the air conditioner to be controlled according to the working condition temperature range; the working condition temperature range comprises a heating temperature range and a cooling temperature range;
the working state determining module is used for determining the working state of the air conditioner to be controlled at the next moment by adopting a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environment data;
the set temperature determining module is used for determining a plurality of set temperatures of the air conditioner to be controlled at the next moment according to the historical moment data, the corresponding historical moment environment data and the real-time environment data when the working state at the next moment is on;
the energy consumption value determining module is used for determining the energy consumption value of each set temperature;
the target set temperature determining module is used for determining the target set temperature of the air conditioner to be controlled at the next moment according to the energy consumption value and the indoor comfort level of each set temperature; the target set temperature is a set temperature with a low energy consumption value and a high indoor comfort level.
Optionally, the method further includes:
the random forest model determining module is used for determining a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environment data; the random forest model comprises 20 base learners; and each base learner takes the data according to the current working condition and the historical moment and the environmental data of the corresponding historical moment as input and takes the working state of the air conditioner to be controlled at the next moment as output.
Optionally, the method further includes:
the first judgment module is used for judging whether the working state of the air conditioner to be controlled at the next moment is on or not;
the automatic closing module is used for automatically closing the air conditioner if the working state of the air conditioner to be controlled at the next moment is not the opening state;
the working state acquisition module is used for acquiring the working state of the air conditioner to be controlled at the current moment and the working state of the air conditioner to be controlled at the previous moment if the working state of the air conditioner to be controlled at the next moment is started;
the second judgment module is used for judging whether the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on or not;
the first control module is used for controlling the next-moment working state of the air conditioner to be controlled to be closed if the previous-moment working state, the current-moment working state and the next-moment working state are on-off-on; controlling the air conditioner to be controlled to be started until the working state of the air conditioner to be controlled is determined to be started again;
and the second control module is used for controlling the air conditioner to be controlled to be started if the working state at the previous moment, the working state at the current moment and the working state at the next moment are not on-off-on.
Optionally, the set temperature determining module specifically includes:
the decision tree construction unit is used for constructing a plurality of decision trees based on a C4.5 algorithm according to the data of the historical time, the environmental data of the corresponding historical time and the real-time environmental data; the decision tree is used for determining the set temperature of the air conditioner to be controlled at the next moment;
a set temperature determining unit for determining a plurality of set temperatures according to the plurality of decision trees;
the first judgment unit is used for judging whether any two set temperatures are the same;
the deleting unit is used for deleting any one set temperature if the two set temperatures are the same;
and the reserving unit is used for reserving the two set temperatures if the two set temperatures are different.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the invention provides an automatic determination method and system for air conditioner temperature, which are used for determining the temperature of an air conditioner to be controlled by using a random forest model according to historical moment data of the air conditioner to be controlled, corresponding historical moment environment data and real-time environment data, and determining the target set temperature of the air conditioner to be controlled at the next moment according to the energy consumption value and the indoor comfort level of each set temperature, so that energy-saving control over the air conditioner system is realized, the thermal comfort requirement of a resident is met, and automatic air conditioner control service is provided for the resident. Meanwhile, the method can effectively balance the contradiction relation between the building energy-saving and thermal comfort requirements for a long time, effectively avoid improper behaviors of the air conditioner of a resident in the using process, and provide energy-saving, efficient and convenient service experience for the resident. Furthermore, under the condition of ensuring the thermal comfort, the energy-saving property and the intelligence of the air conditioning equipment are improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide an automatic air conditioner temperature determining method and system, which can improve the energy saving property and intelligence of air conditioning equipment under the condition of ensuring the thermal comfort.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 1 is a schematic flow chart of an automatic determination method for air conditioner temperature provided by the present invention, and as shown in fig. 1, the automatic determination method for air conditioner temperature provided by the present invention includes:
s101, acquiring historical moment data of an air conditioner to be controlled, environmental data of corresponding historical moments and real-time environmental data; the environmental data includes outdoor air temperature, outdoor relative humidity, indoor relative humidity, and indoor temperature; the historical moment data comprises working conditions, working states and set temperatures of the air conditioning equipment at the corresponding moment under the environment data; the working condition comprises heating or cooling; the working state comprises opening or closing.
And acquiring historical moment data of the air conditioner to be controlled, environmental data of corresponding historical moments and real-time environmental data by utilizing the building indoor and outdoor environmental data acquisition system and the smart home platform.
The building outdoor environment data acquisition system only needs to monitor the outdoor air temperature and the outdoor relative humidity in real time; each air-conditioned room only needs to be provided with real-time monitoring of indoor relative humidity and temperature. The smart home platform records and uploads the switch and temperature setting conditions of the heating working condition and the cooling working condition of the residents in real time. The program is written by adopting MATLAB language, and the whole modeling and regulation strategy forming process is automatically realized in MATLAB.
S102, determining the current working condition of the air conditioner to be controlled according to the working condition temperature range; the working condition temperature range comprises a heating temperature range and a cooling temperature range. The time distribution ranges of the heating season and the cooling season can be automatically specified and adjusted at any time by a user at the client of the smart home platform according to personal requirements (for example, 11 months and 15 days in the heating season to 3 months and 15 days in the coming year, and 5 months and 15 days in the cooling season to 9 months and 20 days in the same year).
And determining a time-varying matrix of the historical time data and the corresponding historical time environmental data of the air-conditioning equipment according to the historical time data and the corresponding historical time environmental data of the air-conditioning equipment.
Determining a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environmental data; the random forest model comprises 20 base learners; and each base learner takes the data according to the current working condition and the historical moment and the environmental data of the corresponding historical moment as input and takes the working state of the air conditioner to be controlled at the next moment as output.
The acquired data set is named as a set A, the random forest model needs to construct 20 base learners-C4.5 decision trees, the construction method of each base learner is the same, and the specific construction steps of any base learner i (i is more than or equal to 1 and less than or equal to 20) are as follows:
1) from the sample set a, 0.8 × t-1 samples were randomly sampled to form a sample set D.
2) Randomly extracting 3 attributes from the input attributes to serve as candidate partition attributes; automatically selecting the optimal partition attribute in the attributes, and placing the optimal partition attribute at a root node, wherein the branches of the root node are respectively each category of the attribute partition; and when the attribute is a continuous variable, the attribute category is not clearly divided, and the program automatically realizes the second classification by taking the median points of all values of the continuous variable as boundaries.
The specific selection process of the optimal partition attribute comprises the following steps: first, the "information entropy" of the sample set D is calculated (equation 1); on the basis, calculating the 'information gain' (formula 2) of each candidate partition attribute; then calculating the gain ratio of each candidate partition attribute (formula 3); among the attributes in which the information gain value is higher than the average information gain, the attribute with the largest gain ratio is selected as the optimal division attribute.
Wherein D is a sample set D; ent (D) -the entropy of the information of the set of samples D; k-class of sample label, k ═ 1,2, …, m; p is a radical ofk-probability of occurrence of class k sample label.
Where a-any candidate partition attribute a; gain (D, a) -the information Gain when the attribute a divides the sample D; l D | -the number of samples of sample set D; ent (D) -the entropy of the information of the set of samples D; v is any branch of the attribute a, V is 1,2, …, and V is the total branch number of the attribute a; dv-sample set of v branches in attribute a; dv sample set DvThe number of samples of (a); ent (dv) -set of samples DvThe entropy of information of (1).
Where Gain _ ratio (D, a) -the Gain rate at which attribute a divides sample D; gain (D, a) -the information Gain when the attribute a divides the sample D; iv (a) -intrinsic values of the property a,
3) based on the division condition of the root node, if the program recognizes that the sample 'tag' of a certain branch belongs to the same type, the sample of the branch cannot be further divided, and the program automatically marks the tail end of the branch as a 'leaf node'. If the sample set of a branch is identified to be continuously divided, the program will continuously and automatically randomly extract 3 attributes from the input attributes as candidate division attributes. If the attribute of the node (root node) at the upper level of the node is a classification variable, the attribute cannot be used as the candidate partition attribute again; if the attribute of the node at the previous level of the node (such as the root node) is a continuous variable, the node can be continuously used as the attribute of the candidate partition at the level on the basis of the partition at the previous level. Based on the partition attribute determination, the program places the automatically selected optimal partition attributes at the "internal nodes". Based on the above dividing principle, the program will continue to automatically divide the sample and mark the nodes until there are no more available division attributes or the sample can not be further divided, and mark the branches as leaf nodes. Finally, a base learner C4.5 decision tree is formed.
4) From sample set a, the complement of sample set D (named sample set B) is sampled. And substituting the samples in the set B into the constructed base learner, and enabling each sample in the set B to traverse the base learner to obtain the label category of each sample, namely the 'prediction result' based on the base learner. The program will automatically count the "predicted results" of the samples in set B against their original values.
Since the output variable "the operating state at the next moment" is a classification variable, the program will automatically calculate the prediction Accuracy (Accuracy) based on the base learner, and the calculation formula is as shown in equation 4. Record as accuracy 1.
In the formula ncorrect-the number of correctly sorted samples in the set; n istotal-the total number of samples in the set.
5) Starting from the "internal node" at the bottommost layer, the following operations are carried out on the "internal nodes" one by one from bottom to top: marking all samples under the internal node as the label category with the maximum number under the current node; and then automatically substituting the samples in the set B into the constructed base learner, so that each sample in the set B traverses the base learner to obtain the label category of each sample, and obtaining a 'prediction result' based on the base learner. The program will automatically count the new "predicted result" of the samples in set B against their original values. The prediction accuracy 2 of this time base learner is calculated. If the prediction accuracy rate 2 of the base learner is higher than the prediction accuracy rate 1 of the base learner, replacing the current 'internal nodes' with 'leaf nodes', namely 'pruning'; otherwise, no replacement is performed, i.e., no "pruning".
5) And completing the construction of a base learner i (i is more than or equal to 1 and less than or equal to 20).
S103, determining the working state of the air conditioner to be controlled at the next moment by adopting a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environment data.
And substituting each input variable of the current time t into the 20 base learners, and traversing the base learners to obtain 20 prediction labels.
And counting the categories of the 20 labels and the occurrence times of the categories, and selecting the category of the label with the largest occurrence time as the working state of the next moment.
In order to prevent the phenomenon of large energy consumption caused by frequent air conditioner opening and closing actions, as shown in fig. 2, the present invention further comprises:
and judging whether the working state of the air conditioner to be controlled at the next moment is open or not.
And if the working state of the air conditioner to be controlled at the next moment is not the opening state, automatically closing the air conditioner.
And if the working state of the air conditioner to be controlled at the next moment is on, acquiring the working state of the air conditioner to be controlled at the current moment and the working state of the air conditioner to be controlled at the previous moment.
And judging whether the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on.
If the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on, controlling the working state at the next moment of the air conditioner to be controlled to be off; and controlling the air conditioner to be controlled to be started until the working state of the air conditioner to be controlled is determined to be started again.
And if the working state at the previous moment, the working state at the current moment and the working state at the next moment are not on-off-on, controlling the air conditioner to be controlled to be started.
And S104, when the working state at the next moment is on, determining a plurality of set temperatures at the next moment of the air conditioner to be controlled according to the data at the historical moment, the environmental data at the corresponding historical moment and the real-time environmental data.
Constructing a plurality of decision trees based on a C4.5 algorithm according to the data of the historical time, the environmental data of the corresponding historical time and the real-time environmental data; and the decision tree is used for determining the set temperature of the air conditioner to be controlled at the next moment.
A plurality of set temperatures is determined from a plurality of the decision trees.
And judging whether any two set temperatures are the same.
And if the two set temperatures are the same, deleting any one set temperature.
And if the two set temperatures are different, keeping the two set temperatures.
And S105, determining the energy consumption value of each set temperature.
S106, determining a target set temperature of the air conditioner to be controlled at the next moment according to the energy consumption value and the indoor comfort level of each set temperature; the target set temperature is a set temperature with a low energy consumption value and a high indoor comfort level.
Under the air conditioner heating operating mode, 1 level: very low indoor temperature (below 15 ℃), class 2: low indoor temperature ([15, 18) ° c), 3: indoor temperature is generally comfortable ([18, 22) ° c), 4: the indoor temperature is suitable (22 ℃ and above). Under the air conditioner cooling working condition, level 1: high indoor temperature (above 28 ℃), grade 2: the indoor temperature is low ((26, 28) DEG C), 3 grade is that the indoor temperature is generally comfortable ((24, 26) DEG C), and 4 grade is that the indoor temperature is suitable (24 ℃ and below).
Fig. 3 is a schematic structural diagram of an automatic air conditioner temperature determining system provided by the present invention, and as shown in fig. 3, the automatic air conditioner temperature determining system provided by the present invention includes: the system comprises a data acquisition module 301, a working condition determination module 302, a working state determination module 303, a set temperature determination module 304, an energy consumption value determination module 305 and a target set temperature determination module 306.
The data acquisition module 301 is configured to acquire historical time data of an air conditioner to be controlled, environmental data of a corresponding historical time, and real-time environmental data; the environmental data includes outdoor air temperature, outdoor relative humidity, indoor relative humidity, and indoor temperature; the historical moment data comprises working conditions, working states and set temperatures of the air conditioning equipment at the corresponding moment under the environment data; the working condition comprises heating or cooling; the working state comprises opening or closing;
the working condition determining module 302 is configured to determine a current working condition of the air conditioner to be controlled according to the working condition temperature range; the working condition temperature range comprises a heating temperature range and a cooling temperature range;
the working state determining module 303 is configured to determine a working state of the air conditioner to be controlled at the next moment by using a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environment data;
the set temperature determining module 304 is configured to determine a plurality of set temperatures of the air conditioner to be controlled at the next time according to the historical time data, the environmental data at the corresponding historical time, and the real-time environmental data when the operating state at the next time is on;
the energy consumption value determining module 305 is used for determining an energy consumption value of each set temperature;
the target set temperature determining module 306 is configured to determine a target set temperature at the next moment of the air conditioner to be controlled according to the energy consumption value and the indoor comfort level of each set temperature; the target set temperature is a set temperature with a low energy consumption value and a high indoor comfort level.
The air conditioner temperature automatic determination system provided by the invention further comprises: and a random forest model determining module.
The random forest model determining module is used for determining a random forest model according to the current working condition, the historical moment data and the corresponding historical moment environment data; the random forest model comprises 20 base learners; and each base learner takes the data according to the current working condition and the historical moment and the environmental data of the corresponding historical moment as input and takes the working state of the air conditioner to be controlled at the next moment as output.
The air conditioner temperature automatic determination system provided by the invention further comprises: the automatic shutdown device comprises a first judgment module, an automatic shutdown module, a working state acquisition module, a second judgment module, a first control module and a second control module.
The first judgment module is used for judging whether the working state of the air conditioner to be controlled at the next moment is on or not.
The automatic closing module is used for automatically closing the air conditioner if the working state of the air conditioner to be controlled at the next moment is not opened.
The working state acquisition module is used for acquiring the current working state and the previous working state of the air conditioner to be controlled if the next working state of the air conditioner to be controlled is on.
The second judging module is used for judging whether the working state at the previous moment, the working state at the current moment and the working state at the next moment are on-off-on.
The first control module is used for controlling the next-moment working state of the air conditioner to be controlled to be off if the previous-moment working state, the current-moment working state and the next-moment working state are on-off-on; and controlling the air conditioner to be controlled to be started until the working state of the air conditioner to be controlled is determined to be started again.
And the second control module is used for controlling the air conditioner to be controlled to be started if the working state at the previous moment, the working state at the current moment and the working state at the next moment are not on-off-on.
The set temperature determination module specifically includes: the device comprises a decision tree construction unit, a set temperature determination unit, a first judgment unit, a deletion unit and a retention unit.
The decision tree construction unit is used for constructing a plurality of decision trees based on a C4.5 algorithm according to the data of the historical time, the environmental data of the corresponding historical time and the real-time environmental data; the decision tree is used for determining the set temperature of the air conditioner to be controlled at the next moment;
the set temperature determining unit is used for determining a plurality of set temperatures according to the decision trees;
the first judging unit is used for judging whether any two set temperatures are the same;
the deleting unit is used for deleting any one set temperature if the two set temperatures are the same;
the reserving unit is used for reserving the two set temperatures if the two set temperatures are different.
The method and the system for automatically determining the temperature of the air conditioner can effectively realize the energy-saving operation of the air conditioning system. At present, the following energy waste phenomena exist in the process of heating/cooling by using an air conditioner by a resident: 1) a user frequently turns on and off the air conditioner, and the action of frequently turning on the air conditioner consumes huge energy; 2) the temperature set by the user when heating/cooling with the air conditioner is not reasonable, for example, the temperature set when heating is too high or the temperature set when cooling with the air conditioner is too low. The method and the system can effectively solve the problems. On the one hand, the energy-saving control of the frequent opening and closing actions of the air conditioner can be realized. The management and control strategy can effectively avoid frequent 'on-off-on' actions of the air conditioner, when the frequent opening action is met, the action of a short time (sampling time interval) is delayed, the frequent action of the air conditioner in the short time is not caused, and meanwhile, the thermal comfort requirement of a user is not influenced after the action of the short time is delayed. On the other hand, can select on the low side heating temperature or the cooling temperature on the high side in the air conditioner settlement temperature that satisfies the comfortable demand of resident's heat for the demand of indoor cold and hot load reduces, thereby air conditioning system's energy consumption reduces, can realize the energy-conserving management and control of air conditioner operation.
The method and the system can effectively balance the relation between energy conservation and thermal comfort, can ensure thermal comfort experience of residents while realizing energy conservation control, and can also meet behavior habits of the residents. 1) The time of the heating season and the time of the cooling season are automatically specified by a user and can be changed according to personal requirements at any time; 2) the prediction of the on and off states of the air conditioner in the step 2 and the setting of the heating/cooling temperature of the air conditioner in the step 4 are carried out according to the historical use data of the user, so that the behavior habits and the heat comfort requirements of residents can be met; 3) the set temperature which can ensure the indoor thermal comfort level is selected preferentially from the set temperature values of the heating/cooling of the air conditioner to be selected, and the thermal comfort requirement of a resident is met.
The method, namely the system, researches the households one by one, so that the method and the system are not limited by the geographical position of a building, the house type of the room, the room function, the number of personnel and the like, and can effectively establish a relevant model to realize the automatic regulation and control of the air conditioner. Meanwhile, the invention is convenient to apply, the user only needs to set the time ranges of the heating season and the cooling season at the client, and the operation control of the energy saving and the heat comfort of the air conditioner is automatically completed by the system without manual operation.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.