PID temperature control method and device, computer equipment and medium
By constructing and training candidate fuzzy neural networks, the change of PID control parameters is generated, and the nonlinearity and hysteresis problems in server temperature control are solved, and the robustness and efficiency of temperature control are improved.
Patent Information
- Application Number
- CN202410981409.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-12
AI Technical Summary
There are nonlinearity and hysteresis in the server temperature control process, making it difficult to determine appropriate PID control parameters, resulting in low temperature control efficiency and insufficient system robustness.
By obtaining the parameters to be adjusted in the initial fuzzy neural network, using genetic algorithms to generate candidate parameters, construct candidate fuzzy neural network, and iterative training through sample data sets, the change of PID control parameters is generated to adjust the PID control parameters, real-time temperature control is achieved .
It improves the robustness, fault tolerance and adaptability of the PID temperature control system, and enhances the effect of nonlinear and hysteresis server temperature control.
Smart Images

Figure CN118939027A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic control technology, and in particular to a PID temperature control method, device, computer equipment and medium. Background Art
[0002] With the rapid development of computer technology, the amount of data accumulated is getting larger and larger. Servers need to process massive amounts of data every day. However, the large server load will cause the server temperature to rise, and the internal components cannot run smoothly, which reduces the operating efficiency of the server.
[0003] In order to keep the server at normal operating temperature as much as possible, PID (proportional-integral-derivative) can generally be used to control the temperature. In the PID temperature control process, the temperature control system is adjusted according to the difference between the actual temperature and the set temperature by processing the signal collected by the temperature sensor, thereby maintaining the temperature of the server at a constant and safe level.
[0004] However, the server temperature control process has nonlinearity and hysteresis, making it difficult to determine appropriate PID control parameters. Summary of the invention
[0005] In view of this, the present invention provides a PID temperature control method, device, computer equipment and medium to solve the problem that the server temperature control process has nonlinearity and hysteresis and it is difficult to determine appropriate PID control parameters.
[0006] In a first aspect, the present invention provides a PID temperature control method, the method comprising:
[0007] Obtaining the parameters to be adjusted in the initial fuzzy neural network;
[0008] Based on the parameters to be adjusted, generating N groups of first candidate parameters by genetic algorithm; N ≥ 2, and N is a positive integer;
[0009] The N groups of first candidate parameters replace the parameters to be adjusted in the initial fuzzy neural network, and construct N candidate fuzzy neural networks respectively;
[0010] Iteratively train N candidate fuzzy neural networks respectively through sample data sets, and if during the iterative training process, the objective function value of a candidate fuzzy neural network satisfies the training conditions, the candidate fuzzy neural network that satisfies the training conditions is obtained as the target fuzzy neural network; the sample data sets include sample temperature data and annotated changes of control parameters;
[0011] The target fuzzy neural network is used to process the difference between the acquired first temperature and the target preset temperature, generate a change in the PID control parameter to adjust the PID control parameter; the PID control parameter is used to instruct the PID controller to perform temperature control based on the difference between the first temperature and the target preset temperature.
[0012] A PID temperature control method provided by the present invention has the following advantages:
[0013] Before performing PID temperature control, the computer device can first obtain the initialization structure of the target fuzzy neural network model for adjusting the PID control parameters, that is, the initial fuzzy neural network model, and determine the parameters to be adjusted therein; at this time, the computer device then performs operations such as replication, crossover, and mutation on the parameters to be adjusted based on a genetic algorithm, and selects N groups of first candidate parameters in the global parameter space; at this time, the computer device can replace the N groups of first candidate parameters with the parameters to be adjusted in the initial fuzzy neural network, thereby constructing N candidate fuzzy neural networks; after constructing the N candidate fuzzy neural networks, the computer device uses a sample data set including sample temperature data and annotated changes in control parameters to iteratively train the N candidate fuzzy neural networks, respectively, in the hope of training a fuzzy neural network that can be used to predict the changes in PID control parameters based on temperature data. During the iterative training process, if the computer device detects that the objective function value in the training process, that is, the difference between the predicted change of the control parameter and the marked change of the control parameter meets the training conditions, it means that at this time there is a candidate fuzzy neural network whose training effect meets expectations. The computer device can directly use the candidate fuzzy neural network that meets the training conditions as the target fuzzy neural network to predict the change of the control parameters of the PID, so as to adjust the control parameters of the PID in real time during the PID temperature control process, so that the PID temperature control process has the advantages of fuzzy control, and the PID control system has stronger robustness, fault tolerance and adaptability, which improves the temperature control effect when facing a server temperature control process with nonlinearity and hysteresis.
[0014] In an optional embodiment, the method further includes:
[0015] If there is no candidate fuzzy neural network whose objective function value satisfies the training condition, at least one processing process is performed until the processing condition is satisfied, and the processing process includes:
[0016] Based on the N candidate parameters to be adjusted of the fuzzy neural network after iterative training, N groups of second candidate parameters are generated by genetic algorithm;
[0017] Based on the N groups of the second candidate parameters, respectively updating the parameters to be adjusted of the N candidate fuzzy neural networks;
[0018] The N candidate fuzzy neural networks are iteratively trained using sample data sets.
[0019] Specifically, when there is no objective function value of the candidate fuzzy neural network that meets the training conditions during the iterative training process, the genetic algorithm can be used to copy, cross, mutate, and other processes on the parameters to be adjusted of the N candidate fuzzy neural networks after the iterative training, so that the parameters to be adjusted after the local space parameter optimization is achieved by the back propagation algorithm can be updated again in the global space. At this time, the updated parameters to be adjusted of the N candidate fuzzy neural networks have more optimization possibilities than before the update, which increases the possibility of obtaining a candidate fuzzy neural network that meets the training conditions through subsequent iterative training.
[0020] In an optional embodiment, the processing condition is that there exists an objective function value of the trained candidate fuzzy neural network that is less than an error threshold;
[0021] Alternatively, the processing procedure is executed a certain number of times, reaching a certain number threshold.
[0022] In an optional embodiment, the method further includes:
[0023] If the number of executions of the processing procedure reaches a threshold number, the candidate fuzzy neural network with the smallest objective function value among the N candidate fuzzy neural networks after iterative training is selected as the target fuzzy neural network.
[0024] If the number of executions of the genetic algorithm also reaches the threshold, it means that the update degree of the candidate fuzzy neural network through the genetic algorithm and the back propagation algorithm has reached the upper limit. Continuing the optimization will not only make it difficult to find a target fuzzy neural network that meets the requirements, but also easily produce adverse effects such as overfitting. At this time, the candidate fuzzy neural network with the smallest objective function value in the iterative training process can be directly used as the target fuzzy neural network.
[0025] In an optional implementation, the parameters to be adjusted based on the trained N candidate fuzzy neural networks are generated by a genetic algorithm with N groups of second candidate parameters, including:
[0026] The parameters to be adjusted of the N candidate fuzzy neural networks after training are obtained as N groups of individuals; each group of individuals includes at least two chromosomes; the chromosomes are vector representations of the parameters to be adjusted;
[0027] Determine the target replication probability based on the sum of the fitness of N groups of individuals; the fitness is used to indicate the value of the objective function of the candidate fuzzy neural network corresponding to the individual during the training process;
[0028] Based on the target replication probability, the N groups of individuals are selectively replicated to generate N groups of first candidate individuals;
[0029] Determine the crossover probability set based on the maximum fitness values of N groups of the first candidate individuals and the fitness values of any two groups of the first candidate individuals; the crossover probability set includes the crossover probability between any two groups of the first candidate individuals;
[0030] Based on the crossover probability set, performing a crossover operation on the N groups of the first candidate individuals by a crossover operator to obtain N groups of second candidate individuals;
[0031] Determine the mutation probability of the N second candidate individuals based on the maximum value of the fitness of the N groups of the second candidate individuals, the average value of the fitness of the N groups of the second candidate individuals, and the fitness of the N second candidate individuals;
[0032] Based on the mutation probabilities of the N second candidate individuals, the N second candidate individuals are updated respectively by using a mutation operator to obtain N groups of the second candidate parameters.
[0033] In an optional implementation, the generating N groups of first candidate parameters by using a genetic algorithm based on the parameters to be adjusted includes:
[0034] Get the initialization parameters of the genetic algorithm;
[0035] Based on the initialization parameters, the parameters to be adjusted are taken as initial individuals and processed by a genetic algorithm to obtain N groups of the first candidate parameters.
[0036] In an optional implementation, the iterative training of N candidate fuzzy neural networks respectively using the sample data sets includes:
[0037] Perform at least one training process until the number of training times reaches a maximum number of iterations or the objective function value of a candidate fuzzy neural network is less than an error threshold;
[0038] The training process includes:
[0039] Select sample temperature data from the sample data set and annotate the change in control parameters;
[0040] Processing the sample temperature data through N candidate fuzzy neural networks respectively to obtain N prediction results;
[0041] Based on the change in the marked control parameter and the N prediction results, obtaining objective function values of N candidate fuzzy neural networks;
[0042] If the objective function values of the N candidate fuzzy neural networks are not less than the error threshold, then determining whether the number of training times is less than the maximum number of iterations;
[0043] If the number of training times is less than the maximum number of iterations, back-propagation updates are performed on the parameters to be adjusted of the N candidate fuzzy neural networks respectively based on the objective function values of the N candidate fuzzy neural networks.
[0044] In a second aspect, the present invention provides a PID temperature control device, the device comprising:
[0045] A module for obtaining parameters to be adjusted, used for obtaining parameters to be adjusted in the initial fuzzy neural network;
[0046] A genetic algorithm processing module, used to generate N groups of first candidate parameters through a genetic algorithm based on the parameters to be adjusted; N ≥ 2, and N is a positive integer;
[0047] A model building module, used to replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, and to build N candidate fuzzy neural networks respectively;
[0048] A model training module is used to iteratively train N candidate fuzzy neural networks respectively through sample data sets. If during the iterative training process, there is a candidate fuzzy neural network whose objective function value meets the training conditions, the candidate fuzzy neural network that meets the training conditions is obtained as the target fuzzy neural network; the sample data set includes sample temperature data and annotated changes in control parameters;
[0049] The target fuzzy neural network is used to process the difference between the acquired first temperature and the target preset temperature, generate a change in the PID control parameter to adjust the PID control parameter; the PID control parameter is used to instruct the PID controller to perform temperature control based on the difference between the first temperature and the target preset temperature.
[0050] A PID temperature control device provided by the present invention has the following advantages:
[0051] Before performing PID temperature control, the computer device can first obtain the initialization structure of the target fuzzy neural network model for adjusting the PID control parameters, that is, the initial fuzzy neural network model, and determine the parameters to be adjusted therein; at this time, the computer device then performs operations such as replication, crossover, and mutation on the parameters to be adjusted based on a genetic algorithm, and selects N groups of first candidate parameters in the global parameter space; at this time, the computer device can replace the N groups of first candidate parameters with the parameters to be adjusted in the initial fuzzy neural network, thereby constructing N candidate fuzzy neural networks; after constructing the N candidate fuzzy neural networks, the computer device uses a sample data set including sample temperature data and annotated changes in control parameters to iteratively train the N candidate fuzzy neural networks, respectively, in the hope of training a fuzzy neural network that can be used to predict the changes in PID control parameters based on temperature data. During the iterative training process, if the computer device detects that the objective function value in the training process, that is, the difference between the predicted change of the control parameter and the marked change of the control parameter meets the training conditions, it means that at this time there is a candidate fuzzy neural network whose training effect meets expectations. The computer device can directly use the candidate fuzzy neural network that meets the training conditions as the target fuzzy neural network to predict the change of the control parameters of the PID, so as to adjust the control parameters of the PID in real time during the PID temperature control process, so that the PID temperature control process has the advantages of fuzzy control, and the PID control system has stronger robustness, fault tolerance and adaptability, which improves the temperature control effect when facing a server temperature control process with nonlinearity and hysteresis.
[0052] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the PID temperature control method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0053] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the PID temperature control method of the first aspect or any corresponding embodiment thereof.
[0054] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the PID temperature control method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 is a schematic structural diagram of a temperature control system provided by an embodiment of the present invention;
[0057] Figure 2 It is a flow chart of a PID temperature control method provided by an embodiment of the present invention;
[0058] Figure 3 A network architecture diagram of a fuzzy neural network involved in an embodiment of the present invention is shown;
[0059] Figure 4 It is a flow chart of another PID temperature control method provided by an embodiment of the present invention;
[0060] Figure 5 A flow chart of optimizing the node parameters of a neural network set using a GA-BP hybrid algorithm according to an embodiment of the present invention is shown;
[0061] Figure 6 A structural block diagram of an online training and offline control system involved in an embodiment of the present invention is shown;
[0062] Figure 7 is a structural block diagram of a PID temperature control device according to an embodiment of the present invention;
[0063] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0065] With the rapid development of computer technology, the amount of data accumulated is increasing. Servers need to process massive amounts of data every day, and the large server load will cause the server temperature to rise. The temperature rise of the server can easily cause the internal components to fail to operate smoothly, which in turn leads to a decrease in the server's work efficiency, thus creating a vicious cycle and seriously affecting the server's processing efficiency. In addition, if the server is in an overloaded state for a long time, it will also lead to huge energy consumption. Therefore, there is an urgent need for a method to efficiently control the temperature of the server.
[0066] At present, the PID algorithm can usually be used for temperature control, that is, the PID controller processes the signal collected by the temperature sensor by setting certain PID control parameters (proportional parameter, integral parameter and differential parameter), so as to adjust the temperature control system according to the difference between the actual temperature and the set temperature, thereby maintaining the temperature of the server at a constant and safe level. However, in the field of server temperature control, the temperature change of the server is nonlinear and hysteretic, the error of the PID control algorithm is large, and it is difficult to find suitable PID parameters. Fuzzy control can be effectively applied to the control of nonlinear systems, so fuzzy control can be applied to PID parameter determination, so as to find suitable PID parameters to achieve PID temperature control. However, the establishment process of the fuzzy control system is very complicated. Different fuzzy controllers need to be designed for different PID temperature control systems, which is very inefficient.
[0067] To solve the above problems, the embodiment of the present invention trains a suitable target fuzzy neural network and determines the PID control parameters through the target fuzzy neural network. It should be noted that the steps shown in the present application can be executed in a temperature control system including a set of computer executable instructions, and although the logical order is shown in the flow chart, in some cases, the steps shown or described can be executed in a different order than that here.
[0068] Figure 1 Schematic diagram of a temperature control system provided by an embodiment of the present invention. Figure 1 As shown, the system includes a target terminal 110 and a target server 120 .
[0069] Optionally, the target terminal may be a PC (Personal Computer), a tablet computer, a mobile phone, or other terminal devices on which control software can be deployed.
[0070] Optionally, control software can be deployed on the target terminal, so that it can serve as a PID controller in the temperature control system. The target terminal can obtain temperature data collected by the temperature controller in real time, and generate corresponding control instructions according to PID control parameters and send them to the temperature control device, thereby realizing temperature control.
[0071] Optionally, the target terminal 110 may be a computer device with high computing power, on which the target fuzzy neural network in the present application may be deployed, and the temperature data collected in real time by the temperature controller may be processed by the target fuzzy neural network to generate appropriate PID control parameters.
[0072] Optionally, the target terminal 110 may also be connected to a PID controller for communication, thereby sending the generated PID control parameters to the PID controller, so that the PID controller controls the server that needs to control the temperature based on the PID control parameters.
[0073] Optionally, the target fuzzy neural network in the present application can also be trained in the target server 120. After the target server 120 completes the training of the target fuzzy neural network, the trained target fuzzy neural network can be sent to the target terminal 110 and deployed in the target terminal 110 for subsequent PID temperature control operations.
[0074] Optionally, the target server in the present application can be a server that needs to control the temperature, or it can be other servers, that is, the present application can use a smaller server as the target server to carry out the training process of the target fuzzy neural network, and then use the trained target fuzzy neural network to control the temperature of the server with a heavier load.
[0075] In this embodiment, a PID temperature control method is provided, which can be used for the target terminal 110 or the target server 120. Figure 2 is a flow chart of a PID temperature control method provided by an embodiment of the present invention, such as Figure 2 As shown, the method comprises the following steps:
[0076] Step S201, obtaining the parameters to be adjusted in the initial fuzzy neural network.
[0077] Figure 3 FIG. 1 shows a network architecture diagram of a fuzzy neural network involved in an embodiment of the present invention. Figure 3 As shown, in the fuzzy neural network, the first layer is the output layer, the second layer is the antecedent layer, the third layer is the consequent layer, the fourth layer is the normalization layer, and the fifth layer is the output layer.
[0078] exist Figure 3 The square nodes are adaptive nodes with parameters to be adjusted, the circular nodes are fixed nodes with unchanged parameters, and the connection weights between neurons in adjacent layers are all 1. Suppose the input of a single node in the nth layer is I (n) , output is O (n) 、.
[0079] At this time, the first layer is used to pass the input vector to the next layer. There are two nodes in the first layer, corresponding to the input deviation x1 = e and the input deviation change rate x2 = e c In the embodiment of the present invention, since the application scenario of the trained fuzzy neural network is PID temperature control, the input deviation of the fuzzy neural network should be the deviation between the actual temperature and the set temperature, and the input deviation change rate should be the change rate of the deviation between the actual temperature and the set temperature. The input and output of the first layer can be expressed by the following formula:
[0080]
[0081] Where i is the number of nodes; Represents the input of each node in the first layer; Represents the output of each node in the first layer;
[0082] The function of the second layer is to quantify the membership of each linguistic variable fuzzy set based on the input and membership function. The 14 nodes in this layer represent the 7 linguistic variables of the two inputs, and the input and output of the second layer can be expressed by the following formula:
[0083]
[0084] where μ ij (x i ) is a Gaussian function, representing the membership function of the jth fuzzy set of the i-th variable. ij , σ ij are the center position and width of the membership function respectively. Represents the input of each node in the second layer; Represents the output of each node in the first layer; Represents the output of each node in the second layer.
[0085] Each node in the third layer represents an activated fuzzy rule. At this time, the fuzzy neural network performs logical synthesis on the linguistic variables of the activated rule to quantify the matching degree of the fuzzy rule activation. As the output of the third layer. In this fuzzy neural network, the product synthesis method can be used. There are 49 nodes in this layer, corresponding to 49 rules. The input and output of the third layer can be expressed by the following formula:
[0086]
[0087] in, Represents the output of each node in the second layer; Represents the input of each node in the third layer; Represents the output of each node in the third layer; is the complement of i;
[0088] Each node in the fourth layer is used to normalize the output of the previous layer. The number of nodes is the same as that of the third layer, which is 49 nodes. The input and output of the fourth layer can be expressed by the following formula:
[0089] The fifth layer needs to defuzzify the output of the fourth layer by weighted averaging. Since the fourth layer has been normalized, the fifth layer only needs to determine the output weight ω nk The accurate output value can be calculated. Since the fuzzy neural network in the embodiment of the present invention is used to adjust the PID control parameters, and the PID control parameters include proportional parameters, integral parameters and differential parameters, the fifth layer has three nodes to output the changes of proportional parameters, integral parameters and differential parameters respectively. The input and output of the fifth layer can be expressed by the following formula:
[0090]
[0091] in Represents the input of each node in the fifth layer; Represents the output of each node in the fourth layer; Represents the output of each node in the fourth layer; Y n Corresponding to the change of proportional parameters ΔKp , the change of the integral parameter ΔK i and the change in the differential parameter ΔK d .
[0092] In such Figure 3 In the fuzzy neural network shown in the figure, the parameter to be adjusted is the central position σ of the membership function of the second layer ij and width c ij , and the output weight ω of the fifth layer nk In the embodiment of the present invention, it is necessary to update the parameters to be adjusted in the fuzzy neural network by means of training, so as to obtain appropriate parameters to be adjusted, so that the fuzzy neural network can output appropriate changes in PID control parameters.
[0093] Step S202: Generate N groups of first candidate parameters through a genetic algorithm based on the parameters to be adjusted; N≥2, and N is a positive integer.
[0094] When training fuzzy neural networks, the back propagation algorithm is usually used for processing. However, the back propagation algorithm belongs to the gradient numerical optimization method. Although it has fast convergence speed in the early stage and strong local optimization ability, it requires the objective function to be continuous and first-order differentiable. At the same time, there are inevitably local minima problems, which leads to overfitting.
[0095] Therefore, in the embodiment of the present invention, before the fuzzy neural network is trained by the back propagation algorithm, the initialized parameters to be adjusted in the initial fuzzy neural network can be obtained first, that is, the initialized σ ij 、c ij And ω nk , and construct it into three chromosomes in the genetic algorithm in the form of a vector, thereby constructing an individual in the genetic algorithm.
[0096] At this time, after the genetic algorithm performs operations such as replication, crossover, and mutation on the individuals generated by the parameters to be adjusted, N groups of individuals can be obtained. The three chromosomes in each group of individuals can be used as the parameters to be adjusted σ in the fuzzy neural network. ij 、c ij And ω nk , thus constituting N groups of first candidate parameters.
[0097] Step S203: replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, and construct N candidate fuzzy neural networks respectively.
[0098] In an embodiment of the present invention, after obtaining N groups of first candidate parameters, the N groups of first candidate parameters can replace the parameters to be adjusted in the initial fuzzy neural network model, that is, the parameters to be adjusted in the initial fuzzy neural network model are replaced with the N groups of first candidate parameters respectively, thereby generating N candidate fuzzy neural networks.
[0099] The N groups of first candidate parameters have richer diversity than the parameters to be adjusted in the initial fuzzy neural network model. Therefore, the N candidate fuzzy neural networks also have richer possibilities than the initial fuzzy neural network. Training based on the N candidate fuzzy neural networks makes it easier to obtain suitable model parameters in the global space, and the possibility of obtaining a fuzzy neural network that meets the requirements is also higher.
[0100] Step S204, iteratively training the N candidate fuzzy neural networks respectively through the sample data set, if during the iterative training process, there is a candidate fuzzy neural network whose objective function value meets the training conditions, then the candidate fuzzy neural network that meets the training conditions is obtained as the target fuzzy neural network.
[0101] In an embodiment of the present invention, the sample data set includes sample temperature data and annotated changes in control parameters. Specifically, the sample temperature data includes actual temperature and preset temperature in a continuous time period;
[0102] In a possible implementation of the embodiment of the present invention, the process of iteratively training N candidate fuzzy neural networks using sample data sets is as follows:
[0103] Perform at least one training process until the number of training times reaches a maximum number of iterations or the objective function value of a candidate fuzzy neural network is less than an error threshold;
[0104] The training process includes:
[0105] Select sample temperature data and annotated changes of control parameters in the sample data set;
[0106] The sample temperature data is processed by N candidate fuzzy neural networks respectively to obtain N prediction results;
[0107] Based on the marked change amount of the control parameter and the N prediction results, obtaining the objective function values of the N candidate fuzzy neural networks;
[0108] If the objective function values of the N candidate fuzzy neural networks are not less than the error threshold, then determine whether the number of training times is less than the maximum number of iterations;
[0109] If the number of training times is less than the maximum number of iterations, the parameters to be adjusted of the N candidate fuzzy neural networks are back-propagated and updated respectively based on the objective function values of the N candidate fuzzy neural networks.
[0110] In the embodiment of the present invention, the parameter to be adjusted can be updated by using the BP (Back Propagation) algorithm. The parameter to be adjusted in the fuzzy neural network FNN in the embodiment of the present invention is the center position σ of the membership function of the second layer ij and width c ij , and the output weight ω of the fifth layer nk , at this time, the objective function is defined as the variance E between the expected value of the lth sample output and the actual output value of the network l , the formula is as follows:
[0111]
[0112] Where R n The change in the expected output ratio of the lth group of training data in the training set Mark the integral change Label the differential change The corresponding actual output prediction ratio change ΔK of the neural network p , predicted node change ΔK i , predict differential change ΔK d . Gradient descent method is often used in BP algorithm for numerical optimization. Given a point x k , then the gradient at this point is recorded as Current establishment:
[0113]
[0114] For the above variables to be adjusted, Figure 3 The model shown in the figure gives its gradient calculation formula:
[0115]
[0116] Then x K The update formula is as follows:
[0117]
[0118] Among them, α is the momentum term, is the learning rate.
[0119] At this time, for any candidate fuzzy neural network, the computer device can use the difference between the actual temperature and the preset temperature, and the gradient of the difference between the actual temperature and the preset temperature as two input data of the candidate fuzzy neural network; then the input data is processed in turn through each layer of the candidate fuzzy neural network, and finally the predicted change amount is obtained;
[0120] The computer device then inputs the predicted change and the labeled change of the control parameter into the objective function for processing, and the error between the predicted value of the candidate fuzzy neural network and the sample label can be obtained. After the error is obtained, the model parameters of the candidate fuzzy neural network can be updated through the back propagation algorithm according to the error. The updated candidate fuzzy neural network can be trained through the above process until the maximum number of iterations is reached.
[0121] In an embodiment of the present invention, the objective function value between the predicted value of the candidate fuzzy neural network and the sample label represents the prediction accuracy of the candidate fuzzy neural network at this time. Therefore, in the process of training to the maximum number of iterations, if there is a candidate fuzzy neural network whose objective function value meets the training conditions, for example, it is less than the error threshold, it means that the candidate fuzzy neural network has a good prediction ability for the change of the PID control parameters at this time. Therefore, the training process can be stopped and the candidate fuzzy neural network that meets the training conditions can be directly used as the target fuzzy neural network for subsequent prediction.
[0122] In an embodiment of the present invention, the target fuzzy neural network is used to process the difference between the acquired first temperature and the target preset temperature to generate a change in a PID control parameter to adjust the PID control parameter. The PID control parameter is used to instruct the PID controller to perform temperature control based on the difference between the first temperature and the target preset temperature.
[0123] That is, when the computer device completes the training process of the fuzzy neural network and obtains a target fuzzy neural network that meets the requirements, the computer device can use the target fuzzy neural network to process the difference between the first temperature collected in real time by the temperature sensor and the target preset temperature.
[0124] Specifically, the computer device can use the difference between the first temperature collected by the temperature sensor in real time and the target preset temperature, and the gradient of the difference between the first temperature and the target preset temperature as two inputs of the target fuzzy neural network. Figure 3 The target fuzzy neural network of the architecture is processed to obtain the change of PID control parameters (that is, the change of proportional coefficient, the change of integral coefficient and the change of differential coefficient), so as to update the PID control parameters at the current moment, and the computer equipment then controls the temperature of the server according to the updated PID control parameters.
[0125] In summary, before performing PID temperature control, the computer device can first obtain the initialization structure of the target fuzzy neural network model for adjusting the PID control parameters, that is, the initial fuzzy neural network model, and determine the parameters to be adjusted therein; at this time, the computer device then performs operations such as replication, crossover, and mutation on the parameters to be adjusted based on the genetic algorithm, and selects N groups of first candidate parameters in the global parameter space; at this time, the computer device can replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, respectively, so as to construct N candidate fuzzy neural networks; after constructing the N candidate fuzzy neural networks, the computer device uses a sample data set including sample temperature data and annotated changes in the control parameters to iteratively train the N candidate fuzzy neural networks, respectively, in the hope of training a fuzzy neural network that can be used to predict the changes in the PID control parameters based on the temperature data. During the iterative training process, if the computer device detects that the objective function value in the training process, that is, the difference between the predicted change of the control parameter and the marked change of the control parameter meets the training conditions, it means that at this time there is a candidate fuzzy neural network whose training effect meets expectations. The computer device can directly use the candidate fuzzy neural network that meets the training conditions as the target fuzzy neural network to predict the change of the control parameters of the PID, so as to adjust the control parameters of the PID in real time during the PID temperature control process, so that the PID temperature control process has the advantages of fuzzy control, and the PID control system has stronger robustness, fault tolerance and adaptability, which improves the temperature control effect when facing a server temperature control process with nonlinearity and hysteresis.
[0126] Figure 4 is a flow chart of another PID temperature control method provided by an embodiment of the present invention. The method can be executed by a computer device, and the computer device can be as follows Figure 1 The target terminal 110 or the target server 120 shown in FIG. Figure 4 As shown, the method comprises the following steps:
[0127] Step S401, obtaining the parameters to be adjusted in the initial fuzzy neural network.
[0128] The initial fuzzy neural network in the embodiment of the present invention can also be used as follows Figure 3 The architecture shown in Figure 2, where the parameter to be adjusted is the center position σ of the membership function of the second layer. ij and width c ij , and the output weight ω of the fifth layer nk .
[0129] Step S402, obtaining initialization parameters of the genetic algorithm.
[0130] When the computer device obtains the parameters to be adjusted in the initial fuzzy neural network, the genetic algorithm can be used to expand the possibilities of the parameters to be adjusted in the global space.
[0131] In the embodiment of the present invention, when the computer device obtains the parameters to be adjusted for the first time, the genetic algorithm can be initialized, and the parameters to be adjusted can be processed by the genetic algorithm according to the initialized parameters. Specifically, the initialized parameters of the genetic algorithm can include the initialized replication probability, the initialized crossover probability, the initialized mutation probability, the mutation intensity function, etc.
[0132] Step S403: Based on the initialization parameters, the parameters to be adjusted are used as initial individuals and processed by a genetic algorithm to obtain N groups of the first candidate parameters.
[0133] When the initialization parameters of the genetic algorithm are obtained, the genetic algorithm after the initialization parameters can be used to take the parameters to be adjusted as initial individuals to obtain N groups of individuals. At this time, the N groups of individuals correspond to the N groups of first candidate parameters.
[0134] Step S404: replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, and construct N candidate fuzzy neural networks respectively.
[0135] Step S405, iteratively train the N candidate fuzzy neural networks respectively using the sample data set. If during the iterative training process, there is a candidate fuzzy neural network whose objective function value meets the training conditions, the candidate fuzzy neural network that meets the training conditions is obtained as the target fuzzy neural network.
[0136] The execution process of step S403 to step S405 is similar to that of step S202 to step S204, and the number of times is not repeated.
[0137] Step S406: If there is no candidate fuzzy neural network whose objective function value satisfies the training condition, the processing process is executed at least once until the processing condition is satisfied.
[0138] Specifically, when there is no objective function value of the candidate fuzzy neural network that meets the training conditions during the iterative training process, the genetic algorithm can be used to copy, cross, mutate, and other processes on the parameters to be adjusted of the N candidate fuzzy neural networks after the iterative training, so that the parameters to be adjusted after the local space parameter optimization is achieved by the back propagation algorithm can be updated again in the global space. At this time, the updated parameters to be adjusted of the N candidate fuzzy neural networks have more optimization possibilities than before the update, which increases the possibility of obtaining a candidate fuzzy neural network that meets the training conditions through subsequent iterative training.
[0139] Specifically, the training condition is that the objective function value of the candidate fuzzy neural network is less than an error threshold.
[0140] In a possible implementation of the embodiment of the present invention, the processing includes:
[0141] Step A1, based on the N candidate parameters to be adjusted of the fuzzy neural network after iterative training, generate N groups of second candidate parameters through a genetic algorithm;
[0142] Step A2, based on the N groups of the second candidate parameters, respectively updating the parameters to be adjusted of the N candidate fuzzy neural networks;
[0143] Step A3, iteratively training the N candidate fuzzy neural networks respectively using the sample data set.
[0144] Specifically, the processing process is a genetic algorithm iteration process. If there is no candidate fuzzy neural network whose objective function value meets the training conditions, the genetic algorithm can be used to process the parameters to be adjusted of the N candidate fuzzy neural networks to generate new N groups of individuals, thereby reconstructing the N candidate fuzzy neural networks as N groups of parameters to be adjusted.
[0145] Furthermore, the processing condition is that there exists a candidate fuzzy neural network after training whose objective function value is less than an error threshold;
[0146] Alternatively, the number of executions of the processing procedure reaches a threshold number of times.
[0147] Furthermore, if the number of executions of the processing procedure reaches a threshold number, the candidate fuzzy neural network with the smallest objective function value among the N candidate fuzzy neural networks after iterative training is selected as the target fuzzy neural network.
[0148] If the number of executions of the genetic algorithm also reaches the threshold, it means that the update degree of the candidate fuzzy neural network through the genetic algorithm and the back propagation algorithm has reached the upper limit. Continuing the optimization will not only make it difficult to find a target fuzzy neural network that meets the requirements, but also easily produce adverse effects such as overfitting. At this time, the candidate fuzzy neural network with the smallest objective function value in the iterative training process can be directly used as the target fuzzy neural network.
[0149] That is to say, in the embodiment of the present invention, the computer device can first generate N groups of parameters to be tested through the genetic algorithm of the initialization parameters, and construct N candidate fuzzy neural networks according to the N groups of parameters to be tested, and iteratively train the N candidate fuzzy neural networks through the back propagation algorithm. If the candidate fuzzy neural network whose objective function value is less than the error threshold is not found during the iteration process, it means that it is difficult to find suitable parameters to be tested in the local space. At this time, the computer device can process the parameters to be tested of the trained N candidate fuzzy neural networks through the genetic algorithm, regenerate N groups of parameters to be tested, and update the N candidate fuzzy neural networks. At this time, the candidate fuzzy neural network searches for the parameters to be tested from the global space through the genetic algorithm, and then trains through the back propagation algorithm to optimize the parameters to be tested from the local space, and again judges whether there is a candidate fuzzy neural network whose objective function value meets the training conditions during the training process.
[0150] If in the iterative process of the above-mentioned GA-BP (genetic algorithm-back propagation), the number of iterations of the genetic algorithm reaches the threshold number, it means that the algorithm may have optimized the parameters of the candidate fuzzy neural network as much as possible. In order not to occupy too many computing resources, at this time, the one with the smallest objective function value can be selected from the current N candidate fuzzy neural networks as the optimal individual, and the candidate fuzzy neural network corresponding to the optimal individual can be used as the target fuzzy neural network.
[0151] In a possible implementation of an embodiment of the present invention, considering that it may be difficult to find a model whose objective function value is less than the error threshold during the iteration process of GA-BP, in order to ensure that the optimal model can be selected during multiple iterations, when the computer device calculates the objective function values of N candidate fuzzy neural networks, the objective function value can be compared with the objective function value in the target sequence to determine whether there is a candidate fuzzy neural network with an objective function value less than the objective function value in the target sequence; if there is a candidate fuzzy neural network with an objective function value less than the objective function value in the target sequence, the objective function value less than the candidate fuzzy neural network is written into the target sequence in order of size, and the objective function value at the end of the preferred sequence is deleted, and the computer device saves the corresponding parameters to be adjusted of the candidate fuzzy neural network; wherein the target sequence can save a specified number of objective function values, for example 5, and the objective function values in the target sequence are sorted from small to large.
[0152] If the computer device detects that the number of executions of the processing process (i.e., the genetic algorithm) reaches a threshold number, the computer device can select the parameters to be adjusted of the candidate fuzzy neural networks corresponding to each objective function value in the preferred sequence, and construct them into each fuzzy neural network to be tested. The computer device then selects verification data from the sample data set, verifies each fuzzy neural network to be tested, and uses the fuzzy neural network to be tested with the smallest objective function value obtained during the verification process as the target fuzzy neural network.
[0153] In the above scheme, whether it is the back propagation algorithm or the genetic algorithm, there is a possibility that the optimization effect will decrease as the number of iterations increases. For example, overfitting may occur as the number of training times of the back propagation algorithm increases. Therefore, in order to find the optimal solution in a long-term iterative training process, the computer device can save the parameters of the candidate fuzzy neural network with a smaller objective function value in real time. These models are likely to become the optimal models. If the candidate fuzzy neural network that meets the training conditions is not found when the number of iterations of the genetic algorithm reaches the limit, the candidate fuzzy neural network with a smaller objective function value can be obtained in these training processes as the network to be tested. It can be verified by verification data, which can greatly increase the possibility that the selected target fuzzy neural network is the optimal model.
[0154] Specifically, step A1 can be implemented by the following steps:
[0155] Step B1, obtaining the parameters to be adjusted of the trained N candidate fuzzy neural networks as N groups of individuals; one group of individuals includes at least two chromosomes; the chromosomes are vector representations of the parameters to be adjusted.
[0156] Specifically, in the embodiment of the present invention, the real number encoding method can be used to obtain the parameter to be adjusted as an individual in the genetic algorithm, that is, the true value of the parameter to be adjusted is directly used as the encoding value, which has high accuracy and does not require decoding operations. ij 、c ij ,ω nk Construct chromosome C in the form of a vector σ , C c , C ω , and then the chromosomes form individual V = [C σ C c C ω ], each individual constitutes a population. In the embodiment of the present invention, the population includes N individuals (i.e., N groups); and each group of individuals includes three chromosomes, which correspond to the parameters to be adjusted in the fuzzy neural network σ ij 、c ij And ω nk .
[0157] Step B2, determining the target replication probability based on the sum of the fitness of the N groups of individuals. The fitness is used to indicate the value of the objective function of the candidate fuzzy neural network corresponding to the individual during the training process.
[0158] In genetic algorithms, replication is the process of selecting excellent individuals from the old population to generate a new population. In the embodiment of the present invention, the roulette method can be used to implement the replication process, where the replication probability P i The formula is as follows:
[0159]
[0160] Among them, F i In the embodiment of the present invention, the target replication probability represents the fitness of N groups of individuals, and each group of individuals has its own replication probability.
[0161] In a possible implementation of the embodiment of the present invention, the fitness function is defined as the sum of all individual objective functions of the population E sum The reciprocal of is as follows:
[0162]
[0163] If the fitness function is the inverse of the sum of the objective functions of all individuals in the population, then the fitness of each individual in the population is the same, that is, the target replication probability is also the same.
[0164] In another possible implementation of the embodiment of the present invention, the fitness function is the inverse of the objective function of each individual in the population, that is, each individual in the population has its own fitness, and the fitness is the inverse of the objective function value of the candidate fuzzy neural network corresponding to the individual, that is, the smaller the objective function value, the higher the fitness, the corresponding replication probability is also higher, and it is easier to preserve the characteristics of its parameters in the genetic algorithm.
[0165] Step B3, based on the target replication probability, performing selective replication on the N groups of individuals to generate N groups of first candidate individuals;
[0166] When the target replication probability is determined, the individuals to be replicated can be selected from N groups of individuals through the roulette method based on the target replication probability. When the roulette method is used N times, N groups of first candidate individuals can be selected according to the target replication probability.
[0167] Step B4, determining the crossover probability set based on the maximum fitness values of the N groups of the first candidate individuals and the fitness values of any two groups of the first candidate individuals.
[0168] The crossover probability set includes the crossover probabilities between any two groups of the first candidate individuals.
[0169] The crossover operation is the process of randomly exchanging some genes of chromosomes in a matching pool. The arithmetic crossover operator used in the embodiment of the present invention is as follows:
[0170]
[0171] Among them, V1 and V2 are individuals to be crossed. is a newly generated individual, β is a random number ranging from [0, 1].
[0172] In the embodiment of the present invention, the crossover probability P c Use the following formula to calculate:
[0173]
[0174] Among them, F max 、F min are the maximum and minimum fitness values of individuals in the population, respectively; F` is the larger fitness value of the two crossover individuals; F is the average fitness value of the population; P cmax , P cmin are constants, taking values of 0.8 and 0.5 respectively; t is the number of evolution generations.
[0175] Step B5: Based on the crossover probability set, a crossover operator is used to perform a crossover operation on the N groups of first candidate individuals to obtain N groups of second candidate individuals.
[0176] After obtaining the crossover probability sets corresponding to N groups of first candidate individuals, the arithmetic crossover operator can be used to perform a crossover operation according to the fitness of any two groups of first candidate individuals recorded in the crossover probability set. Since the number of individuals to be crossed is the same as the number of newly generated individuals, N groups of first candidate individuals can also generate N groups of second candidate individuals after the crossover operation.
[0177] Step B6, determining the mutation probability of the N second candidate individuals based on the maximum value of the fitness in the N groups of the second candidate individuals, the average value of the fitness in the N groups of the second candidate individuals, and the fitness of the N second candidate individuals.
[0178] In the embodiment of the present invention, since the chromosomes within the individual have changed after the crossover operation, that is, the corresponding parameters to be adjusted of the fuzzy neural network have changed, it is necessary to recalculate the fitness of the second candidate individual generated by the crossover operation.
[0179] After obtaining the fitness of N groups of second candidate individuals, the computer device can also calculate the mutation probability of the second candidate individuals based on them. In the genetic algorithm, all individuals after the crossover operation have P mThe probability of mutation to produce new individuals.
[0180] In the embodiment of the present invention, the mutation probability P of different individuals can also be adjusted by fitness. m :
[0181]
[0182] Among them: F max is the maximum fitness value in the population; is the average fitness value of the population; F is the fitness value of the target individual; P m1 , P m2 are constants, taking values of 0.3 and 0.4 respectively.
[0183] Step B7: Based on the mutation probabilities of the N second candidate individuals, the N second candidate individuals are updated respectively by using a mutation operator to obtain N groups of the second candidate parameters.
[0184] In the embodiment of the present invention, it is assumed that the population size is N, Vn represents the nth individual in the population, and the average individual of the tth generation population is defined as The width of the membership function corresponds to the chromosome mean Similarly, the chromosome mean corresponding to the center position of the membership function can be calculated The mean of the chromosome corresponding to the output weight
[0185] Furthermore, the present invention defines the population variance factor s and the variation intensity function s(t):
[0186]
[0187] Among them, in the formula: u is the base, the value is 0.2; γ is the constant coefficient, the value is 0.0001; t is the evolutionary generation.
[0188] In the embodiment of the present invention, the mutation operator V'=V±s(t)Δd, where V is the individual to be mutated and V' is the individual after mutation. Δd is the step vector. In the embodiment of the present invention, the step vector Δd can be [0.0001, 0.000001, 0.01].
[0189] After determining the mutation operator, mutation intensity function and population variance factor in the embodiment of the present invention, the mutation probabilities corresponding to N groups of second candidate individuals can be determined in the above manner, and the second candidate individuals can be selected according to the probabilities for mutation operation. When the operation is completed, the chromosomes in the N groups of second candidate individuals constitute N groups of second candidate parameters, and the N groups of second candidate parameters can be used to update the parameters to be adjusted of the N candidate fuzzy neural networks.
[0190] Optionally, the computer device may directly replace the parameters to be adjusted in the N candidate fuzzy neural networks with the N groups of second candidate parameters, or the computer device may weightedly combine the N groups of second candidate parameters with the parameters to be adjusted in the N candidate fuzzy neural networks, thereby updating the parameters to be adjusted in the N candidate fuzzy neural networks.
[0191] Specifically, in order to further explain the execution logic of the above steps S301 to S306, Figure 5 The following is a flow chart of optimizing the node parameters of a neural network set using a GA-BP hybrid algorithm according to an embodiment of the present invention. Figure 5 As shown, the embodiment of the present invention is mainly divided into two parts, one is the use of an improved genetic algorithm, and the other is the use of a fuzzy neural network and combining it with the improved genetic algorithm. Specifically, the computer device can first determine the network topology structure and obtain the pre-selected parameters to be adjusted (in the embodiment of the present invention, the center position σ of the membership function of the second layer ij and width c ij , and the output weight ω of the fifth layer nk ), the computer device then initializes the parameters of the GA algorithm (i.e., genetic algorithm), and randomly generates a population of N individuals through the GA algorithm after the parameters are initialized.
[0192] At this time, each individual can be used as a set of parameters to be adjusted in the fuzzy neural network, so N individuals can correspond to N fuzzy neural networks. The computer device can construct N fuzzy neural networks based on the N individuals, and process them through the sample data set to calculate the gradient of each individual, and update each individual parameter (that is, the parameters to be adjusted in each fuzzy neural network at this time) through the BP algorithm according to the gradient. After the update, the computer device calculates the objective function of the fuzzy neural network where different individuals are located through the BP algorithm based on the sample data set, and determines whether there is an individual in the population that meets the error requirements based on the objective function.
[0193] If it does not exist, go back to the step of calculating the gradient of each individual and execute the BP iteration process; if during the BP iteration process, there is an individual in the population that meets the error requirements, it will be directly used as the optimal individual, and the fuzzy neural network corresponding to the individual will be the target fuzzy neural network that meets the requirements;
[0194] If no individual that meets the error requirement is found when the maximum number of iterations is reached, the genetic algorithm is switched to for processing. Specifically, the computer device calculates the fitness of each individual according to the objective function of each fuzzy neural network, and determines whether the GA iteration has reached the maximum number of times; if it has not reached the maximum number of times, the individual replication is selected by the roulette method, and adaptive crossover, adaptive mutation and other operations are performed in sequence to obtain a new population (that is, the N groups of second candidate individuals mentioned above). At this time, each individual in the new population represents a new parameter to be adjusted calculated by the genetic algorithm. At this time, the computer device can re-perform BP iteration for the new parameter to be adjusted.
[0195] In the above process, if no individual that meets the error requirements is found during the BP iteration process, and the GA iteration reaches the maximum number of times, the computer device directly uses the individual with the smallest objective function value in the iteration process as the optimal individual, and the candidate fuzzy neural network corresponding to the optimal individual is directly used as the target fuzzy neural network to predict the change of PID control parameters later.
[0196] In passing Figure 5 After the target fuzzy neural network is trained in the manner shown, the target fuzzy neural network can be used for PID control. Figure 6 FIG. 1 shows a structural block diagram of an online training and offline control system involved in an embodiment of the present invention. Figure 6 As shown, the training process of the fuzzy neural network is performed online. For example, the fuzzy neural network can be Figure 1 The target server 120 shown in FIG. 1 trains the fuzzy neural network through the training data set through the learning algorithm. When the training is completed, the model parameters of the trained target fuzzy neural network are sent to the target server 120 through the MUX (multiplexer). Figure 1 Offline control is performed in the target terminal 110 shown. At this time, the computer device obtains the temperature data of the temperature sensor, and inputs the temperature data (including temperature deviation and deviation change rate) into the PID controller and the target fuzzy neural network respectively. The target fuzzy neural network generates the change of the PID control parameters and adjusts the parameters of the PID controller. The PID controller controls the actuator according to the adjusted parameters to realize temperature control of the server.
[0197] In summary, before performing PID temperature control, the computer device can first obtain the initialization structure of the target fuzzy neural network model for adjusting the PID control parameters, that is, the initial fuzzy neural network model, and determine the parameters to be adjusted therein; at this time, the computer device then performs operations such as replication, crossover, and mutation on the parameters to be adjusted based on the genetic algorithm, and selects N groups of first candidate parameters in the global parameter space; at this time, the computer device can replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, respectively, so as to construct N candidate fuzzy neural networks; after constructing the N candidate fuzzy neural networks, the computer device uses a sample data set including sample temperature data and annotated changes in the control parameters to iteratively train the N candidate fuzzy neural networks, respectively, in the hope of training a fuzzy neural network that can be used to predict the changes in the PID control parameters based on the temperature data. During the iterative training process, if the computer device detects that the objective function value in the training process, that is, the difference between the predicted change of the control parameter and the marked change of the control parameter meets the training conditions, it means that at this time there is a candidate fuzzy neural network whose training effect meets expectations. The computer device can directly use the candidate fuzzy neural network that meets the training conditions as the target fuzzy neural network to predict the change of the control parameters of the PID, so as to adjust the control parameters of the PID in real time during the PID temperature control process, so that the PID temperature control process has the advantages of fuzzy control, and the PID control system has stronger robustness, fault tolerance and adaptability, which improves the temperature control effect when facing a server temperature control process with nonlinearity and hysteresis.
[0198] In this embodiment, a PID temperature control device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0199] This embodiment provides a PID temperature control device, such as Figure 7 As shown, it includes: a parameter acquisition module 701 to be adjusted, a genetic algorithm processing module 702, a model construction module 703, and a model training module 704.
[0200] The module 701 for obtaining parameters to be adjusted is used to obtain the parameters to be adjusted in the initial fuzzy neural network;
[0201] A genetic algorithm processing module 702 is used to generate N groups of first candidate parameters through a genetic algorithm based on the parameters to be adjusted; N ≥ 2, and N is a positive integer;
[0202] A model building module 703 is used to replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters to respectively build N candidate fuzzy neural networks;
[0203] The model training module 704 is used to iteratively train N candidate fuzzy neural networks respectively through sample data sets. If during the iterative training process, the objective function value of a candidate fuzzy neural network satisfies the training conditions, the candidate fuzzy neural network that satisfies the training conditions is obtained as the target fuzzy neural network; the sample data sets include sample temperature data and annotated changes of control parameters;
[0204] The target fuzzy neural network is used to process the difference between the acquired first temperature and the target preset temperature, generate a change in the PID control parameter to adjust the PID control parameter; the PID control parameter is used to instruct the PID controller to perform temperature control based on the difference between the first temperature and the target preset temperature.
[0205] In a possible implementation, the genetic algorithm processing module 702 is further configured to execute at least one processing process until the processing condition is met if there is no candidate fuzzy neural network whose objective function value satisfies the training condition, and the processing process includes:
[0206] Based on the N candidate parameters to be adjusted of the fuzzy neural network after iterative training, N groups of second candidate parameters are generated by genetic algorithm;
[0207] Based on the N groups of the second candidate parameters, respectively updating the parameters to be adjusted of the N candidate fuzzy neural networks;
[0208] The model training module 704 is also used to iteratively train the N candidate fuzzy neural networks respectively through the sample data sets.
[0209] In a possible implementation, the processing condition is that there exists a trained candidate fuzzy neural network whose objective function value is less than an error threshold;
[0210] Alternatively, the processing procedure is executed a certain number of times, reaching a certain number threshold.
[0211] In a possible implementation, the model training module 704 is further used to select the candidate fuzzy neural network with the smallest objective function value among the N candidate fuzzy neural networks after iterative training as the target fuzzy neural network if the number of executions of the processing reaches a threshold number.
[0212] In a possible implementation, the genetic algorithm processing module 702 is further used to obtain the parameters to be adjusted of the trained N candidate fuzzy neural networks as N groups of individuals; each group of individuals includes at least two chromosomes; the chromosomes are vector representations of the parameters to be adjusted;
[0213] Determine the target replication probability based on the sum of the fitness of N groups of individuals; the fitness is used to indicate the value of the objective function of the candidate fuzzy neural network corresponding to the individual during the training process;
[0214] Based on the target replication probability, the N groups of individuals are selectively replicated to generate N groups of first candidate individuals;
[0215] Determine the crossover probability set based on the maximum fitness values of N groups of the first candidate individuals and the fitness values of any two groups of the first candidate individuals; the crossover probability set includes the crossover probability between any two groups of the first candidate individuals;
[0216] Based on the crossover probability set, performing a crossover operation on the N groups of the first candidate individuals by a crossover operator to obtain N groups of second candidate individuals;
[0217] Determine the mutation probability of the N second candidate individuals based on the maximum value of the fitness of the N groups of the second candidate individuals, the average value of the fitness of the N groups of the second candidate individuals, and the fitness of the N second candidate individuals;
[0218] Based on the mutation probabilities of the N second candidate individuals, the N second candidate individuals are updated respectively by using a mutation operator to obtain N groups of the second candidate parameters.
[0219] In a possible implementation, the genetic algorithm processing module 702 is further used to obtain initialization parameters of the genetic algorithm;
[0220] Based on the initialization parameters, the parameters to be adjusted are taken as initial individuals and processed by a genetic algorithm to obtain N groups of the first candidate parameters.
[0221] In a possible implementation, the model training module 704 is further used to perform at least one training process until the number of training times reaches a maximum number of iterations or the objective function value of a candidate fuzzy neural network is less than an error threshold;
[0222] The training process includes:
[0223] Select sample temperature data from the sample data set and annotate the change in control parameters;
[0224] Processing the sample temperature data through N candidate fuzzy neural networks respectively to obtain N prediction results;
[0225] Based on the change in the marked control parameter and the N prediction results, obtaining objective function values of N candidate fuzzy neural networks;
[0226] If the objective function values of the N candidate fuzzy neural networks are not less than the error threshold, then determining whether the number of training times is less than the maximum number of iterations;
[0227] If the number of training times is less than the maximum number of iterations, back-propagation updates are performed on the parameters to be adjusted of the N candidate fuzzy neural networks respectively based on the objective function values of the N candidate fuzzy neural networks.
[0228] The PID temperature control device in this embodiment is presented in the form of a functional module, where the module refers to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0229] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0230] A PID temperature control device provided by an embodiment of the present invention, before performing PID temperature control, a computer device can first obtain an initialization structure of a target fuzzy neural network model for adjusting PID control parameters, that is, an initial fuzzy neural network model, and determine the parameters to be adjusted therein; at this time, the computer device then performs operations such as copying, crossover, and mutation on the parameters to be adjusted based on a genetic algorithm, and selects N groups of first candidate parameters in a global parameter space; at this time, the computer device can replace the parameters to be adjusted in the initial fuzzy neural network with the N groups of first candidate parameters, respectively, so as to construct N candidate fuzzy neural networks; after constructing the N candidate fuzzy neural networks, the computer device uses a sample data set including sample temperature data and annotated changes of control parameters to iteratively train the N candidate fuzzy neural networks, respectively, in the hope of training a fuzzy neural network that can be used to predict the changes of PID control parameters based on temperature data. During the iterative training process, if the computer device detects that the objective function value in the training process, that is, the difference between the predicted change of the control parameter and the marked change of the control parameter meets the training conditions, it means that at this time there is a candidate fuzzy neural network whose training effect meets expectations. The computer device can directly use the candidate fuzzy neural network that meets the training conditions as the target fuzzy neural network to predict the change of the control parameters of the PID, so as to adjust the control parameters of the PID in real time during the PID temperature control process, so that the PID temperature control process has the advantages of fuzzy control, and the PID control system has stronger robustness, fault tolerance and adaptability, which improves the temperature control effect when facing a server temperature control process with nonlinearity and hysteresis.
[0231] The embodiment of the present invention also provides a computer device having the above Figure 8 The PID temperature control device shown.
[0232] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0233] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0234] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0235] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0236] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0237] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0238] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0239] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0240] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0241] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A PID temperature control method, characterized in that: The method comprises: Obtaining the parameters to be adjusted in the initial fuzzy neural network; Based on the parameters to be adjusted, generating N groups of first candidate parameters by genetic algorithm; N ≥ 2, and N is a positive integer; The N groups of first candidate parameters replace the parameters to be adjusted in the initial fuzzy neural network, and construct N candidate fuzzy neural networks respectively; Iteratively train N candidate fuzzy neural networks respectively through sample data sets, and if during the iterative training process, the objective function value of a candidate fuzzy neural network satisfies the training conditions, the candidate fuzzy neural network that satisfies the training conditions is obtained as the target fuzzy neural network; the sample data sets include sample temperature data and annotated changes of control parameters; The target fuzzy neural network is used to process the difference between the acquired first temperature and the target preset temperature, generate a change in the PID control parameter to adjust the PID control parameter; the PID control parameter is used to instruct the PID controller to perform temperature control based on the difference between the first temperature and the target preset temperature.
2. The method according to claim 1, characterized in that The method further comprises: If there is no candidate fuzzy neural network whose objective function value satisfies the training condition, at least one processing process is performed until the processing condition is satisfied, and the processing process includes: Based on the N candidate parameters to be adjusted of the fuzzy neural network after iterative training, N groups of second candidate parameters are generated by genetic algorithm; Based on the N groups of the second candidate parameters, respectively updating the parameters to be adjusted of the N candidate fuzzy neural networks; The N candidate fuzzy neural networks are iteratively trained using sample data sets.
3. The method according to claim 2, characterized in that The processing condition is that the objective function value of the candidate fuzzy neural network after training is less than the error threshold; Alternatively, the processing procedure is executed a certain number of times, reaching a certain number threshold.
4. The method according to claim 3, characterized in that The method further comprises: If the number of executions of the processing procedure reaches a threshold number, the candidate fuzzy neural network with the smallest objective function value among the N candidate fuzzy neural networks after iterative training is selected as the target fuzzy neural network.
5. The method according to claim 2, characterized in that: The method of generating N groups of second candidate parameters based on the trained N candidate fuzzy neural network parameters to be adjusted by using a genetic algorithm comprises: The parameters to be adjusted of the N candidate fuzzy neural networks after training are obtained as N groups of individuals; each group of individuals includes at least two chromosomes; the chromosomes are vector representations of the parameters to be adjusted; Determine the target replication probability based on the sum of the fitness of N groups of individuals; the fitness is used to indicate the value of the objective function of the candidate fuzzy neural network corresponding to the individual during the training process; Based on the target replication probability, the N groups of individuals are selectively replicated to generate N groups of first candidate individuals; Determine a crossover probability set based on the maximum fitness values of the N groups of the first candidate individuals and the fitness values of any two groups of the first candidate individuals; the crossover probability set includes the crossover probability between any two groups of the first candidate individuals; Based on the crossover probability set, performing a crossover operation on the N groups of the first candidate individuals by a crossover operator to obtain N groups of second candidate individuals; Determine the mutation probability of the N second candidate individuals based on the maximum value of the fitness of the N groups of the second candidate individuals, the average value of the fitness of the N groups of the second candidate individuals, and the fitness of the N second candidate individuals; Based on the mutation probabilities of the N second candidate individuals, the N second candidate individuals are updated respectively by using a mutation operator to obtain N groups of the second candidate parameters.
6. The method according to any one of claims 1 to 5, characterized in that: The step of generating N groups of first candidate parameters based on the parameters to be adjusted by using a genetic algorithm includes: Get the initialization parameters of the genetic algorithm; Based on the initialization parameters, the parameters to be adjusted are taken as initial individuals and processed by a genetic algorithm to obtain N groups of the first candidate parameters.
7. The method according to any one of claims 1 to 5, characterized in that: The iterative training of N candidate fuzzy neural networks respectively through the sample data set includes: Perform at least one training process until the number of training times reaches a maximum number of iterations or the objective function value of a candidate fuzzy neural network is less than an error threshold; The training process includes: Select sample temperature data from the sample data set and annotate the change in control parameters; Processing the sample temperature data through N candidate fuzzy neural networks respectively to obtain N prediction results; Based on the change in the marked control parameter and the N prediction results, obtaining objective function values of N candidate fuzzy neural networks; If the objective function values of the N candidate fuzzy neural networks are not less than the error threshold, then determining whether the number of training times is less than the maximum number of iterations; If the number of training times is less than the maximum number of iterations, back-propagation updates are performed on the parameters to be adjusted of the N candidate fuzzy neural networks respectively based on the objective function values of the N candidate fuzzy neural networks.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the PID temperature control method according to any one of claims 1 to 7 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the PID temperature control method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the PID temperature control method according to any one of claims 1 to 7.
Citation Information
Cited By
Temperature control module based on serial port communication of single chip microcomputer
CN120848651A
