Artificial rainbow generation method and device with wind power compensation
Through the combination of LSTM network and deep reinforcement learning model, real-time monitoring and adjustment of nozzle angle and pressure, the instability problem of artificial rainbow technology under the influence of wind is solved, self-optimization and high-quality rainbow generation are achieved, and different environmental conditions are adapted to different environmental conditions. .
Patent Information
- Application Number
- CN202410954035.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-12-06
Smart Images

Figure CN119076288A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of artificial rainbows, and in particular to a method and a device for generating an artificial rainbow with wind compensation. Background Art
[0002] At present, the technology of artificial rainbow is developing day by day. For example, the Chinese patent with application number 201110455761.2 proposes an artificial rainbow with bright colors and good viewing effect. The observation direction is set to the horizontal direction, and the artificial spraying device is placed in a curved staggered manner. Before the water pipe is passed through, it is first passed through the pressure device to increase the pressure of the water, and then sprayed out from the meeting head through the arc water pipe to form a ring-shaped water mist ring. Under the illumination of the side lighting device, the white light is dispersed to achieve the effect of an artificial rainbow. The Chinese patent with application number 201510135437.0 proposes an intelligent artificial rainbow machine, which forms a fine water mist belt through a pressure pump and an atomizing device, and intelligently adjusts the intensity and illumination angle of the light source irradiated on the water mist belt to artificially create a rainbow.
[0003] However, none of the above solutions considers the problem that water mist is easily dispersed under the influence of wind, which makes the rainbow unstable or even unable to form. In addition, there is a lack of self-optimizing intelligent control mechanism, which cannot automatically adjust to different environmental conditions and improve the stability of rainbow generation. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a method and device for generating an artificial rainbow with wind compensation and automatic optimization.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A method for generating an artificial rainbow with wind compensation, comprising:
[0007] S1: Acquire real-time status data of the artificial rainbow, wherein the status data includes wind speed, wind direction, nozzle angle, spray pressure, image of the generated rainbow and corresponding time data;
[0008] S2: Obtaining a corresponding rainbow quality score according to the generated rainbow image;
[0009] S3: Establishing an LSTM network and a deep reinforcement learning model, wherein the LSTM network extracts features of the wind speed, wind direction, nozzle angle, spray pressure and corresponding time data; the deep reinforcement model adjusts the nozzle angle and spray pressure according to the rainbow quality score and the wind speed, wind direction, nozzle angle and spray pressure data extracted by the LSTM network;
[0010] S4: Use the state data obtained in step S1 to train the LSTM network and the deep reinforcement learning model, and use the trained final model to adjust the nozzle angle and the injection pressure according to the current state data.
[0011] Another technical solution adopted by the present invention is:
[0012] An artificial rainbow generating device with wind compensation comprises a sensor module, a control system, a nozzle and a power mechanism;
[0013] The sensor module is connected to the control system and is used to collect the state data of the artificial rainbow in real time and transmit it to the control system. The sensor module includes: a wind speed sensor, which is used to collect the wind speed and corresponding time data of the artificial rainbow generating device with wind compensation; a wind direction sensor, which is used to collect the wind direction and corresponding time data of the artificial rainbow generating device with wind compensation; a nozzle angle sensor, which is used to collect the nozzle angle and corresponding time data; a pressure sensor, which is used to collect the injection pressure of the nozzle and the corresponding time data; a visual sensor, which is used to collect the image of the generated rainbow and the corresponding time data;
[0014] The power mechanism is connected to the control system and the nozzle respectively, and the control system controls the power mechanism to adjust the action of the nozzle. Specifically, the control system includes a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the steps included in the above-mentioned method for generating artificial rainbow with wind compensation can be implemented.
[0015] The beneficial effects of the present invention are:
[0016] (1) Real-time environmental monitoring can accurately capture key parameters such as wind speed and wind direction, and intelligently adjust the angle and pressure of the nozzle through a deep reinforcement learning model. It can respond quickly to changes in wind speed and adjust the parameters of the water mist injection, thereby significantly improving the stability and adaptability of rainbow generation and ensuring that high-quality rainbows can be generated under different environmental conditions.
[0017] (2) The deep reinforcement learning model is used to enable the system to have the ability of self-learning and optimization. As time goes by and more data is accumulated, the system can continuously optimize its control strategy, improve the speed and accuracy of its response to environmental changes, and further improve the quality and stability of rainbow generation.
[0018] (3) No longer relying on artificial light sources, the device only needs to be placed under sunlight to achieve the most stable water mist distribution through control to form the best rainbow effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1FIG. 1 is a flow chart of a method for generating an artificial rainbow with wind compensation according to an embodiment of the present invention;
[0020] Figure 2 It is a schematic structural diagram of an artificial rainbow generating device with wind compensation according to an embodiment of the present invention;
[0021] Figure 3 FIG. 1 is a flow chart of a method for generating an artificial rainbow with wind compensation according to Embodiment 1 of the present invention;
[0022] Figure 4 Shown is a schematic diagram of the structure and application of an artificial rainbow generating device with wind compensation according to the second embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to more clearly understand the technical content, achieved purposes and effects of the present invention, the present invention is described in detail below in conjunction with specific implementation methods and in conjunction with the accompanying drawings. It should be noted that, in the absence of conflict, the implementation methods of the present invention and the features in the implementation methods can be combined with each other. In the following description, many specific details are set forth in order to fully understand the present invention. The described implementation methods are only part of the implementation methods of the present invention, not all implementation methods. Based on the implementation methods in the present invention, all other implementation methods obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0024] Please refer to Figure 1 and 3 As shown, the present invention provides a method for generating an artificial rainbow with wind compensation, comprising:
[0025] S1: Acquire real-time status data of the artificial rainbow, wherein the status data includes wind speed, wind direction, nozzle angle, spray pressure, image of the generated rainbow and corresponding time data;
[0026] S2: Obtaining a corresponding rainbow quality score according to the generated rainbow image;
[0027] S3: Establishing an LSTM network and a deep reinforcement learning model, wherein the LSTM network extracts features of the wind speed, wind direction, nozzle angle, spray pressure and corresponding time data; the deep reinforcement model adjusts the nozzle angle and spray pressure according to the rainbow quality score and the wind speed, wind direction, nozzle angle and spray pressure data extracted by the LSTM network;
[0028] S4: Use the state data obtained in step S1 to train the LSTM network and the deep reinforcement learning model, and use the trained final model to adjust the nozzle angle and the injection pressure according to the current state data.
[0029] From the above description, it can be seen that the artificial rainbow generation method with wind compensation of the present invention has intelligent wind compensation control: it adopts real-time monitoring of wind speed and wind direction in the environment, and intelligently adjusts the angle and injection pressure of the nozzle through a deep reinforcement learning algorithm to achieve automatic compensation for the influence of wind, thereby improving the stability and adaptability of rainbow generation. Introducing intelligent control and adaptive optimization mechanism: by using a deep reinforcement learning model, self-learning and optimization can be achieved, so that the rainbow generation device can adapt to environmental changes and continuously improve the control strategy to obtain the best rainbow generation effect.
[0030] Furthermore, step S2 specifically includes:
[0031] S21: Obtaining the color vividness (C), arc length (L) and radius (R) of the rainbow according to the generated rainbow image;
[0032] S22: Calculate the corresponding rainbow quality score according to the following formula:
[0033] score=w1*C+w2*L+w3*R
[0034] Where w1, w2 and w3 are weight factors.
[0035] The vividness of colors can be assessed by analyzing the saturation and brightness of the colors in a rainbow. Specifically, image processing techniques can be used to calculate the average saturation and brightness values from an image of a rainbow. The arc length of a rainbow, i.e., the visual length of a rainbow, can be measured from an image of a rainbow using image processing algorithms. The radius of a rainbow can be inferred from the arc and arc length of the rainbow, or directly from a geometric analysis of the image.
[0036] From the above description, we can know that the above scoring formula is designed by comprehensively considering the color vividness (C), arc length (L) and radius (R) of the rainbow. The weight factors w1, w2 and w3 are adjusted according to the actual situation to reflect the importance of different parameters. The rainbow quality scoring formula and its application in the deep enhancement model can be regularly reviewed and adjusted to ensure that it can adapt to different environmental changes and user expectations.
[0037] Furthermore, the initial value of w1 is 0.5, the initial value of w2 is 0.3, and the initial value of w3 is 0.2.
[0038] From the above description, we can see that color is the most direct visual experience when watching a rainbow, and it has a greater impact on the viewing experience. Therefore, it can be given a higher weight, and w1=0.5 is initially set. The arc length determines the size and integrity of the rainbow, which is equally important for the viewing experience, but may be slightly inferior to the color vividness. The initial weight is set to w2=0.3. The radius is related to the size of the rainbow and the viewing angle. Although it is important, its impact may not be as direct as color and arc length. The initial weight is set to w3=0.2. The weight factor can be adjusted later through feedback from actual deployment in different environments to ensure that the score can accurately reflect the visual effect of the rainbow and the audience's satisfaction.
[0039] Furthermore, the specific settings of the LSTM network in step S3 include:
[0040] The input wind speed, wind direction, nozzle angle, and spray pressure data were collected with 30 seconds as the length of the input sequence;
[0041] The collected data were normalized to the range of [0, 1] using the maximum and minimum normalization process.
[0042] The activation function uses a linear activation function; and
[0043] The loss function adopts the mean square error loss function.
[0044] From the above description, we can see that normalization is used to improve the stability and efficiency of model training. Regression is achieved through linear activation and mean square error (MSE) function.
[0045] Furthermore, the specific settings of the deep reinforcement learning model in step S3 include:
[0046] The state vector includes wind speed, wind direction, nozzle angle, spray pressure, and the most recent rainbow quality score;
[0047] The action space includes nozzle angle adjustment and spray pressure adjustment;
[0048] The reward function uses the following formula:
[0049] R = score-cost, where R is the reward, score is the rainbow quality score, and cost is the total cost.
[0050] From the above description, we can see that based on the visibility and stability of the rainbow, the rainbow quality score is directly used as part of the reward, so that the direct goal of the model is to improve the overall quality of the rainbow. The cost includes all resource consumption and possible penalty factors.
[0051] Furthermore, the cost calculation formula is as follows:
[0052] cost = α * cwater +β*c energy +γ*c wear +δ*c risk
[0053] Among them, c water is the water resource consumption cost, c energy is the energy consumption cost, c wear is the equipment wear cost, c risk is the operational risk cost, and α, β, γ and δ are the weight coefficients of each cost factor.
[0054] From the above description, we can see that the total cost includes water resource consumption cost, energy consumption cost, equipment wear cost and operational risk cost. Water resource consumption cost is calculated based on the amount of water consumed per unit time. Energy consumption is mainly used to drive nozzles, pumps and control systems, and the energy consumption cost is calculated based on the amount of electricity consumed and the local electricity price. Frequent adjustment of nozzle angle and injection pressure may accelerate the wear of equipment. The equipment wear cost can be estimated based on the expected reduction in equipment life and increased maintenance frequency. Incorrect operation or over-adjustment may lead to equipment failure or safety accidents. For example, excessive water pressure may cause pipeline rupture. The operational risk cost can be estimated based on historical data of past failures and potential repair costs. In the initial setting, the same value can be set for all weights, α=β=γ=δ=1, to provide a benchmark, and dynamically adjust the weights based on data feedback and performance evaluation in actual operation. For example, if it is found that the impact of operational risk costs is smaller than expected, the value of δ can be appropriately reduced.
[0055] Further, the nozzle angle adjustment includes increasing or decreasing the angle, and the action values are set as: +1°, -1°, +5°, -5°;
[0056] The injection pressure regulation includes increasing or decreasing the pressure, and the action values are set as: +5%, -5%, +10%, -10%.
[0057] From the above description, it can be seen that through the above settings, the adjustment direction and adjustment range of the nozzle angle and the injection pressure are controlled to meet the needs of rainbow generation.
[0058] Furthermore, the algorithm of the deep reinforcement learning model is a Proximal Policy Optimization algorithm, and the neural network architecture is an Actor-Critic network.
[0059] From the above description, we can see that the Proximal Policy Optimization (PPO) algorithm is suitable for continuous action space, balances the exploration and utilization of strategies, and is more stable. The Actor network is a network that predicts actions, with the input being the state vector and the output being the probability of each action. The Critic network is a network that estimates the value of a state or state-action pair, with the input being the state vector and the output being the value estimate of the state. The Actor-Critic network is a combination of the Actor network and the Critic network.
[0060] Furthermore, a joint training method is adopted to train the LSTM network and the deep reinforcement learning model, in which the data extracted by the LSTM network is used as the state identifier, the Actor network proposes actions, and the Critic network evaluates the value of the actions.
[0061] From the above description, we can see that the LSTM network and the deep reinforcement learning model can be trained jointly. The LSTM network learns to extract effective features from historical data, while the deep reinforcement learning model optimizes action selection based on these features and the current environment state.
[0062] Furthermore, after step S4, the following steps are further included:
[0063] S5: Monitor the effect of rainbow generation and the running status of the final model, and optimize the model according to the monitored data.
[0064] From the above description, it can be seen that continuous optimization can be achieved through monitoring feedback to further improve the quality and stability of rainbow generation.
[0065] Please refer to Figure 2 and 4 As shown, the present invention also provides an artificial rainbow generating device with wind compensation, comprising a sensor module, a control system, a nozzle and a power mechanism;
[0066] The sensor module is connected to the control system and is used to collect the state data of the artificial rainbow in real time and transmit it to the control system. The sensor module includes: a wind speed sensor, which is used to collect the wind speed and corresponding time data of the artificial rainbow generating device with wind compensation; a wind direction sensor, which is used to collect the wind direction and corresponding time data of the artificial rainbow generating device with wind compensation; a nozzle angle sensor, which is used to collect the nozzle angle and corresponding time data; a pressure sensor, which is used to collect the injection pressure of the nozzle and the corresponding time data; a visual sensor, which is used to collect the image of the generated rainbow and the corresponding time data;
[0067] The power mechanism is connected to the control system and the nozzle respectively, and the control system controls the power mechanism to adjust the action of the nozzle. Specifically, the control system includes a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the steps included in the above-mentioned method for generating artificial rainbow with wind compensation can be implemented.
[0068] Specifically, the power mechanism includes a water pump, a booster pump, an air pressure regulating valve, an air pump and a direction rod, the water pump is connected to the nozzle through the booster pump, the air pressure regulating valve is connected to the nozzle through the air pump, the direction rod is connected to the nozzle, and the control system is connected to the air pressure regulating valve, the booster pump and the direction rod respectively. In a specific embodiment, the direction rod can be integrated with the nozzle.
[0069] In practical applications, a rainbow can be generated by placing an artificial rainbow generating device with wind compensation under sunlight.
[0070] From the above description, it can be seen that the beneficial effect of the present invention is that by real-time monitoring of environmental factors such as wind speed and wind direction, and intelligently adjusting the angle and pressure of the nozzle, the adaptability and stability of the water mist generated by the artificial rainbow generating device under changing environmental conditions are significantly improved. By utilizing the deep reinforcement learning algorithm, self-learning and optimization can be achieved, so that the rainbow generating device can adapt to environmental changes and continuously improve the control strategy to obtain the best rainbow generating effect. And no longer relying on artificial light sources, just placing the device in the sun can achieve the most stable water mist distribution through control to form the best rainbow effect.
[0071] Please refer to Figure 2 , Embodiment 1 of the present invention is:
[0072] A method for generating an artificial rainbow with wind compensation, comprising:
[0073] S1: Acquire real-time status data of the artificial rainbow, wherein the status data includes wind speed, wind direction, nozzle angle, spray pressure, image of the generated rainbow and corresponding time data;
[0074] S2: Obtaining a corresponding rainbow quality score according to the generated rainbow image;
[0075] S3: Establishing an LSTM network and a deep reinforcement learning model, wherein the LSTM network extracts features of the wind speed, wind direction, nozzle angle, spray pressure and corresponding time data; the deep reinforcement model adjusts the nozzle angle and spray pressure according to the rainbow quality score and the wind speed, wind direction, nozzle angle and spray pressure data extracted by the LSTM network;
[0076] S4: Use the state data obtained in step S1 to train the LSTM network and the deep reinforcement learning model, and use the trained final model to adjust the nozzle angle and the injection pressure according to the current state data.
[0077] S5: Monitor the effect of rainbow generation and the running status of the final model, and optimize the model according to the monitored data.
[0078] Step S2 specifically includes:
[0079] S21: Obtaining the color vividness (C), arc length (L) and radius (R) of the rainbow according to the generated rainbow image;
[0080] S22: Calculate the corresponding rainbow quality score according to the following formula:
[0081] score=w1*C+w2*L+w3*R
[0082] Wherein w1, w2 and w3 are weight factors. The initial value of w1 is 0.5, the initial value of w2 is 0.3, and the initial value of w3 is 0.2.
[0083] The specific settings of the LSTM network in step S3 include:
[0084] The input wind speed, wind direction, nozzle angle, and spray pressure data were collected with 30 seconds as the length of the input sequence;
[0085] The collected data were normalized to the range of [0, 1] using the maximum and minimum normalization process.
[0086] The activation function uses a linear activation function; and
[0087] The loss function adopts the mean square error loss function.
[0088] The specific settings of the deep reinforcement learning model in step S3 include:
[0089] The state vector includes wind speed, wind direction, nozzle angle, spray pressure, and the most recent rainbow quality score.
[0090] The action space includes nozzle angle adjustment and spray pressure adjustment; the nozzle angle adjustment includes increasing or decreasing the angle, and the action value is set to: +1°, -1°, +5°, -5°; the spray pressure adjustment includes increasing or decreasing the pressure, and the action value is set to: +5%, -5%, +10%, -10%.
[0091] The reward function uses the following formula:
[0092] R = score-cost, where R is the reward, score is the rainbow quality score, and cost is the total cost; the cost is calculated as follows:
[0093] cost = α * c water +β*c energy +γ*c wear +δ*c risk
[0094] Among them, c water is the water resource consumption cost, c energy is the energy consumption cost, c wear is the equipment wear cost, c risk is the operational risk cost, α, β, γ and δ are the weight coefficients of each cost factor. The initial values of α, β, γ and δ are all set to 1.
[0095] The algorithm of the deep reinforcement learning model is the Proximal Policy Optimization algorithm, and the neural network architecture is the Actor-Critic network.
[0096] Step S4 specifically adopts a joint training method to train the LSTM network and the deep reinforcement learning model, wherein the data extracted by the LSTM network is used as a state identifier, the Actor network proposes an action, and the Critic network evaluates the value of the action.
[0097] Step S5 specifically continuously optimizes and iterates the parameters of the LSTM network and the deep reinforcement learning model through feedback in the simulation or actual operation environment.
[0098] The following is a specific example of this embodiment.
[0099] The LSTM network design is as follows:
[0100] (1) Rainbow data preprocessing and feature engineering
[0101] Data Collection:
[0102] Wind Speed: Continuous variable, in meters per second.
[0103] Wind Direction: A continuous variable indicating the direction of the wind in degrees.
[0104] Nozzle Angle: Continuous variable, in degrees.
[0105] Spray Pressure: Continuous variable, in Pascals.
[0106] Timestamp: The time each data point was collected.
[0107] Feature processing:
[0108] Sequence length: 30 seconds is selected as the length of the input sequence. Assuming that the data sampling frequency is once per second, each input sequence contains 30 time steps.
[0109] Normalization: Use MinMaxScaler to normalize all features to the range of [0, 1] to improve the stability and efficiency of model training.
[0110] (2) LSTM network structure design
[0111] Network Configuration:
[0112] 1) Input layer: accepts 30 time-step data of four features (wind speed, wind direction, nozzle angle, and spray pressure), so the input dimension is [batch_size, 30, 4].
[0113] 2) LSTM layer:
[0114] The first LSTM layer has 64 units and returns a sequence output for the next LSTM layer to continue processing.
[0115] Second LSTM layer: 32 units, only returns the output of the final time step to simplify the mapping to the output layer.
[0116] 3) Fully connected output layer:
[0117] A fully connected layer with two output nodes, one for predicting the nozzle angle at the next time step and the other for predicting the injection pressure at the next time step.
[0118] Activation function: Use linear activation function.
[0119] Loss function: The mean square error (MSE) loss function is used, which is suitable for regression problems.
[0120] Optimizer: The Adam optimizer is used and the initial learning rate is set to 0.001.
[0121] (3) Training and evaluation
[0122] Batch size (batch_size): Choose 32. A moderate batch size can balance training speed and memory consumption.
[0123] Training cycle (epochs): initially set to 100 cycles, adjusted according to the performance on the validation set.
[0124] Model training:
[0125] Use the time series split training and validation sets for training, and monitor the loss on the validation set to adjust the learning rate and stop training early to prevent overfitting.
[0126] Performance evaluation:
[0127] The model performance is evaluated on an independent test set, focusing on the accuracy of the predicted nozzle angle and pressure.
[0128] (4) Deployment and practical application
[0129] Deploy the trained model to the actual control system. The model will receive sensor data in real time, predict and adjust the angle and pressure of the nozzle.
[0130] (5) Output
[0131] The main role of the LSTM network is to act as a feature extractor to extract useful information from historical sequence data to help the deep reinforcement learning model better understand the dynamic changes of the environment state. The output of the LSTM network is not directly used to predict the next action of the sprinkler, but to enhance the state representation, which is then input into the deep reinforcement learning model.
[0132] The design of the deep reinforcement learning model is as follows:
[0133] (1) Environment definition and state representation
[0134] 1) Environmental factors:
[0135] Wind Speed: Continuous variable, in meters per second.
[0136] Wind Direction: A continuous variable indicating the direction of the wind in degrees.
[0137] Nozzle Angle: Continuous variable, in degrees.
[0138] Spray Pressure: Continuous variable, in Pascals.
[0139] 2) Status:
[0140] The state vector includes: wind speed, wind direction, nozzle angle, spray pressure and the most recent rainbow quality score.
[0141] Each feature needs to be properly normalized to optimize learning efficiency.
[0142] (2) Action Space and Reward Mechanism
[0143] Action Space:
[0144] Nozzle angle adjustment: The actions include increasing or decreasing the angle, and the action values are set to +1°, -1°, +5°, -5°.
[0145] Injection pressure adjustment: Actions include increasing or decreasing pressure, and the action values are set to +5%, -5%, +10%, -10%.
[0146] Reward function:
[0147] Reward: Based on the visibility and stability of the rainbow, the rainbow quality score is directly used as part of the reward so that the model directly aims to improve the overall quality of the rainbow. The reward function is defined as R = score-cost where cost includes resource consumption and possible penalty factors.
[0148] The cost calculation method is defined as follows:
[0149] 1) Water resource consumption cost: define water resource consumption cost as c water , calculated based on the amount of water consumed per unit time.
[0150] 2) Energy consumption cost: Energy is mainly used to drive the nozzle, pump and control system. The energy consumption cost is c energy It is calculated based on the amount of electricity consumed and the local electricity price.
[0151] 3) Equipment wear cost: Frequent adjustment of nozzle angle and pressure may accelerate equipment wear, and equipment wear cost c wear It can be estimated based on the expected reduction in equipment life and increased maintenance frequency.
[0152] 4) Operational risk cost: Improper operation or over-adjustment may lead to system failure or safety accidents. For example, excessive water pressure may cause pipeline rupture. Operational risk cost c risk This can be estimated based on historical data of past failures and potential repair costs.
[0153] Combining the above cost factors, the total cost can be expressed as cost = α·c water +β·c energy +γ·c wear +δ·c risk
[0154] Among them, α, β, γ, δ are the weight coefficients of each cost factor. In the initial setting at the starting point, all weights are set to the same value, α = β = γ = δ = 1, to provide a benchmark, and dynamically adjust the weights based on data feedback and system performance evaluation in actual operation. For example, if it is found that the impact of operational risk costs is smaller than expected, the value of δ can be appropriately adjusted.
[0155] Penalty: High-frequency and large-scale adjustments will lead to equipment wear and waste of resources, and negative rewards should be given.
[0156] (3) Algorithm selection and network structure of deep reinforcement learning model
[0157] Algorithm selection:
[0158] Proximal Policy Optimization (PPO): Applicable to continuous action space, balances the exploration and utilization of the strategy, and is more stable.
[0159] Neural network structure:
[0160] Actor Network: A network that predicts actions. The input is a state vector and the output is the probability of each action.
[0161] Critic network: Estimates the value of a state or state-action pair. The input is a state vector and the output is an estimate of the value of that state.
[0162] (4) Training
[0163] Set the total number of training epochs: 1000 training epochs.
[0164] Batch size: The number of samples used to update the model each time, for example 32.
[0165] Learning rate: The learning rate affects the speed and stability of model learning. It is initially set to 0.001 and can be adjusted based on performance during training.
[0166] Please refer to Figure 4 , Embodiment 2 of the present invention is:
[0167] An artificial rainbow generating device with wind compensation comprises a sensor module, a control system, a nozzle and a power mechanism, wherein the power mechanism comprises a water pump, a booster pump, an air pressure regulating valve, an air pump and a direction rod, the water pump is connected to the nozzle through the booster pump, the air pressure regulating valve is connected to the nozzle through the air pump, the direction rod is connected to the nozzle, and the control system is respectively connected to the air pressure regulating valve, the booster pump and the direction rod.
[0168] The sensor module is connected to the control system and is used to collect the status data of the artificial rainbow in real time and transmit it to the control system. The sensor module includes: a wind speed sensor, which is used to collect the wind speed and corresponding time data of the artificial rainbow generating device with wind compensation; a wind direction sensor, which is used to collect the wind direction and corresponding time data of the artificial rainbow generating device with wind compensation; a nozzle angle sensor, which is used to collect the nozzle angle and corresponding time data; a pressure sensor, which is used to collect the injection pressure of the nozzle and the corresponding time data; and a visual sensor, which is used to collect the image of the generated rainbow and the corresponding time data.
[0169] The control system controls the power mechanism to adjust the action of the nozzle. Specifically, the control system includes a computer-readable storage medium and a processor; the computer-readable storage medium stores a computer program, and when the program is executed by the processor, the steps included in the method for generating an artificial rainbow with wind compensation described in the first embodiment can be implemented.
[0170] When in use, the artificial rainbow generating device with wind compensation of this embodiment is placed under sunlight to generate a rainbow. Figure 4 shown.
[0171] In summary, the method and device for generating an artificial rainbow with wind compensation of the present invention have the following advantages:
[0172] (1) There is no need to add additional light sources or install additional nozzles. Simply place the device in the sun and adjust the nozzle angle and spray pressure according to the real-time environment to generate a good rainbow effect.
[0173] (2) Real-time environmental monitoring can accurately capture key parameters such as wind speed and wind direction, and intelligently adjust the angle and pressure of the nozzle through a deep reinforcement learning algorithm. It can respond quickly to changes in wind speed and adjust the parameters of the water mist injection, thereby significantly improving the stability and adaptability of rainbow generation and ensuring that high-quality rainbows can be generated under different environmental conditions.
[0174] (3) The deep reinforcement learning algorithm is used to enable the system to have the ability of self-learning and optimization. As time goes by and more data is accumulated, the system can continuously optimize its control strategy, improve the speed and accuracy of its response to environmental changes, and further improve the quality and stability of rainbow generation.
[0175] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Therefore, any modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for generating an artificial rainbow with wind compensation, characterized in that: include: S1: Acquire real-time status data of the artificial rainbow, wherein the status data includes wind speed, wind direction, nozzle angle, spray pressure, image of the generated rainbow and corresponding time data; S2: Obtaining a corresponding rainbow quality score according to the generated rainbow image; S3: Establishing an LSTM network and a deep reinforcement learning model, wherein the LSTM network extracts features of the wind speed, wind direction, nozzle angle, spray pressure and corresponding time data; the deep reinforcement model adjusts the nozzle angle and spray pressure according to the rainbow quality score and the wind speed, wind direction, nozzle angle and spray pressure data extracted by the LSTM network; S4: Use the state data obtained in step S1 to train the LSTM network and the deep reinforcement learning model, and use the trained final model to adjust the nozzle angle and the injection pressure according to the current state data.
2. The method for generating an artificial rainbow with wind compensation according to claim 1, characterized in that: Step S2 specifically includes: S21: Obtaining the color vividness (C), arc length (L) and radius (R) of the rainbow according to the generated rainbow image; S22: Calculate the corresponding rainbow quality score according to the following formula: score=w1*C+w2*L+w3*R Where w1, w2 and w3 are weight factors.
3. The method for generating an artificial rainbow with wind compensation according to claim 2, characterized in that: The initial value of w1 is 0.5, the initial value of w2 is 0.3, and the initial value of w3 is 0.
2.
4. The method for generating an artificial rainbow with wind compensation according to claim 1, characterized in that: The specific settings of the LSTM network in step S3 include: The input wind speed, wind direction, nozzle angle, and spray pressure data were collected with 30 seconds as the length of the input sequence; The collected data were normalized to the range of [0, 1] using the maximum and minimum normalization process. The activation function uses a linear activation function; and The loss function adopts the mean square error loss function.
5. The method for generating an artificial rainbow with wind compensation according to claim 1, characterized in that: The specific settings of the deep reinforcement learning model in step S3 include: The state vector includes wind speed, wind direction, nozzle angle, spray pressure, and the most recent rainbow quality score; The action space includes nozzle angle adjustment and spray pressure adjustment; The reward function uses the following formula: R = score-cost, where R is the reward, score is the rainbow quality score, and cost is the total cost.
6. The method for generating an artificial rainbow with wind compensation according to claim 5, characterized in that: The cost calculation formula is as follows: cost=α*c water +β*c energy +γ*c wear +δ*c risk Among them, c water is the water resource consumption cost, c energy is the energy consumption cost, c wear is the equipment wear cost, c risk is the operational risk cost, and α, β, γ and δ are the weight coefficients of each cost factor.
7. The method for generating an artificial rainbow with wind compensation according to claim 5, characterized in that: The algorithm of the deep reinforcement learning model is the Proximal Policy Optimization algorithm, and the neural network architecture is the Actor-Critic network.
8. The method for generating an artificial rainbow with wind compensation according to claim 7, characterized in that: The LSTM network and deep reinforcement learning model are trained by joint training, in which the data extracted by the LSTM network is used as the state identifier, the Actor network proposes actions, and the Critic network evaluates the value of the action.
9. The method for generating an artificial rainbow with wind compensation according to claim 1, characterized in that: After step S4, the following steps are also included: S5: Monitor the effect of rainbow generation and the running status of the final model, and optimize the model according to the monitored data.
10. An artificial rainbow generating device with wind compensation, comprising a sensor module, a control system, a nozzle and a power mechanism, characterized in that: The sensor module is connected to the control system and is used to collect the state data of the artificial rainbow in real time and transmit it to the control system. The sensor module includes: a wind speed sensor, which is used to collect the wind speed and corresponding time data of the artificial rainbow generating device with wind compensation; a wind direction sensor, which is used to collect the wind direction and corresponding time data of the artificial rainbow generating device with wind compensation; a nozzle angle sensor, which is used to collect the nozzle angle and corresponding time data; a pressure sensor, which is used to collect the injection pressure of the nozzle and the corresponding time data; a visual sensor, which is used to collect the image of the generated rainbow and the corresponding time data; The power mechanism is connected to the control system and the nozzle respectively, and the control system controls the power mechanism to adjust the action of the nozzle. Specifically, the control system includes a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, it can implement the steps included in the method for generating artificial rainbow with wind compensation described in any one of claims 1-9.
Citation Information
Patent Citations
Artificial rainbow
CN102555653A
Intelligent artificial rainbow machine
CN104772252A
Cited By
Monitoring operation and maintenance system applied to agricultural automatic irrigation equipment
CN119655152A
