Method for determining dynamic compensation filter parameters based on improved cuckoo search algorithm

By improving the cuckoo search algorithm to optimize the sensor's dynamic compensation filter parameters, the problems of low accuracy of sensor compensation filters and difficult parameter design are solved, high-precision and real-time dynamic compensation are achieved, and the performance of the sensing system is improved.

CN120373345APending Publication Date: 2025-07-25BEIJING INST OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510475240.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The compensation filter of existing sensors has low accuracy and difficult parameter design, especially in the inverse modeling method, which is difficult to meet the needs of high-performance sensors.

Method used

The improved cuckoo search algorithm is adopted to establish a dynamic compensation filter model, and use the input and output data of the sensor to optimize the dynamic compensation filter parameters, simplify the parameter design process, and improve the compensation effect.

Benefits of technology

It improves the accuracy of the dynamic compensation filter of the sensor, simplifies the parameter design, realizes real-time dynamic compensation, and improves the data processing accuracy and stability of the sensing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120373345A_ABST
    Figure CN120373345A_ABST
Patent Text Reader

Abstract

The invention relates to a method for determining parameters of a dynamic compensation filter based on an improved cuckoo search algorithm, belongs to the field of intelligent sensors, and solves the problems that a compensation filter of an existing sensor is low in precision and difficult in parameter design. Comprising establishing a dynamic compensation filter model; acquiring original input data and output data of the sensor as a sample data set; based on the sample data set, using an improved cuckoo search algorithm to optimize parameters of the dynamic filtering compensator, and using a dynamic compensation filter model to calculate a fitness value of each nest in the optimization process; obtaining a global optimal solution, transmitting the global optimal solution to a dynamic compensation filter model, performing parameter optimization on the dynamic compensation filter model, and obtaining the optimized dynamic compensation filter model as a sensor dynamic compensation model; and inputting the input data into a sensing system consisting of the sensor and the sensor dynamic compensation model in real time to obtain a compensated sensor output value. And real-time dynamic compensation of the sensor is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent sensors, and in particular, to a method for determining parameters of a dynamic compensation filter based on an improved cuckoo search algorithm. Background Art

[0002] With the rapid development of intelligent sensors, intelligent sensor systems are applied in all walks of life. Intelligent sensing elements are key tools connecting the physical world and the digital world. They can detect and measure various physical parameters (such as temperature, pressure, light intensity, sound, chemical composition, etc.), providing necessary raw information for data analysis and decision-making. This involves many aspects of modern science and technology and industrial applications, and its importance cannot be ignored in human life and production. Sensors undertake key measurement and monitoring tasks in their various applications. Therefore, the high performance of sensors is crucial for ensuring data quality, system safety, improving efficiency, and enhancing the user experience.

[0003] Sensors and filters are closely related in the application of sensors. Sensors are responsible for detecting and measuring physical parameters such as temperature, humidity, pressure, and light intensity to obtain raw data. Due to environmental noise, interference, and the characteristics of the sensors themselves, the output data of sensors is uncertain or has errors. In order to improve data quality and accuracy, it is necessary to process and optimize the sensor output, thus introducing filters. The role of filters is to process the sensor output, remove noise, smooth data, or extract signals of interest.

[0004] Currently, due to limitations in aspects such as technology and structure, it is difficult to develop high-performance sensors. Therefore, dynamic compensation of sensors has become the best choice, and researching high-performance dynamic compensation filters has theoretical and practical significance. Currently, the design of compensation filters can be divided into two categories: forward modeling and inverse modeling. The forward modeling method requires first identifying the model of the sensor, such as the simultaneous identification method. After identification, the compensator can be designed using the zero-pole placement method. This method has high requirements for the accuracy of the identified model. The process of designing the parameters of the compensation filter after identification involves a large amount of calculation, with high implementation complexity and certain limitations. The inverse modeling method does not require identifying the model of the sensor. Only by setting an appropriate objective function based on the input and output of the sensor and using a certain intelligent optimization algorithm can the corresponding compensation filter be obtained. However, it is somewhat difficult to calculate the parameters of the compensation filter for business applications with high precision requirements.

[0005] In summary, there is an urgent need for a method for determining parameters of a dynamic compensation filter based on an improved cuckoo search algorithm to solve the technical problems of low accuracy and difficult parameter design of the compensation filter of existing sensors. Summary of the Invention

[0006] In view of the above analysis, the embodiments of the present invention aim to provide a method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm to solve the technical problems of low accuracy of the compensation filter of existing sensors and difficult parameter design.

[0007] The present invention discloses a method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm, including the following steps:

[0008] Establish a dynamic compensation filter model;

[0009] Obtain the original input data and output data of the sensor as a sample data set;

[0010] Based on the sample data set, use the improved cuckoo search algorithm to optimize the parameters of the dynamic filter compensator. During the optimization process, use the dynamic compensation filter model to calculate the fitness value of each nest; obtain the global optimal solution and transfer it to the dynamic compensation filter model to optimize the parameters of the dynamic filter model, and obtain the optimized dynamic compensation filter model as the sensor dynamic compensation model;

[0011] Input the input data into the sensing system composed of the sensor and the sensor dynamic compensation model in real time to obtain the compensated sensor output value.

[0012] Further, the establishment of the dynamic compensation filter model is as follows:

[0013]

[0014] where z is the complex variable in the z-transform, a0, a1, and a2, and b1 and b2 are the parameters of the dynamic filter compensator.

[0015] Further, each sample in the sample data set includes an original input data of the sensor and a corresponding original output data;

[0016] The original input data is the expected output value of the dynamic compensation filter;

[0017] The original output data is the input of the dynamic compensation filter.

[0018] Further, the optimization of the parameters of the dynamic filter compensator based on the sample data set using the improved cuckoo search algorithm includes:

[0019] Initialize the parameters in the improved cuckoo search algorithm;

[0020] Initialize the bird nests, where each bird nest represents a set of solutions of the dynamic compensation filter model. Calculate the fitness value of each bird nest initially, and select the bird nest corresponding to the optimal fitness value as the current global optimal solution at the initial time. This bird nest is the current optimal bird nest;

[0021] At each iteration:

[0022] For non-current optimal bird nests, use Lévy flight to generate new candidate solutions; for the current optimal bird nest, perform a small random perturbation to obtain the perturbed solution;

[0023] After each Lévy flight and perturbation, calculate the fitness value of each bird nest based on the sample data set and the dynamic compensation filter model; compare each fitness value with the current global optimal solution, and if the calculated fitness value is less than the fitness value of the current global optimal solution, replace the current global optimal solution;

[0024] Determine the bird nests to be discarded according to the probability pa of the host discovering foreign bird eggs, and dynamically adjust the step size;

[0025] Return the global optimal solution when the maximum number of iterations is reached.

[0026] Furthermore, calculating the fitness value of each bird nest using the dynamic compensation filter model includes:

[0027] Take a set of solutions of the dynamic compensation filter model represented by each bird nest as parameters and input them into the parameters of the dynamic compensation filter model;

[0028] Input the original output data of the sensor in the sample data set into the dynamic compensation filter to obtain the actual output value of the dynamic compensation filter;

[0029] The original output data of the sensor in the sample of the sample data set is used as the input of the dynamic compensation filter, and the original input data in the sample of the sample data set is the expected output value of the dynamic compensation filter;

[0030] Input multiple samples in each optimization iteration process;

[0031] Calculate the fitness value of the bird nest according to the actual output value and the expected output value in the corresponding sample as follows:

[0032]

[0033] where h(x) and q(x) are the actual output value and the expected output value of the dynamic compensation filter at the x-th iteration respectively, and A is the number of samples used in the x-th iteration.

[0034] Further, for each nest that is not the current optimal nest, Levy flight is used to generate new candidate solutions and update the candidate solutions as follows:

[0035] X r+1,m = X r,m + stepsize * Levy(β)

[0036] where X r+1,m is the m-th candidate solution at the (r + 1)-th iteration, X r,m is the m-th candidate solution at the r-th iteration, X r,b is the current global optimal solution of the current search, stepsize is the step size, Levy() is the path of Levy flight random walk, and β is the Levy flight parameter.

[0037] Further, a small random perturbation is applied to the current optimal nest to obtain the perturbed solution as follows:

[0038] X r,s = X r,b + P * rand(1, D)

[0039] where X r,s is the solution after perturbing the current global optimal solution, X r,b is the global optimal solution at the r-th iteration, P is the perturbation amplitude, D is the dimension of the search space, and rand() is a random function.

[0040] Further, determining the nests to be discarded according to the probability pa of the host finding foreign bird eggs includes:

[0041] At each iteration, each nest generates a random number k ∈ [0, 1] between 0 and 1, and compares the random number k with the probability pa of the host finding foreign bird eggs;

[0042] If k ≥ pa, it means that the nest is not discarded;

[0043] If k < pa, it means that the nest has been discarded. For each discarded nest, a new nest is randomly generated to replace the discarded nest;

[0044] At the same time, according to the increase in the number of iterations, the probability pa of the host finding foreign bird eggs is linearly increased and adjusted as follows:

[0045] pa = minpa + (maxpa - minpa) * (iter / maxiterations)

[0046] where minpa is the minimum discard probability, maxpa is the maximum discard probability, iter is the current iteration number, and maxiterations is the maximum number of iterations.

[0047] Furthermore, the dynamic adjustment of the step size includes:

[0048] Set a counter with an initial value of 0;

[0049] If the optimal fitness value of the current iteration is less than the global optimal solution of the previous iteration, then reduce the step size "stepsize" of the next iteration and reset the counter;

[0050] Otherwise, if the optimal fitness value of the current iteration is greater than or equal to the global optimal solution of the previous iteration, then increment the counter by 1. When the counter reaches the preset threshold, increase the step size of the next iteration.

[0051] Furthermore, the dimension D of the search space in the improved cuckoo search algorithm is the number of parameters of the dynamic compensation filter model.

[0052] Compared with the prior art, the present invention can at least achieve one of the following beneficial effects:

[0053] 1. Improve the accuracy of the dynamic compensation filter of the sensor: By optimizing the parameters of the dynamic compensation filter through the improved cuckoo search algorithm, the compensation effect of the sensor is effectively improved, and the accuracy and stability of data processing are enhanced;

[0054] 2. Simplify the parameter design process: Using the improved cuckoo search algorithm, the problem of determining and optimizing the parameters of the dynamic compensation filter of the sensor is transformed into a global optimal solution problem, avoiding the complex parameter design and adjustment process in the traditional method, and reducing the difficulty and cost of parameter design determination and optimization;

[0055] 3. Achieve real-time dynamic compensation: By combining the dynamic compensation filter with the sensor, the sensor can be dynamically compensated in real time, improving the performance of the sensing system composed of the sensor and the dynamic compensation filter model in practical applications and meeting the requirements of real-time data processing.

[0056] In the present invention, the above technical solutions can also be combined with each other to achieve more preferred combination schemes. Other features and advantages of the present invention will be described in the subsequent specification, and some advantages can be made obvious from the specification or understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained from the content specifically pointed out in the specification and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The drawings are only for the purpose of showing specific embodiments and are not considered as limiting the present invention. Throughout the drawings, the same reference numerals represent the same components.

[0058] Figure 1It is a flowchart of a method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm;

[0059] Figure 2 It is the schematic diagram of the compensation principle of the compensation filter for the sensor;

[0060] Figure 3 It is the schematic diagram of the sensing system composed of the sensor and the sensor dynamic compensation model;

[0061] Figure 4 It is the graph of the fitness function value changing with the number of iterations;

[0062] Figure 5 It is the comparison graph of the effects before and after compensation using the improved cuckoo search algorithm. Specific embodiments

[0063] The following will specifically describe the preferred embodiments of the present invention with reference to the accompanying drawings. The accompanying drawings form a part of this application and are used together with the embodiments of the present invention to explain the principle of the present invention, and are not used to limit the scope of the present invention.

[0064] The method for determining the parameters of the dynamic compensation filter using the improved cuckoo search algorithm adopted in the present invention is a kind of inverse modeling method.

[0065] The inverse modeling method does not need to first model the sensor model, but directly designs the compensation filter according to the input and output data of the sensor.

[0066] In the inverse modeling method, first set an appropriate objective function to measure the compensation effect, such as mean square error, response time, etc.;

[0067] Then use intelligent optimization algorithms, such as genetic algorithms, particle swarm algorithms, cuckoo search algorithms, etc., to search for the compensation filter parameters that minimize the objective function in the parameter space.

[0068] The advantage of the inverse modeling method is that it does not need to confirm the sensor model in advance, is more flexible, and is applicable to some sensor systems that are difficult to model or have inaccurate models. However, the designed compensation filter may not be as accurate as the forward modeling method and needs to be improved, experimentally verified, and debugged.

[0069] The method for determining the parameters of the dynamic compensation filter based on the improved cuckoo search algorithm disclosed in the present invention, according to the input and output data of the sensor, quickly calculates the parameters of the compensation filter using an intelligent algorithm (i.e., the improved cuckoo search algorithm), so that the entire sensor system after adding the compensation filter significantly improves the response speed and reduces the overshoot (i.e., the amplitude by which the actual output exceeds the expected output). Compared with the original output to the expected output, the mean square error of the actual output to the expected output after compensation is significantly reduced.

[0070] The objective of the present invention is to determine the parameters of a dynamic compensation filter through an improved cuckoo search algorithm, so as to minimize the mean square error between the actual output and the desired output of the compensated sensor. Therefore, the parameters of the dynamic compensation filter are optimized according to the difference between the actual output and the expected output of the sensor, thereby achieving the improvement and optimization of the performance of the sensor system.

[0071] A specific embodiment of the present invention discloses a method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm, as Figure 1 shown, which includes the following steps:

[0072] Step S1: Establish a dynamic compensation filter model;

[0073] Step S2: Obtain the original input data and output data of the sensor as a sample data set;

[0074] Step S3: Optimize the parameters of the dynamic filter compensator based on the sample data set using the improved cuckoo search algorithm. During the optimization process, calculate the fitness value of each nest using the dynamic compensation filter model; obtain the global optimal solution and transfer it to the dynamic compensation filter model to optimize the parameters of the dynamic filter model, and obtain the optimized dynamic compensation filter model as the sensor dynamic compensation model;

[0075] Step S4: Input the input data into the sensing system composed of the sensor and the sensor dynamic compensation model in real time to obtain the compensated sensor output value.

[0076] Step S1, specifically.

[0077] For the method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm disclosed by the present invention, taking a second-order compensation filter as an example, the establishment of the dynamic compensation filter model is as shown in formula (1).

[0078]

[0079] Where z is the complex variable in the z-transform, a0, a1, and a2, and b1 and b2 are the parameters of the dynamic filter compensator.

[0080] The parameters of the dynamic compensation filter determine the performance of the compensation filter.

[0081] Exemplarily, a0, a1, and a2 are 0.5531, -0.9032, 0.4864 respectively, and b1 and b2 are -0.9157, 0.0589 respectively.

[0082] The parameters of the dynamic compensation filter in the present invention are the five parameters in the dynamic compensation filter model: a0, a1, and a2, and b1 and b2.

[0083] Initialize the parameters of the dynamic filter compensator. Exemplarily, each parameter value is initialized to a randomly generated value within the range of -1 to 1.

[0084] In signal processing, the z-transform is a commonly used discrete-time transform, similar to the Laplace transform in the continuous-time domain. The complex variable z of the z-transform represents a complex position in the complex frequency domain, similar to s in the Laplace transform, but the z-transform is used to describe the frequency-domain characteristics of discrete-time signals and systems.

[0085] The complex variable z of the z-transform is defined as: z = e sT 。

[0086] where s is the complex variable in the Laplace transform, T is the sampling period, and the z-transform converts the discrete-time signal to the complex frequency domain.

[0087] In the transfer function of the dynamic compensation filter, the complex variable z of the z-transform is used to represent the complex frequency-domain position of the transfer function to describe the frequency response of the sensor system to the input signal and convert the discrete time domain to the complex frequency domain.

[0088] The dynamic filter compensator model is a mathematical expression of the relationship between the input and output of the sensor system. It describes the dynamic behavior of the system in the complex frequency domain and is the basis for designing the dynamic compensation filter.

[0089] Taking the mean square error between the actual output and the desired output of the compensated sensor as the evaluation criterion, set the corresponding fitness function, improve the problems existing in the existing cuckoo algorithm, make the algorithm have stronger global search ability, optimize its search mechanism and optimization strategy, and solve the problem that the existing technology is easy to fall into the local optimal solution by dynamically adjusting the step size and improving the cuckoo search algorithm.

[0090] Step S2, specifically.

[0091] Specifically, the obtained signals are the stimulus signal (input) received by the sensor and the response signal (output) generated by the sensor.

[0092] Obtain the original input data and output data of the sensor as the sample data set.

[0093] Each sample in the sample data set includes an original input data of the sensor and a corresponding original output data.

[0094] The original input data is the desired output value of the dynamic compensation filter.

[0095] The original output data is the input of the dynamic compensation filter.

[0096] As shown Figure 2 in the figure, the original output data of the sensor is used as the input data of the dynamic compensation filter, and the expected output of the dynamic compensation filter is the original input data of the sensor, that is, the output data of the sensor is compensated by the dynamic compensation filter to make it as close as possible to the original input data, that is, the real input data.

[0097] Step S3 is divided into steps S31 - S32. Specifically.

[0098] Step S31, the optimization of the dynamic filter compensator parameters using the improved cuckoo search algorithm based on the sample data set includes:

[0099] Initializing the parameters in the improved cuckoo search algorithm;

[0100] Initializing the bird nests, each bird nest represents a set of solutions of the dynamic compensation filter model, calculating the fitness value of each bird nest initially, and selecting the bird nest corresponding to the optimal fitness value as the current global optimal solution initially, and this bird nest is the current optimal bird nest;

[0101] At each iteration:

[0102] Generating new candidate solutions for non - current optimal bird nests using Levy flight; performing a small - amplitude random perturbation on the current optimal bird nest to obtain the perturbed solution;

[0103] After each Levy flight and perturbation, calculating the fitness value of each bird nest based on the sample data set and the dynamic compensation filter model; comparing each fitness value with the current global optimal solution, and if the calculated fitness value is less than the fitness value of the current global optimal solution, then replacing the current global optimal solution;

[0104] Determining the bird nests to be discarded according to the probability pa of the host finding foreign bird eggs, and dynamically adjusting the step size;

[0105] Returning the global optimal solution when the maximum number of iterations is reached.

[0106] Step S31 includes steps S311 - S315. Specifically.

[0107] Step S11, initializing the parameters in the improved cuckoo search algorithm;

[0108] Defining and initializing the main parameters of the improved cuckoo search algorithm.

[0109] Determining the main parameters of the algorithm, including: the number of cuckoo nests N, the dimension D of the search space, the maximum number of iterations maxiterations, the probability pa of the host finding foreign bird eggs, and the iteration step size stepsize.

[0110] Initialize the parameters. Exemplarily, the number of cuckoo nests N is set to 160;

[0111] The dimension D of the search space. In this example, the second-order compensation filter model has 5 parameters, and D is set to 5; the dimension D of the search space in the improved cuckoo search algorithm is the number of parameters of the dynamic compensation filter model.

[0112] The maximum number of iterations maxiterations is set to 12000;

[0113] The probability pa that a foreign egg is discovered by the host is initially set to 0.25.

[0114] Step 312: Initialize the nests. Each nest represents a set of solutions of the dynamic compensation filter model. Calculate the fitness value of each nest at the initial time, and select the nest corresponding to the optimal fitness value as the current global optimal solution at the initial time. This nest is the current optimal nest.

[0115] Initialize the nests. A nest represents a set of solutions (there are five values in a set of solutions, representing the five parameter values of the dynamic compensation filter model). The actual output value of the dynamic compensation filter model is the input of the dynamic compensation filter (the input of the dynamic filter is the original output of the sensor), and is obtained through the calculation of the dynamic compensation filter model.

[0116] Initialize the nests, which is the starting point of the cuckoo algorithm. Each nest corresponds to a set of parameter values, that is, a possible solution (i.e., a set of parameter values);

[0117] Initializing the nests means randomly assigning a set of parameter values (5 parameter values) to each nest at the beginning of the algorithm, and each parameter value is randomly generated within the range of -1 to 1.

[0118] Set the fitness function. Taking the mean square error between the compensated actual output and the expected output as the evaluation criterion, set the corresponding fitness function. Each nest corresponds to a set of solutions, and calculate the position of the current optimal nest and its corresponding fitness value.

[0119] Set the fitness function. In the present invention, the mean square error between the actual output value of the selected compensation filter and the expected output is used as the fitness function.

[0120] Calculating the fitness value of each nest using the dynamic compensation filter model includes:

[0121] Taking a set of solutions of the dynamic compensation filter model represented by each nest as parameters and inputting them into the parameters of the dynamic compensation filter model;

[0122] Input the original output data of the sensors in the sample dataset into the dynamic compensation filter to obtain the actual output value of the dynamic compensation filter;

[0123] Calculate the fitness value of the cuckoo nest according to the actual output value and the expected output value in its corresponding sample, as shown in formula (2)

[0124]

[0125] where h(x) and q(x) are the actual output value and the expected output value of the dynamic compensation filter at the x-th iteration respectively, and A is the number of samples used in the x-th iteration.

[0126] The fitness function is used to evaluate the quality of each cuckoo nest (i.e., each group of solutions) of the improved cuckoo search algorithm.

[0127] These parameter values form an initial point in the solution space. The initial point represents the starting point of the algorithm's search, that is, the solution that the algorithm may find initially. As the algorithm iterates, the solution will be continuously optimized and adjusted until the optimal solution is found. Initializing the cuckoo nests is to provide a starting point for the algorithm to start searching for the optimal solution.

[0128] Initialize the cuckoo nests. Each cuckoo nest represents a group of solutions of the dynamic compensation filter model. Calculate the fitness value of each cuckoo nest initially, and select the cuckoo nest corresponding to the optimal fitness value as the current global optimal solution initially. This cuckoo nest is the current optimal cuckoo nest;

[0129] Compare the fitness values of all cuckoo nests in the current iteration, and find the cuckoo nest with the optimal fitness value, that is, the cuckoo nest with the minimum fitness value is used as the global optimal solution. The parameter values corresponding to this cuckoo nest are the current global optimal solution.

[0130] Step S313: Generate new candidate solutions for non-current optimal cuckoo nests using Levy flight; perform a small random perturbation on the current optimal cuckoo nest to obtain the perturbed solution;

[0131] Generate new candidate solutions for each non-current optimal cuckoo nest using Levy flight, and update the candidate solutions, as shown in formula (3).

[0132] X r+1,m =X r,m +stepsize*Levy(β) Formula (3)

[0133] where, X r+1,m is the m-th candidate solution when the algorithm iterates to the (r + 1)-th time, X r,m is the m-th candidate solution when iterating to the r-th time, X r,bis the current globally optimal solution found in the current search, stepsize is the step size, Levy() is the path of the Levy flight random walk, and β is the Levy flight parameter.

[0134] Exemplarily, β is set to a fixed value of 1.5 to control the step size distribution of the Levy flight.

[0135] Based on the current globally optimal solution when the algorithm iterates to the r-th time, a small random perturbation is applied to the current optimal bird nest to explore the solution space in its vicinity. The small random perturbation of the current optimal bird nest yields a perturbed solution, as shown in Equation (4).

[0136] X r,s =X r,b +P*rand(1, D) Formula (4)

[0137] In the formula, X r,s is the solution after perturbing the current globally optimal solution, X r,b is the globally optimal solution iterated to the r-th time, P is the perturbation amplitude, D is the dimension of the search space, and rand() is a random function.

[0138] Exemplarily, the perturbation amplitude P is set to 0.05.

[0139] The random function rand() returns a uniformly distributed random real number greater than or equal to 0 and less than 1, and belongs to a pseudo-random number generator.

[0140] After each Levy flight and perturbation, the fitness value of each bird nest is calculated based on the sample data set and the dynamic compensation filter model; each fitness value is compared with the current globally optimal solution, and if the calculated fitness value is less than the fitness value of the current globally optimal solution, the current globally optimal solution is replaced.

[0141] After each Levy flight and perturbation, it is compared with and replaced by the current globally optimal solution.

[0142] Perform Levy flight and perturbation. According to the iterative steps of the improved cuckoo search algorithm, in each iteration, a new candidate solution is generated for each bird nest that is not the current best bird nest using Levy flight; a small random perturbation is applied to the current optimal bird nest to obtain the solution after perturbing the current globally optimal solution.

[0143] Calculate the fitness values for the new candidate solution and the solution after perturbing the current globally optimal solution;

[0144] Compare the calculated fitness values with the fitness value of the current globally optimal solution;

[0145] If the calculated fitness value is less than the fitness value of the global optimal solution, replace the current global optimal solution with the new solution, and update the position and fitness value of the global optimal solution; otherwise, do not update the global optimal solution.

[0146] Step S314: Determine the bird nests to be discarded according to the probability pa of the host discovering foreign bird eggs.

[0147] The determination of the bird nests to be discarded according to the probability pa of the host discovering foreign bird eggs includes:

[0148] Each time an iteration is performed, each bird nest generates a random number k ∈ [0, 1] between 0 and 1, and compare the random number k with the probability pa of the host discovering foreign bird eggs;

[0149] If k ≥ pa, it means that the bird nest is not discarded;

[0150] If k < pa, it means that the bird nest has been discarded. For each discarded bird nest, randomly generate a new bird nest to replace the discarded bird nest;

[0151] At the same time, according to the increase in the number of iterations, linearly increase and adjust the probability pa of the host discovering foreign bird eggs. The update of pa is shown in formula (5).

[0152] pa = minpa + (maxpa - minpa) * (iter / maxiterations) Formula (5)

[0153] Where minpa is the minimum discard probability, maxpa is the maximum discard probability, iter is the current number of iterations, and maxiterations is the maximum number of iterations.

[0154] Exemplarily, the minimum discard probability minpa is set to 0.25, the maximum discard probability maxpa is set to 0.4, and the maximum number of iterations maxiterations is set to 12000.

[0155] pa is dynamically adjusted during the iteration. Exemplarily, starting from the minimum initial value 0.25, as the number of iterations ranges from 1 to the maximum number of iterations maxiterations of 12000 times, pa increases to 0.4.

[0156] Step S315: The dynamic adjustment of the step size includes:

[0157] Set a counter with an initial value of 0;

[0158] If the optimal fitness value of the current iteration is less than the global optimal solution of the previous iteration, reduce the step size stepsize of the next iteration, and reset the counter at the same time;

[0159] Otherwise, if the optimal fitness value of the current iteration is greater than or equal to the global optimal solution of the previous iteration, increment the counter by 1. When the counter reaches the preset threshold, increase the step size of the next iteration.

[0160] Exemplarily, the counter threshold is set to 600.

[0161] Set a counter with an initial value of 0. After each iteration, if the iteration reduces the fitness value compared to the global optimal solution of the previous iteration, reduce the stepsize (i.e., the step length) of the next iteration. Exemplarily, reduce the step size of the next iteration to (0.9 * the current step size), and at the same time reset the counter to 0;

[0162] If the iteration does not reduce the fitness value, increment the counter by 1. When the counter reaches the threshold, increase the step size of the next iteration. Exemplarily, increase the step size of the next iteration to (1.1 * the current step size).

[0163] Exemplarily, the counter threshold is preset to 600.

[0164] If the fitness value decreases, it indicates that the algorithm has made progress in the exploration direction. Reduce the step size of the next iteration by multiplying the step size by a factor of 0.9 to search the solution space more precisely, and reset the counter to 0;

[0165] If the fitness value does not decrease, it indicates that the algorithm may be at a local optimal solution or the search direction is incorrect. Increase the step size of the next iteration by multiplying the step size by a factor of 1.1 to jump out of the current local optimal solution more quickly or search the solution space more widely, and increment the counter by 1.

[0166] If the counter reaches the maximum threshold of 600, it means that these 600 iterations have not achieved good results. Therefore, increase the step size in the hope that the algorithm will conduct a wider search.

[0167] Dynamically adjust the step size of the next iteration according to the change of the fitness value in each iteration to optimize the search efficiency of the algorithm.

[0168] Step S32: Reach the maximum number of iterations and output the global optimal solution. After the iteration ends, output the optimal fitness value and the corresponding global optimal solution, which are the parameters of the dynamic compensation filter.

[0169] Exemplarily, the maximum number of iterations maxiterations is 12000.

[0170] Exemplarily, the final output result is 5 parameter values of the dynamic compensation filter, which are: 0.5531, -0.9032, 0.4864, -0.9157, 0.0589.

[0171] Output the result as the parameters of the dynamic compensation filter model.

[0172] Through the above steps, the present invention can effectively determine the dynamic compensation filter parameters by using the improved cuckoo search algorithm, thereby improving the performance of the sensor system.

[0173] Step S4, specifically.

[0174] The input data is input in real time into the sensing system composed of the sensor and the sensor dynamic compensation model to obtain the compensated sensor output value. As Figure 3 shown.

[0175] As Figure 4 shown, by using the improved cuckoo search algorithm, the convergence speed of the target fitness function f mean square error value is fast, and the convergence accuracy is relatively high.

[0176] Figure 5 In the figure, the dotted line is after compensation, and the solid line is before compensation. It can be seen that according to the compensation filter parameters output by the algorithm, a dynamic compensation filter is added after the sensor, and the overshoot of the entire sensing system is significantly reduced, and the response time is significantly reduced. The above results prove the feasibility of the method for determining the dynamic compensation filter parameters based on the improved cuckoo search algorithm.

[0177] Compared with the prior art, the present invention can at least achieve one of the following beneficial effects:

[0178] 1. Improve the accuracy of the dynamic compensation filter of the sensor: By optimizing the dynamic compensation filter parameters through the improved cuckoo search algorithm, the compensation effect of the sensor is effectively improved, and the accuracy and stability of data processing are improved;

[0179] 2. Simplify the parameter design process: By using the improved cuckoo search algorithm, the problem of determining and optimizing the dynamic compensation filter parameters of the sensor is transformed into a global optimal solution problem, avoiding the complex parameter design and adjustment process in the traditional method, and reducing the difficulty and cost of parameter design determination and optimization;

[0180] 3. Achieve real-time dynamic compensation: By combining the dynamic compensation filter with the sensor, the sensor can be dynamically compensated in real time, improving the performance of the sensing system composed of the sensor and the dynamic compensation filter model in practical applications, and meeting the requirements of real-time data processing.

[0181] Those skilled in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.

[0182] The above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for determining the parameters of a dynamic compensation filter based on an improved cuckoo search algorithm, characterized in that, It includes the following steps: Establish a dynamic compensation filter model; Obtain the original input data and output data of the sensor as a sample data set; Based on the sample data set, use the improved cuckoo search algorithm to optimize the parameters of the dynamic filter compensator. During the optimization process, use the dynamic compensation filter model to calculate the fitness value of each nest; obtain the global optimal solution and transfer it to the dynamic compensation filter model to optimize the parameters of the dynamic filter model, and obtain the optimized dynamic compensation filter model as the sensor dynamic compensation model; Input the input data into the sensing system composed of the sensor and the sensor dynamic compensation model in real time to obtain the compensated sensor output value.

2. The method according to claim 1, wherein The establishment of the dynamic compensation filter model is as follows: Where z is the complex variable in the z-transform, a0, a1, and a2, and b1 and b2 are the parameters of the dynamic filter compensator.

3. The method according to claim 2, wherein Each sample in the sample data set includes an original input data of the sensor and a corresponding original output data; The original input data is the expected output value of the dynamic compensation filter; The original output data is the input of the dynamic compensation filter.

4. The method according to claim 3, characterized in that, The optimization of the parameters of the dynamic filter compensator based on the sample data set using the improved cuckoo search algorithm includes: Initialize the parameters in the improved cuckoo search algorithm; Initialize the nests. Each nest represents a set of solutions of the dynamic compensation filter model. Calculate the fitness value of each nest at the initial time, and select the nest corresponding to the optimal fitness value as the current global optimal solution at the initial time. This nest is the current optimal nest; At each iteration: Use Lévy flight to generate new candidate solutions for non-current optimal nests; perform a small random perturbation on the current optimal nest to obtain the perturbed solution; After each Lévy flight and perturbation, calculate the fitness value of each nest based on the sample data set and the dynamic compensation filter model; compare each fitness value with the current global optimal solution. If the calculated fitness value is less than the fitness value of the current global optimal solution, replace the current global optimal solution; Determine the nests to be discarded according to the probability pa of the host discovering foreign eggs and dynamically adjust the step size; When the maximum number of iterations is reached, return the global optimal solution.

5. The method according to claim 4, wherein The calculation of the fitness value of each nest using the dynamic compensation filter model includes: Take a set of solutions of the dynamic compensation filter model represented by each nest as the parameters of the dynamic compensation filter model; Input the original output data of the sensor in the sample data set into the dynamic compensation filter to obtain the actual output value of the dynamic compensation filter; Calculate the fitness value of the nest according to the actual output value and the expected output value in the corresponding sample as follows: Where h(x) and q(x) are the actual output value and the expected output value of the dynamic compensation filter at the x-th iteration respectively, and A is the number of samples used in the x-th iteration.

6. The method according to claim 5, wherein The generation of new candidate solutions for each non-current optimal nest using Lévy flight is as follows: X r+1,m = X r,m + stepsize * Levy(β) Among them, X r+1,m is the m-th candidate solution at the (r + 1)-th iteration, X r,m is the m-th candidate solution at the r-th iteration, X r,b is the current global optimal solution, stepsize is the step size, Levy() is the path of Levy flight random walk, and β is the Levy flight parameter.

7. The method according to claim 6, characterized in that, The small random perturbation of the current optimal nest to obtain the perturbed solution is as follows: X r,s = X r,b + P * rand(1, D) Among them, X r,s is the solution after perturbing the current global optimal solution, X r,b is the global optimal solution iterated to the r-th time, P is the perturbation amplitude, D is the dimension of the search space, and rand() is a random function.

8. The method according to claim 7, wherein The determination of the nest to be discarded according to the probability \(p_a\) of the host discovering foreign bird eggs includes: At each iteration, each nest generates a random number \(k\in[0,1]\) between 0 and 1, and compares the random number \(k\) with the probability \(p_a\) of the host discovering foreign bird eggs; If \(k\geq p_a\), it means that the nest is not discarded; If \(k < p_a\), it means that the nest has been discarded. Each time a nest is discarded, a new nest is randomly generated to replace the discarded nest; At the same time, according to the increase in the number of iterations, the probability \(p_a\) of the host discovering foreign bird eggs is linearly increased as follows: \(p_a=\text{min}p_a+(\text{max}p_a - \text{min}p_a)\times(\text{iter} / \text{maxiterations})\) where \(\text{min}p_a\) is the minimum discard probability, \(\text{max}p_a\) is the maximum discard probability, \(\text{iter}\) is the current number of iterations, and \(\text{maxiterations}\) is the maximum number of iterations.

9. The method according to claim 8, wherein The dynamic adjustment of the step size includes: Set a counter with an initial value of 0; If the optimal fitness value of the current iteration is less than the global optimal solution of the previous iteration, reduce the step size \(\text{stepsize}\) of the next iteration and reset the counter; Otherwise, if the optimal fitness value of the current iteration is greater than or equal to the global optimal solution of the previous iteration, increment the counter. When the counter reaches the preset threshold, increase the step size of the next iteration.

10. The method according to any one of claims 1-9, characterized in that, The dimension \(D\) of the search space in the improved cuckoo search algorithm is the number of parameters of the dynamic compensation filter model.

Citation Information

Cited By

  • Ore grinding system control method based on large model and cuckoo algorithm

    CN120891784A