Visual interface intelligent control method based on oxidation ditch process
By designing a visual interface intelligent control method to automatically detect and restart the oxidation ditch process mathematical model, the problem of tedious model startup steps and frequent crashes has been solved, and the efficiency of sewage treatment has been improved and manpower and material resources have been saved.
Patent Information
- Application Number
- CN202410789814.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
AI Technical Summary
The mathematical model for intelligent control of the oxidation ditch process has cumbersome startup steps and lacks a simple visual interface, resulting in frequent model crashes and difficulty for non-professionals to start and restart, resulting in a waste of manpower and material resources and increasing sewage treatment costs.
Design a visual interface intelligent control method based on the oxidation ditch process. By receiving the startup request, display the preset layout, automatically detect the model output data, determine whether the data is normal or crashed, automatically close and restart the mathematical model, and provide adaptive correction function to output Optimal parameters to simplify model operation.
It enables non-professionals to easily start and restart the mathematical model with one click, monitor the oxidation ditch process in real time, solve the problem of model crash, improve the efficiency of sewage treatment, and save manpower and material resources.
Smart Images

Figure CN118619443A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology for sewage treatment, and in particular to a visual interface intelligent control method based on oxidation ditch process. Background Art
[0002] With the development of intelligent control of sewage treatment, the treatment process and treatment efficiency of sewage treatment are becoming more and more mature, but the intelligent control of sewage treatment needs to be further improved. The mathematical model of intelligent control of oxidation ditch process can optimize process parameters and control signals and conduct simulation experiments, diagnose problems in process design and operation, and study solutions to optimization methods. Combined with adaptive algorithms, the mathematical model control system can self-learn and self-optimize during operation, adapt to various working conditions and output optimal control parameters. The mathematical model of intelligent control of oxidation ditch process is established according to certain modeling principles, and then converted into functions that can be called by mathematical software such as Matlab. Matlab must be running all the time to ensure the normal operation of the model. However, the steps for Matlab to start the model are relatively cumbersome and specialized, without a simple visual interface, and running all the time will cause a certain module of Simulink in Matlab to crash. Once the "model crashes", it will bring difficulties to subsequent work, and only professional developers can restart the mathematical model. Ordinary staff cannot restart the model in time, resulting in a waste of manpower and material resources, and increasing the cost of sewage treatment.
[0003] Therefore, a visual interface intelligent control method based on oxidation ditch process is developed to solve the above problems. Summary of the invention
[0004] The purpose of the present invention is to provide a visual interface intelligent control method based on oxidation ditch process.
[0005] In order to achieve the above technical effects, the present invention is implemented by the following technical solutions: a visual interface intelligent control method based on oxidation ditch process, characterized in that it includes the following steps:
[0006] S1, receiving a request for starting intelligent control of the oxidation ditch process mathematical model;
[0007] S2, displaying a preset layout style of the visual interface on the screen;
[0008] S3. Select the automatic detection function in the preset layout style;
[0009] S4, read the latest data output by the model in the online database and make a judgment based on the timestamp;
[0010] S5. If the latest data is output normally, the optimal parameters are passed to the database for execution by the automatic control PLC system; if there is no latest data or the data is output repeatedly, a "model freeze" is determined, and the visual interface method will automatically close and restart the mathematical model;
[0011] The mathematical model establishment in S1 includes establishing a basic rate equation, establishing a component total rate equation, equation combination and parameter input; the mathematical model performs adaptive correction to output optimal dissolved oxygen control, reflux control and carbon source addition control;
[0012] The adaptive correction function is specifically:
[0013] 1. A model that randomly changes sensitive parameters within a set range to form a variant;
[0014] 2. Calculate all the variants of the model, and memorize the variant whose calculation results meet the effluent water quality requirements but have the lowest energy consumption under the same inlet water conditions;
[0015] 3. The variant that obtained the best result from the previous batch of calculations is used in the next batch of calculations and has a higher priority;
[0016] 4. The better variants calculated by the new batch overwrite the previously memorized variants;
[0017] 5. Models are constantly being replaced, retaining increasingly advantageous variants.
[0018] Furthermore, the attribute information includes at least the name, height, width, font and color of the selected preset style.
[0019] Furthermore, the automatic detection function is specifically as follows: by clicking a function interface button, a preset program automatically controls the computer to automatically call a bat command prompt window for subsequent operations.
[0020] Furthermore, the timestamp refers to a way of recording time, which is usually used to record the time of occurrence of an event or the creation and modification time of a file; the database MySQL statement is used to query the latest three data according to the timestamp, and the query result is created into a JSON format sub-file.
[0021] Furthermore, in S5, if the latest data is output normally, the optimal parameters are passed to the database for execution by the automatic control PLC system; if there is no latest data or the data is output repeatedly, a "model crash" is determined, and the visual interface method will automatically close and restart the mathematical model. Specifically:
[0022] Compare the created JSON files. If the three results are unique, use MySQL statements to output them to the database and call them using PLC statements. If the three data are duplicated, use BAT statements to shut down and restart the model.
[0023] Furthermore, the process of restarting the model after the "model crash" judgment is a timed judgment, and the validity period is set to 5 to 7 minutes; after the judgment, the created JSON statement is transmitted back to the preset layout of S2.
[0024] The beneficial effects of the present invention are:
[0025] 1. The present invention aims at the situation that the steps of starting the model of the intelligent control mathematical model of the oxidation ditch process model are relatively cumbersome and specialized during operation, there is no simple visual interface, and the optimal parameters cannot be output. Non-professionals can also easily start the program with one key, automatically judge and automatically restart the mathematical model, and then the mathematical model continues to recalculate normally; the present invention can realize real-time monitoring and continuous monitoring of the oxidation ditch process mathematical model, which truly solves the problem that the model cannot be output normally, provides assistance for the intelligent control of the oxidation ditch process of the sewage treatment plant, and achieves higher sewage treatment efficiency;
[0026] 2. The present invention can better solve the problem of "model freeze", provide better auxiliary effect for the operation of mathematical models, save manpower and material resources; and provide a technical reference for other mathematical model visualization auxiliary programs. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0028] Figure 1 It is the overall flow chart of the present invention;
[0029] Figure 2 It is a diagram of the human-computer interaction interface of the present invention. DETAILED DESCRIPTION
[0030] 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.
[0031] Example 1
[0032] See also Figure 1 As shown, a visual interface intelligent control method based on oxidation ditch process is characterized by comprising the following steps:
[0033] S1, receiving a request for starting intelligent control of the oxidation ditch process mathematical model;
[0034] Among them, the mathematical model of the oxidation ditch process described in S1, since the oxidation ditch is an integrated and continuous reactor, anoxic, anaerobic and aerobic processes all occur inside it, and the analysis is carried out through a fluid dynamics (CFD) model, including constructing the geometric structure of the oxidation ditch, gridding considering physical fields, gravity and pressure factors, and calculating the dissolved oxygen distribution; at the same time, an activated sludge (ASM2D) mathematical model is established through software, including establishing the basic rate equation, establishing the component total rate equation, equation combination and parameter input; the model is adaptively corrected to output the optimal dissolved oxygen control, reflux control and carbon source addition control.
[0035] The adaptive correction function is specifically:
[0036] 1. A model that randomly changes sensitive parameters within a set range to form a variant;
[0037] 2. Calculate all the variants of the model, and memorize the variant whose calculation results meet the effluent water quality requirements but have the lowest energy consumption under the same inlet water conditions;
[0038] 3. The variant that obtained the best result from the previous batch of calculations is used in the next batch of calculations and has a higher priority;
[0039] 4. The better variants calculated by the new batch overwrite the previously memorized variants;
[0040] 5. Models are constantly being replaced, retaining increasingly advantageous variants.
[0041] Among them, the differential equation of the hypoxia section is as follows:
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048] Anaerobic differential equation:
[0049]
[0050]
[0051]
[0052] Aerobic differential equation:
[0053]
[0054]
[0055]
[0056] Among them, q e is the influent flow rate of the oxidation ditch, q r is the sludge return flow, q in is the comprehensive water inlet flow rate, q out is the effluent flow rate of the oxidation ditch, and q in =q e +q r , the subscript i represents the reaction unit, for example: So2in4 represents the fourth section of the influent SO2. V represents the volume, t represents the time; the ASM2D mathematical model contains 20 components and 21 process rates, among which ρ1, ρ2...ρ 20 , 21 to indicate the process rate; among the 20 components, those starting with X indicate insoluble components or particulate components, those starting with S indicate soluble components, subscript S indicates easily degradable organic substrates, subscript I indicates inert organic matter, subscript O indicates oxygen, subscript NH indicates ammonia nitrogen, subscript NO indicates nitrate nitrogen, and subscript ALK indicates alkalinity; SO2 is dissolved oxygen, SF is easily biodegradable substrate, SA is fermentation product, SNH4 is ammonia nitrogen, SNO3 is nitrate nitrogen (including nitrite nitrogen), SPO4 is phosphate, SI is inert soluble organic matter, SALK is alkalinity, SN2 is nitrogen, XI is inert particulate organic matter, XAUT is nitrifying bacteria, XH is anoxic bacteria, XMeOH is metal hydroxide, XMeP is metal phosphate, XPAO is polyphosphate bacteria, XPHA is the intracellular storage of polyphosphate bacteria, XPP is polyphosphate, XS is slowly degradable substrate, and TSS is total suspended solids.
[0057] S2, displaying a preset layout style of the visual interface on the screen;
[0058] wherein, the attribute information of the selected preset layout style is displayed on the screen, the attribute information at least including the name, height, width, font and color of the selected preset style;
[0059] In one implementation, the default preset layout style code is:
[0060] #position,0,0,#size,1920,930,#server,http: / / ip address / wscen / php / api,#topmost,False;
[0061] S3. Select the automatic detection function in the preset layout style;
[0062] By clicking the function interface button, the preset program automatically controls the computer to automatically call the bat command prompt window for subsequent operations;
[0063] In one embodiment, the auto-detect function code is:
[0064] HWNDhButton=CreateWindow("BUTTON","Automatically detect model",WS_VISIBLE|WS_CHILD|WS_BORDER,50,50,100,30,
[0065] hWnd,NULL,NULL,NULL);
[0066] S4, read the latest data output by the model in the online database and make a judgment based on the timestamp;
[0067] Timestamp refers to a way of recording time, usually used to record the time when an event occurred or the time when a file was created or modified. Use the MySQL statement in the database to query the latest three data according to the timestamp, and create a JSON format subfile for the query results; the specific code for determination is as follows:
[0068] for / f %%bin(D:\find.txt)do(setvar=%%b)mysql-h(ip address)-P(port)-u(username)-p(password)
[0069] -Nrs-e"selectcount(*)frominformation_schema.tableswhere table_name='modelcontroltable01'andupdate_timebetweensubdat e(now(),interval3minute)andnow();">D:\out.txt
[0070] if "%var%"==""(startC:\Polyspace\R2020a\bin\matlab.exe-nosplash-r"run('D:\ProgramFiles\water\watersupply\restar tyanghuagou.m')")else(if%var1%==0(taskkill / f / im"matlab.exe"&&startC:\Polyspace\R2020a\bin\matlab.exe-nosplash-r where matlab is the default file path.
[0071] In one embodiment, the decision logic is:
[0072] First query the latest system time and then convert it to timestamp time;
[0073] Query the timestamps corresponding to the three latest data in the database;
[0074] Compare and judge the data corresponding to the three latest timestamps found in the query in turn;
[0075] S5. If the latest data is output normally, the optimal parameters are passed to the database for execution by the automatic control PLC system; if there is no latest data or the data is output repeatedly, a "model freeze" is determined, and the visual interface method will automatically close and restart the mathematical model;
[0076] Among them, if the "model freezes" judgment is made, the visual interface method will automatically close and restart the mathematical model to determine whether the model is running, query the database for the latest data update, and query whether the three most recent data in the database are repeated; if the model is not running, the database has no latest data update, and the three most recent data in the database are repeated, at least one of the three situations occurs, then the model is closed and restarted, and finally all bat statements are converted into exe programs. The specific code is as follows:
[0077] 1. The starting point of each cycle running step
[0078] Usingsystem;
[0079] Usingsystm.Globalization;
[0080] UsingRuntime.InteropServices;
[0081] UsingRuntime.Serialization;
[0082] Usingsystem.Security;
[0083] echoon
[0084] setlocal
[0085] enableDelayedExpansion
[0086] :start
[0087] 2. Check whether there is a matlab process in the background task manager. If yes, save it to the D drive and find the text
[0088] tasklist|find / I"matlab.exe">D:\find.txt
[0089] 3. After finding the out text, log in to the database to query the data corresponding to the latest three IDs, determine whether the data time is the same, and store the results in the D drive byc text
[0090] for / f %%ain(D:\out.txt)do(setvar1=%%a)mysql-h(ip address)-P(port)-u(username)-p(password)
[0091] -Nrs-e"selectcasewhenA1.TIME=C1.y1andA1.TIME=D1.y2then0else1endZ1from(selectID,TIMEfromsjmodel.jydataorderbyIDdesc limit1)A1,(selectID+1x1,TIMEy1fromsjmodel.jydatawhereID=(se lectIDfromsjmodel.jydataorderbyIDdesclimit1)-1)C1,(selectID+2x2,TIMEy2fromsjmodel.jydatawhereID=(selectIDfromsjmodel.jydataorderbyIDdesclimit1)-2)D1whereA1.ID=C1.x1andA1.ID=D1.x2;">D:\byc.txt
[0092] 4. Query the stored find and byc texts respectively. If the corresponding values are found, the program will run normally. If the corresponding values are not found, the auxiliary program will close all matlab processes and restart the model.
[0093] if "%var%" == ""(
[0094] startmatlab.exe-nosplash-r"run('D:\ProgramFiles\water\watersupply\restartwatersupply.m')"
[0095] )else(
[0096] if%var1%==0(taskkill / f / im"matlab.exe"&&startmatlab.exe-nosplash-r"run('D:\ProgramFiles\water\watersupply\restartwa tersupply.m')"
[0097] )else(
[0098] if%var2%==0(taskkill / f / im"matlab.exe"&&startmatlab.exe-nosplash-r"run('D:\ProgramFiles\water\watersupply\restartwa tersupply.m')"
[0099] )else(
[0100] echo %TIME% ) ) )
[0104] 5. The time limit is set to run automatically once every 360 seconds, starting from the starting point of each cycle step
[0105] choice / t360 / dy / n>nul
[0106] Go to start
[0107] In one implementation, a JSON file is created for comparison after timestamp determination:
[0108] If the three results are not repeated, use MySQL statements to output to the database and call using PLC statements;
[0109] If the three data are repeated, use the BAT statement to close and restart the model.
[0110] In one embodiment, S5 also includes that the determination process of restarting the model is a timed determination: the time limit is set to 6 minutes, and then the created JSON statement is returned to the preset layout described in S2;
[0111] The mathematical model establishment in S1 includes establishing a basic rate equation, establishing a component total rate equation, equation combination and parameter input; the mathematical model performs adaptive correction to output optimal dissolved oxygen control, reflux control and carbon source addition control;
[0112] The adaptive correction function is specifically:
[0113] 1. A model that randomly changes sensitive parameters within a set range to form a variant;
[0114] 2. Calculate all the variants of the model, and memorize the variant whose calculation results meet the effluent water quality requirements but have the lowest energy consumption under the same inlet water conditions;
[0115] 3. The variant that obtained the best result from the previous batch of calculations is used in the next batch of calculations and has a higher priority;
[0116] 4. The better variants calculated by the new batch overwrite the previously memorized variants;
[0117] 5. Models are constantly being replaced, retaining increasingly advantageous variants.
[0118] In summary, in a real-time example, data from various water management businesses can be stored through distributed storage, local centralized storage, cloud storage, edge storage and other storage methods according to the scale and data volume of the water management business, thereby improving the data storage efficiency of the deep learning network and reducing data transmission delay.
Claims
1. A visual interface intelligent control method based on oxidation ditch process, characterized in that: The following steps are involved: S1, receiving a request for starting intelligent control of the oxidation ditch process mathematical model; S2, displaying a preset layout style of the visual interface on the screen; S3. Select the automatic detection function in the preset layout style; S4, read the latest data output by the model in the online database and make a judgment based on the timestamp; S5. If the latest data is output normally, the optimal parameters are passed to the database for execution by the automatic control PLC system; if there is no latest data or the data is output repeatedly, a "model freeze" is determined, and the visual interface method will automatically close and restart the mathematical model; The mathematical model establishment in S1 includes establishing a basic rate equation, establishing a component total rate equation, equation combination and parameter input; the mathematical model performs adaptive correction to output optimal dissolved oxygen control, reflux control and carbon source addition control; The adaptive correction function is specifically: (1) A model that randomly changes sensitive parameters within a set range to form a variant; (2) All model variants are calculated, and the variant whose calculation results meet the effluent water quality requirements but has the lowest energy consumption under the same water inlet conditions is memorized; (3) In the next batch of calculations, the variant that obtained the best result from the previous batch of calculations is used and has a higher priority; (4) The better variants calculated by the new batch cover the previously memorized variants; (5) Models are constantly replaced, retaining increasingly advantageous variants.
2. The method for intelligent control of a visual interface based on oxidation ditch process according to claim 1, characterized in that: The attribute information includes at least the name, height, width, font and color of the selected preset style.
3. The visual interface intelligent control method based on oxidation ditch process according to claim 1 is characterized in that: The automatic detection function is specifically: by clicking the function interface button, the preset program automatically controls the computer to automatically call the bat command prompt window for subsequent operations.
4. The visual interface intelligent control method based on oxidation ditch process according to claim 1 is characterized in that: The timestamp is a way of recording time, usually used to record the time when an event occurs or the time when a file is created or modified. Use the MySQL statement in the database to query the latest three data according to the timestamp, and create a JSON format sub-file with the query results.
5. The visual interface intelligent control method based on oxidation ditch process according to claim 1 is characterized in that: In S5, if the latest data is output normally, the optimal parameters are passed to the database for execution by the automatic control PLC system; if there is no latest data or the data is output repeatedly, a "model crash" is determined, and the visual interface method will automatically close and restart the mathematical model. Specifically: Compare the created JSON files. If the three results are unique, use MySQL statements to output them to the database and call them using PLC statements. If the three data are duplicated, use BAT statements to shut down and restart the model.
6. The visual interface intelligent control method based on oxidation ditch process according to claim 1 is characterized in that: The process of restarting the model after the "model crash" judgment is a timed judgment with a validity period of 5 to 7 minutes. After the judgment, the created JSON statement is passed back to the preset layout of S2.
Citation Information
Patent Citations
Process intelligent control model method for automatically detecting and starting coagulation kinetic model
CN117850361A
