Flow velocity estimation optimization method based on Q-learning and application thereof
Through the flow velocity estimation optimization method based on Q-learning, the unmodeled parameter noise in the stratified flow velocity system of the horizontal acoustic Doppler flowmeter is processed, which improves the accuracy and reliability of the flow velocity estimation and solves the problem of noise in the existing technology. The problem of influence has important application value.
Patent Information
- Application Number
- CN202411205528.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In hydraulic engineering and ocean science, unmodeled parameter noise exists in the stratified flow velocity system modeling of horizontal acoustic Doppler current meters, which leads to uncertainty and errors in flow velocity estimation and affects the accuracy and reliability of measurements.
The flow rate estimation optimization method based on Q-learning is adopted. By establishing the state transformation model and the measurement equation model, the four-dimensional grid Q-learning method is used to optimize the process noise variance, measurement noise variance, unmodeled parameters of the state equation and unmodeled measurement equation. parameters to improve the accuracy of flow velocity estimation.
It significantly improves the accuracy and reliability of flow velocity estimation, enhances the adaptability and stability of the algorithm, and reduces the risks and losses caused by inaccurate flow velocity estimation, which has important practical application value.
Smart Images

Figure CN118709609A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of acoustic technology, and in particular to a flow velocity estimation optimization method based on Q-learning and an application thereof. Background Art
[0002] In today's hydraulic engineering, marine science and other fields, modeling of stratified flow velocity systems using horizontal acoustic Doppler current meters is of great significance. However, there are many challenges in practical applications.
[0003] The complexity of the natural environment is an aspect that cannot be ignored. For example, factors such as the variability of water flow, the uneven distribution of impurities in the water body, and the difference in water temperature can all lead to uncertainty in the measurement results.
[0004] At the same time, the measuring instrument itself also has certain deviations. The accuracy limit of the instrument, the sensitivity change of the sensor and the aging of the equipment may introduce errors.
[0005] It is particularly important that in the system model, there is inevitably undetermined unmodeled parameter noise. The sources of these noises are varied, and may be slight changes in environmental factors that are not accurately incorporated into the model, or may be unpredictable interference caused by the instrument under specific conditions. This unmodeled parameter noise has a significant impact on the final stratified flow velocity estimation method. For example, in some complex water flow environments, due to the presence of noise, the estimated flow velocity may deviate greatly from the actual value, affecting the accuracy and reliability of the measurement. For another example, in scientific research that requires high-precision flow velocity measurement, noise may cause deviations in the research results, thereby affecting the scientificity and practicality of the relevant conclusions.
[0006] In summary, how to effectively deal with the unmodeled parameter noise in the modeling of the stratified flow velocity system of the horizontal acoustic Doppler current meter in order to improve the accuracy and reliability of the stratified flow velocity estimation method has become a technical problem that needs to be solved urgently. Summary of the invention
[0007] The embodiment of the present invention provides a flow velocity estimation optimization method based on Q-learning and its application, aiming at the problem of undetermined unmodeled parameter noise and the like existing in the current technology.
[0008] The core technology of the present invention is to take (process noise variance, measurement noise variance, unmodeled parameters of the state model, and unmodeled parameters of the measurement model) as a four-element whole, and use the Q-learning method to continuously optimize the above quaternions to improve the final estimation accuracy.
[0009] In a first aspect, the present invention provides a flow velocity estimation optimization method based on Q-learning, the method comprising the following steps: S00, respectively establishing a state transformation model before and after the current stratified flow velocity and a H-ADCP measurement equation model for the current stratified flow velocity; S10, taking the unmodeled parameters of the state equation of the state transformation model, the unmodeled parameters of the measurement equation of the measurement equation model, the process noise variance of the state transformation model, and the measurement noise variance of the measurement equation model as the quaternion as a whole; S20, determining the most appropriate process noise variance parameter and measurement noise variance parameter at each moment, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation by a four-dimensional grid Q-learning method; S30, calculating the final estimated value of the stratified flow velocity at each moment according to the most appropriate process noise variance parameter and measurement noise variance parameter at each moment, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation.
[0010] Furthermore, in step S00, the state transformation model between the current stratified flow velocity and the previous and next moments is: x k+1 =(φ k +Δφ k )x k +w k Among them, x k is the stratified flow velocity state variable, φ k is the stratified flow velocity state transformation transfer matrix, Δφ k is the unmodeled parameter of the state equation, w k is the process noise, satisfying w k ~N(0,Q k ), Q k is the process noise variance.
[0011] Furthermore, in step S00, the H-ADCP measurement equation model for the current stratified flow velocity is: y k =h k (x k )+ΔH k x k +v k Among them, y k is the actual flow rate value measured by H-ADCP, h k (·) represents the measurement function, v k To measure noise, satisfy v k ~N(0,R k ), ΔH k To measure the unmodeled parameters of the equation, R k is the measurement noise variance.
[0012] Furthermore, in step S20, the specific steps of determining the most appropriate quaternion parameters at each moment by the four-dimensional grid Q-learning method are: Refer to the empirical value to set the four-dimensional grid, each grid corresponds to Δφ k , ΔH k , Q k , R k A different combination of values of ; Among them, Δφ k is the unmodeled parameter of the state equation of the state transition model, ΔH k is the unmodeled parameter of the measurement equation of the measurement equation model, Q k is the process noise variance of the state transition model, R k is the measurement noise variance of the measurement equation model; According to the current Δφ k , ΔH k , Q k , R k The greedy algorithm is used to select the execution action based on the value of to decide which neighboring grid to move to in this cycle t; based on , the filtering information is calculated by referring to the RMS volumetric Kalman filtering method ;in, are the filtered estimated value of the stratified flow velocity and the estimated error covariance matrix calculated at the previous time k-1, They are the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance, which are preset according to empirical values; based on , the estimated information is calculated by grid search RMS volumetric Kalman filter method ;in, are the filtered estimated value of the stratified flow velocity and the estimated error covariance matrix calculated at the previous time k-1, are the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance in the selected grid during the t-th iteration; Based on the calculated , calculate the reward function R q And according to the reward function R q Iterative calculation of Q q (s q ,a q ), in order to continuously optimize the value of each element in the quaternion, iterate until t=T, and the final quaternion is ; based on , calculate the final estimated value of the current stratified flow velocity .
[0013] Furthermore, in step S40, the strategy of the greedy algorithm is as follows: Set the random threshold ε∈(0,1) and let ε'=rand(·) be a random number uniformly distributed in the interval (0,1); When ε'<ε, in set A s Randomly select the next action a s Among them, A s Represents the set of all movable actions that can be selected for the current grid; When ε'≥ε, the next step is a s Select a s =argmax a Q q (s q ,a q ).
[0014] Further, in step S40, according to the reward function R q Iterative calculation of Q q (s q ,a q ) is:
[0015] in, is the learning rate, represents the discount factor, .
[0016] Further, in step S40, according to the calculated , calculate the reward function R q The formula is as follows: .
[0017] In a second aspect, the present invention provides a flow velocity estimation optimization device based on Q-learning, comprising: The model building module respectively builds the state transformation model before and after the current stratified flow velocity and the H-ADCP measurement equation model for the current stratified flow velocity: wherein the state equation unmodeled parameters of the state transformation model, the measurement equation unmodeled parameters of the measurement equation model, the process noise variance of the state transformation model, and the measurement noise variance of the measurement equation model are used as the quaternion as a whole; The calculation module determines the most appropriate process noise variance parameters and measurement noise variance parameters, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation at each moment through the four-dimensional grid Q-learning method; and calculates the final estimated value of the stratified flow velocity at each moment based on the most appropriate process noise variance parameters and measurement noise variance parameters, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation at each moment.
[0018] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the above-mentioned Q-learning-based flow velocity estimation optimization method.
[0019] In a fourth aspect, the present invention provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process, and the process includes the above-mentioned Q-learning-based flow rate estimation optimization method.
[0020] The main contributions and innovations of the present invention are as follows: 1. The present invention proposes a velocity estimation optimization method based on Q-learning, which can effectively deal with the unmodeled parameter noise problem caused by the complex natural environment and measurement instrument deviation in the modeling of the stratified flow velocity system of the horizontal acoustic Doppler current meter, and significantly improve the accuracy and reliability of the velocity estimation.
[0021] 2. By establishing accurate state transformation models and measurement equation models, and optimizing the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance as quaternions, a systematic and effective solution is provided to solve the uncertainty and error in flow velocity estimation.
[0022] 3. The four-dimensional grid Q-learning method, combined with the greedy algorithm and a specific iterative formula, can quickly and accurately search for the optimal quaternion parameter combination in a complex parameter space, greatly improving the efficiency and adaptability of the algorithm.
[0023] 4. Compared with the traditional reference RMS volumetric Kalman filter method, the grid search RMS volumetric Kalman filter method in the present invention optimizes quaternion parameters through Q-learning, can better adapt to various changes and uncertainties in actual measurement, and improves the accuracy and stability of flow velocity estimation.
[0024] 5. The velocity estimation optimization method and device proposed in the present invention, as well as the corresponding electronic device and readable storage medium, provide more advanced and reliable technical means for velocity measurement and related research in the fields of water conservancy engineering, marine science, etc., and help promote the development and progress of these fields.
[0025] This method can reduce the risks and losses caused by inaccurate flow velocity estimation, for example, in water resource management, flood prevention and disaster reduction in water conservancy projects, as well as ocean circulation research and marine resource development in marine science, and has important practical application value.
[0026] In summary, the present invention has significant beneficial effects in improving the accuracy of flow velocity estimation, enhancing algorithm adaptability, and promoting the development of related fields.
[0027] The details of one or more embodiments of the invention are set forth in the following drawings and description so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 is a flow chart of a flow velocity estimation optimization method based on Q-learning according to an embodiment of the present invention; Figure 2 is a projection diagram of a four-dimensional grid on the coordinate axes of each dimension according to an embodiment of the present invention; Figure 3 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0030] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0031] In the process of modeling the stratified flow velocity system of (horizontal) acoustic Doppler current meter, due to factors such as the natural environment and measurement instrument deviation, there must be undetermined unmodeled parameter noise in the system model, which will affect the final stratified flow velocity estimation method.
[0032] Based on this, the present invention solves the problems existing in the prior art based on the Q-learning method.
[0033] Embodiment 1 The present invention aims to propose a flow velocity estimation optimization method based on Q-learning. Specifically, referring to Figure 1 , the method comprising: S1. Model the system model, as follows: Assume that the state transformation equation before and after a certain stratified flow velocity is: (1) in is the stratified flow velocity state variable, (equivalent to φ k , different fonts) is the stratified flow velocity state transformation transfer matrix, is the unmodeled parameter of the state equation, is the process noise, satisfying .in Expressing expectation , a normal distribution with variance A.
[0034] Assume that the H-ADCP (Horizontal Acoustic Doppler Current Profile) measurement equation for a certain layered flow velocity is: (2) in is the actual flow rate value measured by H-ADCP, represents the measurement function, To measure noise, satisfy . Parameters not modeled for the measurement equations.
[0035] Among them, the quaternion in this method refers to ,in The unmodeled parameters in the state transformation model and the measurement equation model will affect the estimation accuracy of the actual stratified flow velocity. is the variance of process noise and measurement noise, and the accuracy of its value will also affect the estimation accuracy of stratified flow velocity.
[0036] To this end, it is proposed to use the Q-learning method to continuously optimize the parameters in the above quaternion while estimating the stratified flow velocity, so as to improve the estimation accuracy of the stratified flow velocity.
[0037] Among them, Q-learning is a reinforcement learning algorithm. Its core idea is to learn what actions to take in a specific environment to obtain the maximum long-term cumulative reward by constantly trying and evaluating different actions. In Q-learning, a Q-value table is created to store the expected reward value of each state-action pair. By constantly interacting with the environment, the values in the Q-value table are updated according to the rewards obtained, so as to gradually find the optimal strategy.
[0038] S2. Use the proposed method to filter and estimate the flow velocity value. The main process is as follows: S21, initial moment, i.e. When initialization is performed: make
[0039] in represents the initialization estimate of the reference RMS cubature Kalman filter and the corresponding estimation error variance matrix, Represents the initialization estimate of the grid search RMS volumetric Kalman filter and the corresponding estimation error variance matrix, where the quaternion selected in the reference RMS volumetric Kalman filter method is manually set based on experience; the quaternion parameters in the grid search RMS volumetric Kalman filter method are continuously optimized based on the four-dimensional grid Q-learning method. are preset parameters.
[0040] S211. Setting parameters in the four-dimensional grid Q-learning method The initial value of is 0.
[0041] S22, Moment, cycle Next, the four-dimensional grid Q-learning method is used to obtain the most suitable quaternion parameters at this moment. The four-dimensional grid Q-learning method is mainly described as follows: Since the working environment of H-ADCP is constantly changing, the process noise variance parameters, measurement noise variance parameters, state equation unmodeled parameters, and measurement equation unmodeled parameters in its model are constantly changing. In this method, the grid Q-learning method is used to determine the most appropriate process noise variance parameters and measurement noise variance parameters, as well as state equation unmodeled parameters and measurement equation unmodeled parameters at each moment. The main process is: S221, four-dimensional grid setting, first refer to the empirical value, set the value of the four-dimensional grid, its projection on the coordinate axis of each dimension is as follows Figure 2 shown.
[0042] Figure 2 It can be seen that a grid in the four-dimensional grid represents a different combination of unmodeled parameters of the state equation, unmodeled parameters of the measurement equation, process noise variance, and measurement noise variance, that is, a grid includes four parameters, and the parameter values of each grid are different. This means that the unmodeled parameters of the state equation at this moment are , the unmodeled parameters of the measurement equation are , the process noise variance is , the measurement noise variance is .
[0043] S222, according to the current state equation unmodeled parameters, measurement equation unmodeled parameters, process noise variance, measurement noise variance value, that is, which grid value is currently selected, according to the greedy algorithm, select the execution action, that is, in this cycle In which neighbor grid to move to, the moving direction is shown in Figure 2 As shown in , each component can only be moved once at a time.
[0044] Among them, the greedy algorithm is an algorithm strategy that takes the option that seems to be the best at the moment in each step of selection. The greedy strategy is detailed as follows: Setting random threshold ,make for Uniformly distributed random numbers in the interval.
[0045] when When, in the collection Randomly select the next action a s ; Here the set A s Represents the set of all movable actions that can be selected for the current grid. s It is the specific action of moving to which neighboring grid next.
[0046] when When the next step is a s Select a s =argmax a Q q (s q ,a q ), max a Indicates Q q (s q ,a q ) is the value of a when it reaches its maximum value.
[0047] Here Q q (s q ,a q ) is the parameter in the four-dimensional grid Q-learning method. The iterative calculation formula is:
[0048] In the formula is the learning rate, represents the discount factor, is the reward function. The reward function is calculated in step S225. , V q Biggest Q q The numerical value of .
[0049] S223. First, based on the existing information , based on the reference RMS volumetric Kalman filter method, the filtering information is calculated, where Last moment respectively The calculated filtered estimate of the stratified velocity and the estimated error covariance matrix, They are the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance, which are preset according to empirical values. The main process is as follows: S2231, Initialization First, the algorithm is initialized to obtain the square root of the estimated error covariance matrix in the form of information and the corresponding estimated information vector .
[0050] (3) in is a symmetric positive definite matrix. represents the Cholesky decomposition of a symmetric positive definite matrix.
[0051] S2232, Time Update 1) Apply the volume sampling rule to perform a one-step recursion and obtain and .
[0052] ① Generate volume sampling points , .in is the dimension of the state vector, and l is the index in the lower right corner.
[0053] (4) in , ,ξ 1 It is an intermediate parameter used in volume sampling point calculation.
[0054] ② Perform one-step recursion on the volume points generated in 1)-①: (5) ③ Sum the predicted volume points in one step and calculate the predicted state value: (6) ④ Calculate the root mean square matrix of the prediction error covariance matrix: (7) in , , represents the transpose of the upper triangular matrix obtained by QR decomposition of the matrix.
[0055] 2) Calculate the root mean square matrix of the prediction information matrix: (8) 3) Calculate the prediction information vector: (9) S2233, measurement update 1) Calculated using the RMS volumetric Kalman filter algorithm , is the matrix calculated using the RMS cubature Kalman filter algorithm; 2) Calculate the root mean square of the information contribution matrix: (10) in, .
[0056] 3) Calculate the information contribution vector: (11) in , indicating the measurement of one-step prediction value.
[0057] 4) Calculate the updated information vector: (12) 5) Calculate the updated information matrix RMS matrix: (13) 6) Calculate the final estimate: (14) S2234. Calculate the estimated information based on the final estimated value obtained at this moment: (15) S224. Based on existing information , based on the grid search RMS volumetric Kalman filter method, the estimated information is calculated, where Last moment respectively The calculated filtered estimate of the stratified velocity and the estimated error covariance matrix, Respectively The unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance and the measurement noise variance in the selected grid during the iteration process. The main process is as follows: S2241, Initialization Initialize the algorithm and get the square root of the estimated error covariance matrix in the form of information and the corresponding estimated information vector .
[0058] (16) in is a symmetric positive definite matrix. represents the Cholesky decomposition of a symmetric positive definite matrix.
[0059] S2242, Time Update 1) Apply the volume sampling rule to perform a one-step recursion and obtain and .
[0060] ① Generate volume sampling points , .in is the dimension of the state vector.
[0061] (17) in , .
[0062] ② Perform one-step recursion on the volume points generated in 1)-①: (18) ③ Sum the predicted volume points in one step and calculate the predicted state value: (19) ④ Calculate the root mean square matrix of the prediction error covariance matrix: (20) in , , represents the transpose of the upper triangular matrix obtained by QR decomposition of the matrix.
[0063] 2) Calculate the root mean square matrix of the prediction information matrix: (twenty one) 3) Calculate the prediction information vector: (twenty two) S2243, measurement update 1) Calculated using the RMS volumetric Kalman filter algorithm ; 2) Calculate the root mean square of the information contribution matrix: (twenty three) in, .
[0064] 3) Calculate the information contribution vector: (twenty four) in , indicating the measurement of one-step prediction value.
[0065] 4) Calculate the updated information vector: (25) 5) Calculate the updated information matrix RMS matrix: (26) 6) Calculate the final estimate: (27) S2244: Based on the final estimated value obtained at this moment, the estimated information is calculated: (28) S225: Based on the estimated information obtained above , calculate the reward function: (29) S226: Based on the reward function , iterative calculation , continuously optimize the value of each element in the quaternion, iterate to , let the final quaternion be .
[0066] S227: Based on , using the algorithm used in step S224, calculate the final estimated value of the stratified flow velocity at this moment .
[0067] S23: Prepare for the next calculation: Let the process noise variance of the reference RMS cubature Kalman filter method be , the measurement noise variance is , the unmodeled parameters of the state equation are , the unmodeled parameters of the measurement equation are . Let the reward function ,make , which means assignment. Because the last calculation is finished at this moment, it needs to be assigned, so that the accuracy of subsequent calculations will be higher and higher.
[0068] S24: The next moment , return to step S223 and calculate the estimated value of the stratified flow velocity at the next moment.
[0069] Embodiment 2 Based on the same concept, the present invention also proposes a flow velocity estimation optimization device based on Q-learning, comprising: Model building module, builds the state transformation model before and after the current stratified flow velocity: x k+1 =(φ k +Δφ k )x k +w k Among them, x k is the stratified flow velocity state variable, φ k is the stratified flow velocity state transformation transfer matrix, Δφ k is the unmodeled parameter of the state equation, w k is the process noise, satisfying w k ~N(0,Q k ), Q k is the process noise variance; Establish the H-ADCP measurement equation model for the current stratified flow velocity: y k =h k (x k )+ΔH k x k +v k Among them, y kis the actual flow rate value measured by H-ADCP, h k (·) represents the measurement function, v k To measure noise, satisfy v k ~N(0,R k ), ΔH k To measure the unmodeled parameters of the equation, R k is the measurement noise variance; Among them, Δφ k , ΔH k , Q k , R k As a quaternion; Initialization module, at the initial time k=0, is initialized, let:
[0070] in, represents the initialization estimate of the reference RMS cubature Kalman filter and the corresponding estimation error variance matrix; represents the initialization estimate of the grid search RMS volumetric Kalman filter and the corresponding estimation error variance matrix. The quaternion selected in the reference RMS volumetric Kalman filter method is set based on experience. The parameters of the quaternion in the grid search RMS volumetric Kalman filter method are optimized based on the four-dimensional grid Q-learning method. is the preset parameter; The learning module sets the parameter Q in the four-dimensional grid Q-learning method q (s q ,a q ) has an initial value of 0; q (s q ,a q ) in state s q Take action a q The estimated value of the long-term cumulative reward that can be obtained; at the time k≥1, the cycle is t=1,2,...,T times, and the most appropriate quaternion parameters and layered flow velocity estimates at each moment are determined by the four-dimensional grid Q-learning method; where T is the maximum number of cycles; After each calculation, let k=k+1 at the next moment, and refer to the process noise variance of the RMS cubature Kalman filter method as follows: , the measurement noise variance is , the unmodeled parameters of the state equation are , the unmodeled parameters of the measurement equation are ; Let the reward function R of the four-dimensional grid Q-learning method be q =0, .
[0071] Embodiment 3 This embodiment also provides an electronic device, referring to Figure 3 , comprises a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.
[0072] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0073] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0074] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0075] The processor 402 implements any Q-learning-based flow velocity estimation optimization method in the above-mentioned embodiments by reading and executing computer program instructions stored in the memory 404 .
[0076] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0077] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0078] Input / output devices 408 are used to input or output information.
[0079] Embodiment 4 This embodiment also provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process. The process includes the Q-learning-based flow rate estimation optimization method according to the first embodiment.
[0080] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0081] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0082] Embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, at this point, it should be noted that, for example, Figure 1 Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or storage blocks implemented within the processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.
[0083] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0084] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A flow velocity estimation optimization method based on Q-learning, characterized in that: The following steps are involved: S00, respectively establishing a state transformation model before and after the current stratified flow velocity and a H-ADCP measurement equation model for the current stratified flow velocity; S10, taking the unmodeled parameters of the state equation of the state transformation model, the unmodeled parameters of the measurement equation of the measurement equation model, the process noise variance of the state transformation model, and the measurement noise variance of the measurement equation model as the quaternion as a whole; S20, determining the most appropriate process noise variance parameter and measurement noise variance parameter at each moment, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation by a four-dimensional grid Q-learning method; S30, calculating the final estimated value of the stratified flow velocity at each moment according to the most appropriate process noise variance parameter and measurement noise variance parameter at each moment, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation.
2. The flow velocity estimation optimization method based on Q-learning according to claim 1, characterized in that: In step S00, the state transformation model between the current stratified flow velocity and the previous and next moments is: x k+1 =(φ k +Df k )x k +w k Among them, x k is the stratified flow velocity state variable, φ k is the stratified flow velocity state transformation transfer matrix, Δφ k is the unmodeled parameter of the state equation, w k is the process noise, satisfying w k ~N(0,Q k ), Q k is the process noise variance.
3. The flow velocity estimation optimization method based on Q-learning according to claim 1, characterized in that: In step S00, the H-ADCP measurement equation model for the current stratified flow velocity is: y k =h k (x k )+ΔH k x k +v k Among them, y k is the actual flow rate value measured by H-ADCP, h k (·) represents the measurement function, v k To measure noise, satisfy v k ~N(0,R k ), ΔH k To measure the unmodeled parameters of the equation, R k is the measurement noise variance.
4. The flow velocity estimation optimization method based on Q-learning according to claim 1, characterized in that: In step S20, the specific steps of determining the most appropriate quaternion parameters at each moment by the four-dimensional grid Q-learning method are: Refer to the empirical value to set the four-dimensional grid, each grid corresponds to Δφ k , ΔH k , Q k , R k A different combination of values of ; Among them, Δφ k is the unmodeled parameter of the state equation of the state transition model, ΔH k is the unmodeled parameter of the measurement equation of the measurement equation model, Q k is the process noise variance of the state transition model, R k is the measurement noise variance of the measurement equation model; According to the current Δφ k , ΔH k , Q k , R k The greedy algorithm is used to select the execution action based on the value of to decide which neighboring grid to move to in this cycle t; based on , the filtering information is calculated by referring to the RMS volumetric Kalman filtering method ;in, are the filtered estimated value of the stratified flow velocity and the estimated error covariance matrix calculated at the previous time k-1, They are the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance, which are preset according to empirical values; based on , the estimated information is calculated by grid search RMS volumetric Kalman filter method ;in, are the filtered estimated value of the stratified flow velocity and the estimated error covariance matrix calculated at the previous time k-1, are the unmodeled parameters of the state equation, the unmodeled parameters of the measurement equation, the process noise variance, and the measurement noise variance in the selected grid during the t-th iteration; Based on the calculated , calculate the reward function R q And according to the reward function R q Iterative calculation of Q q (s q ,a q ), in order to continuously optimize the value of each element in the quaternion, iterate until t=T, and the final quaternion is ; based on , calculate the final estimated value of the current stratified flow velocity .
5. The Q-learning-based flow velocity estimation optimization method according to claim 4, characterized in that: In step S20, the strategy of the greedy algorithm is as follows: Set the random threshold ε∈(0,1) and let ε'=rand(·) be a random number uniformly distributed in the interval (0,1); When ε'<ε, in set A s Randomly select the next action a s ; Among them, A s Represents the set of all movable actions that can be selected for the current grid; When ε'≥ε, the next step is a s Select a s =argmax a Q q (s q ,a q ).
6. The Q-learning-based flow velocity estimation optimization method according to claim 4, characterized in that: In step S20, according to the reward function R q Iterative calculation of Q q (s q ,a q ) is: ; in, is the learning rate, represents the discount factor, .
7. The Q-learning-based flow velocity estimation optimization method according to any one of claims 2 to 6, characterized in that: In step S40, based on the calculated , calculate the reward function R q The formula is as follows: 。 8. A flow velocity estimation and optimization device based on Q-learning, characterized in that: include: The model building module respectively builds the state transformation model before and after the current stratified flow velocity and the H-ADCP measurement equation model for the current stratified flow velocity: wherein the state equation unmodeled parameters of the state transformation model, the measurement equation unmodeled parameters of the measurement equation model, the process noise variance of the state transformation model, and the measurement noise variance of the measurement equation model are used as the quaternion as a whole; The calculation module determines the most appropriate process noise variance parameters and measurement noise variance parameters, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation at each moment through the four-dimensional grid Q-learning method; and calculates the final estimated value of the stratified flow velocity at each moment based on the most appropriate process noise variance parameters and measurement noise variance parameters, as well as the unmodeled parameters of the state equation and the unmodeled parameters of the measurement equation at each moment.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the Q-learning-based flow velocity estimation optimization method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, wherein the computer program includes a program code for controlling a process to execute a process, wherein the process includes the Q-learning-based flow velocity estimation optimization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Acoustoelectric bimodal fusion measuring method of two-phase flow process parameters
CN107153086A
H-ADCP section average flow velocity self-correction method based on scene self-adaption
CN115854999A
Flow sensor and river flow observation device
JP2018036218A
