Control method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202311817920.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-12-26
AI Technical Summary
目前,常用的温度湿度控制方法基于传统的控制理论,如PID控制、模型预测控制等,这种方法的缺点是,需要建立精确的数学模型,而实际情况往往存在不确定性和非线性性,导致控制效果不理想
[0043]本申请提供的一种控制方法、装置、设备及存储介质,通过获取室内当前的温度和湿度;确定所述温度对应的模糊数值,并确定所述湿度对应的模糊数值;将所述温度对应的模糊数值和所述湿度对应的模糊数值输入至预先建立的模糊规则中,确定各个模糊规则对应的舒适度;基于各个模糊规则对应的舒适度确定舒适度的隶属度;基于所述隶属度确定目标温度和目标湿度;基于所述目标温度和目标湿度控制目标设备的工作状态,提高调节温度湿度的精度,提高用户的舒适度。
Smart Images

Figure CN117872788B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of control technology, and in particular to a control method, apparatus, device and storage medium. Background Technology
[0002] Temperature and humidity are important factors affecting human comfort, and the suitability of indoor temperature and humidity directly affects people's work efficiency and quality of life. Currently, commonly used temperature and humidity control methods are based on traditional control theories, such as PID control and model predictive control. The drawback of this method is that it requires the establishment of accurate mathematical models, while actual situations often involve uncertainties and nonlinearities, leading to unsatisfactory control results. Summary of the Invention
[0003] To address the aforementioned problems, this application provides a control method, apparatus, device, and storage medium that can improve the accuracy of temperature and humidity regulation.
[0004] This application provides a control method, including:
[0005] Obtain the current indoor temperature and humidity;
[0006] Determine the fuzzy value corresponding to the temperature, and determine the fuzzy value corresponding to the humidity;
[0007] The fuzzy values corresponding to the temperature and humidity are input into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule.
[0008] The membership degree of comfort is determined based on the comfort level corresponding to each fuzzy rule;
[0009] The target temperature and target humidity are determined based on the membership degree.
[0010] The operating state of the target device is controlled based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
[0011] In some embodiments, the method further includes:
[0012] Obtain indoor sample temperature, sample humidity, and corresponding sample comfort level;
[0013] Determine the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample.
[0014] The sample dataset is determined based on the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample.
[0015] The decision tree model is obtained by training based on the sample dataset.
[0016] The decision tree model is then transformed to obtain fuzzy rules.
[0017] In some embodiments, the fuzzy values corresponding to the sample temperature and the fuzzy values corresponding to the sample humidity are input attributes during training, and the fuzzy value corresponding to the sample comfort is the output attribute during training. The step of training the decision tree model based on the sample dataset includes:
[0018] Calculate the fuzzy entropy of each input attribute, select the input attribute with the smallest fuzzy entropy as the branch attribute, and divide the sample dataset into several subsets according to the fuzzy intervals corresponding to the branch attributes.
[0019] For each target subset, if it is determined whether all output data in the target subset belong to the same fuzzy interval of the same output attribute, or if the number of data in the target subset is less than a preset threshold, the target subset is treated as a leaf node, and the average value of the output attribute of the sample data in the target subset is used as the output value of the leaf node; the training of the decision tree model is completed until all sample data are assigned to leaf nodes, or the stopping condition is met.
[0020] In some embodiments, each fuzzy rule includes a premise part and a conclusion part. The premise part includes fuzzy logical connections of all branch attributes and split points on the path. The conclusion part includes the comfort level of the leaf nodes on the path. The step of inputting the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule includes:
[0021] The truth value of the premise part of each fuzzy rule is calculated based on the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity, and the truth value is determined as the weight of each fuzzy rule.
[0022] The candidate comfort level corresponding to each fuzzy rule is determined based on the conclusion part of each fuzzy rule.
[0023] The comfort level of each fuzzy rule is determined based on the candidate comfort level and the weight of each fuzzy rule.
[0024] In some embodiments, determining the membership degree of comfort based on the comfort degree corresponding to each fuzzy rule includes:
[0025] The comfort levels corresponding to each fuzzy rule are summed to obtain the total value of each comfort level.
[0026] Determine the maximum value among the total values for all comfort levels;
[0027] The membership degree of comfort is determined based on the maximum value.
[0028] In some embodiments, determining the target temperature and target humidity based on the membership degree includes:
[0029] Based on the membership degree, determine the fuzzy interval corresponding to the target humidity and the fuzzy interval corresponding to the target temperature;
[0030] The target temperature and target humidity are determined based on the fuzzy intervals corresponding to the target humidity and the target temperature.
[0031] In some embodiments, controlling the operating state of the target device based on the target temperature and target humidity includes:
[0032] The temperature difference is determined based on the stated temperature and the target temperature, and the humidity difference is determined based on the stated humidity and the target humidity.
[0033] The temperature control device's operating status is controlled based on the temperature difference, and the humidity control device's operating status is controlled based on the humidity difference.
[0034] This application provides a control device, including:
[0035] The acquisition module is used to acquire the current indoor temperature and humidity.
[0036] The first determining module is used to determine the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity;
[0037] The second determining module is used to input the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule.
[0038] The third determining module is used to determine the membership degree of comfort based on the comfort corresponding to each fuzzy rule;
[0039] The fourth determining module is used to determine the target temperature and target humidity based on the membership degree;
[0040] The control module is used to control the working state of the target device based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
[0041] This application provides an electronic device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, performs the control method described in any of the above embodiments.
[0042] This application provides a computer-readable storage medium storing a computer program that can be executed by one or more processors and can be used to implement the control method described above.
[0043] This application provides a control method, apparatus, device, and storage medium that acquires the current indoor temperature and humidity; determines a fuzzy value corresponding to the temperature and a fuzzy value corresponding to the humidity; inputs the fuzzy values corresponding to the temperature and humidity into pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule; determines the membership degree of the comfort level based on the comfort level corresponding to each fuzzy rule; determines the target temperature and target humidity based on the membership degree; and controls the working state of the target device based on the target temperature and target humidity, thereby improving the accuracy of temperature and humidity regulation and enhancing user comfort. Attached Figure Description
[0044] The present application will be described in more detail below based on embodiments and with reference to the accompanying drawings.
[0045] Figure 1 A schematic diagram illustrating the implementation flow of a control method provided in an embodiment of this application;
[0046] Figure 2 A schematic diagram illustrating the implementation flow of another control method provided in an embodiment of this application;
[0047] Figure 3 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application.
[0048] In the accompanying drawings, the same parts are represented by the same reference numerals, and the drawings are not drawn to scale. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0051] If the application documents contain similar descriptions such as "first, second, third", the following explanation shall be added: In the following description, the terms "first, second, third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0052] Unless otherwise defined, 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 application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0053] To address the problems existing in related technologies, this application provides a control method. The executing entity of the method can be an electronic device, such as a mobile terminal, computer, smart home device, or smart wearable device. In some embodiments, the electronic device can be a controller for a mobile terminal, computer, or smart home device.
[0054] The control method provided in this application can achieve its functions by having the processor of an electronic device call program code, wherein the program code can be stored in a computer storage medium.
[0055] This application provides a control method. Figure 1 This is a schematic diagram illustrating the implementation flow of a control method provided in an embodiment of this application, as shown below. Figure 1 As shown, the control methods include:
[0056] Step S1: Obtain the current indoor temperature and humidity.
[0057] In this embodiment of the application, indoor temperature and humidity data are acquired through sensors or other devices.
[0058] For example, sensors such as DHT11, DHT22, or SHT series sensors can be used to directly measure indoor temperature and humidity.
[0059] In some embodiments, indoor temperature and humidity data can be obtained via a smartphone app or other means.
[0060] Step S2: Determine the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity.
[0061] In this embodiment of the application, temperature and humidity are converted into fuzzy values, which can be represented by membership functions of triangles, trapezoids, or other shapes.
[0062] For example, the indoor temperature is divided into three fuzzy intervals: low, medium, and high, corresponding to 0–18℃, 18–26℃, and 26–40℃, respectively, and a triangular fuzzy membership function is defined for each fuzzy interval.
[0063] Indoor humidity is divided into three fuzzy intervals: dry, suitable, and humid, corresponding to 0–40%, 40–60%, and 60–100%, respectively. A triangular fuzzy membership function is defined for each fuzzy interval.
[0064] Fuzzy numerical values can be obtained through fuzzy membership functions.
[0065] Step S3: Input the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule.
[0066] In this embodiment of the application, a set of fuzzy rules can be established to map fuzzy values to fuzzy outputs of comfort. Thus, when the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity are obtained and input into the pre-established fuzzy rules, the comfort level corresponding to each fuzzy rule is determined.
[0067] Step S4: Determine the membership degree of comfort based on the comfort degree corresponding to each fuzzy rule.
[0068] In this embodiment of the application, fuzzy numerical values are applied to fuzzy rules to calculate the membership degree of comfort corresponding to each rule.
[0069] In this embodiment, the membership degree of human comfort can be divided into three fuzzy intervals: uncomfortable, normal, and comfortable, corresponding to 1-3 points, 3-6 points, and 6-9 points, respectively. Here, 1 point represents very uncomfortable and 9 points represent very comfortable. A triangular fuzzy membership function is defined for each fuzzy interval. After determining the comfort level, the membership degree of the comfort level can be determined.
[0070] Step S5: Determine the target temperature and target humidity based on the membership degree.
[0071] In this embodiment, the fuzzy output of the target temperature and target humidity is determined by combining the membership degrees of each fuzzy rule.
[0072] Step S6: Control the working state of the target device based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
[0073] In this embodiment of the application, the target device may include: a temperature regulating device and a humidity regulating device. The temperature regulating device may include: an air conditioner, and the humidity regulating device may include: a humidifier, etc.
[0074] This application provides a control method that involves acquiring the current indoor temperature and humidity; determining the fuzzy values corresponding to the temperature and humidity; inputting the fuzzy values corresponding to the temperature and humidity into pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule; determining the membership degree of the comfort level based on the comfort level corresponding to each fuzzy rule; determining the target temperature and target humidity based on the membership degree; and controlling the working state of the target device based on the target temperature and target humidity, thereby improving the accuracy of temperature and humidity regulation and enhancing user comfort.
[0075] In some embodiments, prior to step S1, the method further includes:
[0076] Step S11: Obtain the indoor sample temperature, sample humidity, and corresponding sample comfort level.
[0077] In this embodiment of the application, a series of indoor temperature and humidity data are collected, and the comfort evaluation corresponding to each sample is recorded. For example, these data can be obtained by questionnaire survey or actual measurement.
[0078] Step S12: Determine the fuzzy values corresponding to the temperature of each sample, determine the fuzzy values corresponding to the humidity of each sample, and determine the fuzzy values corresponding to the comfort level of each sample.
[0079] In this embodiment of the application, the actual temperature, humidity and comfort data are converted into fuzzy values, and membership functions of triangles, trapezoids or other shapes can be used to represent the fuzzy values.
[0080] Step S13: Determine the sample dataset based on the fuzzy values corresponding to the temperature, humidity, and comfort of each sample.
[0081] In this embodiment of the application, these sample data are organized into a sample dataset, including fuzzy values of temperature, fuzzy values of humidity, and corresponding fuzzy values of comfort.
[0082] Step S14: Train the decision tree model based on the sample dataset to obtain the model.
[0083] In this embodiment of the application, a decision tree model can be obtained by training the sample dataset based on the decision tree algorithm.
[0084] Step S15: Convert the decision tree model to obtain fuzzy rules.
[0085] In this embodiment, the decision tree model can be transformed into fuzzy rules. Some techniques, such as fuzzy logic reasoning, can be used to transform the decision tree model into fuzzy rules, so that the corresponding comfort evaluation can be obtained based on the input temperature and humidity.
[0086] In some embodiments, the fuzzy values corresponding to the sample temperature and the sample humidity are input attributes during training, and the fuzzy value corresponding to the sample comfort is the output attribute during training. The decision tree model is obtained by training based on the sample dataset through the following steps:
[0087] Step S141: Calculate the fuzzy entropy of each input attribute, select the input attribute with the smallest fuzzy entropy as the branch attribute, and divide the sample dataset into several subsets according to the fuzzy intervals corresponding to the branch attributes.
[0088] In this embodiment of the application, the calculation of fuzzy entropy can use the fuzzified form of Shannon entropy, that is, for each input attribute, calculate its corresponding fuzzy membership function, and then use these membership functions to calculate the fuzzy entropy.
[0089] In this embodiment, the fuzzy entropy of each input attribute can be compared, and the attribute with the minimum fuzzy entropy can be selected as the branch attribute. This attribute will be used to divide the sample dataset into several subsets. Based on the fuzzy intervals corresponding to the branch attribute, the sample dataset is divided into several subsets. Based on the selected branch attribute, the sample dataset is divided into different subsets, each subset corresponding to a different fuzzy interval of the branch attribute.
[0090] Step S142: For each target subset, if it is determined whether all output data in the target subset belong to the same fuzzy interval of the same output attribute, or if the number of data in the target subset is less than a preset number threshold, the target subset is treated as a leaf node, and the average value of the output attribute of the sample data in the target subset is used as the output value of the leaf node; the training of the decision tree model is completed until all sample data are assigned to leaf nodes or the stopping condition is met.
[0091] In this embodiment, for each target subset, it is checked whether all output data within it belong to the same fuzzy interval of the same output attribute. If so, the target subset is designated as a leaf node, and the fuzzy interval of the output attribute is used as the output value of the leaf node. If the number of data points in the target subset is less than a preset threshold, the target subset is designated as a leaf node, and the average value of the output attribute of the sample data in the target subset is used as the output value of the leaf node. If the number of data points in the target subset is greater than the preset threshold, and the output data within it do not all belong to the same fuzzy interval of the same output attribute, the target subset is designated as an intermediate node, and the subset is further divided until a stopping condition is met. This process is repeated until all sample data are assigned to leaf nodes, or the stopping condition is met, thus completing the training of the decision tree model.
[0092] In some embodiments, each fuzzy rule includes a premise part and a conclusion part, wherein the premise part includes fuzzy logical connections of all branch attributes and split points on the path, and the conclusion part includes the comfort level of the leaf nodes on the path.
[0093] For example, the premise of a fuzzy rule could be "If the current temperature is 15°C and the humidity is 35%, then...". Here, "temperature" and "humidity" are branch attributes, "15°C" and "is 35%" are dividing points, and the logical connection can be "AND", "OR", etc. The conclusion typically consists of the comfort levels of the leaf nodes along the path. For example, the conclusion of a fuzzy rule could be "Then the comfort level is very comfortable". Here, "very comfortable" is the output value of the leaf node, indicating that based on the conditions in the premise, the comfort level of the sample data is determined to be "very comfortable".
[0094] In this embodiment, these fuzzy rules can be used for fuzzy inference, that is, to derive the corresponding output result based on the fuzzy membership function of the input data. The process of fuzzy inference typically includes steps such as fuzzification, rule matching, rule evaluation, and defuzzification.
[0095] In this embodiment of the application, step S3 can be implemented through the following steps:
[0096] Step S31: Calculate the truth value of the premise part of each fuzzy rule based on the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity, and determine the truth value as the weight of each fuzzy rule.
[0097] In this embodiment, fuzzy logic operations (such as fuzzy AND and OR operations) can be used to calculate the truth value of each fuzzy rule premise based on fuzzy numerical values of temperature and humidity. These truth values represent the degree to which each rule condition is satisfied.
[0098] In this embodiment, the truth value of the premise is used as the weight of each fuzzy rule. A higher truth value usually corresponds to a stronger weight, indicating that the condition corresponding to that rule is more satisfied.
[0099] Step S32: Determine the candidate comfort level corresponding to each fuzzy rule based on the conclusion part of each fuzzy rule.
[0100] In this embodiment, candidate comfort levels are determined based on the conclusion portion of each fuzzy rule. These candidate comfort levels can be fuzzy numerical values or fuzzy sets, representing the possible comfort levels under the given rule.
[0101] Step S33: Determine the comfort level of each fuzzy rule based on the candidate comfort level and the weight of each fuzzy rule.
[0102] In this embodiment, based on the candidate comfort levels and weights corresponding to each fuzzy rule, a fuzzy inference method (such as fuzzy weighted averaging) is used to determine the final comfort level for each fuzzy rule. This process considers the weight of each rule and its corresponding candidate comfort level to arrive at the final comfort level result.
[0103] For example, the candidate comfort level corresponding to a fuzzy rule is 3.2, the weight is 0.8, and the comfort level is 0.8 × 3.2 = 2.56.
[0104] In some embodiments, step S4 can be implemented through the following steps:
[0105] Step S41: Sum the comfort levels corresponding to each fuzzy rule to obtain the total value of each comfort level.
[0106] In this embodiment of the application, the comfort levels corresponding to each fuzzy rule can be summed to obtain the total value of each comfort level.
[0107] Step S42: Determine the maximum value among the total values of all comfort levels.
[0108] In this embodiment, the maximum value is found among all the total comfort values, and this value corresponds to the final comfort result.
[0109] Step S43: Determine the membership degree of comfort based on the maximum value.
[0110] In this embodiment, the comfort level corresponding to the maximum value is taken as the output result, and its membership degree can be determined using a membership function. The membership function is usually a fuzzy set that represents the degree of membership of the output result.
[0111] In some embodiments, step S5 can be implemented through the following steps:
[0112] Step S51: Determine the fuzzy interval corresponding to the target humidity and the fuzzy interval corresponding to the target temperature based on the membership degree.
[0113] In this embodiment, fuzzy inference can be used to determine the fuzzy interval corresponding to the target humidity. This fuzzy interval can be a fuzzy set describing the range of values for the target humidity. For example, fuzzy sets of shapes such as triangles or trapezoids can be used to describe the fuzzy interval of the target humidity.
[0114] Step S52: Determine the target temperature and target humidity based on the fuzzy interval corresponding to the target humidity and the fuzzy interval corresponding to the target temperature.
[0115] In this embodiment, fuzzy inference can be used to determine the fuzzy interval corresponding to the target temperature. This fuzzy interval can also be a fuzzy set, describing the range of values for the target temperature.
[0116] In this embodiment of the application, by determining the fuzzy intervals corresponding to the target humidity and target temperature, we can better understand the fuzzy nature of the output results, and thus better apply them to the control system or decision-making process.
[0117] Step S6 can be achieved through the following steps:
[0118] Step S61: Determine the temperature difference based on the temperature and the target temperature, and determine the humidity difference based on the humidity and the target humidity.
[0119] In this embodiment, the temperature difference can be determined by the difference between the current temperature and the target temperature. For example, if the current temperature is T_cur and the target temperature is T_target, the temperature difference can be expressed as ΔT = T_target - T_cur.
[0120] In this embodiment, the humidity difference can be determined by the difference between the current humidity and the target humidity. For example, if the current humidity is H_cur and the target humidity is H_target, the humidity difference can be expressed as ΔH = H_target - H_cur.
[0121] Step S62: Control the working state of the temperature regulating device based on the temperature difference, and control the working state of the humidity regulating device based on the humidity difference.
[0122] In this embodiment, based on the determined temperature difference ΔT and humidity difference ΔH, a control algorithm can be designed to determine the operating state of the temperature and humidity control devices. For example, if the temperature difference ΔT is greater than 0, the cooling device can be activated; if the temperature difference ΔT is less than 0, the heating device can be activated. Similarly, the operating state of the humidification or dehumidification device can be controlled based on the sign of the humidity difference ΔH.
[0123] Based on the foregoing embodiments, this application further provides a control method. Figure 2 This is a schematic diagram illustrating the implementation flow of a control method provided in an embodiment of this application, as shown below. Figure 2 As shown, it includes:
[0124] A temperature and humidity control method based on fuzzy decision trees, the method comprising the following steps:
[0125] Step 1: Collect indoor temperature and humidity data, as well as human comfort assessments, and convert them into fuzzy values;
[0126] Step 2: Using the FIDT fuzzy decision tree algorithm, with temperature and humidity as input attributes and comfort as the output attribute, a decision tree model is established.
[0127] Step 3: Convert the generated decision tree into a set of fuzzy rules. Calculate the membership degree of each comfort level based on the current temperature and humidity, and then select the one with the highest membership degree as the final decision result.
[0128] Step four: Based on this result, adjust the air conditioner or humidifier to achieve the optimal comfort level of indoor temperature and humidity.
[0129] In this embodiment of the application, the specific method for converting indoor temperature and humidity data, as well as human comfort evaluation, into fuzzy numerical values is as follows:
[0130] The indoor temperature is divided into three fuzzy intervals: low, medium, and high, corresponding to 0–18℃, 18–26℃, and 26–40℃, respectively. A triangular fuzzy membership function is defined for each fuzzy interval.
[0131] Indoor humidity is divided into three fuzzy intervals: dry, suitable, and humid, corresponding to 0-40%, 40-60%, and 60-100%, respectively. A triangular fuzzy membership function is defined for each fuzzy interval.
[0132] The evaluation of human comfort is divided into three fuzzy intervals: uncomfortable, average, and comfortable, corresponding to 1-3 points, 3-6 points, and 6-9 points, respectively. 1 point represents very uncomfortable and 9 points represent very comfortable. A fuzzy membership function of a triangle is defined for each fuzzy interval.
[0133] Indoor temperature and humidity data, as well as human comfort evaluations, can be obtained based on actual measurements or questionnaires. Then, based on the corresponding fuzzy membership function, the fuzzy value corresponding to each data point can be calculated as the input and output data of the fuzzy decision tree.
[0134] In this embodiment of the application, the specific method for establishing a decision tree model using the FIDT fuzzy decision tree algorithm, with temperature and humidity as input attributes and comfort as the output attribute, includes:
[0135] Starting from the root node, calculate the fuzzy entropy of each input attribute, select the attribute with the smallest fuzzy entropy as the branch attribute, and then divide the dataset into several subsets according to the fuzzy interval of the attribute; (b) For each subset, if all the data in the subset belong to the same fuzzy interval of the output attribute, or the number of data in the subset is less than a preset threshold, or the preset tree depth is reached, then the subset is taken as a leaf node, and the average value of the output attribute of the data in the subset is taken as the output value of the leaf node; otherwise, repeat step (a) to continue generating subtrees; (c) Repeat step (b) until all the data are assigned to leaf nodes, or the stopping condition is met, and the generation of the decision tree is completed.
[0136] In this embodiment of the application, the specific method for converting the generated decision tree into a set of fuzzy rules, calculating the membership degree of each comfort level based on the current temperature and humidity, and then selecting the one with the largest membership degree as the final decision result includes:
[0137] Starting from the root node, a fuzzy rule is generated along each path of the decision tree. The premise of the rule is the fuzzy logical connection of all branch attributes and split points on the path, and the conclusion of the rule is the output value of the leaf node on the path. For example, if the temperature is low and the humidity is dry, then the comfort level is 3.2.
[0138] Based on the current temperature and humidity, the truth value of the premise part of each fuzzy rule is calculated as the weight of the rule. Then, based on the conclusion part of each fuzzy rule, the membership degree of each comfort level is calculated as the candidate value of that comfort level. For example, if the current temperature is 15℃ and the humidity is 35%, then the weight of the rule "If the temperature is low and the humidity is dry, then the comfort level is 3.2" is 0.8, and the candidate value of the comfort level is 0.8 × 3.2 = 2.56.
[0139] For each comfort level, sum all candidate values to obtain the total membership degree of that comfort level. Then, select the comfort level with the largest total membership degree as the final decision result. For example, if the total membership degree of uncomfortable is 5.6, the total membership degree of normal is 4.2, and the total membership degree of comfortable is 3.8, then the final decision result is uncomfortable.
[0140] In this embodiment, based on the final decision result, a fuzzy range of the target temperature and humidity is determined. For example, if the final decision result is comfortable, then the target temperature is moderate and the target humidity is suitable. Based on the fuzzy range of the target temperature and humidity, the specific values of the target temperature and humidity are calculated. For example, if the target temperature is moderate and the target humidity is suitable, then the target temperature is 22°C and the target humidity is 50%. Based on the difference between the current temperature and humidity and the target temperature and humidity, the working state of devices such as air conditioners or humidifiers is adjusted so that the indoor temperature and humidity gradually approach the target temperature and humidity. For example, if the current temperature is 15°C and the humidity is 35%, and the target temperature is 22°C and the humidity is 50%, then the air conditioner should turn on the heating mode and the humidifier should turn on the humidification mode until the indoor temperature and humidity reach the target temperature and humidity.
[0141] The method provided in this application uses a fuzzy decision tree (FIDT) to transform and process target temperature and humidity according to fuzzy rules, thereby adjusting the temperature and humidity to the target values. It can handle uncertain and fuzzy data, improve the accuracy and efficiency of temperature and humidity control, improve human comfort and health, and can explain the control rules and principles.
[0142] Based on the foregoing embodiments, this application provides a control device. The modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0143] This application provides a control device, including:
[0144] The acquisition module is used to acquire the current indoor temperature and humidity.
[0145] The first determining module is used to determine the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity;
[0146] The second determining module is used to input the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule.
[0147] The third determining module is used to determine the membership degree of comfort based on the comfort corresponding to each fuzzy rule;
[0148] The fourth determining module is used to determine the target temperature and target humidity based on the membership degree;
[0149] The control module is used to control the working state of the target device based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
[0150] In some embodiments, the control device is further configured to:
[0151] Obtain indoor sample temperature, sample humidity, and corresponding sample comfort level;
[0152] Determine the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample.
[0153] The sample dataset is determined based on the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample.
[0154] The decision tree model is obtained by training based on the sample dataset.
[0155] The decision tree model is then transformed to obtain fuzzy rules.
[0156] In some embodiments, the fuzzy values corresponding to the sample temperature and the fuzzy values corresponding to the sample humidity are input attributes during training, and the fuzzy value corresponding to the sample comfort is the output attribute during training. The step of training the decision tree model based on the sample dataset includes:
[0157] Calculate the fuzzy entropy of each input attribute, select the input attribute with the smallest fuzzy entropy as the branch attribute, and divide the sample dataset into several subsets according to the fuzzy intervals corresponding to the branch attributes.
[0158] For each target subset, if it is determined whether all output data in the target subset belong to the same fuzzy interval of the same output attribute, or if the number of data in the target subset is less than a preset threshold, the target subset is treated as a leaf node, and the average value of the output attribute of the sample data in the target subset is used as the output value of the leaf node; the training of the decision tree model is completed until all sample data are assigned to leaf nodes, or the stopping condition is met.
[0159] In some embodiments, each fuzzy rule includes a premise part and a conclusion part. The premise part includes fuzzy logical connections of all branch attributes and split points on the path. The conclusion part includes the comfort level of the leaf nodes on the path. The step of inputting the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule includes:
[0160] The truth value of the premise part of each fuzzy rule is calculated based on the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity, and the truth value is determined as the weight of each fuzzy rule.
[0161] The candidate comfort level corresponding to each fuzzy rule is determined based on the conclusion part of each fuzzy rule.
[0162] The comfort level of each fuzzy rule is determined based on the candidate comfort level and the weight of each fuzzy rule.
[0163] In some embodiments, determining the membership degree of comfort based on the comfort degree corresponding to each fuzzy rule includes:
[0164] The comfort levels corresponding to each fuzzy rule are summed to obtain the total value of each comfort level.
[0165] Determine the maximum value among the total values for all comfort levels;
[0166] The membership degree of comfort is determined based on the maximum value.
[0167] In some embodiments, determining the target temperature and target humidity based on the membership degree includes:
[0168] Based on the membership degree, determine the fuzzy interval corresponding to the target humidity and the fuzzy interval corresponding to the target temperature;
[0169] The target temperature and target humidity are determined based on the fuzzy intervals corresponding to the target humidity and the target temperature.
[0170] In some embodiments, controlling the operating state of the target device based on the target temperature and target humidity includes:
[0171] The temperature difference is determined based on the stated temperature and the target temperature, and the humidity difference is determined based on the stated humidity and the target humidity.
[0172] The temperature control device's operating status is controlled based on the temperature difference, and the humidity control device's operating status is controlled based on the humidity difference.
[0173] It should be noted that, in the embodiments of this application, if the above-described control method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0174] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements the steps in the control method provided in the above embodiments.
[0175] This application provides an electronic device. Figure 3 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application, such as... Figure 3 As shown, the electronic device 500 includes: a processor 501, at least one communication bus 502, a user interface 503, at least one external communication interface 504, and a memory 505. The communication bus 502 is configured to enable communication between these components. The user interface 503 may include a display screen, and the external communication interface 504 may include standard wired and wireless interfaces. The processor 501 is configured to execute a program of a control method stored in the memory to implement the steps of the control method provided in the above embodiment.
[0176] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0177] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0178] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0179] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the controlled or discussed components can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical, or other forms.
[0180] The units described above as separate components may or may not be physically separate. The components controlled by the units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0181] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0182] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0183] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a controller to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks. The above are merely embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A control method, characterized in that, include: Obtain the current indoor temperature and humidity; Determine the fuzzy value corresponding to the temperature, and determine the fuzzy value corresponding to the humidity; The fuzzy values corresponding to the temperature and humidity are input into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule. The determination of the comfort level corresponding to each fuzzy rule includes: The truth value of the premise part of each fuzzy rule is calculated based on the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity, and the truth value is determined as the weight of each fuzzy rule. The candidate comfort level corresponding to each fuzzy rule is determined based on the conclusion part of each fuzzy rule. Based on the candidate comfort level and the weight of each fuzzy rule, the comfort level of each fuzzy rule is determined. The membership degree of comfort is determined based on the comfort level corresponding to each fuzzy rule; The step of determining the membership degree of comfort based on the comfort degree corresponding to each fuzzy rule includes: The comfort levels corresponding to each fuzzy rule are summed to obtain the total value of each comfort level. Determine the maximum value among the total values of all comfort levels; The membership degree of comfort is determined based on the maximum value; The target temperature and target humidity are determined based on the membership degree. The operating state of the target device is controlled based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
2. The method according to claim 1, characterized in that, The method further includes: Obtain indoor sample temperature, sample humidity, and corresponding sample comfort level; Determine the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample. The sample dataset is determined based on the fuzzy values corresponding to the temperature, humidity, and comfort levels of each sample. A decision tree model is obtained by training based on the aforementioned sample dataset; The decision tree model is then transformed to obtain fuzzy rules.
3. The method according to claim 2, characterized in that, The fuzzy values corresponding to the sample temperature and the sample humidity are the input attributes during training, and the fuzzy value corresponding to the sample comfort is the output attribute during training. The process of training the decision tree model based on the sample dataset includes: Calculate the fuzzy entropy of each input attribute, select the input attribute with the smallest fuzzy entropy as the branch attribute, and divide the sample dataset into several subsets according to the fuzzy intervals corresponding to the branch attributes. For each target subset, if it is determined whether all output data in the target subset belong to the same fuzzy interval of the same output attribute, or if the number of data in the target subset is less than a preset threshold, the target subset is treated as a leaf node, and the average value of the output attribute of the sample data in the target subset is used as the output value of the leaf node; the training of the decision tree model is completed until all sample data are assigned to leaf nodes, or the stopping condition is met.
4. The method according to claim 3, characterized in that, Each fuzzy rule includes a premise part and a conclusion part. The premise part includes the fuzzy logical connections of all branch attributes and split points on the path, and the conclusion part includes the comfort level of the leaf nodes on the path.
5. The method according to claim 1, characterized in that, The determination of target temperature and target humidity based on the membership degree includes: Based on the membership degree, determine the fuzzy interval corresponding to the target humidity and the fuzzy interval corresponding to the target temperature; The target temperature and target humidity are determined based on the fuzzy intervals corresponding to the target humidity and the target temperature.
6. The method according to claim 1, characterized in that, The method of controlling the operating status of the target device based on the target temperature and target humidity includes: The temperature difference is determined based on the stated temperature and the target temperature, and the humidity difference is determined based on the stated humidity and the target humidity. The temperature control device's operating status is controlled based on the temperature difference, and the humidity control device's operating status is controlled based on the humidity difference.
7. A control device, characterized in that, include: The acquisition module is used to acquire the current indoor temperature and humidity. The first determining module is used to determine the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity; The second determining module is used to input the fuzzy values corresponding to the temperature and the fuzzy values corresponding to the humidity into the pre-established fuzzy rules to determine the comfort level corresponding to each fuzzy rule. The step of determining the comfort level corresponding to each fuzzy rule includes: calculating the truth value of the premise part of each fuzzy rule based on the fuzzy value corresponding to the temperature and the fuzzy value corresponding to the humidity, and determining the truth value as the weight of each fuzzy rule; determining the candidate comfort level corresponding to each fuzzy rule based on the conclusion part of each fuzzy rule; and determining the comfort level corresponding to each fuzzy rule based on the candidate comfort level and the weight of each fuzzy rule. The third determining module is used to determine the membership degree of comfort based on the comfort corresponding to each fuzzy rule; wherein, determining the membership degree of comfort based on the comfort corresponding to each fuzzy rule includes: summing the comfort corresponding to each fuzzy rule to obtain the total value of each comfort; determining the maximum value among the total values of each comfort; and determining the membership degree of comfort based on the maximum value. The fourth determining module is used to determine the target temperature and target humidity based on the membership degree; The control module is used to control the working state of the target device based on the target temperature and target humidity, so that the difference between the indoor temperature and the target humidity is less than a first difference threshold, and the difference between the indoor humidity and the target humidity is less than a second difference threshold.
8. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, performs the control method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The computer program stored in the storage medium can be executed by one or more processors and can be used to implement the control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Detection and classification of process flaws using fuzzy logic
CN103843015A
On-line sequence data prediction method and device
CN108898214A