Neural network-based method for soft measurement of secondary water supply demand, device, and medium

Through the soft measurement method of secondary water supply water demand based on neural network, the problem that traditional water demand prediction is difficult to capture the nonlinear fluctuation of water demand is solved, and more accurate water demand prediction and efficiency improvement are achieved.

WO2025107481A1PCT designated stage expired Publication Date: 2025-05-30ANHUI UNIVERSITY OF ARCHITECTURE

Patent Information

Application Number
PCT/CN2024/086871
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-20
Filing Date
2024-04-09
Publication Date
2025-05-30

Smart Images

  • Figure CN2024086871_30052025_PF_FP_ABST
    Figure CN2024086871_30052025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the field of soft measurement of water resource demand. Disclosed are a neural network-based method for soft measurement of secondary water supply demand, a device, and a medium. The method comprises: by means of training an optimized secondary water supply demand soft measurement model, performing soft measurement of secondary water supply demand, the secondary water supply demand soft measurement model ignoring the shortcomings of individual inertia for a GWO algorithm; introducing the concept of velocity from a PSO algorithm, to improve an individual position updating formula; optimizing a neural network model using the improved algorithm, to establish a regression prediction model; inputting data into the trained improved neural network model; and once a maximum number of instances of training is reached, outputting a water demand prediction result. The present invention uses external influencing factors and the secondary water supply amount of a certain living community as parameters, and inputs same into an improved neural network model to measure the water demand, so that hourly prediction of secondary water supply demand is achieved, and the precision of prediction is significantly improved compared with other models.
Need to check novelty before this filing date? Find Prior Art

Description

Soft measurement method, equipment and medium for secondary water supply demand based on neural network Technical Field

[0001] The present invention relates to the technical field of soft measurement of water resource demand, and in particular to a soft measurement method, device and storage medium for secondary water supply demand based on a neural network. Background Art

[0002] With the rapid urbanization of China, influenced by population growth, urban expansion, and urban planning, soft measurement of secondary water supply demand for high-rise buildings during water resource allocation faces challenges such as high volatility, strong randomness, and numerous external influencing factors. Traditional water demand forecasting methods struggle to meet precision requirements, and accurately predicting random fluctuations in water demand is a current research hotspot in soft measurement. Traditional water demand forecasting, primarily using linear regression and time series analysis, struggles to capture nonlinear fluctuations in water demand, resulting in poor prediction results. In recent years, with the advancement of modeling technology, more complex machine learning models have been widely applied in this area, bringing new opportunities for water demand forecasting.

[0003] Optimization algorithms are methods for solving problems based on certain ideas and mechanisms, using specific pathways or rules. Traditional optimization algorithms include linear and nonlinear programming, dynamic programming, and network flow optimization algorithms. These algorithms are generally very complex and only suitable for solving small-scale problems, making them often inapplicable in practical engineering. The development of artificial intelligence has spawned a novel optimization algorithm: the swarm intelligence optimization algorithm. This algorithm simulates natural biological systems, where individual organisms rely on their own instincts to optimize their survival through unconscious evolution and optimization behavior to adapt to their environment. This dependent optimization method has many characteristics that distinguish it from traditional optimization algorithms, providing a practical solution to combinatorial optimization problems that are difficult to handle with traditional optimization techniques.

[0004] Soft water demand measurement is a fundamental task that every city's water supply department must perform before allocating water resources. With the development of artificial intelligence, soft water demand measurement using digital models has become increasingly popular. Using neural network models as a foundation for forecasting models allows for more accurate predictions. Compared to traditional forecasting methods, these methods offer advantages such as reduced labor costs, increased efficiency, and foresight.

[0005] Summary of the Invention

[0006] The present invention proposes a neural network-based soft measurement method, device and storage medium for secondary water supply demand, which can solve at least one of the technical problems in the background technology.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] A soft measurement method for secondary water supply demand based on a neural network is provided. The soft measurement of secondary water supply demand is performed by training an optimized soft measurement model of secondary water supply demand. The training process of the soft measurement model of secondary water supply demand includes the following steps:

[0009] (1) Obtain the historical secondary water supply data set from the network cloud platform. Other factors affecting water demand, such as whether it is a weekday, temperature, humidity, etc., can be obtained from the open database on the network;

[0010] (2) Use Python programming to automatically calculate the correlation coefficient of the influencing factor data set in step (1) and draw a correlation heat map, and select the main characteristic variables based on the size of the correlation coefficient;

[0011] (3) One-hot encode the discrete data in the dataset and perform mapminmax normalization on the variable data as follows;

[0012] The mapmixmax function will standardize the data row by row, standardizing each row of data to the interval [y min ,y max ], if the data in a row are all the same, then x max =x min , the divisor is 0, then Matlab internally transforms this into y=y min ;

[0013] (4) Determine the topological structure of the neural network. The main characteristic variables selected in step (2) are used as the input of the neural network to determine the number of nodes in the input layer. The number of nodes in the hidden layer is set based on experience. The output layer is the historical secondary water supply volume dataset in step (1). Set the maximum number of training times, transfer function, and training function of the neural network, and initialize the weights and thresholds of the neural network.

[0014] (5) The weights and thresholds of the neural network are used as the optimization targets of the improved gray wolf algorithm to input the improved gray wolf algorithm iteration, and the improved gray wolf algorithm based on the particle swarm algorithm optimizes the weights and thresholds of the neural network;

[0015] (6) Retraining the weights and thresholds obtained in step (5) as the optimal weights and thresholds of the neural network to obtain the output value of the neural network model;

[0016] (7) Establish an error function, calculate the error between the model output value and the true value in the comparison step (6), and reversely adjust the weights and thresholds of each layer of the neural network with the goal of minimizing the error function value;

[0017] (8) Determine whether the neural network prediction value meets the preset accuracy. If not, repeat steps (6) and (7). If so, output the optimal value predicted by the model.

[0018] As the performance of iterative optimization of model parameters is further improved:

[0019] Preferably, the gray wolf algorithm population is initialized in step (5). Randomly initialize the gray wolf population number and the gray wolf individual position X i , where i = 1, 2, 3, ..., n. n is the number of gray wolf populations. Due to the linear decrease of parameters, the gray wolf algorithm lacks the ability to balance global and local search. At the same time, the gray wolf algorithm ignores the information update of individual gray wolves. This defect increases the probability of falling into local optimality. Therefore, the inertia factor w is introduced into the algorithm, which represents the degree of memory of the original speed and performs inertial motion based on the original speed. lb and ub are the upper and lower limits of the search interval. The number of iterations t is set to 0;

[0020] Preferably, in step (5), a fitness function is constructed and individual fitness values ​​are calculated, the fitness values ​​are sorted from small to large, and the three gray wolves with the smallest fitness values ​​are selected as the leadership class and marked as α, β, and σ in sequence, and the other gray wolf individuals are marked as ω;

[0021] Preferably, in step (5), the wolf pack searches for prey and performs encirclement operations, wherein the position and speed of wolves α, β, and σ are updated as follows:

[0022] in, are the distances between the wolf and the prey, α, β, and σ; t is the number of iterations; and are the position vectors of the gray wolves α, β, σ and the current gray wolf’s position vector; and is the coefficient vector, and its calculation formula is as follows:

[0023] in, and is a random number in the range [0, 1], corresponding to formulas (5), (6), and (7), This means that the gray wolf conducts a global search. It means that the gray wolf conducts a local search; is a linear decreasing factor, which decreases linearly from 2 to 0 with the number of iterations. The decreasing formula is:

[0024] Among them, t max is the maximum number of iterations.

[0025] Preferably, step (5) introduces the concept of particle velocity in the particle swarm algorithm into the gray wolf position update, and regards the gray wolf individual as a particle in the particle swarm. The gray wolf particle velocity and position update formula is as follows:

[0026] in, is the velocity vector of particle i.

[0027] Preferably, in step (5), it is determined whether the iteration termination condition is met. If not, the update parameters are and Repeat step (5) until the iteration termination condition is met.

[0028] In another aspect, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0029] On the other hand, the present invention further discloses a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0030] It can be seen from the above technical solution that the neural network-based soft measurement method for secondary water supply demand of the present invention adopts a neural network model as the basis to build a prediction model, which can obtain prediction results more accurately; at the same time, compared with traditional prediction methods, it has the advantages of saving manpower, high efficiency, and foresight.

[0031] Compared with the prior art, the present invention has the following significant effects: the speed concept in the particle swarm algorithm is introduced into the gray wolf algorithm, and the ability of the particle swarm algorithm to remember the inertia of individual motion is increased on the basis of the strong global search ability of the gray wolf algorithm, thereby improving the algorithm's convergence performance and optimization ability. In the process of using the improved algorithm to optimize the neural network model in the field of soft measurement of secondary water supply demand, Pearson correlation analysis is used to screen out the key influencing factors of secondary water supply demand from multiple aspects such as time series factors, temperature, humidity, and holidays. By establishing three prediction models with gradually increasing complexity and comparing the prediction effects, the degree of influence of the combination of model and algorithm on model performance is explored. The application of this model in the field of soft measurement of secondary water supply demand provides a certain reference significance for achieving water supply and demand balance in residential areas and improving the water resource scheduling level of pipeline networks. At the same time, it provides data support for the intelligent real-time allocation of municipal water supply pipeline networks, laying the foundation for improving the intelligent level of pipeline networks. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] FIG1 is a heat map showing the correlation between factors affecting water consumption in this embodiment;

[0033] FIG2 is a curve showing hourly water consumption changes for four days in a week according to this embodiment;

[0034] FIG3 is a flowchart of an improved algorithm according to an embodiment of the present invention;

[0035] FIG4 is a topological diagram of a BP neural network according to an embodiment of the present invention;

[0036] FIG5 is a flowchart of an improved algorithm for optimizing a neural network according to an embodiment of the present invention;

[0037] FIG6 is a mean square error curve of the BP model according to an embodiment of the present invention;

[0038] FIG7 is a mean square error curve of the GWO-BP model according to an embodiment of the present invention;

[0039] FIG8 is a mean square error curve of the PSOGWO-BP model according to an embodiment of the present invention;

[0040] FIG9 is a schematic diagram of BP prediction results according to an embodiment of the present invention;

[0041] FIG10 is a GWO-BP prediction result according to an embodiment of the present invention;

[0042] FIG11 is a PSOGWO-BP prediction result according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0044] As shown in FIG1 , the neural network-based soft measurement method for secondary water supply demand in this embodiment performs soft measurement of secondary water supply demand by training an optimized soft measurement model for secondary water supply demand, wherein the training process of the soft measurement model for secondary water supply demand includes the following steps:

[0045] (1) Obtain the historical secondary water supply data set from the network cloud platform. Other factors affecting water demand, such as whether it is a weekday, temperature, humidity, etc., can be obtained from the open database on the network;

[0046] (2) Use Python programming to automatically calculate the correlation coefficient of the influencing factor data set in step (1) and draw a correlation heat map, and select the main characteristic variables based on the size of the correlation coefficient;

[0047] (3) One-hot encode the discrete data in the dataset and perform mapminmax normalization on the variable data as follows;

[0048] The mapmixmax function will standardize the data row by row, standardizing each row of data to the interval [y min ,y max ], if the data in a row are all the same, then x max =x min , the divisor is 0, then Matlab internally transforms this into y=y min ;

[0049] (4) Determine the topological structure of the neural network. The main characteristic variables selected in step (2) are used as the input of the neural network to determine the number of nodes in the input layer. The number of nodes in the hidden layer is set based on experience. The output layer is the historical secondary water supply volume dataset in step (1). Set the maximum number of training times, transfer function, and training function of the neural network, and initialize the weights and thresholds of the neural network.

[0050] (5) The weights and thresholds of the neural network are used as the optimization targets of the improved gray wolf algorithm to input the improved gray wolf algorithm iteration, and the improved gray wolf algorithm based on the particle swarm algorithm optimizes the weights and thresholds of the neural network;

[0051] (6) Retraining the weights and thresholds obtained in step (5) as the optimal weights and thresholds of the neural network to obtain the output value of the neural network model;

[0052] (7) Establish an error function, calculate the error between the model output value and the true value in the comparison step (6), and reversely adjust the weights and thresholds of each layer of the neural network with the goal of minimizing the error function value;

[0053] (8) Determine whether the neural network prediction value meets the preset accuracy. If not, repeat steps (6) and (7). If so, output the optimal value predicted by the model.

[0054] The following examples illustrate:

[0055] The embodiment of the present invention adopts the hourly flow of pressurized zones 1, 2 and 3 in the secondary water supply pump room of a residential community in Changfeng from January to June 2023, obtains the temperature, humidity and holiday conditions of the corresponding dates from the network, and preliminarily selects 12 related variables for correlation test, including the time series factors selected during the data sorting process. The Pearson correlation coefficient of the factors affecting water consumption in the residential community is calculated by python programming, and a heat map of the influencing factors is drawn. Figure 1 is a heat map of the factors affecting water consumption drawn by python. It can be seen from Figure 1 that the instantaneous flow of the first 1 hour in the time series factors is strongly correlated with the water demand at the current moment. In addition, the instantaneous flow of the first 2 hours, the instantaneous flow of the first 5 hours, the instantaneous flow of the first 6 hours, the instantaneous flow of the first 7 hours and the temperature and humidity are all correlated with the water demand at the current moment. A total of 10 variables, including the instantaneous flow of the first 1, 2, 5, 6 and 7 hours and the temperature, humidity and holidays, are selected as model inputs.

[0056] Based on the historical flow data of the secondary water supply pump room in the residential area, a daily water consumption change curve is drawn. As shown in Figure 2, it can be found that the two peak periods of daily water consumption appear 1 hour ahead or behind, and the interval between the two peak periods is about 7 hours. This daily water consumption pattern explains the difference in the correlation of temporal factors.

[0057] The calendar is used to distinguish whether the corresponding date is a holiday and perform one-hot coding. Other numerical data are normalized by mapminmax using Matlab software as follows;

[0058] The mapmixmax function will standardize the data row by row, standardizing each row of data to the interval [y min ,y max ], if the data in a row are all the same, then x max =x min , the divisor is 0, then Matlab internally transforms this into y=y min The original data is shown in Table 1:

[0059] Table 1 Original dataset

[0060] The hybrid algorithm combines the advantages of the particle swarm optimization algorithm and the gray wolf algorithm. The algorithm parameters are set to 10 iterations, 3 populations, and upper and lower limits between 0 and 1. The iterative update formula of the three solutions with the best fitness in the search space of the gray wolf algorithm is:

[0061] in, are the distances between the wolf and the prey, α, β, and σ; t is the number of iterations; and are the position vectors of the gray wolves α, β, σ and the current gray wolf’s position vector; and is the coefficient vector, and its calculation formula is as follows:

[0062] in, and is a random number in the range [0, 1], corresponding to formulas (5), (6), and (7), This means that the gray wolf conducts a global search. It means that the gray wolf conducts a local search; is a linear decreasing factor, which decreases linearly from 2 to 0 with the number of iterations. The decreasing formula is:

[0063] Among them, t max is the maximum number of iterations. In the traditional gray wolf algorithm, the individual ω wolf always updates its position according to the α, β, and σ wolves, which is prone to local convergence. To avoid this, the speed concept of the particle swarm is introduced when the gray wolf updates its position. At this time, the speed position update formula of the optimal solution particle is:

[0064] in, is the velocity vector of particle i. Figure 3 is the flow chart of the improved algorithm.

[0065] Determine the topology of the neural network, including the number of network layers, number of nodes, weights, number of thresholds, maximum number of training times, transfer function, and training function.

[0066] Specifically, the topological structure of the BP neural network is shown in Figure 4. All data are divided into training set and test set at a ratio of 3:1, as shown in Table 2:

[0067] Table 2 Dataset division rules

[0068] The number of nodes in the input layer and the output layer is determined by the specific circumstances of the embodiment. A BP neural network with one hidden layer can realize arbitrary precision fitting of nonlinear functions. The BP neural network structure established in the present invention is: 10-5-1, with 10 input layers, namely ten influencing factor variables screened according to correlation, and 5 hidden layers selected based on experience. The output layer is the water demand at the current moment.

[0069] The present invention uses a tangent sigmoid function as the hidden layer activation function, a linear function as the output layer activation function, and the trainlm function as the training function. The Levenberg-Marquardt algorithm has the fastest convergence rate for medium-sized BP neural networks, but requires a large amount of memory, and training time increases with the number of nodes. The maximum number of network iterations is set to 100, the learning rate is 0.1, the target accuracy is 0.00001, and the iterative algorithm is a hybrid improved algorithm. The algorithm application process is shown in Figure 5.

[0070] The processed data set was trained on the improved neural network, the traditional BP neural network, and the BP neural network optimized by the Gray Wolf Algorithm (GWA) to predict hourly water consumption for June 30th. The mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) were selected as error metrics to confirm the model's prediction accuracy. Table 3 shows a comparison of the prediction accuracy results of the three models used in this example. The hybrid improved model achieved the best prediction performance, with MAE, MSE, and RMSE values ​​of 0.63729, 0.65945, and 0.81207, respectively, the lowest among all models. The correlation coefficient (R) was also the highest among all models. It can be seen that applying the GWA alone to the traditional BP neural network improves prediction accuracy. However, the hybrid improved algorithm employed in this invention reduced MAE by 24.08%, MSE by 37.34%, and RMSE by 17.19% compared to the GWA alone, further improving prediction accuracy.

[0071] Table 3 Prediction result accuracy index

[0072] The mean square error curves of the prediction results of the embodiment are shown in Figures 6, 7 and 8. Among them, the traditional BP neural network reaches a minimum value of 0.0063256 after 18 generations of fitness function value iteration, the BP neural network optimized by the gray wolf algorithm reaches a minimum value of 0.0059249 after 27 generations of fitness function value iteration, and the improved neural network reaches a minimum value of 0.005265 after 44 generations of fitness function value iteration. As the model improvement method deepens, the number of iterations increases, the minimum value of the fitness function decreases, and the performance of the model gradually improves. The performance of the improved neural network model is the best among the three. In addition, the specific prediction results of the three models are shown in Figures 9, 10 and 11. Comparing the gap between the actual value and the predicted value in the three figures, it can be seen that the error between the predicted value and the actual value of the improved neural network model is significantly smaller than that of the other two models, further proving the performance advantage of the improved model in prediction. The error between the predicted value and the actual value of the BP neural network model optimized by the gray wolf algorithm is smaller than that of the traditional BP neural network model, which confirms that the application of the algorithm during model parameter initialization can indeed improve model performance.

[0073] In another aspect, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0074] On the other hand, the present invention further discloses a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0075] In another embodiment provided by the present application, a computer program product containing instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the neural network-based soft measurement methods for secondary water supply demand in the above embodiments.

[0076] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts of the above method.

[0077] The embodiment of the present application further provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus.

[0078] Memory for storing computer programs;

[0079] The processor is used to implement the above-mentioned soft measurement method of secondary water supply demand based on neural network when executing the program stored in the memory.

[0080] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0081] The communication interface is used for communication between the above electronic device and other devices.

[0082] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0083] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0084] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive SolidStateDisk (SSD)).

[0085] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0086] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A soft measurement method for secondary water supply demand based on neural network, characterized in that: The soft measurement of the secondary water supply demand is performed by training the optimized soft measurement model of the secondary water supply demand, wherein the training process of the soft measurement model of the secondary water supply demand includes the following steps: S1. Obtain the historical secondary water supply volume influencing factor data set; S2. Use Python programming to automatically calculate the correlation coefficient of the influencing factor data set in step S1 and draw a correlation heat map, and select the main characteristic variables according to the size of the correlation coefficient; S3, One-Hot encode the discrete data in the influencing factor data set, and perform mapminmax normalization on the variable data, as follows; The mapmixmax function will standardize the data row by row, standardizing each row of data to the interval [y min ,y max ], if the data in a row are all the same, then x max =x min , the divisor is 0, then Matlab internally transforms this into y = y min ; S4, determine the topological structure of the neural network, use the main characteristic variables selected in step S2 as the input of the neural network to determine the number of nodes in the input layer, set the number of nodes in the hidden layer based on experience, and use the historical secondary water supply volume data set in step S1 as the output layer; set the maximum number of training times, transfer function and training function of the neural network, and initialize the weights and thresholds of the neural network; S5, taking the weights and thresholds of the neural network as the optimization targets of the improved gray wolf algorithm and inputting the improved gray wolf algorithm into iteration, and optimizing the weights and thresholds of the neural network by the improved gray wolf algorithm based on the particle swarm algorithm; S6, retraining the weights and thresholds obtained in step S5 as the optimal weights and thresholds of the neural network to obtain the output value of the neural network model; S7, establish an error function, calculate and compare the error between the model output value and the true value in step S6, and reversely adjust the weights and thresholds of each layer of the neural network with the minimum error function value as the goal; S8, judging whether the predicted value of the neural network meets the preset accuracy, if not, repeating steps S6 and S7; if so, outputting the optimal value predicted by the model; The step S5 comprises the following steps: S51, Gray Wolf Algorithm Population Initialization, Randomly Initialize the Gray Wolf Population Position X i , where i = 1, 2, 3, ···, n; n is the number of gray wolf populations, the inertia factor w represents the degree of memory of the original speed, and the inertial motion is performed according to the original speed, lb and ub are the upper and lower limits of the search interval; the number of iterations t is set to 0; S52, construct a fitness function and calculate individual fitness values, and mark the three gray wolves with the best fitness in the wolf pack as α, β, and σ, respectively, and mark the other gray wolf individuals as ω; S53, the wolf pack searches for prey and performs encirclement operations, wherein the position and speed of α, β, and σ wolves are updated: in, α, β, σ are the distances between the wolf and the prey respectively; t is the number of iterations; and are the position vectors of α, β, σ gray wolves and the current gray wolf’s position vector; and is the coefficient vector, and its calculation formula is as follows: in, and is a random number in the range [0, 1], corresponding to formulas (5), (6), and (7), This means that the gray wolf conducts a global search. It means that the gray wolf conducts a local search; is a linear decreasing factor, which decreases linearly from 2 to 0 with the number of iterations. The decreasing formula is: Among them, t max is the maximum number of iterations; the speed concept of particles in the particle swarm algorithm is introduced in the gray wolf position update, and the gray wolf individual is regarded as a particle in the particle swarm. The speed and position update formula of the prey, that is, the optimal solution, is as follows: in, is the velocity vector of particle i; In step S5, it is determined whether the iteration termination condition is met. If not, the update parameters are and And repeat step S5 until the iteration termination condition is met.

2. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to claim 1.

3. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the method according to claim 1.

Citation Information

Patent Citations

  • Urban water supply scheduling method and system based on BP neural network

    CN110400234A

  • Urban water consumption prediction method based on GA-BP neural network

    CN110443418A

  • GA-ELM-based short-term water demand prediction method

    CN111310974A

  • Secondary water supply water demand soft measurement method and device based on neural network, and medium

    CN117252115A

  • Information processing system, information processing device, information processing method, and program

    JP2022138509A

Cited By

  • Seawater desulfurization water channel flow control method, storage medium and electronic equipment

    CN120973086A

  • Scheduling method and system of wafer automatic material transmission system

    CN121032131A

  • Underground power station workshop water spray system layout optimization method based on particle swarm optimization

    CN121072143A

  • Loosening moisture regaining machine inlet hot air temperature prediction control method in combination with pattern recognition PID (Proportion Integration Differentiation) control

    CN121477583A

  • Discrete codebook determination method, device and equipment for reconfigurable intelligent surface

    CN121530413A