Equipment control method and device, electronic equipment and storage medium
By predicting the measurement point parameters and evaluation values of the candidate action strategy at the next moment in online reinforcement learning in the data center, and selecting the appropriate action strategy for temperature adjustment, the problems of long response time and security risks in the existing technology are solved, and the Efficient and secure equipment control.
Patent Information
- Application Number
- CN202410660614.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-06
AI Technical Summary
Existing online reinforcement learning algorithms have long response times in the control of temperature adjustment equipment in data centers and are difficult to achieve minute-level refined control. Random action exploration may bring security risks and are inefficient, making it difficult to meet the needs for efficient optimal control.
By obtaining the current environment parameters in each round of reinforcement learning, predicting the measurement point parameters of the candidate action strategy at the next moment, and determining the evaluation value based on the difference between the prediction results and the early warning parameters, selecting the probability, and thus selecting the action strategy at the current moment for parameter adjustment. Reduce the uncertainty risk of random action exploration and improve control safety and efficiency.
It improves the safety and efficiency of the online reinforcement learning algorithm, realizes efficient and optimized control of temperature adjustment equipment, and meets the complex air flow organization characteristics and differentiated heating and ventilation needs of the data center.
Smart Images

Figure CN118605263A
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a device control method, apparatus, electronic device and storage medium. Background Art
[0002] In the control and management of modern data centers, faced with the complex airflow organization characteristics and differentiated HVAC requirements caused by the unique architectural structure and diversified equipment layout of various types of data rooms, the industry attempts to use online reinforcement learning algorithms to achieve real-time learning of the room status and real-time control and optimization of temperature control equipment (e.g.
[0003] However, in actual engineering operation, the current computer room power environment monitoring system generally has a long response time in the data collection, transmission and control links. In addition, considering that the temperature control equipment should not be adjusted too frequently, the online reinforcement learning algorithm often finds it difficult to achieve minute-level fine control. At present, in most cases, the online reinforcement learning algorithm can only control the computer room in a half-hour or one-hour cycle, which greatly limits the frequency of interaction between reinforcement learning and the real environment. The resulting lack of data seriously restricts the effect, learning ability and convergence speed of reinforcement learning, especially in the early stage of algorithm startup. Due to the lack of necessary control practice experience, if a blind random action exploration strategy is adopted, it may bring high operational risks.
[0004] Specifically, the existing online reinforcement learning algorithms have the following problems: under the strict computer room environment control requirements, the safety of temperature control equipment is particularly important. However, due to the limited ability of the computer room to withstand the harmful consequences that may be caused by control errors, directly applying online reinforcement learning algorithms to perform random action exploration on the control of temperature control equipment in actual operation will undoubtedly bring potential safety risks. In addition, the training time is long and the efficiency is low, which makes it difficult to meet the needs of efficient optimization control. Summary of the invention
[0005] The embodiments of the present application provide a device control method, apparatus, electronic device and storage medium to improve the security and efficiency of device control by an online reinforcement learning algorithm.
[0006] In a first aspect, an embodiment of the present application provides a device control method, comprising:
[0007] In each round of reinforcement learning, the current environment parameters corresponding to the target device are obtained, and the current environment parameters include the current measurement point parameters and the current setting parameters;
[0008] If it is determined to search for the next moment setting parameter of the target device based on the setting decision method in the reinforcement learning, then a plurality of candidate action strategies of the target device at the next moment are obtained, each of which corresponds to a setting parameter;
[0009] Based on each of the candidate action strategies, the current moment measurement point parameters and the current moment setting parameters, predict the next moment measurement point parameters corresponding to each of the candidate action strategies, and determine the evaluation value of each of the candidate action strategies based on the difference between the predicted next moment measurement point parameters and the warning parameters;
[0010] Based on the evaluation values of each of the plurality of candidate action strategies, obtaining a selection probability of each of the candidate action strategies, and based on the selection probabilities of each of the plurality of candidate action strategies, selecting a current moment action strategy from the plurality of candidate action strategies;
[0011] Parameters of the target device are adjusted according to the current action strategy.
[0012] In a second aspect, an embodiment of the present application provides a device control apparatus, comprising:
[0013] An acquisition unit, used to acquire the current moment environmental parameters corresponding to the target device in each round of reinforcement learning, wherein the current moment environmental parameters include the current moment measurement point parameters and the current moment setting parameters;
[0014] A search unit, configured to obtain a plurality of candidate action strategies for the target device at the next moment, each of which corresponds to a setting parameter, if it is determined to search for the setting parameter of the target device at the next moment based on the setting decision method in the reinforcement learning;
[0015] A prediction unit, configured to predict the next moment measurement point parameter corresponding to each candidate action strategy based on each candidate action strategy, the current moment measurement point parameter and the current moment setting parameter, and determine the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameter and the warning parameter;
[0016] A first selection unit, configured to obtain a selection probability of each of the candidate action strategies based on respective evaluation values of the plurality of candidate action strategies, and select a current moment action strategy from the plurality of candidate action strategies based on respective selection probabilities of the plurality of candidate action strategies;
[0017] A control unit is used to adjust parameters of the target device according to the current action strategy.
[0018] Optionally, when predicting the next moment measurement point parameter corresponding to each candidate action strategy based on each candidate action strategy, the current moment measurement point parameter and the current moment setting parameter, the prediction unit is specifically used to:
[0019] Input the current moment measurement point parameter, the change between the setting parameter corresponding to each candidate action strategy and the current moment setting parameter into a nonlinear prediction model, and output the change of the measurement point parameter at the next moment;
[0020] Based on the measurement point parameters at the current moment and the variation of the measurement point parameters at the next moment, the predicted measurement point parameters at the next moment are obtained.
[0021] Optionally, the device further comprises a training unit, configured to:
[0022] The historical environment parameters corresponding to the target device are obtained at set time intervals, and the historical environment parameters are divided into a training set and a test set, and the nonlinear prediction model is retrained based on the training set and the test set.
[0023] Optionally, when determining the evaluation value of each candidate action strategy based on the difference between the predicted next-moment measurement point parameter and the warning parameter, the prediction unit is specifically configured to:
[0024] Acquire a plurality of preset difference ranges, and determine a target difference range among the plurality of difference ranges corresponding to the difference between the warning parameter and the predicted next moment measurement point parameter;
[0025] Based on the evaluation values corresponding to each of the plurality of difference ranges, a target evaluation value corresponding to the target difference range is determined, and the target evaluation value is used as the evaluation value of the candidate action strategy.
[0026] Optionally, the device further comprises a rejection unit, configured to:
[0027] For each of the candidate action strategies, if it is determined that under the candidate action strategy, the predicted next moment measurement point parameter reaches the warning parameter, or the difference between the warning parameter and the predicted next moment measurement point parameter is not less than a first set value, the candidate action strategy is eliminated.
[0028] Optionally, the device further comprises:
[0029] A reward determination unit, configured to obtain the actual next-moment measurement point parameters corresponding to the target device after adjusting the parameters of the target device according to the current-moment action strategy, and determine the reward parameters of the current-moment action strategy based on the difference between the actual next-moment measurement point parameters and the warning parameters;
[0030] An updating unit, configured to obtain a first state corresponding to the environmental parameter at the current moment, and based on the first state, the value estimation parameter corresponding to the executed action strategy, and the reward parameter of the action strategy at the current moment, obtain the value estimation parameter corresponding to the first state and the action strategy at the current moment in combination with a preset updating rule; wherein the initial value of the value estimation parameter is a set value;
[0031] The second selection unit is used to obtain the next moment environment parameters corresponding to the target device in the next round of reinforcement learning. If it is determined based on the setting decision method in the reinforcement learning to select the next moment setting parameters of the target device from the executed action strategies, then the second state corresponding to the next moment environment parameters is obtained, and from the multiple executed action strategies corresponding to the second state, the executed action strategy with the largest value estimation parameter is selected as the next moment action strategy.
[0032] Optionally, the reward determination unit is specifically used to:
[0033] If the actual next moment measurement point parameter is less than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is greater than a second set value, then based on the actual next moment measurement point parameter and the warning parameter, combined with the first reward function, determine the first reward parameter of the current moment action strategy;
[0034] If the actual next moment measurement point parameter is not greater than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is not greater than the second set value, then based on the actual next moment measurement point parameter and the warning parameter, in combination with a second reward function, determine the second reward parameter of the current moment action strategy;
[0035] If the actual next moment measurement point parameter is greater than the warning parameter, determining a third reward parameter of the current moment action strategy based on the actual next moment measurement point parameter and the warning parameter in combination with a third reward function;
[0036] The second reward parameter is greater than the first reward parameter, and the first reward parameter is greater than the third reward parameter.
[0037] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned device control methods.
[0038] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is executed on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned device control methods.
[0039] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned device control methods.
[0040] The above solution of the present application has at least the following beneficial effects:
[0041] The embodiment of the present application provides a device control method, apparatus, electronic device and storage medium. In each round of reinforcement learning, the current moment measurement point parameters and current moment setting parameters corresponding to the target device are obtained; when the next moment setting parameters of the target device are determined, multiple candidate action strategies of the target device at the next moment are obtained. In order to avoid blind random exploration of multiple candidate action strategies, the embodiment of the present application predicts the next moment measurement point parameters based on each candidate action strategy, the current moment measurement point parameters and the current moment setting parameters, and determines the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameters and the warning parameters; then, based on the respective evaluation values of the multiple candidate action strategies, the selection probability of each candidate action strategy is obtained, and then the current moment action strategy is selected from the multiple candidate action strategies based on the selection probability to adjust the parameters of the target device. Different from the random action exploration method commonly used in existing online reinforcement learning, the embodiment of the present application gives appropriate direction guidance to the action selection of multiple candidate action strategies by determining the selection probability of each candidate action strategy, reduces the uncertainty risk brought by the exploration of random action strategies, thereby improving the security of the online reinforcement learning algorithm, and accelerating the learning process, thereby improving the training efficiency, and meeting the demand for efficient optimization control of the target device.
[0042] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0044] Figure 1 This is a flow chart of a device control method in an embodiment of the present application;
[0045] Figure 2 A curve diagram of a reward function in an embodiment of the present application;
[0046] Figure 3 It is an overall logic diagram of a device control method in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of a device control device in an embodiment of the present application;
[0048] Figure 5 The present invention is a schematic diagram of the structure of an electronic device to which the present invention is applied. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0050] The following is an introduction to some concepts involved in the embodiments of the present application.
[0051] Reinforcement Learning (RL): Reinforcement learning is a machine learning paradigm whose goal is to learn the optimal strategy through the interaction between the agent and the environment. In this process, the agent will adjust its behavior strategy according to the reward signal fed back by the environment, in order to maximize the cumulative reward after a long period of operation. Through continuous trial and error and learning, reinforcement learning algorithms can autonomously discover and execute the optimal sequence of actions in complex environments.
[0052] Sarsa (State-Action-Reward-State-Action): is a reinforcement learning algorithm and an online learning method for estimating and optimizing strategies in the field of reinforcement learning. In the Sarsa algorithm, the agent updates its value estimate (Q value) of the state-action pair based on the current state, the action taken, the immediate reward received, and the next state. The agent follows the ε-greedy strategy or other exploration strategy, on the one hand, using the learned experience (experience utilization) and on the other hand, exploring unknown strategies (exploration). Through continuous interaction and learning with the environment, the goal of the Sarsa algorithm is to find an optimal behavior strategy that maximizes the cumulative reward in the environment.
[0053] Regression Tree (RT): Regression tree is a nonlinear prediction model and a type of decision tree. It is used to solve regression problems, that is, predict continuous numerical target variables. Regression tree recursively divides the data set into several subsets and builds a simple model (usually a constant value) on each subset, eventually forming a decision tree structure. In the prediction stage, by traversing the tree structure, the leaf node is determined based on the value of the input variable, and the value of the leaf node is the prediction result. Regression tree has good interpretability and robustness, and is particularly suitable for data scenarios that deal with nonlinear relationships and multiple interaction effects.
[0054] The existing online reinforcement learning algorithms have the following problems: Under the strict requirements of computer room environment control, the safety of temperature control equipment is particularly important. However, due to the limited tolerance of the computer room for the harmful consequences that may be caused by control errors, directly applying online reinforcement learning algorithms to perform random action exploration on the control of temperature control equipment in actual operation will undoubtedly bring potential safety risks. In addition, the training time is long and the efficiency is low, which makes it difficult to meet the needs of efficient optimization control.
[0055] In view of this, the embodiments of the present application provide a device control method, apparatus, electronic device and storage medium. Different from the random action exploration method commonly used in existing online reinforcement learning, the embodiments of the present application predict the next-moment measurement point parameters under each candidate action strategy for multiple candidate action strategies to be searched, and determine the selection probability of each candidate action strategy based on the prediction results, thereby providing appropriate direction guidance for the action selection of multiple candidate action strategies, reducing the uncertainty risk brought by random action strategy exploration, thereby improving the security of the online reinforcement learning algorithm, and accelerating the learning process, thereby improving the training efficiency and meeting the needs of efficient optimization control of the target device.
[0056] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0057] The device control method of the embodiment of the present application can be used to perform real-time control and optimization of the temperature control equipment in the data center, thereby achieving energy-saving and power consumption of the temperature control equipment under the premise of equipment safety. In addition, the device control method of the embodiment of the present application can also be used to perform real-time control and optimization of temperature control equipment in other scenarios, without limitation.
[0058] See also Figure 1 As shown, it is an implementation flow chart of a device control method provided in an embodiment of the present application. The method can be executed by a control device, and the control device is used to control the target device. Specifically, it can be a terminal device or a server. Taking the server as the execution subject as an example, the specific implementation process of the method includes the following S11-S15:
[0059] S11. In each round of reinforcement learning, the current environmental parameters corresponding to the target device are obtained, and the current environmental parameters include the current measurement point parameters and the current setting parameters.
[0060] The target device may be any temperature control device in a data center, such as an air conditioning device, or a temperature control device in other application scenarios, without limitation.
[0061] Before using an online reinforcement learning algorithm (such as Sarsa, etc.) to control and optimize the target device in real time, the warning parameters and adjustable setting parameter range of the target device can be determined, where the setting parameter is the adjustable parameter of the target device, and the warning parameter is the upper limit of the adjustable parameter; for example, the warning parameter can specifically be the warning temperature, and the setting parameter can specifically be the setting temperature.
[0062] The current moment measurement point parameter may be the environmental parameter of the scene where the target device is located, and the current moment setting parameter may be the parameter for adjusting the target device at the current moment. Taking the target device as an air-conditioning device as an example, the current moment measurement point parameter may be the measurement point temperature at the current moment, specifically the highest measurement point temperature. For example, in a data room scenario, multiple measurement points (i.e., temperature detection points) of the air-conditioning device may be set in the data room. The multiple measurement points may be locations that the air-conditioning device can blow to or affect, and the temperatures of the multiple measurement points are collected, and the highest temperature among the multiple measurement points at the current moment is used as the current moment measurement point parameter; the current moment setting parameter may specifically be the current moment setting temperature.
[0063] S12: If the setting parameter of the target device at the next moment is determined based on the setting decision method in reinforcement learning, a plurality of candidate action strategies of the target device at the next moment are obtained, and each candidate action strategy corresponds to a setting parameter.
[0064] Specifically, the execution of the online reinforcement learning algorithm is divided into two branches: exploration and experience utilization. The decision method is set to decide which branch to enter. For example, the decision method is set to use the ε-greedy method or other decision methods. Taking the ε-greedy method as an example, a certain exploration probability (for example, ε is a parameter between 0 and 1) is used to enter the exploration phase, that is, a candidate action strategy is randomly selected from multiple candidate action strategies with a probability of ε to explore unknown possibilities, and the currently known optimal action strategy is selected with a probability of (1-ε) to utilize the known best feedback. For example, if ε is set to 0.5, there is a 50% probability of entering the exploration phase and a 50% probability of entering the experience utilization phase. Over time, the value of ε usually decreases (decays) to reduce exploration and rely more on the learned optimal action strategy.
[0065] Among them, multiple candidate action strategies are determined according to the adjustable setting parameter range of the target device, that is, the action space of online reinforcement learning can cover multiple possible setting parameters, and each candidate action strategy corresponds to a setting parameter, which is within the setting parameter range. For example, the setting parameter range is specifically a setting temperature range of 22℃~26℃, then each candidate action strategy corresponds to a setting temperature between 22℃~26℃.
[0066] S13. Based on each candidate action strategy, the current moment measurement point parameters and the current moment setting parameters, the next moment measurement point parameters corresponding to each candidate action strategy are predicted, and based on the difference between the predicted next moment measurement point parameters and the warning parameters, the evaluation value of each candidate action strategy is determined.
[0067] In the embodiment of the present application, in order to avoid blindly selecting from multiple candidate action strategies, under each candidate action strategy, the corresponding next-moment measurement point parameters are predicted based on the candidate action strategy, the current-moment measurement point parameters, and the current-moment setting parameters. Furthermore, based on the difference between the next-moment measurement point parameters predicted under each candidate action strategy and the warning parameters, the evaluation value of each candidate action strategy is determined, so that selection from multiple candidate action strategies can be made based on the evaluation value.
[0068] In some possible implementations, in the above S13, a nonlinear prediction model may be used to predict the next moment measurement point parameters corresponding to each candidate action strategy. At this time, the above S13 predicts the next moment measurement point parameters based on each candidate action strategy, the current moment measurement point parameters and the current moment setting parameters, specifically including:
[0069] The measurement point parameters at the current moment, the change between the set parameters corresponding to each candidate action strategy and the set parameters at the current moment are input into the nonlinear prediction model, and the change of the measurement point parameters at the next moment is output; based on the measurement point parameters at the current moment and the change of the measurement point parameters at the next moment, the predicted measurement point parameters at the next moment are obtained.
[0070] Specifically, the nonlinear prediction model can use a regression tree prediction model or other nonlinear prediction models. Taking the target device as an air-conditioning device, the measurement point parameter as the highest measurement point temperature, and the setting parameter as the set temperature as an example, the input of the nonlinear prediction model includes: the current highest measurement point temperature Current set temperature The change in the set temperature at the next moment (i.e., the change between the setting parameters corresponding to the candidate action strategy and the setting parameters at the current moment), that is, the input vector is Where air_id refers to the ID of the air conditioner, t represents the time, T is the temperature, and S is the set temperature. The set temperature at the next moment (i.e., the candidate action strategy) can be calculated as That is, the current set temperature plus the change in the set temperature at the next moment is the set temperature at the next moment. The output of the nonlinear prediction model is the predicted change in the highest measuring point temperature at the next moment. (i.e. the change in the measuring point parameters).
[0071] The input of the nonlinear prediction model includes the above three features, which can effectively reduce the training difficulty of the prediction algorithm and the depth of the regression tree, and speed up the training speed of the prediction algorithm. The output of the prediction model is the temperature change of the highest measuring point at the next moment. Can be restored to the highest measuring point temperature at the next moment
[0072] The prediction idea of the nonlinear prediction model of the embodiment of the present application is to predict how much the measurement point parameter changes can be caused by different setting parameter changes (i.e., setting parameters at the next moment) based on the current measurement point parameters and the current setting parameters. In practical applications, in order to reduce the difficulty of training, various temperatures can be limited to floating point numbers with 1 decimal place.
[0073] In some embodiments, the above S13 determines the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameter and the warning parameter, specifically including:
[0074] Acquire multiple preset difference ranges, and determine a target difference range among the multiple difference ranges corresponding to the difference between the warning parameter and the predicted measurement point parameter at the next moment; determine a target evaluation value corresponding to the target difference range based on the evaluation values corresponding to each of the multiple difference ranges, and use the target evaluation value as the evaluation value of the candidate action strategy.
[0075] Among them, multiple difference ranges can be set as needed, and each difference range corresponds to an evaluation value. Each difference range indicates the degree to which the predicted measurement point parameter at the next moment is close to the warning parameter. When the difference between the warning parameter and the predicted measurement point parameter at the next moment is not less than the first set value, it is considered that the control effect is not energy-saving. When the predicted measurement point parameter at the next moment reaches the warning parameter, it is considered that the control effect is more dangerous, and the evaluation value can be smaller, for example, 0; when the difference between the warning parameter and the predicted measurement point parameter at the next moment is less than the first set value, a suitable evaluation value can be set. Both the value of the warning parameter and the first set value can be set according to actual conditions.
[0076] For example, the predicted next moment measurement point parameter is the next moment maximum measurement point temperature The warning parameter is the warning temperature T warning For example, according to Close to T warning The degree of scoring of different candidate action strategies (setting temperature at the next moment) is, among which, Lower than T warning If the control effect is above 3 degrees, it is considered that the control effect is not energy-saving. More than T warning The control effect is considered to be relatively dangerous, and the corresponding evaluation value is zero. warning and The difference The evaluation values are set as shown in Table 1 below:
[0077] Table 1
[0078] Difference (∞,3) [3,2.5) [2.5,2) [2,1.5) [1.5,1) [1,0.5) [0.5,0.01] [0.01,-∞) Evaluation value 0 1 / 6 1 / 5 1 / 4 1 / 2 1 / 1 1 / 4 0
[0079] Among them, when T warning and When the difference is 0.01, it is considered Reach T warning .
[0080] In an embodiment of the present application, the evaluation value of the corresponding candidate action strategy is determined according to the degree to which the measured point parameters predicted at the next moment under each candidate action strategy are close to the warning parameters, and the current moment action strategy is subsequently selected from multiple candidate action strategies based on the evaluation value, thereby ensuring the safety of equipment control.
[0081] S14. Based on the evaluation values of each of the multiple candidate action strategies, obtain the selection probability of each candidate action strategy, and based on the selection probability of each of the multiple candidate action strategies, select the action strategy at the current moment from the multiple candidate action strategies.
[0082] Specifically, after obtaining the evaluation values of multiple candidate action strategies, different distribution probabilities are given for different evaluation values. For example, the selection probabilities of multiple candidate action strategies are obtained by using the softmax function. Specifically, it is shown in the following formula (1):
[0083]
[0084] Among them, a i represents the i-th candidate action strategy, represents the selection probability of the i-th candidate action strategy, represents the evaluation value of the i-th candidate action strategy, and N is the total number of candidate action strategies
[0085] Furthermore, based on the selection probabilities of the multiple candidate action strategies, sampling is performed from the multiple candidate action strategies to select the action strategy at the current moment. The higher the selection probability of the candidate action strategy, the greater the probability of being selected, and the lower the selection probability, the smaller the probability of being selected; for example, different sampling weights can be assigned to the multiple candidate action strategies based on their respective selection probabilities.
[0086] In some possible implementations, if a candidate action strategy may cause danger or there is still a large energy saving space after execution, the candidate action strategy is not considered. At this time, before obtaining the selection probability of each candidate action strategy based on the evaluation values of each of the multiple candidate action strategies, for each candidate action strategy, if it is determined that under the candidate action strategy, the predicted next moment measurement point parameter reaches (including greater than and equal to) the warning parameter, or the difference between the warning parameter and the predicted next moment measurement point parameter is not less than the first set value, the candidate action strategy is eliminated.
[0087] For example, if under a certain candidate action strategy, the predicted measurement point parameter at the next moment is lower than the warning parameter by more than 3, it is considered that the control effect is not energy-saving and the candidate action strategy can be eliminated. Alternatively, under a certain candidate action strategy, the predicted measurement point parameter at the next moment exceeds the warning parameter and the control effect is considered to be more dangerous and the candidate action strategy can be eliminated to ensure the safety of the scene where the target device is located.
[0088] In addition, if the predicted measurement point parameters at the next moment exceed the warning parameters under all candidate action strategies, the candidate action strategy with the smallest set parameters is selected from all candidate action strategies as the action strategy at the current moment; if the difference between the warning parameters and the predicted measurement point parameters at the next moment reaches the first set value under all candidate action strategies, the candidate action strategy with the largest set parameters is selected from all candidate action strategies as the action strategy at the current moment.
[0089] S15. Adjust parameters of the target device according to the current action strategy.
[0090] For example, the target device is an air-conditioning device, and the temperature of the air-conditioning device is adjusted to the set temperature corresponding to the action strategy at the current moment.
[0091] In the embodiment of the present application, in each round of reinforcement learning, the current moment measurement point parameters and the current moment setting parameters corresponding to the target device are obtained; when determining the next moment setting parameters of the search target device, multiple candidate action strategies of the target device at the next moment are obtained. In order to avoid blind random exploration of multiple candidate action strategies, the embodiment of the present application predicts the next moment measurement point parameters based on each candidate action strategy, the current moment measurement point parameters and the current moment setting parameters, and determines the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameters and the warning parameters; then, based on the respective evaluation values of multiple candidate action strategies, the selection probability of each candidate action strategy is obtained, and then the current moment action strategy is selected from multiple candidate action strategies based on the selection probability to adjust the parameters of the target device. Different from the random action exploration method commonly used in existing online reinforcement learning, the embodiment of the present application gives appropriate direction guidance to the action selection of multiple candidate action strategies by determining the selection probability of each candidate action strategy, reduces the uncertainty risk brought by random action strategy exploration, thereby improving the security of the online reinforcement learning algorithm, and accelerating the learning process, thereby improving the training efficiency, and meeting the needs of efficient optimization control of the target device.
[0092] In some embodiments, after adjusting the parameters of the target device according to the current action strategy in S15, the following steps A1-A2 may be performed:
[0093] A1. Obtain the actual next-moment measurement point parameters corresponding to the target device, and determine the reward parameters of the current-moment action strategy based on the difference between the actual next-moment measurement point parameters and the warning parameters.
[0094] Among them, the reward parameters of the current moment action strategy can be determined based on the difference between the actual next moment measurement point parameters and the warning parameters according to the preset reward function. Specifically, the reward function needs to reflect the goal of equipment control in balancing the safety of the computer room and energy saving. The closer the actual next moment measurement point parameters are to the warning parameters, the higher the reward, and if the actual next moment measurement point parameters exceed the warning parameters, a larger penalty will be given.
[0095] In a possible implementation, the reward function may be a piecewise function. In the above step A, the reward parameter of the action strategy at the current moment is determined based on the difference between the actual next moment measurement point parameter and the warning parameter, which may include the following three possible situations:
[0096] The first possible situation is that if the actual next moment measurement point parameter is less than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is greater than the second set value, then based on the actual next moment measurement point parameter and the warning parameter, combined with the first reward function, the first reward parameter of the current moment action strategy is determined.
[0097] Among them, the first reward function and the second set value can be set as needed.
[0098] The second possible situation is that if the actual measurement point parameter at the next moment is not greater than the warning parameter, and the difference between the warning parameter and the actual measurement point parameter at the next moment is not greater than the second set value, then based on the actual measurement point parameter at the next moment and the warning parameter, combined with the second reward function, the second reward parameter of the action strategy at the current moment is determined.
[0099] The second reward function can be set as needed. The second reward parameter is greater than the first reward parameter.
[0100] The third possible situation is that if the actual next moment measurement point parameter is greater than the warning parameter, then based on the actual next moment measurement point parameter and the warning parameter, combined with the third reward function, the third reward parameter of the current moment action strategy is determined;
[0101] The third reward function can be set as needed. The third reward parameter is smaller than the first reward parameter.
[0102] For example, taking the next moment measurement point parameter as the next moment maximum measurement point temperature, and the warning parameter as the warning temperature as an example, the reward function is a piecewise function, including the above-mentioned first reward function, the second reward function and the third reward function, as shown in the following formula (2):
[0103]
[0104] in, represents the reward parameters (including the first reward parameter, the second reward parameter, and the third reward parameter), Indicates the actual maximum temperature of the measuring point at the next moment, T warning Indicates the warning temperature.
[0105] The specific curve of the above reward function is as follows Figure 2 As shown, the x-axis represents The y-axis represents The purpose of the above reward function is to control the temperature of the highest measuring point corresponding to the air-conditioning equipment within the range of 0 to 3 degrees below the warning temperature, and it would be best if it can be stabilized at 0.5 below the warning temperature and never exceed the warning temperature.
[0106] A2. Obtain the first state corresponding to the environmental parameters at the current moment, and based on the value estimation parameters corresponding to the first state and the executed action strategy, as well as the reward parameters of the action strategy at the current moment, obtain the value estimation parameters corresponding to the first state and the action strategy at the current moment in combination with the preset update rules; wherein the initial value of the value estimation parameter is the set value.
[0107] Specifically, before using the online reinforcement learning algorithm to control and optimize the target device in real time, the relevant parameters of the online reinforcement learning algorithm can be configured, including defining the state space, action space, setting the specific form of the reward function (such as the above-mentioned reward function) and key parameters such as the learning rate. Among them, the state space and action space are as follows:
[0108] State: It is necessary to select variables that are closely related to the optimization target, and select the variables that have the greatest impact on the control target while minimizing the state space. For example, taking the target device as an air conditioning device, the state specifically includes: the highest measurement point temperature Set temperature And the return air temperature That is, the state vector is
[0109] Action strategy: set parameters that can be executed at the next moment, such as setting temperature
[0110] In the exploration phase, the prediction algorithm is run for all candidate action strategies for the current state s (i.e., prediction is performed through a nonlinear prediction model), and then the action strategy a at the current moment is selected using the selection probability of the candidate action strategies provided by the prediction algorithm. The Q(s,a) value of (s,a) is updated using the iterative formula of the value estimation parameter Q based on the reward parameter r fed back by the environment.
[0111] In the experience utilization phase, all Q values under the current state s obtained in the exploration phase are obtained, and the executed action strategy a with the largest Q value is selected and executed. Then, according to the reward parameter r fed back by the environment, the iterative formula of the value estimation parameter Q is used to update the Q(s,a) value of (s,a).
[0112] As the number of rounds of online reinforcement algorithm training increases, the probability of exploration will gradually decrease, while the probability of experience utilization will gradually increase, and the Q(s,a) values of all state-action pairs (s,a) will gradually become fixed. At this time, the algorithm converges and the optimal strategy can be obtained.
[0113] The equipment control requirement is to ensure that the measurement point parameters (such as the maximum temperature of the measurement point) are kept below the warning parameters (such as the warning temperature), while achieving energy saving of the target equipment as much as possible. For example, the online reinforcement learning algorithm can use the Sarsa Table algorithm.
[0114] Sarsa is a table-based policy optimization algorithm used to find the optimal control strategy in a limited state-action space. The principle of the Sarsa algorithm is to use a table to record the Q(s,a) values of all state-action pairs (s,a). In the same state, the Q value is cumulatively updated, that is, different executed action strategies in the same state correspond to different Q values. When the table training converges, the action with the largest Q value in the same state is the optimal action strategy. In this way, the algorithm can find the optimal strategy by continuously updating the value function Q(s,a) of the state-action pair. The execution process of the Sarsa algorithm is to select an action strategy a and execute it according to the current state s through the ε-greedy method (that is, the optimal action strategy is selected with a certain probability and the non-optimal action strategy is selected with a certain probability) at each decision. Then, after a period of time, the reward parameter r and the next state s′ are obtained from the environment, and the next action strategy a′ is selected according to the ε-greedy method. The update rule of the Q(s,a) value of the state-action pair (s,a) is shown in formula (3):
[0115] Q(s,a)=Q(s,a)+α[r+γQ(s′,a′)-Q(s,a)] (3)
[0116] Where α represents the learning rate and γ represents the discount factor. The meaning of this update rule is to use the Q(s′,a′) value of the next state-action pair (s′,a′) and the current reward parameter r to update the Q(s,a) value of the current state-action pair (s,a). The core method is bootstrap update. The algorithm repeats the above steps for multiple iterations until the stop condition is met, and the optimal strategy can be obtained.
[0117] In the above step A2, the first state corresponding to the environmental parameters at the current moment includes: the measurement point parameters at the current moment, the setting parameters at the current moment, and may also include other parameters, such as the return air temperature of the air conditioner. The above online reinforcement learning algorithm iteratively updates the value estimation parameters under the same state. The value estimation parameters corresponding to the first state and the executed action strategy (such as the above Q) are the current value estimation parameters corresponding to the first state obtained before this round of reinforcement learning. Based on the current value estimation parameters and the reward parameters of the action strategy at the current moment, combined with the preset update rules (such as the above formula (3)), the value estimation parameters corresponding to the first state and the action strategy at the current moment are obtained, that is, the new current value estimation parameters corresponding to the first state are obtained.
[0118] The initial value of the value estimation parameter in each state can be set as needed, for example, to 0. Afterwards, for the same state, the value estimation parameter is cumulatively updated using the above preset update rule.
[0119] A3. In the next round of reinforcement learning, after obtaining the next moment environmental parameters corresponding to the target device, if the setting decision method in reinforcement learning is used to determine the next moment setting parameters of the target device from the executed action strategies, then the second state corresponding to the next moment environmental parameters is obtained, and from the multiple executed action strategies corresponding to the second state, the executed action strategy with the largest value estimation parameter is selected as the next moment action strategy.
[0120] Specifically, the decision-making method is set as described in step S12 of the above embodiment of the present application. If it is determined that the setting parameters for the next moment (i.e., the next moment of the next moment) of selecting the target device from the executed action strategies are set, the experience utilization stage is entered, and the second state corresponding to the environmental parameters at the next moment is determined, and the executed action strategy with the largest value estimation parameter is selected from the multiple executed action strategies corresponding to the second state as the action strategy for the next moment. Among them, the online reinforcement learning algorithm records the Q(s,a) values of all state-action pairs (s,a), i.e., the value estimation parameters. In the same state, the Q values are cumulatively updated, i.e., different executed action strategies in the same state correspond to different Q values. In the experience utilization stage, when the current state is the second state, the executed action strategy with the largest Q value in the second state is selected.
[0121] In some embodiments, in order to ensure the prediction accuracy of the nonlinear prediction model, the historical environmental parameters corresponding to the target device can be obtained at set intervals, and the historical environmental parameters are divided into a training set and a test set, and the nonlinear prediction model is retrained based on the training set and the test set. The set time can be set as needed, for example, 12 hours, and the historical environmental parameters can include the environmental parameters of the target device in the recent period of time.
[0122] Taking the nonlinear prediction model as a regression tree prediction model as an example, the training process of the regression tree prediction model is introduced below.
[0123] The regression tree prediction model uses a regression algorithm, which effectively distinguishes different samples and gives labels by continuously dividing the continuous feature space. It can be used to deal with the classification and prediction problems of continuous data. The specific formulas for the division area and average label value involved in the regression tree algorithm are as follows:
[0124]
[0125] Among them, X is the training sample set, which consists of a large number of samples X = [x1, x2, x3, ...], and each sample x i It also contains many features The characteristics It is the smallest unit of space division for regression tree algorithm. Y is the label set of X, Y = [y1, y2, y3, ...], where y i is the corresponding sample x i The label of . R is the non-overlapping area obtained by dividing the entire feature space. left (j,s) is for feature x j , the dividing point is the left area divided by s, and similarly R right (j,s) is the divided right area.
[0126] It is region R left The average label value of all samples in (j, s) can be used as the label prediction value of the samples in this area. That is, if a sample falls into this area during classification, the label value of the sample can be predicted as is the number of samples in the region.
[0127] In the embodiment of the present application, each sample corresponds to an environmental parameter of the target device at a certain moment, and the environmental parameter at a certain moment includes a measurement point parameter at a certain moment, a setting parameter at a certain moment, etc. Each parameter serves as a feature in the sample.
[0128] The training method of the regression tree algorithm is to use a top-down greedy recursive scheme to perform feature partitioning. That is, each time the partition is performed, only the current optimal one is considered, and the previous partition is no longer considered. Each time the dimension of the partition (i.e. the feature ), and the split point s. The determination of s always needs to minimize the RSS (Residual Sum of Squares) result after partitioning, and for fixed input features The optimal split point s can always be found. RSS can be calculated by the following formula (8).
[0129]
[0130] The overall idea of the regression tree algorithm is to recursively divide each region into two sub-regions in the feature space where the training data set is located and determine the output value of each sub-region, thereby constructing a binary decision tree. The basic idea of the algorithm is to use least squares to minimize the error between the predicted value of the region and the actual value of each sample.
[0131] In an embodiment of the present application, the training sample set used for training the regression tree prediction model can adopt the historical environmental parameters of the target device within a recent period of time (such as 7 days). For example, 75% of the data in the training sample set is used as a training set and 25% of the data is used as a test set.
[0132] Before starting training of the regression tree prediction model, first assign a random number seed to the regression tree algorithm, and then start the regression tree prediction model for training. When the accuracy of the test set obtained by model training is greater than 95%, and the accuracy of the validation set is greater than 95%, save the trained model and exit the training. Otherwise, discard the currently trained regression tree prediction model, reassign a new random number seed to the regression tree algorithm, and retrain the regression tree prediction model until the accuracy meets the requirements. Different random number seeds may guide the regression tree algorithm to train different regression tree prediction models, and the embodiment of the present application selects the regression tree prediction model from them. The time to successfully complete a training session is generally within 8 seconds, and the computing resources consumption is low.
[0133] In order to improve the prediction accuracy of the regression tree prediction model, the regression tree prediction model needs to be trained frequently. The training time interval can be set as needed, for example, 12 hours, that is, the latest historical environmental parameters of the target device will be used every 12 hours to start retraining the regression tree prediction model. In this way, it can better adapt to the latest information on changes in the computer room environment and prevent the regression tree prediction model from falling into a local optimum due to a certain training, which will affect subsequent training.
[0134] The embodiment of the present application utilizes the real data accumulated in real time during the operation of the online reinforcement learning algorithm in the real environment, and adopts the regression tree prediction model to perform customized learning on the temperature change of the highest measuring point of the air-conditioning equipment. This is equivalent to cleverly improving the efficiency of the learning environment on the basis of making full use of the existing historical environmental data, and making up for the problem of poor initial training effect of online reinforcement learning caused by insufficient training data.
[0135] The embodiment of the present application introduces a regression tree prediction model designed specifically for online reinforcement learning, which can provide effective assistance for the exploration phase of online reinforcement learning in the short term, and at the same time make full use of the data accumulated in the long-term operation of online reinforcement learning as training data. This organic combination enables the embodiment of the present application to surpass the traditional predictive control algorithm and the online reinforcement learning algorithm, realizes the complementary advantages of both parties, and jointly improves the control effect; and compared with the algorithm that completely relies on the prediction results for control decisions, the regression tree prediction model in the embodiment of the present application only plays the role of auxiliary scoring, so the complexity requirements of the regression tree prediction model are relatively low, but the embodiment of the present application improves the accuracy of the prediction results through high-frequency and fast model training. The model training and use costs of the embodiment of the present application are low, the regression tree prediction model does not contain a deep network at all, and adopts a lightweight machine learning model with the advantages of less resource consumption, fast training speed, and high operating efficiency.
[0136] Moreover, unlike the traditional offline reinforcement learning algorithm, the embodiment of the present application does not need to build a complex virtual simulation environment, and the cost of algorithm training is greatly reduced through online reinforcement learning. In view of the drawbacks of the blind strategy exploration of the current online reinforcement learning algorithm, the embodiment of the present application utilizes the relatively stable characteristics of the temperature change inside the computer room in the short term, and combines the prediction algorithm to scientifically predict and efficiently guide the candidate action strategy, effectively improving the decision-making efficiency and safety of the exploration stage.
[0137] At the same time, the online reinforcement learning algorithm of the embodiment of the present application is designed to operate in parallel with the strategy exploration phase and the experience utilization phase during the training process. In the strategy exploration phase, the algorithm will continuously try various action strategies and convert them into a referenceable experience knowledge base through real-time environmental feedback information. The experience utilization phase is to improve the algorithm of the aforementioned accumulated practical experience, and continuously optimize and improve the control strategy.
[0138] The device control method of the embodiment of the present application is generally introduced below with reference to specific examples.
[0139] Taking the control of air conditioning equipment in a data center as an example, the basic process of online reinforcement learning algorithm execution includes: first, read the current environmental state of the room in real time (including the current environmental parameters), then output reliable candidate action control strategies based on the current environmental state and the prediction algorithm, and then obtain real-time feedback on the executed action strategy from the environment for further optimization of the strategy. The control system of the air conditioning equipment (set in the terminal device or server) will pre-set a certain exploration probability. In the strategy exploration stage, a specially designed nonlinear prediction model is used to assist in the evaluation of each possible candidate control action strategy. The nonlinear prediction model can predict the maximum temperature change at the measuring point that may be caused by taking different candidate action strategies under the current environmental state, and score each candidate action strategy based on this prediction result, and then convert it into a selection probability. This process can effectively broaden the action search space of the strategy and reduce the trial and error cost while ensuring the safety of the room temperature control. In the experience utilization stage, the algorithm selects the most appropriate control action strategy based on the experimental data accumulated in the previous exploration stage, and continuously adjusts and optimizes the strategy by obtaining environmental feedback information again.
[0140] In actual application scenarios, all data rooms have preset warning temperatures to ensure the safe operation of equipment. When it is detected that the cabinet or ambient temperature exceeds the warning temperature, appropriate cooling measures should be taken; conversely, when the cabinet or ambient temperature does not reach the warning temperature, energy-saving control strategies should be given priority. Taking into account that the changes in the temperature of the measuring points in the computer room in a short period of time have a certain degree of continuity and stability, and based on a full understanding of the refrigeration principle of air-conditioning equipment, the causal relationship between room temperature changes and air-conditioning regulation, the embodiment of the present application designs an online reinforcement learning computer room control algorithm process based on prediction assistance, through which the set temperature of the air-conditioning equipment in the computer room can be efficiently and safely controlled.
[0141] Given the location distribution of different air-conditioning equipment in the data center, the characteristics of the cabinet equipment they face, and the diversity of their own performance indicators, the data they interact with the environment vary. In order to improve the accuracy of the nonlinear prediction model, a nonlinear prediction model can be customized and trained for each air-conditioning equipment to avoid the impact of mixed training on the nonlinear prediction model's capture of the characteristic changes of individual air-conditioning equipment. At the same time, the nonlinear prediction model needs to run smoothly on the edge control device and needs to meet the following requirements:
[0142] ① The model should be small and light, requiring little storage space;
[0143] ② The model training process should be simple and fast, and should not occupy too much computing power of the equipment;
[0144] ③The model must be able to achieve a high prediction accuracy in a short period of time in order to provide stable and reliable prediction services.
[0145] In order to meet the above requirements, the embodiment of the present application selects a non-deep learning machine learning algorithm as the infrastructure of the nonlinear prediction model. This type of algorithm has intuitive and easy-to-understand interpretability, low data requirements, and can complete the training task with only the CPU (Central Processing Unit). Specifically, the embodiment of the present application can use a regression tree algorithm, which shows excellent timeliness in training and can complete training within 8 seconds, significantly improving the response speed and accuracy of real-time prediction.
[0146] The following uses the air conditioning equipment in a data center as an example to exemplify the specific implementation steps of the equipment control method of the embodiment of the present application.
[0147] like Figure 3 As shown, the specific implementation steps of the device control method of the embodiment of the present application include:
[0148] S31. Determine the warning temperature of the data center and the adjustable temperature range of the air-conditioning equipment.
[0149] S32. Configure the state space, action space, and reward function of online reinforcement learning.
[0150] In this step, configure the relevant parameters of the online reinforcement learning algorithm, including defining the state space, action space, setting the specific form of the reward function, and key parameters such as the learning rate. The state space refers to the variables contained in the state, such as the highest measurement point temperature, set temperature, and return air temperature of the air conditioner, and the action space refers to all possible candidate action strategies.
[0151] S33, reading the current environmental parameters corresponding to the air-conditioning equipment, and inputting the current state of the online reinforcement learning.
[0152] Specifically, various environmental parameters of the current computer room status are obtained from the actual environment, including: maximum measuring point temperature, set temperature, air conditioning return air temperature, etc., and these environmental parameters are converted into input states of the reinforcement learning algorithm.
[0153] S34: Whether to conduct strategy exploration, if yes, continue to execute S35, if no, continue to execute S42.
[0154] Specifically, the decision whether to conduct strategy exploration is made based on the set decision method (such as ε-greedy) of the online reinforcement learning algorithm. If so, the exploration phase is entered, and the selection probability of the candidate action strategy is determined using a specially designed regression tree prediction model, and strategy exploration is performed based on the probability distribution. If not, the experience utilization phase is entered, and the action strategy is directly selected based on the Q value of the corresponding state in the existing reinforcement learning table, and the action strategy is communicated to the air-conditioning equipment for execution.
[0155] S35: Check whether the regression tree prediction model has been trained for 12 hours. If yes, continue to execute S36; if no, continue to execute S37.
[0156] Specifically, it is necessary to regularly check whether the regression tree prediction model needs to be updated and trained (for example, once every 12 hours). If necessary, the historical environmental data of the data center in the past week is used to start the training process of the regression tree prediction model; otherwise, the regression tree prediction model obtained from the last training is continued to be used.
[0157] S36. Retrain the regression tree prediction model using the latest historical environment parameters.
[0158] In this step, for the training of the regression tree prediction model, in the data preprocessing stage, data including cabinet temperature, measuring point temperature, set temperature of air-conditioning equipment, air-conditioning return air temperature, etc. are extracted from the historical environmental parameters of the data room, and data cleaning is performed. When processing missing values (such as NaN), linear interpolation of the data of the previous and next time points is used to fill in the missing values, and abnormal temperature data points are eliminated.
[0159] Then, set the random number seed for regression tree prediction model training, and use the latest 7-day processed data set for model training. When the model accuracy on both the training set and the test set reaches 95% or above, terminate the training and save the regression tree prediction model. Otherwise, replace the random number seed and retrain until the standard is met. Usually, model training can be completed efficiently within 8 seconds.
[0160] S37. Predict the execution results of multiple candidate action strategies for the air-conditioning equipment in the current state based on the regression tree prediction model.
[0161] Specifically, the current state includes the current maximum measurement point temperature and the current set temperature. The changes in the current maximum measurement point temperature, the current set temperature, and various set temperatures (various candidate action strategies) that may be adopted are input into the regression tree prediction model, and the changes in the maximum measurement point temperature under different candidate action strategies are output, so that the next moment maximum measurement point temperature under different candidate action strategies can be obtained. If a certain candidate action strategy may cause the next moment maximum measurement point temperature to exceed the warning temperature, or the next moment maximum measurement point temperature to be more than 3 degrees lower than the warning temperature, then the candidate action strategy will be eliminated to ensure the safe operation of the computer room.
[0162] S38. Scoring multiple candidate action strategies according to the prediction results and converting them into selection probabilities.
[0163] Specifically, the prediction result is the highest temperature of the measuring point at the next moment. According to the difference between the warning temperature and the highest temperature of the measuring point at the next moment, different candidate action strategies are scored, and the score (i.e., evaluation value) is converted into selection probability through the softmax function.
[0164] S39: Select the action strategy at the current moment and execute it, and obtain the reward parameters of the feedback from the environment.
[0165] Specifically, the current action strategy is selected from the candidate action strategies according to their selection probabilities, and the temperature of the air-conditioning equipment is adjusted according to the current action strategy. After the current action strategy is executed for a period of time (e.g., half an hour), the reward parameter of the current action strategy is calculated according to the difference between the highest temperature of the next measurement point and the warning temperature actually fed back by the data center.
[0166] S40: Store the operation data of this round of reinforcement learning.
[0167] Specifically, the state, action strategy, reward parameters, value estimation parameters, etc. generated by this round of reinforcement learning are recorded for subsequent learning updates.
[0168] S41. Train and update the Q value in the reinforcement table.
[0169] According to the preset update rules of online reinforcement learning, the Q(s,a) value in the reinforcement learning table is updated and optimized to improve the timeliness of the strategy.
[0170] S42. Select the action strategy with the largest Q value in the reinforcement table.
[0171] Afterwards, various parameters of the current computer room environment are collected and processed, converted into new input states for the reinforcement learning algorithm, and a new round of reinforcement learning execution and model training process is started to achieve closed-loop iterative optimization.
[0172] The device control method of the embodiment of the present application can be widely used in computer room air conditioning control systems with diverse temperature control requirements. With the efficient use of real-time data, it is possible to predict more state variables for the online reinforcement learning algorithm with the help of nonlinear prediction models, and strongly support various customized reinforcement learning strategies to achieve rapid adaptation and efficient exploration when facing unknown environments. Moreover, in the scenario of ensuring the safety control of the computer room, the embodiment of the present application can conduct risk assessment on the candidate action strategies to be executed, and block dangerous operations when necessary, thereby providing a higher level of security for the computer room.
[0173] At the same time, the equipment control method of the embodiment of the present application can be further expanded, and the prediction variables of the nonlinear prediction model can be flexibly customized according to actual needs, providing each air-conditioning device with personalized temperature change prediction capabilities, which effectively promotes the adaptability of the online reinforcement learning algorithm to environmental changes and the improvement of its ability to achieve strategy optimization. By accurately predicting and timely shielding candidate action strategies that may cause risks, the possibility of the online reinforcement learning algorithm selecting potentially dangerous operations under specific conditions is fundamentally eliminated, thereby significantly enhancing the overall safety and stability of the computer room control system.
[0174] Based on the same inventive concept, an embodiment of the present application also provides an equipment control device, the principle of which is similar to the method of the above embodiment, so the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.
[0175] like Figure 4 As shown, it is a schematic diagram of the structure of the device control device 400, which may include:
[0176] The acquisition unit 401 is used to acquire the current environment parameters corresponding to the target device in each round of reinforcement learning, where the current environment parameters include the current measurement point parameters and the current setting parameters;
[0177] A search unit 402 is used to obtain a plurality of candidate action strategies for the target device at the next moment if the setting parameter of the target device at the next moment is determined based on the setting decision method in reinforcement learning, each candidate action strategy corresponding to a setting parameter;
[0178] The prediction unit 403 is used to predict the next moment measurement point parameter corresponding to each candidate action strategy based on each candidate action strategy, the current moment measurement point parameter and the current moment setting parameter, and determine the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameter and the warning parameter;
[0179] A first selection unit 404 is used to obtain a selection probability of each candidate action strategy based on the evaluation values of each of the multiple candidate action strategies, and select a current moment action strategy from the multiple candidate action strategies based on the selection probabilities of each of the multiple candidate action strategies;
[0180] The control unit 405 is used to adjust the parameters of the target device according to the current action strategy.
[0181] Optionally, when predicting the next moment measurement point parameter corresponding to each candidate action strategy based on each candidate action strategy, the current moment measurement point parameter and the current moment setting parameter, the prediction unit 403 is specifically used to:
[0182] Input the current measurement point parameters, the change between the setting parameters corresponding to each candidate action strategy and the current setting parameters into the nonlinear prediction model, and output the change of the measurement point parameters at the next moment;
[0183] Based on the measuring point parameters at the current moment and the change in the measuring point parameters at the next moment, the predicted measuring point parameters at the next moment are obtained.
[0184] Optionally, the device further comprises a training unit, which is used to:
[0185] The historical environmental parameters corresponding to the target device are obtained at set intervals, and the historical environmental parameters are divided into a training set and a test set. The nonlinear prediction model is retrained based on the training set and the test set.
[0186] Optionally, when determining the evaluation value of each candidate action strategy based on the difference between the predicted next-moment measurement point parameter and the warning parameter, the prediction unit 403 is specifically configured to:
[0187] Acquire a plurality of preset difference ranges, and determine a target difference range among the plurality of difference ranges corresponding to a difference between the warning parameter and a predicted measurement point parameter at the next moment;
[0188] Based on the evaluation values corresponding to each of the plurality of difference ranges, a target evaluation value corresponding to the target difference range is determined, and the target evaluation value is used as the evaluation value of the candidate action strategy.
[0189] Optionally, the device further comprises a rejection unit, configured to:
[0190] For each candidate action strategy, if it is determined that under the candidate action strategy, the predicted next moment measurement point parameter reaches the warning parameter, or the difference between the warning parameter and the predicted next moment measurement point parameter is not less than the first set value, the candidate action strategy is eliminated.
[0191] Optionally, the device further comprises:
[0192] A reward determination unit, configured to obtain the actual next-moment measurement point parameters corresponding to the target device after adjusting the parameters of the target device according to the current-moment action strategy, and determine the reward parameters of the current-moment action strategy based on the difference between the actual next-moment measurement point parameters and the warning parameters;
[0193] An updating unit, used to obtain a first state corresponding to the environmental parameters at the current moment, and based on the first state and the value estimation parameters corresponding to the executed action strategy, and the reward parameters of the action strategy at the current moment, obtain the value estimation parameters corresponding to the first state and the action strategy at the current moment in combination with a preset updating rule; wherein the initial value of the value estimation parameter is a set value;
[0194] The second selection unit is used to obtain the next moment environment parameters corresponding to the target device in the next round of reinforcement learning. If it is determined based on the setting decision method in reinforcement learning to select the next moment setting parameters of the target device from the executed action strategies, then the second state corresponding to the next moment environment parameters is obtained, and from the multiple executed action strategies corresponding to the second state, the executed action strategy with the largest value estimation parameter is selected as the next moment action strategy.
[0195] Optionally, the reward determination unit is specifically used for:
[0196] If the actual next moment measurement point parameter is less than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is greater than the second set value, then based on the actual next moment measurement point parameter and the warning parameter, combined with the first reward function, determine the first reward parameter of the current moment action strategy;
[0197] If the actual next moment measurement point parameter is not greater than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is not greater than the second set value, then based on the actual next moment measurement point parameter and the warning parameter, combined with the second reward function, determine the second reward parameter of the current moment action strategy;
[0198] If the actual next moment measurement point parameter is greater than the warning parameter, then based on the actual next moment measurement point parameter and the warning parameter, combined with the third reward function, determine the third reward parameter of the current moment action strategy;
[0199] The second reward parameter is greater than the first reward parameter, and the first reward parameter is greater than the third reward parameter.
[0200] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0201] After introducing the device control method and apparatus according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0202] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server or a terminal device. In this embodiment, the structure of the electronic device may be as follows: Figure 5 As shown, it includes a memory 501 , a communication module 503 and one or more processors 502 .
[0203] The memory 501 is used to store computer programs executed by the processor 502. The memory 501 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0204] The memory 501 may be a volatile memory, such as a random-access memory (RAM); the memory 501 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 501 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 501 may be a combination of the above memories.
[0205] The processor 502 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 502 is used to implement the above device control method when calling the computer program stored in the memory 501 .
[0206] The communication module 503 is used to communicate with terminal devices and other servers.
[0207] The specific connection medium between the memory 501, the communication module 503 and the processor 502 is not limited in the embodiment of the present application. Figure 5 In the embodiment, the memory 501 and the processor 502 are connected via a bus 504. The bus 504 is connected to the processor 502 via a bus 504. Figure 5The connections between the other components are described with bold lines, which are only for illustrative purposes and are not intended to be limiting. The bus 504 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 5 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.
[0208] The present application embodiment provides a computer-readable storage medium, which stores a computer program. When the computer program is executed on an electronic device, the computer program is used to enable the electronic device to execute the device control method of the above embodiment, such as Figure 1 shown.
[0209] The computer-readable storage medium in the above embodiments can be any available medium or data storage device that can be accessed by the processor in the device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drives (SSDs), etc.
[0210] In some possible implementations, various aspects of the device control method provided in the embodiments of the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the device control method according to various exemplary embodiments of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 1 Follow the steps shown in .
[0211] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0212] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.
[0213] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0214] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0215] The computer program for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0216] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0217] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0218] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0219] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0220] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0221] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0222] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0223] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A device control method, characterized in that: include: In each round of reinforcement learning, the current environment parameters corresponding to the target device are obtained, and the current environment parameters include the current measurement point parameters and the current setting parameters; If it is determined to search for the next moment setting parameter of the target device based on the setting decision method in the reinforcement learning, then a plurality of candidate action strategies of the target device at the next moment are obtained, each of which corresponds to a setting parameter; Based on each of the candidate action strategies, the current moment measurement point parameters and the current moment setting parameters, predict the next moment measurement point parameters corresponding to each of the candidate action strategies, and determine the evaluation value of each of the candidate action strategies based on the difference between the predicted next moment measurement point parameters and the warning parameters; Based on the evaluation values of each of the plurality of candidate action strategies, obtaining a selection probability of each of the candidate action strategies, and based on the selection probabilities of each of the plurality of candidate action strategies, selecting a current moment action strategy from the plurality of candidate action strategies; Parameters of the target device are adjusted according to the current action strategy.
2. The method according to claim 1, characterized in that The predicting of the measurement point parameters at the next moment based on each of the candidate action strategies, the measurement point parameters at the current moment and the setting parameters at the current moment includes: Input the current moment measurement point parameter, the change between the setting parameter corresponding to each candidate action strategy and the current moment setting parameter into a nonlinear prediction model, and output the change of the measurement point parameter at the next moment; Based on the measurement point parameters at the current moment and the variation of the measurement point parameters at the next moment, the predicted measurement point parameters at the next moment are obtained.
3. The method according to claim 2, characterized in that The method further comprises: The historical environment parameters corresponding to the target device are obtained at set time intervals, and the historical environment parameters are divided into a training set and a test set, and the nonlinear prediction model is retrained based on the training set and the test set.
4. The method according to claim 1, characterized in that: The step of determining the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameter and the warning parameter comprises: Acquire a plurality of preset difference ranges, and determine a target difference range among the plurality of difference ranges corresponding to the difference between the warning parameter and the predicted next moment measurement point parameter; Based on the evaluation values corresponding to each of the plurality of difference ranges, a target evaluation value corresponding to the target difference range is determined, and the target evaluation value is used as the evaluation value of the candidate action strategy.
5. The method according to claim 1, characterized in that Before obtaining the selection probability of each candidate action strategy based on the respective evaluation values of the plurality of candidate action strategies, the method further includes: For each of the candidate action strategies, if it is determined that under the candidate action strategy, the predicted next moment measurement point parameter reaches the warning parameter, or the difference between the warning parameter and the predicted next moment measurement point parameter is not less than a first set value, the candidate action strategy is eliminated.
6. The method according to any one of claims 1 to 5, characterized in that: After adjusting the parameters of the target device according to the current action strategy, the method further includes: Acquire the real next-moment measurement point parameter corresponding to the target device, and determine the reward parameter of the current-moment action strategy based on the difference between the real next-moment measurement point parameter and the warning parameter; Obtaining a first state corresponding to the environmental parameters at the current moment, and obtaining the value estimation parameters corresponding to the first state and the action strategy at the current moment based on the first state, the value estimation parameters corresponding to the executed action strategy, and the reward parameters of the action strategy at the current moment, in combination with a preset update rule; wherein the initial value of the value estimation parameter is a set value; In the next round of reinforcement learning, after obtaining the next moment environmental parameters corresponding to the target device, if it is determined based on the setting decision method in the reinforcement learning to select the next moment setting parameters of the target device from the executed action strategies, then the second state corresponding to the next moment environmental parameters is obtained, and from the multiple executed action strategies corresponding to the second state, the executed action strategy with the largest value estimation parameter is selected as the next moment action strategy.
7. The method according to claim 6, characterized in that The step of determining the reward parameter of the action strategy at the current moment based on the difference between the actual next moment measurement point parameter and the warning parameter comprises: If the actual next moment measurement point parameter is less than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is greater than a second set value, then based on the actual next moment measurement point parameter and the warning parameter, combined with the first reward function, determine the first reward parameter of the current moment action strategy; If the actual next moment measurement point parameter is not greater than the warning parameter, and the difference between the warning parameter and the actual next moment measurement point parameter is not greater than the second set value, then based on the actual next moment measurement point parameter and the warning parameter, in combination with a second reward function, determine the second reward parameter of the current moment action strategy; If the actual next moment measurement point parameter is greater than the warning parameter, determining a third reward parameter of the current moment action strategy based on the actual next moment measurement point parameter and the warning parameter in combination with a third reward function; The second reward parameter is greater than the first reward parameter, and the first reward parameter is greater than the third reward parameter.
8. A device control device, characterized in that: include: An acquisition unit, used to acquire the current moment environmental parameters corresponding to the target device in each round of reinforcement learning, wherein the current moment environmental parameters include the current moment measurement point parameters and the current moment setting parameters; A search unit, configured to obtain a plurality of candidate action strategies for the target device at the next moment, each of which corresponds to a setting parameter, if it is determined to search for the setting parameter of the target device at the next moment based on the setting decision method in the reinforcement learning; A prediction unit, configured to predict the next moment measurement point parameter corresponding to each candidate action strategy based on each candidate action strategy, the current moment measurement point parameter and the current moment setting parameter, and determine the evaluation value of each candidate action strategy based on the difference between the predicted next moment measurement point parameter and the warning parameter; A first selection unit, configured to obtain a selection probability of each of the candidate action strategies based on respective evaluation values of the plurality of candidate action strategies, and select a current moment action strategy from the plurality of candidate action strategies based on respective selection probabilities of the plurality of candidate action strategies; A control unit is used to adjust parameters of the target device according to the current action strategy.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 7.
Citation Information
Cited By
Circuit control method and device and storage medium
CN118963229A
