Disclosure of Invention
The invention provides an intelligent air conditioner control system and method based on fuzzy reasoning, aiming at solving the problems of difficult parameter adjustment and poor adjustment effect of the traditional air conditioner control algorithm. The invention combines the feeling of human body to the environment temperature with the fuzzy language by using the characteristic of the fuzzy things in the nature, and makes up the defect that the air conditioner is difficult to accurately adjust the environment temperature. The invention adopts a plurality of membership functions to fuzzify input and output parameters, sets up a proper and detailed fuzzy rule, adopts a maximum and minimum algorithm to carry out fuzzy reasoning, finally adopts a gravity center method to carry out defuzzification to obtain an accurate control scheme, utilizes a fuzzy J Toolkit to carry out simulation system construction, simulates an air conditioner to accurately adjust the indoor temperature and creates a comfortable home environment.
In a first aspect, the invention provides an intelligent air conditioner control method based on fuzzy reasoning;
the intelligent air conditioner control method based on fuzzy inference comprises the following steps:
acquiring input parameters and output parameters of an air conditioner; converting both the input parameters and the output parameters into a fuzzy set through a membership function;
constructing a fuzzy rule base;
performing reasoning operation on the fuzzy set according to the fuzzy rules of the fuzzy rule base;
performing deblurring operation on the inference operation result;
and adjusting the input parameters of the air conditioner according to the deblurring operation result, so as to realize the control of the air conditioner.
In a second aspect, the invention provides an intelligent air conditioner control system based on fuzzy reasoning;
air conditioner intelligence control system based on fuzzy inference includes:
an acquisition module configured to: acquiring input parameters and output parameters of an air conditioner; converting both the input parameters and the output parameters into a fuzzy set through a membership function;
a rule base construction module configured to: constructing a fuzzy rule base;
an inferential computation module configured to: performing reasoning operation on the fuzzy set according to the fuzzy rules of the fuzzy rule base;
a deblurring operation module configured to: performing deblurring operation on the inference operation result;
an air conditioning control module configured to: and adjusting the input parameters of the air conditioner according to the deblurring operation result, so as to realize the control of the air conditioner.
In a third aspect, the present invention further provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein a processor is connected to the memory, the one or more computer programs are stored in the memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory, so as to make the electronic device execute the method according to the first aspect.
In a fourth aspect, the present invention also provides a computer-readable storage medium for storing computer instructions which, when executed by a processor, perform the method of the first aspect.
Compared with the prior art, the invention has the beneficial effects that:
(1) the indoor environment temperature is expressed by a fuzzy language, and an accurate control scheme is obtained through the steps of fuzzification of accurate parameters, fuzzy rule construction, fuzzy reasoning, defuzzification and the like so as to control the air conditioning system to accurately regulate the environment temperature. The invention overcomes the defects of hysteresis, inaccurate adjustment parameter and the like of the traditional air conditioner control algorithm, saves energy and provides a more comfortable home environment for users.
(2) According to the invention, a Java third-party package FuzzyJ toolkit is utilized to construct the control system of the simulation air conditioner, and a final accurate output control scheme is obtained by inputting the ambient temperature and performing fuzzy control on the simulation system, so that help is provided for the household air conditioner to adjust the home ambient temperature.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and it should be understood that the terms "comprises" and "comprising", and any variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
The embodiment provides an intelligent air conditioner control method based on fuzzy reasoning;
as shown in fig. 1, the intelligent control method of the air conditioner based on fuzzy inference includes:
s101: acquiring input parameters and output parameters of an air conditioner; converting both the input parameters and the output parameters into a fuzzy set through a membership function;
s102: constructing a fuzzy rule base;
s103: performing reasoning operation on the fuzzy set according to the fuzzy rules of the fuzzy rule base;
s104: performing deblurring operation on the inference operation result;
s105: and adjusting the input parameters of the air conditioner according to the deblurring operation result, so as to realize the control of the air conditioner.
Further, the step S101: acquiring input parameters and output parameters of an air conditioner; wherein, the input parameters refer to: ambient temperature; an output parameter comprising: cold and hot valve on-off status and vent size.
Further, the step S101: converting both the input parameters and the output parameters into a fuzzy set through a membership function; the method specifically comprises the following steps:
converting the ambient temperature into a first fuzzy set through a trapezoidal membership function;
converting the on-off state of the cold and hot valve into a second fuzzy set through a triangular membership function;
vent sizes are converted to a third fuzzy set by a gaussian membership function.
Further, the environment temperature is converted into a first fuzzy set through a trapezoid membership function; the method specifically comprises the following steps:
wherein, a1Determining the lower left end of the trapezoid, b1Determining the left vertex of the trapezoid, c1Determining the right vertex of the trapezoid, d1The lower right end point of the trapezoid is determined.
Further, the on-off state of the cold and hot valve is converted into a second fuzzy set through a triangular membership function; the method specifically comprises the following steps:
wherein, a2Determining the lower left end point of the triangle, b2Determining the vertices of the triangle, c2The bottom right endpoint of the triangle is determined.
The on-off state of the cold and hot valve belongs to a Boolean type, and the selected membership function aiming at the state parameter of the cold and hot valve is a triangular membership function.
Further, the vent size is converted into a third fuzzy set through a Gaussian membership function; the method specifically comprises the following steps:
where σ is a positive real number, c3The center of the gaussian curve is determined.
Further, the selection criteria of the three functions in S101 are:
according to the table, when the membership function of the input temperature is a trapezoidal membership function, the membership function of the opening and closing state of the cold and hot valve is a triangular membership function, and the membership function of the size of the vent is a Gaussian membership function, the opening degree of the vent is maximum at 0 ℃, is small at 15 ℃ and is large at 40 ℃.
Compared with other schemes, the combined scheme of the air conditioner most conforms to the principle that the opening degree of the air vents is larger when the human body feels cold and hot, and the opening degree of the air vents is smaller when the human body feels comfortable, and the energy is saved to the greatest extent while the air conditioner is accurately adjusted.
Determining the membership function of the input temperature parameter, the membership function of the cold and hot valve opening and closing state and the vent size parameter, combining and comparing different membership functions of the three parameters to determine that the membership function of the input temperature parameter is a trapezoidal membership function, the membership function of the cold and hot valve opening and closing state parameter is a triangular membership function, and the membership function of the output vent size parameter is a Gaussian membership function.
TABLE 1 comparison table of different membership function combinations of each parameter
The table can determine that the membership function of the input temperature parameter is a trapezoidal membership function, and the membership function of the output vent size parameter is a Gaussian membership function. The input temperature parameter trigonometric membership function is shown in fig. 2, the output cold and hot valve switch state parameter is shown in fig. 3 and 4, and the output vent size parameter is shown in fig. 5.
Further, the S102: constructing a fuzzy rule base; the method specifically comprises the following steps:
THEN y(k)is Bii=1,2,...,l (4)
wherein R is
iDenotes the ith rule, l denotes the total number of rules,
n denotes the fuzzy set in which the system input variables are located, B
iRepresenting the set in which the system output variable is located, x
m(k) N is an input variable of the fuzzy control system, and y (k) is an output variable of the fuzzy control system.
Further, the S102: constructing a fuzzy rule base; the method specifically comprises the following steps:
s1021: determining that the input parameter is an environment temperature value, and the output parameter is a cold and hot valve state and a ventilation opening size;
s1022: the fuzzy rule is constructed as follows:
if the temperature is-20-10 ℃, the cold valve is closed, the hot valve is opened, and the vent is completely opened;
if the temperature is 5-25 deg.C, the cold valve is closed, the hot valve is opened, and the vent is opened by 150mm2~180cm2;
If the temperature is 15-30 ℃, the cold valve is closed, the hot valve is closed, and the vent is half-open;
if the temperature is 20-35 deg.C, the cold valve is opened, the hot valve is closed, and the vent is opened 150mm2~180cm2;
If the temperature is between 27 ℃ and 40 ℃, the cold valve is opened, the hot valve is closed, and the vent is fully open in size.
Further, the step S103: performing reasoning operation on the fuzzy set according to the fuzzy rules of the fuzzy rule base; the method specifically comprises the following steps:
wherein, KiRepresents the ambient temperature; y (K)i) Representing the human perception degree at the ambient temperature, namely the fuzzy weight; lambda is more than or equal to 0 and less than or equal to 1 to represent a fuzzy gaugeA threshold for activation; z (λ) represents the activated fuzzy rule.
Further, the step S103: performing reasoning operation on the fuzzy set according to a fuzzy rule; the method specifically comprises the following steps:
s1031: inputting a temperature parameter as an independent variable, and performing membership function operation to obtain a membership value, wherein the membership value is used as an activation weight of an output parameter;
s1032: acquiring a single rule reasoning result, namely activating the activated part of the weight value on the output variable membership function; the result obtained after Min operation is carried out on the activation weight and the output variable membership function is the activated part; the Min formula is as follows:
μ1(y)=μt1(A)∧μv1(y)=min[μt1(A),μv1(y)] (6)
μ2(y)=μt2(A)∧μv2(y)=min[μt2(A),μv2(y)] (7)
in formulas (6) and (7), a represents an input parameter at a certain time; mu.st1(A) And mut2(A) Respectively representing two membership values obtained by taking the input temperature parameter as an independent variable to carry out membership function operation, namely the activation weight of the output parameter; mu.sv1(y) and μv2(y) respectively representing membership functions of output parameters under the two activation weights; mu.s1(y)、μ2(y) respectively indicates the fuzzy degree of the two rule conclusions.
S1033: max operation is carried out on the single rule reasoning result to obtain a final fuzzy reasoning comprehensive result; the Max operation formula is as follows:
μh(y)=μ1(y)∨μ2(y)=max[μ1(y),μ2(y)] (8)
in the formula (8), μhAnd (y) represents a final fuzzy inference operation result.
Further, the S104: carrying out deblurring operation on the fuzzy inference operation result; the method specifically comprises the following steps:
the method adopts an area gravity center method to carry out defuzzification, and the formula of the area gravity center method is as follows:
y' represents the exact value after defuzzification.
And when the fuzzy set of the inference result obtains a final inference accurate value by taking the area gravity center, the inference accurate value is the accurate opening size of the vent.
Further, the S104: performing deblurring operation on the inference operation result; the method specifically comprises the following steps:
s1041: marking coordinate points of data in the vent dimension data set by taking time as an abscissa and the vent dimension as an ordinate, sequentially connecting the marked points to form a fold line, and finally making perpendicular lines on two end points of the fold line towards a transverse axis respectively to form a closed graph;
s1042: and (4) taking the area gravity center of the obtained closed graph to obtain the final size of the air conditioner ventilation opening.
Further, the step S105: adjusting the output parameters of the air conditioner according to the deblurring operation result to realize the control of the air conditioner; the method specifically comprises the following steps:
and adjusting the size of the air vent of the air conditioner according to the deblurring operation result, so as to realize the control of the air conditioner.
The invention adopts a plurality of membership functions to fuzzify input and output parameters, formulates a proper and detailed fuzzy rule, adopts a maximum and minimum algorithm to carry out fuzzy reasoning, and finally adopts a gravity center method to carry out defuzzification to obtain an accurate control scheme, so that the air conditioner can accurately adjust the indoor temperature and build a comfortable home environment.
And (3) constructing a simulation system by using a FuzzyJ Toolkit tool bag, wherein the input parameter is the ambient temperature, and the output parameter comprises the states of a cold valve and a hot valve and the size of a vent.
The FuzzyJ Toolkit is: and the fuzzy expert system shell adds the fuzzy reasoning function into a Java third-party toolkit in the Jess expert system.
The fuzzy inference algorithm is a natural language processing algorithm, which converts fuzzy variables in nature into corresponding fuzzy sets, obtains new fuzzy sets according to fuzzy rules formulated in advance, and then carries out defuzzification through a certain algorithm to obtain final accurate output results.
In particular, the invention uses a fuzzy J Toolkit to build a simulation system, which is the combination of fuzzy reasoning and Jess expert system. Like most expert system tools, Jess also has a core consisting of a fact library, a rule library and an inference engine, and adopts production rules as a basic knowledge expression mode. Jess provides highly efficient forward and reverse reasoning by realizing a Rete matching algorithm, and the Rete algorithm utilizes two characteristics of time redundancy and structural similarity in an expert system, thereby effectively reducing the times of matching operation and improving the reasoning efficiency. And fuzzy Jess is a stronger fuzzy expert system shell, adds the function of fuzzy reasoning into the Jess expert system, and can express accurate facts and fuzzy facts and execute fuzzy reasoning while having the powerful function of Jess.
The final accurate result obtained by fuzzy reasoning of the input and output parameters according to the fuzzy rule is shown in fig. 6.
An example of a simulation is provided below:
the intelligent control system of the air conditioner based on the fuzzy inference is realized in a simulation mode through a Java third party package FuzzyJ Toolkit, and visualization is realized by using a GUI (graphical user interface). The main functions of the simulation system are as follows:
the user inputs a temperature value within a specified range, and clicks a 'start calculation' button to obtain a corresponding fuzzy reasoning control scheme, wherein the scheme comprises the opening and closing states of the cold and hot valves, the opening degree of the air vents and a size schematic diagram of the air conditioning air vents at the moment.
As shown in FIG. 7, the input temperature is 35 deg.C, the control scheme obtained by fuzzy reasoning is shown in FIG. 8, the cold valve is opened, the hot valve is closed, and the size of the vent is 146.4743589 … cm2. It can be seen that the invention can accurately regulate the on-off state of the cold and hot valve of the air conditioner and the size of the ventilation opening by inputting the indoor temperatureThe defects of hysteresis and the like of the original air conditioner control algorithm are overcome, energy is saved, emission is reduced, and the most comfortable home and office environment is provided for users.
Example two
The embodiment provides an intelligent air conditioner control system based on fuzzy reasoning;
air conditioner intelligence control system based on fuzzy inference includes:
an acquisition module configured to: acquiring input parameters and output parameters of an air conditioner; converting both the input parameters and the output parameters into a fuzzy set through a membership function;
a rule base construction module configured to: constructing a fuzzy rule base;
an inferential computation module configured to: performing reasoning operation on the fuzzy set according to the fuzzy rules of the fuzzy rule base;
a deblurring operation module configured to: performing deblurring operation on the inference operation result;
an air conditioning control module configured to: and adjusting the input parameters of the air conditioner according to the deblurring operation result, so as to realize the control of the air conditioner.
It should be noted here that the acquiring module, the rule base constructing module, the reasoning operation module, the deblurring operation module, and the air conditioner control module correspond to steps S101 to S105 in the first embodiment, and the modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of a system may be implemented in a computer system such as a set of computer-executable instructions.
In the foregoing embodiments, the descriptions of the embodiments have different emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The proposed system can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules may be combined or integrated into another system, or some features may be omitted, or not executed.
EXAMPLE III
The present embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, a processor is connected with the memory, the one or more computer programs are stored in the memory, and when the electronic device runs, the processor executes the one or more computer programs stored in the memory, so as to make the electronic device execute the method according to the first embodiment.
It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general purpose processors, digital signal processors DSP, application specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include both read-only memory and random access memory, and may provide instructions and data to the processor, and a portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.
In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software.
The method in the first embodiment may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, among other storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor. To avoid repetition, it is not described in detail here.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
Example four
The present embodiments also provide a computer-readable storage medium for storing computer instructions, which when executed by a processor, perform the method of the first embodiment.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.