A method and system for controlling the opening and closing of inlet and outlet valves based on capacity change

By combining the PID control algorithm and the Gray Wolf optimization algorithm, the valve switch control parameters are optimized, which solves the problem of inappropriate parameter selection of the traditional control algorithm, improves the accuracy and stability of the valve switch control, and enhances the global search capability of the Gray Wolf optimization algorithm. .

CN118393965BActive Publication Date: 2024-09-24JINING ZHANGXING PLASTIC ADDITIVES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410814218.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-24
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

The traditional valve switching control algorithm has a local optimal solution problem in parameter selection, resulting in unreasonable control and thus affecting the valve switching control effect.

Method used

The inlet and outlet valve switching control method based on capacity changes is adopted, and the PID control algorithm and the gray wolf optimization algorithm are combined to iteratively update the prey position and difference coefficient to expand the global search capability of the gray wolf optimization algorithm, optimize parameter selection, and achieve better results. Suitable valve switching control.

Benefits of technology

It improves the accuracy and stability of valve switch control, enhances the global search capability of the Gray Wolf optimization algorithm, avoids local optimal solutions, and achieves more reasonable valve switch control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118393965B
    Figure CN118393965B
Patent Text Reader

Abstract

The present invention relates to the field of magnet valve control technology, and proposes a method and system for controlling the switch of inlet and outlet valves based on capacity changes, including: collecting liquid volume and target volume, obtaining volume error; establishing parameter space, determining parameter fitness, determining the position point and parameter fitness corresponding to the gray wolf according to the gray wolf optimization algorithm, and obtaining the updated position point of the prey; obtaining the difference coefficient of adjusting the gray wolf; determining the position point of the gray wolf that needs to be mutated in the parameter space after the mutation; updating and obtaining the optimal value of the artificially set parameter of the PID control algorithm according to the position point of the prey during iteration and the position point of the gray wolf that needs to be mutated in the parameter space, thereby realizing the switch control of the inlet and outlet valves based on capacity changes. The present invention solves the problem of unreasonable valve switch control caused by inappropriate parameter selection of the control algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of magnet valve control, and in particular to a method and system for controlling the switch of an inlet and outlet valve based on capacity change. Background Art

[0002] With the continuous development of science and technology, automatic control plays an outstanding role in modern industry. Automatic control can realize automatic detection and adjustment of the production process, effectively reduce energy waste, and reduce the production cost of enterprises. Therefore, automatic control technology plays a huge role in improving system efficiency, stability and reliability. Capacity refers to the volume of an object. In actual production, the reaction and operation of many materials are often completed in containers of specific capacity. Valve switch control refers to the precise control of the flow rate of the fluid in the container by adjusting the opening of the valve, which directly affects the accuracy and efficiency of the production process. The valve control system usually uses an automatic control algorithm to realize valve switch control, that is, by monitoring the change of the liquid level in the container and the actual output, the automatic control algorithm is used to intelligently adjust the opening and closing degree of the valve. Such a valve switch control method can ensure the stability and controllability of the production process while improving the automation degree of the production line. The automatic control system can quickly respond to changes in the production environment, making the production process more flexible and adaptable.

[0003] Traditional control algorithms can achieve relatively appropriate valve switch control when the parameters are properly selected. The Grey Wolf Optimization Algorithm can be used to find the optimal parameters of the control algorithm. However, the Grey Wolf Optimization Algorithm has weak global search capabilities and is prone to fall into local optimal solutions, resulting in inappropriate parameter selection of the control algorithm, which in turn leads to unreasonable valve switch control. Summary of the invention

[0004] The present invention provides a method and system for controlling the opening and closing of inlet and outlet valves based on capacity change, so as to solve the problem of unreasonable valve opening and closing control caused by inappropriate parameter selection of control algorithm. The technical scheme adopted is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for controlling the opening and closing of an inlet and outlet valve based on capacity change, the method comprising the following steps:

[0006] Collecting the liquid volume and target volume inside the reaction container corresponding to all data acquisition moments, and obtaining the volume error at the data acquisition moment;

[0007] Establish a parameter space according to the artificially set parameters of the PID control algorithm, determine the parameter fitness of the artificially set parameters according to the artificially set parameters and the volume error at the time of data acquisition, set the initial position point of the gray wolf, determine the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and the adjusted gray wolf according to the gray wolf optimization algorithm, determine the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, obtain the parameter fitness of the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, determine the first weight coefficient of the first optimal gray wolf and the second optimal gray wolf, and the first weight coefficient of the first optimal gray wolf and the third optimal gray wolf, and obtain the position point of the prey updated by the gray wolf optimization algorithm at each iteration;

[0008] Obtain the parameter fitness of the position point of the gray wolf being adjusted, and obtain the difference coefficient of the gray wolf being adjusted according to the parameter fitness of the first optimal gray wolf and the position point of the prey in the parameter space during iteration and the position point of the first optimal gray wolf and the gray wolf being adjusted in the parameter space;

[0009] Select the gray wolf that needs to be mutated, and determine the position point of the gray wolf that needs to be mutated in the parameter space after mutation according to the position point with the minimum parameter fitness during iteration, the position point of the gray wolf that is adjusted, and the position point with the minimum parameter fitness during all iterations of the gray wolf;

[0010] According to the position of the prey during iteration and the position of the gray wolf that needs to mutate in the parameter space, the optimal values ​​of the artificially set parameters of the PID control algorithm are updated, and the parameters of the solenoid valve are obtained according to the optimal values ​​of the artificially set parameters of the PID control algorithm. According to the obtained parameters of the solenoid valve, the solenoid valve is used to realize the switching control of the inlet and outlet valves based on capacity changes.

[0011] Further, the method for obtaining the parameter space based on the artificially set parameters of the PID control algorithm is:

[0012] The proportional coefficient in the artificially set parameters of the PID control algorithm is taken as the X-axis, the differential coefficient as the Y-axis, and the integral coefficient as the Z-axis to establish the parameter space.

[0013] Furthermore, the method for obtaining the parameter fitness of the artificially set parameters according to the artificially set parameters and the volume error at the time of data acquisition is:

[0014] When the volume error at the first preset threshold number of consecutive data acquisition moments is less than or equal to the first comparison threshold, it is considered that the valve switch system has reached a steady state;

[0015] When the valve switch system reaches a steady state, the sum of the volume errors at all data acquisition moments before and after the valve switch system reaches the steady state is recorded as the parameter fitness of the artificially set parameters of the PID control algorithm.

[0016] Furthermore, the method for obtaining the initial position point of the gray wolf is:

[0017] Randomly select the initial position point of the gray wolf in the parameter space.

[0018] Further, the method for determining the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and adjusting the gray wolf according to the gray wolf optimization algorithm is:

[0019] Determine the value of the artificially set parameter of the PID control algorithm corresponding to the location point according to the location point of the gray wolf, obtain the parameter fitness of the artificially set parameter, and record the parameter fitness corresponding to the value of the artificially set parameter determined by the location point of the gray wolf as the parameter fitness of the location point;

[0020] The second preset threshold number of gray wolves with the smallest parameter fitness are recorded as the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf in order of parameter fitness from small to large;

[0021] The gray wolves that are not the first best gray wolf, the second best gray wolf, and the third best gray wolf are recorded as adjusted gray wolves.

[0022] Further, the method for obtaining the difference coefficient of the adjusted gray wolf according to the position points of the first optimal gray wolf and the prey in the parameter space during iteration and the parameter fitness of the first optimal gray wolf and the position points of the adjusted gray wolf in the parameter space is:

[0023] The first best gray wolf, the second best gray wolf, and the third best gray wolf are respectively , , ;

[0024] The adjusted gray wolf is recorded as ;

[0025]

[0026] In the formula, express Middle A gray wolf The difference coefficient at the iteration; express Middle The gray wolf The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express Wolf The gray wolf The position point in the parameter space at the iteration; Indicates The location of the prey at the iteration; It means taking the Euclidean distance between two points separated by commas in brackets in parameter space; Indicates the first value parameter; It means taking the logarithm of the value in brackets with the natural constant as the base;

[0027] Furthermore, the method for selecting the gray wolf that needs to be mutated is:

[0028] When the first optimal gray wolf has not been updated for a third preset threshold number of times in a row, the gray wolves of the first percentage with the largest difference coefficient are marked as gray wolves that need to be mutated.

[0029] Further, the method for determining the position point of the gray wolf that needs to be mutated in the parameter space after the mutation is performed according to the position point with the minimum parameter fitness during iteration, the position point of the gray wolf being adjusted, and the position point with the minimum parameter fitness of the gray wolf being adjusted during all iterations is:

[0030] Assigning the first random number and the second random number to random numbers in a value range greater than or equal to 0 and less than or equal to 1;

[0031] The product of the difference between the position point where the gray wolf has the minimum parameter fitness in all iterations and the position point where the gray wolf is adjusted in the parameter space in this iteration, the outlier coefficient and the first random number is recorded as the first product;

[0032] The product of the difference between the position point of the first optimal gray wolf in the parameter space at this iteration and the position point of the adjusted gray wolf in the parameter space at this iteration and the second random number is recorded as the second product;

[0033] The sum of the first product and the second product is recorded as the position point of the gray wolf in the parameter space at the next iteration of this iteration.

[0034] Further, the method of updating and acquiring the optimal values ​​of the artificially set parameters of the PID control algorithm according to the position points of the prey during iteration and the position points of the gray wolf that needs to be mutated in the parameter space, acquiring the parameters of the solenoid valve according to the optimal values ​​of the artificially set parameters of the PID control algorithm, and using the solenoid valve to realize the switch control of the inlet and outlet valves based on the capacity change according to the acquired parameters of the solenoid valve is as follows:

[0035] According to the determination of the position point of the prey during iteration and the updating method of the position point of the gray wolf that needs to be mutated in the parameter space, the gray wolf optimization algorithm is used to optimize all the position points in the parameter space, and the first optimal gray wolf position point in the parameter space is obtained after the iteration is completed;

[0036] The values ​​corresponding to the X-axis, Y-axis and Z-axis determined according to the position point of the first optimal gray wolf in the parameter space are the optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters;

[0037] The optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters and the volume error at the time of data acquisition are input into the PID control algorithm to obtain the parameters of the solenoid valve. The solenoid valve is used to control the opening of the inlet and outlet valves according to the parameters of the solenoid valve to realize the inlet and outlet valve switch control based on capacity changes.

[0038] In the second aspect, an embodiment of the present invention also provides an inlet and outlet valve switch control system based on capacity change, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.

[0039] The beneficial effects of the present invention are:

[0040] The present invention obtains the volume error at the time of data acquisition based on the liquid volume inside the reaction container at the time of data acquisition and the target volume, determines the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and the adjusted gray wolf in each iteration process according to the gray wolf optimization algorithm, determines the updated prey position point according to the difference in distance and volume error between the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, so that the prey position point obtained when the position is updated is more biased towards the optimal solution in the iteration process; then, according to the difference in distance and volume error between the adjusted gray wolf and the optimal solution in the iteration process, obtains the difference coefficient of the adjusted gray wolf, the difference coefficient can evaluate the difference between the gray wolf that is not the optimal solution during iteration and the optimal solution, and according to the difference The degree coefficient updates the position points of the gray wolves that need to be mutated. The mutated gray wolves will continue to search for potential better solutions in other directions. The introduction of the mutation operation enables the gray wolf optimization algorithm to expand the diversity of the wolf pack in the algorithm convergence stage, increase the global search capability, and make it easier to find the global optimal solution. Finally, according to the position points of the prey during iteration and the position points of the gray wolves that need to be mutated in the parameter space, the optimal values ​​of the artificially set parameters of the PID control algorithm are updated, and the parameters of the solenoid valve are obtained according to the optimal values ​​of the artificially set parameters of the PID control algorithm. According to the obtained parameters of the solenoid valve, the solenoid valve is used to realize the switch control of the inlet and outlet valves based on capacity changes, so as to solve the problem of unreasonable valve switch control caused by inappropriate parameter selection of the control algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0042] Figure 1 A schematic flow chart of a method for controlling the switch of an inlet and outlet valve based on capacity change provided by an embodiment of the present invention;

[0043] Figure 2 Get the flow diagram for valve opening. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] See also Figure 1 , which shows a flow chart of a method for controlling the switch of an inlet and outlet valve based on capacity change provided by an embodiment of the present invention, the method comprising the following steps:

[0046] Step S001, collecting the liquid volume and target volume inside the reaction container corresponding to all data acquisition moments, and obtaining the volume error at the data acquisition moment.

[0047] The valve can control the feeding and discharging of the reaction materials. The reaction materials enter the reaction vessel from the valve, and the reacted reaction materials flow out from the reaction vessel to the refinement kettle. The refinement kettle is a reaction equipment used in the chemical industry for further fine chemical treatment.

[0048] In order to achieve precise control of the valve switch, a liquid level sensor is installed inside the reaction vessel to monitor the liquid volume inside the reaction vessel. The liquid level sensor is used to obtain the liquid volume inside the reaction vessel at each data acquisition moment. At the same time, according to the plan of adding reaction materials in the reaction vessel, the target volume corresponding to each data acquisition moment is obtained.

[0049] Among them, the time interval between adjacent data acquisition moments can be determined according to the actual needs of valve control of reaction material feeding and discharging. The empirical value of the time interval between adjacent data acquisition moments is 30 seconds. The implementer can set the time interval between adjacent data acquisition moments as needed.

[0050] The difference between the target volume and the liquid volume inside the reaction container corresponding to the same data acquisition time is recorded as the volume error at the data acquisition time.

[0051] At this point, the volume error at the time of data acquisition is obtained.

[0052] Step S002, establish a parameter space according to the artificially set parameters of the PID control algorithm, determine the parameter fitness of the artificially set parameters according to the artificially set parameters and the volume error at the time of data acquisition, set the initial position point of the gray wolf, determine the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and the adjusted gray wolf according to the gray wolf optimization algorithm, determine the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, obtain the parameter fitness of the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, determine the first weight coefficients of the first optimal gray wolf and the second optimal gray wolf, and the first weight coefficients of the first optimal gray wolf and the third optimal gray wolf, and obtain the position point of the prey updated by the gray wolf optimization algorithm at each iteration.

[0053] When using the PID control algorithm to control the valve switch, there are three parameters that need to be manually set and input into the algorithm. These three parameters are the proportional coefficient, integral coefficient and differential coefficient. The implementer can set the initial values ​​of the proportional coefficient, integral coefficient and differential coefficient as needed.

[0054] In order to facilitate subsequent analysis, the parameter space is established with the proportional coefficient as the X-axis, the differential coefficient as the Y-axis, and the integral coefficient as the Z-axis. According to the values ​​of the proportional coefficient, the integral coefficient, and the differential coefficient, a position point can be determined in the parameter space.

[0055] The values ​​of the proportional coefficient, the integral coefficient and the differential coefficient and the volume error at the time of data acquisition are input into the PID control algorithm to obtain the valve opening, and the obtained valve opening is recorded as the valve opening at the time of data acquisition.

[0056] The valve opening at the time of data acquisition is used as the valve opening that should be adjusted at the time of data acquisition. When the valve opening changes, the feed amount of the reaction material at the valve position will change accordingly, so the liquid volume inside the reaction container at the next moment after the data acquisition will change, which will lead to a change in the volume error at the next moment after the data acquisition.

[0057] When the volume error of the first preset threshold consecutive data acquisition moments is less than or equal to the first comparison threshold, it is considered that the valve switch system reaches a steady state at the last data acquisition moment. The empirical value of the first preset threshold is 10, and the empirical value of the first comparison threshold is 0.1.

[0058] When the valve switch system reaches a steady state, the sum of the volume errors at the data acquisition time corresponding to the valve switch system reaching the steady state and all previous data acquisition times is recorded as the parameter fitness of the three parameters of the PID control algorithm.

[0059] When the three parameters of the PID control algorithm are selected more appropriately, the time interval required for the valve switch system to reach a steady state is shorter, and the volume error at each data acquisition moment before the valve switch system reaches a steady state is smaller. That is, when the three parameters of the PID control algorithm are selected more appropriately and the effect is better, the parameter adaptability of the three parameters of the PID control algorithm is smaller.

[0060] The value range of the three parameters of the PID control algorithm is [0,10], and the value step size is 0.01. Therefore, there are 1000×1000×1000 parameter selection methods in the parameter space, which is difficult to traverse and solve in a limited time. Therefore, the gray wolf optimization algorithm can be used to find the optimal solution among all the selection methods in the parameter space and obtain the most appropriate parameter values.

[0061] The Gray Wolf Optimization Algorithm is an algorithm that simulates the social behavior and predation behavior of gray wolves in nature to find the optimal solution. It is a heuristic algorithm. The Gray Wolf Optimization Algorithm is often used to solve optimization problems. In the process of optimizing the Gray Wolf Optimization Algorithm, in the later stage of optimizing, the lack of diversity of individuals can easily lead to the algorithm's optimization results falling into the local optimal solution, resulting in inappropriate parameter selection of the control algorithm, and then leading to unreasonable valve switch control.

[0062] Initialize the position of the gray wolf in the parameter space, and the initial position of the gray wolf is randomly selected. The gray wolf is a well-known concept in the gray wolf optimization algorithm and will not be described in detail.

[0063] According to the location point of the gray wolf, the values ​​of the three parameters of the PID control algorithm corresponding to the location point are determined, and the parameter fitness of the three parameters is obtained according to the values ​​of the parameters. The parameter fitness corresponding to the values ​​of the parameters determined by the location point of the gray wolf is recorded as the parameter fitness of the location point.

[0064] The second preset threshold number of gray wolves with the smallest parameter fitness is recorded as , and .Will , , They are respectively recorded as the first optimal gray wolf, the second optimal gray wolf, and the third optimal gray wolf. The empirical value of the second preset threshold is 3.

[0065] Will , , The position points in the parameter space are denoted as , , . , and All other gray wolves are recorded as .Will Recorded as adjusted gray wolf.

[0066] Prey is a well-known concept in the gray wolf optimization algorithm and will not be described in detail. The location point update of the prey in the gray wolf optimization algorithm is to , and The arithmetic mean center is taken as the location point of the prey, but , , At the point in parameter space , , The distance between them may be far, and at the same time, it is not considered , , Therefore, according to , , At the position point in parameter space , , Parameter fitness and location points , , Get updated prey location points.

[0067]

[0068]

[0069]

[0070] In the formula, express and The first weight coefficient of express and The first weight coefficient of express In the The position point in the parameter space at the iteration; express In the The position point in the parameter space at the iteration; express In the The position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; It means taking the power with the natural constant as the base and the value in the brackets as the exponent; Indicates The position of the prey at the iteration.

[0071] when At the position point in parameter space The parameter fitness and and At the position point in parameter space and The greater the difference in parameter fitness, and as well as and The smaller the first weight coefficient is, the optimal point is The greater the probability of being nearby, the smaller the value should be when obtaining the location of the prey. and At the position point in parameter space and The degree of influence The location point obtained during the location update is more inclined to .

[0072] At this point, the location of the prey in each iteration of the gray wolf optimization algorithm is obtained.

[0073] Step S003, obtaining the parameter fitness of the position point of the gray wolf being adjusted, and obtaining the difference coefficient of the gray wolf being adjusted according to the parameter fitness of the first optimal gray wolf, the position points of the prey in the parameter space during iteration, and the position points of the first optimal gray wolf and the gray wolf being adjusted in the parameter space.

[0074] Will Middle The location of the gray wolf is recorded as .according to Middle Gray wolf location Get The parameter fitness.

[0075] According to the iteration , the location of the prey in parameter space and and Obtaining the parameter fitness of the gray wolf at the position point in the parameter space The dissimilarity coefficient of the gray wolf.

[0076]

[0077] In the formula, express Middle A gray wolf The difference coefficient at the iteration; express Middle The gray wolf The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express Wolf The gray wolf The position point in the parameter space at the iteration; Indicates The location of the prey at the iteration; It means taking the Euclidean distance between two points separated by commas in brackets in parameter space; Indicates the first value parameter, the empirical value is 1, which is used to prevent the logarithmic calculation from being meaningless; It means taking the logarithm of the value in the brackets with a natural constant as the base.

[0078] when The gray wolf and The greater the difference in parameter fitness between the position points in the parameter space during iteration, the closer the position points of the prey are to the The farther the gray wolf's position is from the wolf, The greater the difference coefficient of the gray wolf among the wolves, that is, in the iterative process, The farther the gray wolf is from the optimal position, the greater the difference between the two positions.

[0079] , and The three gray wolves with the smallest parameter fitness in the iterative process are considered , and The distance to the optimal position is relatively close, so it is no longer calculated. , and The difference coefficient of .

[0080] So far, get all The difference coefficient of the gray wolf during iteration.

[0081] Step S004, select the gray wolf that needs to be mutated, and determine the position point of the gray wolf that needs to be mutated in the parameter space after mutation based on the position point with the smallest parameter fitness during iteration, the position point of the gray wolf that is adjusted, and the position point with the smallest parameter fitness of the gray wolf in all iterative processes.

[0082] when When the preset threshold value is not updated for the third consecutive time, all The difference coefficients are arranged from large to small, and the gray wolves with the largest difference coefficient in the first percentage are selected for mutation. Among them, the experience value of the third preset threshold is 30, and the experience value of the first percentage is 10%.

[0083] The position of the gray wolf that needs to mutate is updated in the parameter space to obtain a new position, which can explore potential better solutions. Determine the position of the gray wolf that needs to mutate in the parameter space after the mutation.

[0084]

[0085] In the formula, express Middle A gray wolf The position point in the parameter space at the iteration; Represents the outlier coefficient, the empirical value is 2; They are all random numbers with a value range of greater than or equal to 0 and less than or equal to 1, generated by the random number generator in each iteration; for Middle The gray wolf is at the point where the parameter fitness is the minimum during all iterations; express Wolf The gray wolf The position point in the parameter space at the iteration; express In the The position point in the parameter space at the iteration.

[0086] According to the position point with the minimum parameter fitness during iteration, The location of the gray wolf and The position point where the gray wolf has the smallest parameter fitness in all iterations is determined, and the position point in the parameter space after the gray wolf that needs to mutate is determined. This can enable the gray wolf that has mutated to update in a completely new direction, while the gray wolf that has not mutated can continue to update in the direction of the prey, thereby improving the gray wolf's ability to search for the optimal solution during the iteration process.

[0087] The position points of the mutated gray wolves in the parameter space after mutation can expand the diversity of the wolf pack in the convergence stage of the gray wolf optimization algorithm, which is conducive to improving the global search capability in the later stage of iteration, and then improving the ability of the gray wolf optimization algorithm to jump out of the local optimal solution.

[0088] At this point, the position points of the gray wolves that need to be mutated in the parameter space are updated.

[0089] Step S005, according to the position point of the prey during iteration and the position point of the gray wolf that needs to mutate in the parameter space, update the optimal values ​​of the artificially set parameters of the PID control algorithm, obtain the parameters of the solenoid valve according to the optimal values ​​of the artificially set parameters of the PID control algorithm, and use the solenoid valve according to the obtained parameters of the solenoid valve to realize the switch control of the inlet and outlet valves based on capacity changes.

[0090] According to the determination of the location of the prey during iteration in the above content and the update method of the location of the gray wolf that needs to be mutated in the parameter space, the gray wolf optimization algorithm is used to optimize all the location points in the parameter space. The empirical value of the initialization iteration number is set to 700, the empirical value of the number of gray wolves is 50, and the empirical value of the dimension is 3. When the iteration of the gray wolf optimization algorithm stops, the output At the position point in the parameter space, the Grey Wolf Optimization Algorithm is a well-known technology and will not be described in detail.

[0091] The values ​​corresponding to the position points in the parameter space on the X-axis, Y-axis and Z-axis are the optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters.

[0092] The optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters and the volume error at the time of data acquisition are input into the PID control algorithm to obtain the parameters of the solenoid valve. Among them, the PID control algorithm is a well-known technology and will not be described in detail. According to the parameters of the solenoid valve, the solenoid valve is used to control the opening of the inlet and outlet valves. The valve opening determines the feed flow rate of the reaction material, and the inlet and outlet valve switch control based on the capacity change is realized. The valve opening acquisition flow chart is shown in Figure 2 shown.

[0093] At this point, the switch control of the inlet and outlet valves based on capacity changes is realized.

[0094] Based on the same inventive concept as the above method, an embodiment of the present invention also provides an inlet and outlet valve switch control system based on capacity change, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned inlet and outlet valve switch control methods based on capacity change are implemented.

[0095] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for controlling the opening and closing of inlet and outlet valves based on capacity changes, characterized in that: The method comprises the following steps: Collecting the liquid volume and target volume inside the reaction container corresponding to all data acquisition moments, and obtaining the volume error at the data acquisition moment; Establish a parameter space according to the artificially set parameters of the PID control algorithm, determine the parameter fitness of the artificially set parameters according to the artificially set parameters and the volume error at the time of data acquisition, set the initial position point of the gray wolf, determine the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and the adjusted gray wolf according to the gray wolf optimization algorithm, determine the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, obtain the parameter fitness of the position points of the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf, determine the first weight coefficient of the first optimal gray wolf and the second optimal gray wolf, and the first weight coefficient of the first optimal gray wolf and the third optimal gray wolf, and obtain the position point of the prey updated by the gray wolf optimization algorithm at each iteration; Obtain the parameter fitness of the position point of the gray wolf being adjusted, and obtain the difference coefficient of the gray wolf being adjusted according to the parameter fitness of the first optimal gray wolf and the position point of the prey in the parameter space during iteration and the position point of the first optimal gray wolf and the gray wolf being adjusted in the parameter space; Select the gray wolf that needs to be mutated, and determine the position point of the gray wolf that needs to be mutated in the parameter space after mutation according to the position point with the minimum parameter fitness during iteration, the position point of the gray wolf that is adjusted, and the position point with the minimum parameter fitness during all iterations of the gray wolf; According to the position point of the prey during iteration and the position point of the gray wolf that needs to be mutated in the parameter space, the optimal value of the artificially set parameter of the PID control algorithm is updated, and the parameters of the solenoid valve are obtained according to the optimal value of the artificially set parameter of the PID control algorithm. According to the obtained parameters of the solenoid valve, the solenoid valve is used to realize the switch control of the inlet and outlet valves based on the capacity change; The method for obtaining the parameter fitness of the artificially set parameters according to the artificially set parameters and the volume error at the time of data acquisition is: When the volume error at the first preset threshold number of consecutive data acquisition moments is less than or equal to the first comparison threshold, it is considered that the valve switch system has reached a steady state; When the valve switch system reaches a steady state, the sum of the volume errors at all data acquisition moments before and after the valve switch system reaches a steady state is recorded as the parameter fitness of the artificially set parameters of the PID control algorithm; The method for determining the first weight coefficient of the first optimal gray wolf and the second optimal gray wolf, and the first weight coefficient of the first optimal gray wolf and the third optimal gray wolf, and obtaining the location point of the prey updated by the gray wolf optimization algorithm in each iteration is: In the formula, express and The first weight coefficient of express and The first weight coefficient of express In the The position point in the parameter space at the iteration; express In the The position point in the parameter space at the iteration; express In the The position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; It means taking the power with the natural constant as the base and the value in the brackets as the exponent; Indicates The location of the prey at the iteration; The method for obtaining the difference coefficient of the adjusted gray wolf according to the position points of the first optimal gray wolf and the prey in the parameter space during iteration and the parameter fitness of the first optimal gray wolf and the position points of the adjusted gray wolf in the parameter space is: The first best gray wolf, the second best gray wolf, and the third best gray wolf are respectively , , ; The adjusted gray wolf is recorded as ; In the formula, express Middle A gray wolf The difference coefficient at the iteration; express Middle The gray wolf The parameter fitness of the position point in the parameter space at the iteration; express In the The parameter fitness of the position point in the parameter space at the iteration; express Wolf The gray wolf The position point in the parameter space at the iteration; Indicates The location of the prey at the iteration; It means taking the Euclidean distance between two points separated by commas in brackets in parameter space; Indicates the first value parameter; It means taking the logarithm of the value in brackets with the natural constant as the base; The method for determining the position point of the gray wolf that needs to be mutated in the parameter space after mutation according to the position point with the minimum parameter fitness during iteration, the position point of adjusting the gray wolf, and the position point with the minimum parameter fitness of the gray wolf in all iteration processes is: Assigning the first random number and the second random number to random numbers in a value range greater than or equal to 0 and less than or equal to 1; The product of the difference between the position point where the gray wolf has the minimum parameter fitness in all iterations and the position point where the gray wolf is adjusted in the parameter space in this iteration, the outlier coefficient and the first random number is recorded as the first product; The product of the difference between the position point of the first optimal gray wolf in the parameter space at this iteration and the position point of the adjusted gray wolf in the parameter space at this iteration and the second random number is recorded as the second product; The sum of the first product and the second product is recorded as the position point of the gray wolf in the parameter space at the next iteration of the current iteration; The expression of the position point in the parameter space is: In the formula, express Middle A gray wolf The position point in the parameter space at the iteration; represents the outlier coefficient; They are all random numbers with a value range of greater than or equal to 0 and less than or equal to 1, generated by the random number generator in each iteration; for Middle The gray wolf is at the point where the parameter fitness is the minimum during all iterations; express Wolf The gray wolf The position point in the parameter space at the iteration; express In the The position point in parameter space at the iteration.

2. A method for controlling the opening and closing of inlet and outlet valves based on capacity change according to claim 1, characterized in that: The method for obtaining the parameter space based on the artificially set parameters of the PID control algorithm is as follows: The proportional coefficient in the artificially set parameters of the PID control algorithm is taken as the X-axis, the differential coefficient as the Y-axis, and the integral coefficient as the Z-axis to establish the parameter space.

3. The method for controlling the opening and closing of inlet and outlet valves based on capacity change according to claim 1 is characterized in that: The method for obtaining the initial position point of the gray wolf is: Randomly select the initial position point of the gray wolf in the parameter space.

4. The method for controlling the opening and closing of inlet and outlet valves based on capacity change according to claim 1 is characterized in that: The method for determining the first optimal gray wolf, the second optimal gray wolf, the third optimal gray wolf and adjusting the gray wolf according to the gray wolf optimization algorithm is: Determine the value of the artificially set parameter of the PID control algorithm corresponding to the location point according to the location point of the gray wolf, obtain the parameter fitness of the artificially set parameter, and record the parameter fitness corresponding to the value of the artificially set parameter determined by the location point of the gray wolf as the parameter fitness of the location point; The second preset threshold number of gray wolves with the smallest parameter fitness are recorded as the first optimal gray wolf, the second optimal gray wolf and the third optimal gray wolf in order of parameter fitness from small to large; The gray wolves that are not the first best gray wolf, the second best gray wolf, and the third best gray wolf are recorded as adjusted gray wolves.

5. The method for controlling the opening and closing of inlet and outlet valves based on capacity change according to claim 1 is characterized in that: The method for selecting the gray wolf that needs to be mutated is: When the first optimal gray wolf has not been updated for a third preset threshold number of times in a row, the gray wolves of the first percentage with the largest difference coefficient are marked as gray wolves that need to be mutated.

6. The method for controlling the opening and closing of inlet and outlet valves based on capacity change according to claim 1 is characterized in that: The method of updating and acquiring the optimal values ​​of the artificially set parameters of the PID control algorithm according to the position points of the prey during iteration and the position points of the gray wolf that needs to be mutated in the parameter space, acquiring the parameters of the solenoid valve according to the optimal values ​​of the artificially set parameters of the PID control algorithm, and using the solenoid valve to realize the switch control of the inlet and outlet valves based on the capacity change according to the acquired parameters of the solenoid valve is as follows: According to the determination of the position point of the prey during iteration and the updating method of the position point of the gray wolf that needs to be mutated in the parameter space, the gray wolf optimization algorithm is used to optimize all the position points in the parameter space, and the first optimal gray wolf position point in the parameter space is obtained after the iteration is completed; The values ​​corresponding to the X-axis, Y-axis and Z-axis determined according to the position point of the first optimal gray wolf in the parameter space are the optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters; The optimal values ​​of the proportional coefficient, differential coefficient and integral coefficient in the PID control parameters and the volume error at the time of data acquisition are input into the PID control algorithm to obtain the parameters of the solenoid valve. The solenoid valve is used to control the opening of the inlet and outlet valves according to the parameters of the solenoid valve to realize the inlet and outlet valve switch control based on capacity changes.

7. A capacity-change-based inlet and outlet valve switch control system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.