Coal slime water treatment dosing quantity prediction method and device based on granulation attention mechanism
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA COAL TECH GRP INFORMATION TECH CO LTD
- Filing Date
- 2026-05-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for controlling chemical dosing in coal slurry water treatment suffer from problems such as lag in manual adjustment, insufficient model robustness, lack of explicit compensation for time delay effects, and weak multivariate interaction modeling, leading to inaccurate dosing prediction and low treatment efficiency.
A method based on granular attention mechanism is adopted. By acquiring multi-source time series data, preprocessing it, performing granular decomposition, constructing an input feature matrix, performing multi-head granular attention analysis, and correcting the residuals of historical time points, the method can achieve accurate, real-time, and adaptive prediction of drug dosage.
It improves the accuracy of chemical dosage prediction, enhances the stability of coal slurry water treatment, reduces reagent consumption costs, and achieves precise, real-time, and adaptive control of chemical dosage.
Smart Images

Figure CN122245529B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for predicting the dosage of chemicals used in coal slurry water treatment based on a granular attention mechanism. Background Technology
[0002] Coal slime water treatment is a core supporting link in coal washing and processing. Its core function is to promote the agglomeration of coal slime particles into flocs by adding flocculants (such as polyacrylamide) and coagulants (such as polyaluminum chloride). This flocs are then settled in a clarifier (controlling effluent turbidity ≤ 5 NTU) and dewatered in a filter press (controlling filter cake moisture content ≤ 25%), achieving water resource recycling and coal slime resource recovery. Currently, the chemical dosing control in coal slime water treatment suffers from the following key technical defects, severely restricting treatment efficiency and economic viability:
[0003] Significant lag in manual adjustment: Current dosing methods rely heavily on operator experience, adjusting the dosage based on visual observation of floc size, effluent turbidity, or laboratory testing of coal slurry concentration. When the coal slurry conditions change abruptly, such as the pH value dropping from 7 to 5 due to changes in the sulfur content of raw coal, the manual response will have a significant lag, which can easily lead to problems such as excessive effluent turbidity and increased filter cake moisture.
[0004] Existing models lack robustness: Some applied models, such as back propagation (BP) neural networks and support vector machines, are not adapted to the "strong nonlinearity and high noise" characteristics of coal slurry water. On the one hand, the concentration and turbidity data of coal slurry water collected by sensors are easily affected by equipment vibration and coal slurry agglomeration, and the model lacks a noise suppression mechanism, resulting in large prediction errors. On the other hand, the model parameters need to be manually adjusted and cannot adapt to batch changes in coal slurry water.
[0005] The time lag effect is not explicitly compensated: Coal slurry water treatment has an inherent time lag, that is, after the addition of the agent, it takes 3-8 minutes to complete the floc formation and sedimentation reaction. The existing model does not model this time lag relationship and only predicts the dosage based on real-time data, which leads to "misalignment between the predicted value and the actual demand". For example, when the concentration increases, the model predicts the dosage in real time, but the concentration has already decreased when the flocs are actually formed, resulting in excessive dosage.
[0006] Weaknesses in multivariate interaction modeling: The effect of chemical dosing in coal slurry water is affected by multiple variables in synergy. For example, an increase in coal slurry water concentration requires an increase in flocculant dosage, but acidic conditions (pH<6) will significantly reduce the activity of flocculants, requiring simultaneous adjustment of the coagulant aid ratio; too low stirring intensity (<150r / min) will lead to uneven mixing of chemicals, requiring an increase in stirring speed; existing models mostly use single-variable independent modeling, which cannot capture the interaction between multiple variables, resulting in significant prediction bias under complex working conditions.
[0007] Therefore, there is an urgent need for an intelligent and accurate method for predicting the dosage of chemicals that is adapted to the characteristics of coal slurry water treatment and can solve the above-mentioned defects, so as to improve the accuracy of chemical dosing and the stability of treatment. Summary of the Invention
[0008] This application aims to at least partially address one of the technical problems in the related art.
[0009] Therefore, the first objective of this application is to propose a method for predicting the dosage of chemicals in coal slurry water treatment based on a granular attention mechanism, so as to improve the accuracy of the dosage prediction in the coal slurry water treatment process under complex working conditions.
[0010] The second objective of this application is to propose a dosing prediction device for coal slurry water treatment based on a granulation attention mechanism.
[0011] The third objective of this application is to propose an electronic device.
[0012] The fourth objective of this application is to provide a computer-readable storage medium.
[0013] The fifth objective of this application is to provide a computer program product.
[0014] To achieve the above objectives, the first aspect of this application proposes a method for predicting the dosage of chemicals used in coal slurry water treatment based on a granulated attention mechanism, comprising: Acquire multi-source time-series data of the coal slurry water treatment system, and preprocess the multi-source time-series data to obtain a target data set. The multi-source time-series data includes at least multiple types of time-series data used to characterize the coal slurry water treatment conditions, reagent dosing status, and treatment effect. The target data set is granularized and decomposed for each type of data, and the high-frequency information particles and low-frequency information particles corresponding to each type of data are obtained according to the data values. Construct an input feature matrix based on the high-frequency information particles and the low-frequency information particles within a preset time period; The input feature matrix is input into the pre-trained prediction model for multi-head granular attention analysis to obtain feature vectors. The feature vectors are then mapped according to the fully connected layers of the prediction model to obtain the initial predicted dosage. The multi-head granular attention analysis includes intra-particle temporal analysis, inter-particle crossover analysis, and particle importance weighting analysis. The initial predicted dosage is corrected based on the residual between the actual dosage and the predicted dosage at a historical moment to obtain the target predicted dosage.
[0015] To achieve the above objectives, a second aspect of this application proposes a coal slurry water treatment dosage prediction device based on a granulation attention mechanism, comprising: The acquisition module is used to acquire multi-source time-series data of the coal slurry water treatment system and preprocess the multi-source time-series data to obtain a target data set. The multi-source time-series data includes at least multiple types of time-series data used to characterize the coal slurry water treatment conditions, reagent dosing status and treatment effect. The decomposition module is used to perform granular decomposition on each type of data in the target data set, and to obtain high-frequency information particles and low-frequency information particles in each type of data according to the data values. The generation module is used to construct an input feature matrix based on the high-frequency information particles and the low-frequency information particles within a preset time period; The prediction module is used to input the input feature matrix into a pre-trained prediction model for multi-head granular attention analysis to obtain feature vectors, and to map the feature vectors according to the fully connected layers of the prediction model to obtain the initial predicted dosage; wherein the multi-head granular attention analysis includes intra-particle temporal analysis, inter-particle crossover analysis, and particle importance weighting analysis. The correction module is used to correct the initial predicted dosage based on the residual between the actual dosage and the predicted dosage at a historical moment, so as to obtain the target predicted dosage.
[0016] To achieve the above objectives, a third aspect of this application provides an electronic device comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method described in the first aspect embodiment.
[0017] To achieve the above objectives, a fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described in the first aspect embodiment.
[0018] To achieve the above objectives, a fifth aspect of this application provides a computer program product including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0019] The method and apparatus for predicting chemical dosage in coal slurry water treatment based on granulated attention mechanism provided in this application acquire multi-source time-series data of the coal slurry water treatment system and preprocess the multi-source time-series data to obtain a target data set, thereby improving data quality from the source. Based on the higher-quality target data set, granular decomposition is performed to obtain high-frequency information particles and low-frequency information particles, accurately capturing instantaneous fluctuations and long-term trends. An input feature matrix is constructed based on the high-frequency and low-frequency information particles to input the prediction model, and multi-head granular attention analysis is performed based on the prediction model. At the same time, intra-particle time-series analysis, inter-particle cross-analysis, and particle importance weighting analysis are completed to avoid model bloat and error accumulation, improve the efficiency of obtaining the initial predicted chemical dosage, and correct the initial predicted chemical dosage based on the residuals of historical moments to obtain the final target predicted chemical dosage. This achieves accurate, real-time, and adaptive prediction of chemical dosage, effectively improving the stability of coal slurry water treatment effect and reducing reagent consumption costs.
[0020] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0021] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A schematic flowchart illustrating a method for predicting chemical dosage in coal slurry water treatment based on a granulated attention mechanism, provided in an embodiment of this application. Figure 2 This is a schematic diagram of a process for obtaining high-frequency information particles and low-frequency information particles provided in an embodiment of this application; Figure 3 This is a schematic diagram of a process for obtaining an initial predicted dosage provided in an embodiment of this application; Figure 4 This is a schematic diagram of a process for obtaining a target predicted dosage provided in an embodiment of this application; Figure 5 This is an overall flowchart of a drug dosage prediction method provided in an embodiment of this application; Figure 6 An architecture diagram of information granulation and attention analysis provided in an embodiment of this application; Figure 7 A flowchart for correcting the initial dosage based on residuals is provided in an embodiment of this application; Figure 8 This is a schematic diagram of a coal slurry water treatment chemical dosage prediction device based on granulation attention mechanism, provided in an embodiment of this application. Detailed Implementation
[0022] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0023] The following describes, with reference to the accompanying drawings, a method and apparatus for predicting chemical dosage in coal slurry water treatment based on a granulated attention mechanism, according to embodiments of this application.
[0024] Figure 1 This is a schematic flowchart illustrating a method for predicting chemical dosage in coal slurry water treatment based on a granular attention mechanism, provided as an embodiment of this application. Figure 1 As shown, the method includes the following steps: S101: Acquire multi-source time-series data from the coal slurry water treatment system and preprocess the multi-source time-series data to obtain the target data set.
[0025] In this embodiment, the multi-source time-series data includes at least several types of time-series data used to characterize coal slurry water treatment conditions, reagent dosing status, and treatment effects. Optionally, the coal slurry water treatment condition data includes, but is not limited to, coal slurry water concentration, effluent turbidity, pH value, and coal slurry particle size distribution. The treatment effect data includes, but is not limited to, treatment flow rate, stirring intensity, and clarifier level. The reagent dosing status data includes, but is not limited to, flocculant / coagulant concentration, historical dosage, and filter cake moisture content.
[0026] The concentration of coal slurry water is used to determine the basic dosage of flocculant; the higher the concentration, the more reagent is required.
[0027] The turbidity of the effluent directly reflects the effectiveness of the chemical dosing. The standard requirement is ≤5 NTU, where NTU is the unit of effluent turbidity.
[0028] pH affects flocculant activity; activity decreases by about 30% when pH < 5.
[0029] When the particle size distribution of coal slime indicates that fine particles account for >60%, coagulant aids need to be added to promote the destabilization of the particles.
[0030] The processing flow rate determines the total amount of coal slurry water per unit time, which affects the overall reagent load.
[0031] The stirring intensity affects the uniformity of the drug mixture; too low a stirring speed can lead to localized overmixing.
[0032] When the liquid level in the clarifier exceeds 2.5m, the sedimentation time is shortened, and the flocculation process needs to be accelerated.
[0033] The concentration of flocculant / coagulant aid directly affects the coagulation efficiency; excessively high concentrations can easily lead to pipe blockage.
[0034] Historical dosage is a core reference benchmark for predictive learning, reflecting past control strategies.
[0035] The moisture content of the filter cake is the ultimate indicator of the dehydration effect, and the standard requirement is ≤25%.
[0036] In this embodiment, the above data is collected to obtain multi-source time-series data related to coal slurry water within a preset time period. The collection frequency is uniformly set to 1 time / minute. The dosage is predicted based on the multi-source time-series data within the preset time period, for example, the dosage is predicted based on multi-source time-series data within 1 hour.
[0037] Optionally, to improve the accuracy of drug dosage prediction, the process of preprocessing multi-source time series data to obtain the target data set includes, but is not limited to, missing value repair, outlier correction, and data standardization.
[0038] In some embodiments, missing value repair can be divided into two types based on the duration of data missing: short-term missing and long-term missing. Short-term missing data has a duration of ≤30 minutes, while long-term missing data has a duration of >30 minutes.
[0039] Optionally, for short-term missing data, a sliding window mean method can be used for repair; the window size can be set. The mean of the valid data within the window is used as the repair value. This method effectively smooths out transient interference, and the odd-numbered window size ensures symmetry around the missing time point. It should be noted that the sliding window mean method relies on ensuring a sufficient number of valid data points within the window. If the number of valid data in the window is insufficient, the window size will be increased to 7; if it is still insufficient, the window size will continue to be increased.
[0040] Optionally, for data that has been missing for a long time, linear interpolation can be used for repair. By using the effective data boundary points before and after the missing segment, the data can be fitted and repaired according to a linear trend. This method is suitable for continuous data gaps caused by long-term equipment maintenance, ensuring the overall continuity of the time series.
[0041] Alternatively, the method for correcting outliers can be to use... The criteria are used for anomaly identification, that is, when data points... Deviation from the mean of all data More than 3 standard deviations When the data point is deemed abnormal, that is, when the condition is met... At that time, determine For outliers, a median replacement method can be used for correction. For example, the median of the three non-outlier valid data points before and after the outlier can be obtained for correction. The median of the three non-outlier valid data points before and after the outlier can be obtained and used as the replacement value for the outlier. Compared with the mean replacement method, this method is more robust to extreme outliers.
[0042] Understandably, due to the significant differences in the physical dimensions of different variables—for example, the concentration of coal slurry water is in the hundreds and the pH value is below 10—directly inputting multi-source time-series data into the model would lead to extremely unbalanced gradient updates. Therefore, the multi-source time-series data, after missing value correction and outlier repair, undergoes standardization to eliminate dimensional differences. The standardization calculation formula for each data point is expressed as follows:
[0043] in, For standardized data, For the original data points, This is the mean of the historical sequence of this variable. The standard deviation is denoted as .
[0044] By using the standardized calculation formulas described above, data of different dimensions are converted into standardized data with zero mean and unit variance, thus obtaining the target data set. This reduces the impact of different physical dimensions on model training and enables the model to learn the relative change patterns of each parameter fairly.
[0045] It should be noted that the target dataset obtained after preprocessing must meet strict quality standards, namely, continuity, authenticity, and consistency must be met. For example, the missing data rate must be <0.1%, with no consecutive missing data exceeding 5 minutes, and the anomaly correction rate must be 100%. All data must pass [the relevant standards / tests]. The criteria were reviewed, and all parameters were standardized and distributed reasonably, thereby improving the accuracy of drug dosage prediction based on the target dataset.
[0046] S102, perform granular decomposition on each type of data in the target dataset, and obtain high-frequency information particles and low-frequency information particles in each type of data based on the data values.
[0047] Understandably, the preprocessed target dataset contains a mixture of "instantaneous fluctuations" and "long-term trends." For example, the concentration of coal slurry water can change rapidly at the minute level due to pump switching, and it can also show an hourly trend as the batch of raw coal changes. If the target dataset is directly input into the model, the mixed feature scales will make it difficult for the model to accurately capture key abrupt change signals.
[0048] In some embodiments, the granular decomposition of the target data set in this embodiment can be based on clustering algorithms to cluster the time-series data of each type of data into "high-frequency information particles" and "low-frequency information particles", wherein the high-frequency information particles are used to capture instantaneous fluctuations and the low-frequency information particles are used to capture long-term trends.
[0049] S103, construct the input feature matrix based on the high-frequency information particles and low-frequency information particles within the preset time period.
[0050] In some embodiments, to improve prediction accuracy, an input feature matrix is constructed based on high-frequency and low-frequency information particles within a preset time period. This input feature matrix includes information particle features over a period of time, providing richer reference information for prediction and resulting in higher prediction accuracy.
[0051] In some embodiments, an input feature matrix can be constructed based on high-frequency and low-frequency information particles of all types of data within a preset time period. In this embodiment, feature embedding is performed on each high-frequency and low-frequency information particle to obtain information particle matrices corresponding to the high-frequency and low-frequency information particles respectively. The input feature matrix is obtained by concatenating all information particle matrices within the preset time period.
[0052] S104. Input the input feature matrix into the pre-trained prediction model and perform multi-head granular attention analysis to obtain feature vectors. Then, map the feature vectors according to the fully connected layer of the prediction model to obtain the initial predicted dosage.
[0053] Understandably, considering that the importance of different information particles to chemical dosing prediction changes in real time with the operating conditions, it is necessary to dynamically determine the importance of information particles; coal slurry water treatment has an inherent time lag of 3-8 minutes, and after the agent is added, it is necessary to wait for floc formation, so the model must predict future operating conditions; there are complex synergistic physicochemical relationships between the information particles of each variable; existing models usually design three independent sub-networks for analysis, resulting in model bloat and stepwise accumulation of errors; in this embodiment, the prediction model can perform multi-head granular attention analysis, which includes intra-particle temporal analysis, inter-particle cross-analysis, and particle importance weighting analysis.
[0054] In some embodiments, the prediction model can be trained using a target dataset from the past 30 days as the training set. During training, multi-head granular attention analysis is implemented based on the prediction model. The basic architecture of the prediction model adopts the existing conventional prediction network architecture, and the training method will not be described in detail.
[0055] In some embodiments, intragranular temporal analysis is used to quantify the impact of different historical time steps on the future. The contribution weight of time prediction achieves explicit mathematical compensation for physical time delay, where τ is the average physical time delay of the coal slurry water system. It fully considers floc formation and sedimentation reaction, and can avoid the misalignment between predicted values and actual needs. Inter-particle cross-analysis is used to calculate the degree of synergistic correlation between information particles of different variables, and accurately capture the multivariate coupling effect. The importance weighted analysis of particles is used to dynamically evaluate the relative importance of each information particle to the current prediction target, and automatically adjust the weight ratio of high-frequency fluctuation particles and low-frequency trend particles.
[0056] It is understandable that at least three attention heads are needed for analysis. Each attention head performs intra-particle temporal analysis, inter-particle cross-analysis, and particle importance weighting analysis, and outputs a corresponding vector. In this embodiment, the vectors output by all attention heads are fused to obtain the feature vector.
[0057] Furthermore, the feature vector is passed through a fully connected layer in the prediction model to map the feature vector and obtain the initial predicted dosage. In this embodiment, the initial predicted dosage is the predicted dosage at the future time t+τ, where τ is the average physical time delay of the coal slurry water system. This fully considers the formation of flocs and the sedimentation reaction, and can avoid the situation where the predicted value is misaligned with the actual demand.
[0058] S105, the initial predicted dosage is corrected based on the residual between the actual dosage and the predicted dosage at historical moments to obtain the target predicted dosage.
[0059] To further improve the accuracy of the dosage, this embodiment can correct the initial predicted dosage based on the residual between the actual dosage and the predicted dosage at a historical time. The residual is calculated from the difference between the actual dosage and the predicted dosage at a historical time under the complexity of the industrial site environment. Therefore, by dynamically correcting the current initial predicted dosage based on the historical residual, the target predicted dosage can be obtained. This can take into account the complexity of the site environment, reduce the interference of external factors, and improve the accuracy of obtaining the target predicted dosage.
[0060] In this embodiment, multi-source time-series data of the coal slurry water treatment system are acquired and preprocessed to obtain a target data set, improving data quality from the source and laying a solid foundation for accurate prediction. Granular decomposition divides the data into high-frequency and low-frequency information particles, accurately capturing instantaneous fluctuations and long-term trends in operating conditions. A high-dimensional input feature matrix is constructed based on the information particles, providing richer reference information for the model. Simultaneously, multi-head granular attention analysis is used to complete intra-particle time-series analysis, inter-particle cross-analysis, and particle importance weighting analysis within a unified framework, avoiding model bloat and error accumulation, significantly improving the model's adaptability to complex operating conditions, and increasing the efficiency of obtaining the initial predicted dosage. The initial predicted dosage is corrected based on the residuals to obtain the final target predicted dosage, weakening the influence of various on-site interferences and further optimizing prediction accuracy. This achieves accurate, real-time, and adaptive prediction of dosage, effectively improving the stability of coal slurry water treatment and reducing reagent consumption costs.
[0061] Based on the above embodiments, the process of obtaining high-frequency and low-frequency information particles corresponding to each type of data in the target dataset will be described. Figure 2 This is a schematic diagram illustrating a process for acquiring high-frequency information particles and low-frequency information particles, provided as an embodiment of this application. Figure 2 As shown, the method includes the following steps: S201, for any type of data, determine the initial high-frequency center and the initial low-frequency center.
[0062] Coal slurry water-related data exhibits typical "dual-scale" characteristics. High-frequency characteristics are caused by equipment start-up and shutdown, and instantaneous disturbances, with a time scale typically ranging from 1 to 30 minutes. Low-frequency characteristics are caused by changes in raw coal properties and adjustments in processing load, with a time scale typically ranging from 1 to 24 hours. Existing hard partitioning methods would absolutely classify each data point into a certain category, while the Fuzzy c-means clustering algorithm can achieve flexible differentiation by calculating the membership degree of data points to different cluster centers. Therefore, this embodiment uses the FCM algorithm to distinguish between high-frequency and low-frequency information particles.
[0063] It is understandable that, based on the dual-scale physical characteristics of coal slurry water-related data, the number of clusters in this embodiment is fixed. That is, high-frequency information particles and low-frequency information particles; for any type of data, two cluster centers are initialized, namely the initial high-frequency center and the initial low-frequency center.
[0064] Optionally, the initial high-frequency center can be determined based on the mean of the most volatile segment in the historical sequence, and the initial low-frequency center can be determined based on the mean of the most stable trend segment in the historical sequence.
[0065] S202, retrieve the first data item of the current data type based on the data value. iThe fourth Euclidean distance between the data and the initial high-frequency center, the... i The fifth Euclidean distance between the data and the initial low-frequency center.
[0066] in i It is a positive integer.
[0067] Alternatively, the fourth Euclidean distance can be expressed as The fifth Euclidean distance is expressed as ,in For the first i One data point, As the initial high-frequency center, This is the initial low-frequency center.
[0068] S203, determine the fourth and fifth Euclidean distances based on the Euclidean distances. i The data belongs to the first membership degree of the initial high-frequency center and the second... i The data belongs to the second membership degree of the initial low-frequency center.
[0069] In some embodiments, the membership degree is calculated as follows:
[0070] in, For the first i The membership degree of each data point to the k-th initial center; For the first i Euclidean distance between each data point and the k-th initial center; For the first i The data and the first j The Euclidean distance between the initial centers; m is the fuzzy weighted exponent; c is the total number of initial centers.
[0071] Understandably, in the calculation of the first membership degree, This is the fourth Euclidean distance; in the calculation of the second membership degree, The fifth Euclidean distance; in this embodiment, k is 1 or 2. When k is 1, it represents the initial high-frequency center, and when k is 2, it represents the initial low-frequency center. At this time, c is 2; m is 2, which is used to control the fuzziness of clustering, so that extreme data with large fluctuations are more likely to be classified into high-frequency information particles, while data with stable trends are more likely to be classified into low-frequency information particles.
[0072] S204, the initial high-frequency center and the initial low-frequency center are iteratively updated according to the first membership degree and the second membership degree until the preset iteration stop condition is met.
[0073] Optionally, a membership matrix can be obtained based on the membership degrees of all currently calculated data belonging to each initial cluster center. The positions of the cluster centers can then be recalculated based on the membership matrix. The calculation method is as follows:
[0074] in, The updated cluster centers; N is the number of data points participating in the clustering; For the first i The membership degree of each data point to the k-th initial center is used as the weight to calculate the weighted average of all data points, thereby moving the cluster center to a region with higher density.
[0075] Furthermore, based on the updated cluster centers (including high-frequency centers and low-frequency centers), the membership degree of each data point is calculated, and the cluster centers are iteratively updated again according to the latest calculated membership degree until the preset iteration stop condition is met.
[0076] Optionally, in this embodiment, a preset iteration stopping condition is met when the change in cluster centers between two iterations is extremely small. For example, the change in high-frequency centers and / or low-frequency centers between two iterations... Determine if the current iteration stops under the preset conditions.
[0077] S205, obtain the iteration number after iteration stops. i The first target membership degree and the second target membership degree of each data point are used to determine the first target membership degree and the second target membership degree. i The classification identifier for each data point.
[0078] The classification labels include high frequency and low frequency.
[0079] It is understandable that after the iteration stops, the membership matrix can be used to determine the nth membership level. i The data belongs to the first target membership degree of the high-frequency center and the second... i The data belongs to the second objective membership degree of the low-frequency center.
[0080] Optionally, in this embodiment, a first target membership degree is set. The data is categorized by high frequency, with the second objective being membership degree. The data is categorized as low frequency.
[0081] S206, determine the high-frequency information particles and low-frequency information particles corresponding to each type of data in the target dataset based on the classification identifier.
[0082] It is understandable that data with high-frequency classification labels are grouped into high-frequency information particles, and data with low-frequency classification labels are grouped into low-frequency information particles.
[0083] In this embodiment, the membership degree of the data is determined by calculating the Euclidean distance between the data and the cluster center, combined with the membership degree calculation formula. This allows for flexible data partitioning based on the membership degree, avoiding information loss from hard partitioning and accurately matching the intertwined characteristics of coal slurry water fluctuations and trends. During the partitioning process, the cluster center is iteratively updated through the membership degree matrix until the change is less than 0.01, improving the accuracy of granular partitioning. Ultimately, this achieves accurate separation of high and low frequency information granules for various types of data, effectively capturing minute-level instantaneous fluctuations and hour-level long-term trends, and solving the problem of insufficient capture of key signals caused by the mixing of feature scales in traditional models.
[0084] Based on the above embodiments, the process of obtaining the initial predicted dosage will be described. Figure 3 This is a schematic diagram illustrating a process for obtaining an initial predicted dosage, provided as an embodiment of this application. Figure 3 As shown, the method includes the following steps: S301, construct the input feature matrix based on the high-frequency information particles and low-frequency information particles within a preset time period.
[0085] In some embodiments, a local target data set corresponding to L time steps can be determined, where L is a positive integer; optionally, in this embodiment, L is 12, that is, the local target data set for the current and past 12 minutes is obtained. The value of 12 minutes is because this length is 1.5 times the maximum physical time delay (8 minutes), ensuring that the constructed input feature matrix contains rich historical trend information to support the model's accurate inference of the future.
[0086] Furthermore, the high-frequency and low-frequency information particles corresponding to each type of data can be determined based on the local target data set; the method for obtaining the high-frequency and low-frequency information particles is described in steps S201-S206, and will not be repeated in detail; it is understood that if there are N types of data, the total number of high-frequency and low-frequency information particles obtained is 2N.
[0087] Optionally, feature embedding is performed based on high-frequency and low-frequency information granules respectively to obtain high-frequency and low-frequency information matrices for each type of data. The dimensions of both the high-frequency and low-frequency information matrices are 1. L OK Column, among which The preset embedding dimension is a positive integer, and in this embodiment, it is 64. Based on the high-frequency and low-frequency information matrices of all data types, an input feature matrix is constructed. The dimension of the input feature matrix is... , where N is the number of data types.
[0088] S302: Input the input feature matrix into the pre-trained prediction model, and obtain the output vector corresponding to each attention head in the multi-head granular attention analysis based on the scaling dot product attention calculation.
[0089] In some embodiments, different attention heads in the multi-head attention mechanism of the prediction model are assigned to different granular analysis tasks, enabling multiple attention heads to perform different tasks in parallel.
[0090] Optionally, in this embodiment, the total number of attention heads H=6 is set, and intragranular temporal analysis is performed based on 2 attention heads to obtain a first output vector and a second output vector. Intragranular temporal analysis is used to quantify the influence of historical time steps on the future. The contribution weight of the drug dosage prediction at different times is calculated. Based on two attention heads, inter-particle cross-analysis is performed to obtain the third and fourth output vectors. Inter-particle cross-analysis is used to calculate the degree of synergistic association between different types of data information particles to accurately capture the multivariate coupling effect. Based on two attention heads, particle importance weighting analysis is performed to obtain the fifth and sixth output vectors. Particle importance weighting analysis is used to adjust the weight ratio of high-frequency information particles and low-frequency information particles to dynamically evaluate the relative importance of each information particle to the current prediction target.
[0091] Understandably, intragranular temporal analysis, intergranular crossover analysis, and granular importance weighting analysis are performed in parallel through attention heads, each with its own independently learnable weight matrix.
[0092] This embodiment obtains the output vector corresponding to each attention head by scaling the dot product attention. The formula for calculating the scaling dot product attention is:
[0093] in, For the output vector, For query vector, For key vectors, For value vectors, The embedding dimension is preset; the Q, K, and V vectors are obtained by linearly mapping the input feature matrix through the independent weight matrix of each attention head. In this embodiment, the dimensions are all set to 1. denominator This is a scaling factor used to prevent the softmax function from entering the gradient saturation region due to excessively large inner product values in high dimensions; the softmax function normalizes the calculated raw attention score into probability weights.
[0094] It is understandable that, for different analysis tasks, the attention heads for the three tasks will differ in how they acquire output vectors. The construction methods are different.
[0095] In some embodiments, for the intragranular time-series analysis heads (Head 1, Head 2): It is obtained from the predicted target mapping, that is, from the previous The historical characteristics of drug dosage at each time step are mapped to obtain the data. and The attention weights are obtained by mapping the same information particle to data at different time steps within a time window; these attention heads learn the attention weights. Reflects the first in the window The contribution of each historical time step to future predictions; generally, the closer the data is to the current moment, the greater its contribution. The higher the weight, the more time-axis projection of the time delay characteristics is achieved.
[0096] In some embodiments, for the interparticle cross-linking analysis heads (Head 3, Head 4): Obtained by mapping the information granular features of a specific variable. and The weights are obtained by mapping the information granular features of all other variables; the weights learned by this attention head. Reflects the first The information particle and the first The physical correlation strength between information particles; for example, under acidic conditions, the model can automatically learn a strong correlation weight of 0.18 between "concentration high-frequency information particles" and "pH low-frequency information particles".
[0097] In some embodiments, for the importance-weighted headers of the particles (Head 5, Head 6): The unified method is obtained by mapping the global dosing prediction target. and The weights are obtained from the feature mappings of each independent information particle; the weights learned by this attention head. It dynamically reflects the degree to which each information particle determines the final prediction result under the current specific working conditions.
[0098] S303 concatenates and reduces the dimensionality of the output vectors corresponding to each attention head to obtain the feature vector.
[0099] Optionally, after obtaining the output vectors of the six attention heads, the first, second, third, fourth, fifth, and sixth output vectors can be concatenated and dimensionality reduced to obtain the feature vectors.
[0100] Alternatively, the feature vector can be represented as:
[0101] in, For feature vectors; This is the first output vector; This is the second output vector; This is the sixth output vector; For splicing operations; The output weight matrix has the following dimensions: This operation maps the scattered, multi-dimensional analysis results into a highly condensed, unified feature representation vector.
[0102] In some embodiments, the weights of high-frequency and low-frequency information particles in the feature vector can be adjusted based on the inherent physicochemical rules of coal slurry water.
[0103] In some embodiments, weight adjustment based on the inherent physicochemical rules of coal slurry water can enhance the robustness of the model under extreme operating conditions; optionally, in response to the relative fluctuation of coal slurry water concentration exceeding a first threshold in a first preset time period, the weight of high-frequency information particles corresponding to coal slurry water concentration is increased; in response to the fluctuation of pH value being less than a second threshold in a second preset time period, the weight of low-frequency information particles corresponding to pH value is increased, wherein coal slurry water concentration and pH value are coal slurry water treatment operating condition data.
[0104] For example, when the relative fluctuation of coal slurry concentration is detected within 5 minutes... At this time, the weight of high-frequency particles is forcibly increased by an additional 5-10% to ensure that the system can respond instantaneously to sudden changes in concentration.
[0105] For example, when the pH value fluctuates over the past 2 hours When the pH is determined to be in an extremely stable period, the pH low-frequency particle weight is increased by 5% to stabilize the baseline dosage.
[0106] In this embodiment, initial prior weights can be set for high-frequency and low-frequency information particles of different types of data. For example, the weight of high-frequency information particles is 0.7 and the weight of low-frequency information particles is 0.3. After adjustment based on inherent physical and chemical rules, the weights of high-frequency and low-frequency information particles corresponding to each type of data are obtained.
[0107] Furthermore, after adjusting the information particle weights, a softmax normalization operation must be performed again to ensure that the sum of the weights of all information particles is 1. Based on the normalized weights, multi-head granular attention analysis is performed to obtain the feature vector. The process of obtaining the feature vector through multi-head granular attention analysis will not be elaborated here.
[0108] S304: The feature vector is mapped according to the fully connected layer of the prediction model to obtain the initial predicted dosage.
[0109] Alternatively, the feature vector can be mapped to the future through a fully connected layer. The initial predicted dosage at time, of which Minutes represent the average physical time delay of the coal slurry water system; the initial predicted dosage is expressed as:
[0110] in, For the future The initial predicted dosage at each time point; For feature vectors; This is the output layer weight matrix. This is a bias term.
[0111] In some embodiments, to balance numerical prediction accuracy and trend lag compensation effectiveness, this embodiment employs a customized joint loss function during model training. The joint loss function is as follows:
[0112] in, To compensate for the traditional loss of prediction accuracy, mean square error is used to measure the distance between the absolute value of the prediction and the future true value. The innovative time lag bias loss is used to measure the consistency between the derivative (trend) of the model's predicted curve and the derivative of the future actual demand curve, ensuring that the predicted action is not only "accurate in measurement" but also "accurate in timing." To balance the penalty factor, its value is set between 0.1 and 0.3, with a preferred value of 0.2, which is used to adjust the weight of the two factors in gradient backpropagation.
[0113] In some embodiments, time delay error loss The calculation method is as follows:
[0114] in, This is the time-delay bias loss; Z represents the length of the difference sequence. In a 12-minute time window, Z=11, which means averaging the trend error of all time steps within the time window to avoid the window length affecting the magnitude of the loss. For the first difference of the predicted sequence, The first difference of the true sequence; It can amplify situations with large trend deviations, such as when the actual demand is for an increase in drug dosage, but the model predicts a decrease. The squared error will be significantly amplified, allowing the model to prioritize correcting such serious timing misalignment problems during training.
[0115] In some embodiments, the first difference of the prediction sequence is obtained based on 12 consecutive prediction values within the time window output by the prediction model. The prediction sequence is composed of 12 consecutive prediction values. The difference between two adjacent prediction values in the prediction sequence is performed to obtain the first difference sequence of the prediction sequence, which includes 11 difference values.
[0116] Accordingly, the first difference of the true sequence is obtained based on the true values of 12 consecutive time steps within the time window. The true sequence is constructed from 12 consecutive true values. The difference between two adjacent true values in the true sequence is performed to obtain the first difference sequence of the true sequence, which includes 11 difference values.
[0117] For example, in the predicted sequence, The predicted dosage per minute is 8.5 L / h. The predicted dosage per minute is 8.0 L / h, then... L / h represents the model's prediction that the dosage needs to increase by 0.5 L / h per minute; in the corresponding actual sequence, The actual dosage per minute is 8.3 L / h. The actual dosage per minute is 7.8 L / h, then L / h represents the actual demand, which is also increasing by 0.5 L / h per minute. These two differences are exactly equal, indicating that the trend in this step is perfectly matched, and the corresponding error is 0.
[0118] The model training in this embodiment uses a joint loss function, which takes into account both the accuracy of the predicted numerical value and the effect of time lag trend compensation, greatly improving the accuracy of the dosage prediction and laying a core foundation for subsequent precision dosing.
[0119] In this embodiment, an input feature matrix adapted to the time delay characteristics of coal slurry water is constructed to provide rich historical feature support for prediction. Six attention heads are used in parallel to perform three types of analysis, each with an independent weight matrix. Combined with scaled dot product attention for precise calculation, and with Q, K, and V constructed differently as needed, this achieves explicit time delay compensation, accurately captures multivariate coupling effects, and dynamically adjusts the information particle weights, balancing comprehensiveness and specificity of the analysis. The output vectors of all attention heads are concatenated and dimensionality reduced to form a feature vector. Furthermore, the information particle weights can be adjusted in a targeted manner based on the physicochemical rules of coal slurry water, and normalization processing ensures the rationality of weight calculation, resulting in a more accurate feature vector. Finally, the initial predicted dosage is obtained by mapping the feature vector through a fully connected layer, improving the prediction accuracy of the initial dosage.
[0120] Based on the above embodiments, the process of obtaining the target predicted dosage will be described. Figure 4 This is a schematic diagram illustrating a process for obtaining a target predicted dosage, provided as an embodiment of this application. Figure 4 As shown, the method includes the following steps: S401, obtain the residual between the actual dosage and the predicted dosage at the previous moment based on historical data.
[0121] Optionally, the predicted dosage and actual dosage of the previous moment can be obtained based on historical data. In this embodiment, the residual of the previous moment is the difference between the actual dosage and the predicted dosage of the previous moment.
[0122] S402, obtain the membership set of residuals based on clustering algorithm.
[0123] Optionally, in this embodiment, the membership set is obtained based on fuzzy C-means clustering, wherein the membership set includes the low-frequency residual membership, mid-frequency residual membership, and high-frequency residual membership corresponding to the residual.
[0124] In some embodiments, clustering can be performed based on historical residual data to obtain predetermined high-frequency residual centers, mid-frequency residual centers, and low-frequency residual centers; in this embodiment, FCM triple clustering is used to analyze historical residuals to determine high-frequency residual centers, mid-frequency residual centers, and low-frequency residual centers.
[0125] Calculate the first, second, and third Euclidean distances between the residuals and the centers of high-frequency, mid-frequency, and low-frequency residuals, respectively. Based on the first, second, and third Euclidean distances, determine the membership degrees of the high-frequency, mid-frequency, and low-frequency residuals corresponding to the residuals.
[0126] Alternatively, the membership degree can be calculated as follows:
[0127] in, For the first i The membership degree of each data point to the k-th initial center; For the first i Euclidean distance between each data point and the k-th initial center; For the first i The data and the first j The Euclidean distance between the initial centers; m is the fuzzy weighting exponent, with a value of 2; c is the total number of initial centers, with a value of 3 in this case.
[0128] Specifically, in this embodiment, the high-frequency residual, mid-frequency residual, and low-frequency residual correspond to high-noise residual particles, mid-noise residual particles, and low-noise residual particles, respectively. High-noise residual particles have extremely large amplitudes and extremely short durations, possibly caused by sudden sensor detachment, electromagnetic pulse interference, or mechanical jamming of pumps and valves. Mid-noise residual particles have moderate amplitudes and strong random fluctuations, possibly caused by occasional factors such as minor fluctuations in mixer speed or changes in local pipeline resistance. Low-noise residual particles have extremely small amplitudes, exhibiting long-term systematic deviations, possibly caused by minor differences between batches of reagents or extremely subtle nonlinear patterns due to incomplete model fitting. In this embodiment, if the membership degree of the residual data to the high-frequency residual center is greater than 0.5, the residual data is considered a high-noise residual particle; correspondingly, if the membership degree of the residual data to the mid-frequency residual center is greater than 0.5, the residual data is considered a mid-noise residual particle; and if the membership degree of the residual data to the low-frequency residual center is greater than 0.5, the residual data is considered a low-noise residual particle.
[0129] S403, the initial predicted dosage is corrected based on the residual and membership set to obtain the target predicted dosage.
[0130] In some embodiments, the compensation weight for each type of residual can be obtained; optionally, in this embodiment, the compensation weight for high-noise residual particles is 0.15, the compensation weight for medium-noise residual particles is 0.25, and the compensation weight for low-noise residual particles is 0.65.
[0131] Furthermore, the membership degrees are weighted based on the compensation weights, and the weighted results are multiplied with the residuals to obtain the weighted results corresponding to the low-frequency, mid-frequency, and high-frequency residuals, respectively. The weighted results are summed to obtain the correction value. The target predicted dosage is obtained by summing the correction value with the initial predicted dosage.
[0132] Optionally, the calculation of the target predicted dosage can be expressed as:
[0133] in, Predict the dosage for the target; This is the initial predicted dosage. The degree of membership of the residual data to the cluster center of the k-th class; For the first Compensation weights for noise-like residual particles; For residuals; This is a correction value.
[0134] Furthermore, the obtained target predicted dosage can be transmitted to the field control system in real time with a millisecond delay through standard industrial communication protocols. This signal is then converted into a frequency control signal for the frequency converter, driving the flocculant and coagulant dosing pumps to achieve unmanned, precise, closed-loop automatic adjustment, thereby improving the coal slurry water treatment effect.
[0135] In this embodiment, the residual between the actual and predicted dosage is calculated, and then FCM triple clustering is used to divide the residual into high, medium, and low noise residual particles to accurately distinguish prediction deviations caused by different factors. The membership degree of the residual is determined by the membership degree formula, and differentiated compensation weights are assigned to different noise residual particles. The low weight of high noise residuals suppresses random interference, while the high weight of low noise residuals retains effective correction information, balancing interference suppression and regularity utilization. Based on the residual, membership degree, and compensation weight, the correction value is calculated to accurately correct the initial predicted dosage, resulting in a more realistic target predicted dosage. This effectively reduces model prediction errors, improves the accuracy and stability of dosing control, and ensures that the coal slurry water treatment effect meets the standards.
[0136] Based on the above embodiments, the embodiments of this application are illustrated by example. Assuming a coal preparation plant's coal slurry water treatment system is used as the application scenario, this coal preparation plant processes approximately 5000 tons of raw coal per day, with a coal slurry water treatment capacity of approximately 300 m³ / h. Anionic polyacrylamide (molecular weight 12 million, degree of hydrolysis 25%) is used as the flocculant, and polyaluminum chloride as the coagulant aid. The system is equipped with 10 types of online monitoring devices, including a coal slurry water concentration sensor (range 0-300 g / L, accuracy ±2%), an online pH meter (range 0-14, accuracy ±0.05), an electromagnetic flow meter (range 0-50 m³ / h, accuracy ±0.5%), and a turbidity sensor (range 0-100 NTU, accuracy ±1%). The data acquisition frequency is once per minute, obtaining multi-source time-series data; Figure 5 As shown, preprocessing of multi-source time-series data, including missing value repair, outlier correction, and data standardization, yields the target dataset; further, as... Figure 5 and Figure 6 As shown, the target dataset is granularized, and fuzzy C-means clustering (FCM) is performed independently on each data type, with the number of clusters c=2 and the fuzzy coefficient m=2. Taking coal slurry concentration as an example: the high-frequency center v1=140g / L and the low-frequency center v2=120g / L are initialized. The membership degree is calculated for each data point, based on the concentration value at a certain time. Taking 150g / L as an example: Distance calculation , Membership degree calculation =0.9, =0.1, this data point belongs to the high-frequency information granule 90%; iterate and update the cluster centers repeatedly until convergence (change <0.01g / L). After convergence, data points with a membership degree >0.6 are assigned to the corresponding information granule; at the same time, set the initial weight: high frequency =0.7, low frequency =0.3, perform the above process on all types of quantities to obtain all information particles.
[0137] Furthermore, such as Figure 5 As shown, an input feature matrix is constructed based on information granules and a preset time period. A unified multi-head granular attention mechanism is used to complete intra-granular temporal analysis, inter-granular cross-analysis, and granular importance weighting analysis within the same framework. Taking a specific working condition as an example: when the coal slurry concentration suddenly increases from 120 g / L to 160 g / L within 5 minutes, the granular importance weighting head assigns a weight of approximately 0.988 to high-concentration granules and approximately 0.012 to low-flow granules. The inter-granular cross-analysis head identifies a correlation weight of 0.18 between high-concentration granules and low-pH granules. The intra-granular temporal analysis head assigns a weight of 0.25 to the current time and 0.03 to the time 11 minutes ago. After secondary adjustments based on the physical rules of coal slurry, the outputs of all heads are concatenated and fused through a linear transformation. Finally, the result is mapped to the initial predicted dosage at time t+τ (τ=5 minutes) through a fully connected layer. A joint loss function is used during model training. Optimization was carried out; taking a specific scenario as an example: the current concentration is 130g / L and is on the rise. After granular attention analysis, the model predicts that the concentration will reach about 145g / L after 5 minutes, and outputs a dosage of 9.8L / h; when the dosage takes effect after 5 minutes, the concentration actually rises to 143g / L, and the dosage is highly matched with the actual needs.
[0138] Furthermore, such as Figure 5 and Figure 7 As shown, the residuals are divided into high-noise residual particles, medium-noise residual particles, and low-noise residual particles. The residual at a certain time is... For example, the three cluster centers are respectively , , The membership degree calculation result is (Medium-noise residual particles); the final prediction correction formula is as follows: Among them, compensation weight , as well as =0.65; Taking the main model's predicted value of 8.5 L / h as an example, after residual granulation correction, it becomes 8.661 L / h, effectively suppressing high noise interference.
[0139] Finally, the target predicted dosage is transmitted to the control system in real time via a protocol. The control system automatically adjusts the operating frequency of the flocculant dosing pump (frequency variable control, frequency range 10-50Hz) and the coagulant aid dosing pump (frequency variable control, frequency range 5-30Hz) according to the target predicted dosage. At the same time, this embodiment also supports automatic incremental learning and updating after accumulating new data for 7 days to ensure the accuracy of the target predicted dosage.
[0140] For example, the results of a 30-day continuous operation test in a coal preparation plant are shown in the table below: Table 1
[0141] As shown in Table 1, the experimental results of this embodiment are significantly improved in terms of prediction accuracy, processing effect and economy compared with the traditional BP neural network.
[0142] Based on the above embodiments, this embodiment can also propose an intelligent dosage prediction system, comprising four layers: a data acquisition layer, a data processing layer, an intelligent prediction layer, and a control execution layer. The data acquisition layer is deployed at the coal preparation plant site and includes online monitoring equipment such as coal slurry concentration sensors, online pH meters, electromagnetic flow meters, turbidity sensors, stirring speed sensors, and liquid level sensors. It transmits the collected multi-source time-series data to the host computer time-series database at a frequency of 1 time per minute via industrial Ethernet (Modbus TCP / IP protocol). The data processing layer is deployed on the host computer server and is responsible for performing preprocessing functions on the multi-source time-series data, including missing value repair modules, outlier correction modules, data standardization modules, and data quality verification modules. The intelligent prediction layer is the core computing layer of the system, deployed on an industrial server equipped with a GPU accelerator card. It is responsible for performing functions such as data granulation decomposition, initial prediction dosage acquisition, and correction, including information granulation modules, granular attention fusion modules, and residual granulation correction modules, and finally outputs the target predicted dosage for future moments. The control execution layer receives the predicted dosage value output by the intelligent prediction layer through a PLC and converts it into control signals for the dosing pump. Both the flocculant dosing pump and the coagulant aid dosing pump are driven by variable frequency drives. The PLC calculates the corresponding pump operating frequency based on predicted values, enabling continuous and precise adjustment of the dosing amount. Simultaneously, the control execution layer feeds back the actual dosing amount and effluent water quality data to the data acquisition layer, forming a complete control closed loop.
[0143] To achieve the above embodiments, this application also proposes a coal slurry water treatment dosage prediction device based on granulation attention mechanism.
[0144] Figure 8 This is a schematic diagram of a coal slurry water treatment dosage prediction device based on a granulation attention mechanism, provided as an embodiment of this application. Figure 8As shown, the coal slurry water treatment chemical dosage prediction device 800 based on granulation attention mechanism includes: The acquisition module 801 is used to acquire multi-source time-series data of the coal slurry water treatment system and preprocess the multi-source time-series data to obtain a target data set. The multi-source time-series data includes at least multiple types of time-series data used to characterize the coal slurry water treatment conditions, reagent dosing status and treatment effect. The decomposition module 802 is used to perform granular decomposition on each type of data in the target dataset, and to obtain high-frequency information particles and low-frequency information particles in each type of data based on the data values. The generation module 803 is used to construct an input feature matrix based on high-frequency information particles and low-frequency information particles within a preset time period; The prediction module 804 is used to input the input feature matrix into the pre-trained prediction model for multi-head granular attention analysis to obtain feature vectors, and to map the feature vectors according to the fully connected layers of the prediction model to obtain the initial predicted dosage; wherein the multi-head granular attention analysis includes intra-particle temporal analysis, inter-particle cross-analysis and particle importance weighting analysis; The correction module 805 is used to correct the initial predicted dosage based on the residual between the actual dosage and the predicted dosage at a historical moment, so as to obtain the target predicted dosage.
[0145] Furthermore, in one possible implementation of this application embodiment, the correction module 805 is used for: Obtain the residual between the actual dosage and the predicted dosage at the previous moment based on historical data; The membership set of the residuals is obtained based on the clustering algorithm. The membership set includes the low-frequency residual membership, mid-frequency residual membership and high-frequency residual membership corresponding to the residuals. The initial predicted dosage is corrected based on the residuals and membership set to obtain the target predicted dosage.
[0146] Furthermore, in one possible implementation of this application embodiment, the correction module 805 is used for: Obtain the compensation weight for each type of residual, and perform weighted calculation on the corresponding membership degree based on the compensation weight; The weighted calculation results and residuals are multiplied to obtain the weighted results corresponding to the low-frequency residual, the mid-frequency residual, and the high-frequency residual, respectively. The weighted results are summed to obtain the corrected value; The target predicted dosage is obtained by summing the corrected value with the initial predicted dosage.
[0147] Furthermore, in one possible implementation of this application embodiment, the correction module 805 is used for: Clustering is performed based on historical residual data to obtain pre-determined high-frequency residual centers, mid-frequency residual centers, and low-frequency residual centers; Calculate the first, second, and third Euclidean distances between the residuals and the centers of the high-frequency, mid-frequency, and low-frequency residuals, respectively. Based on the first Euclidean distance, the second Euclidean distance, and the third Euclidean distance, determine the membership degrees of the high-frequency residuals, the mid-frequency residuals, and the low-frequency residuals corresponding to the residuals.
[0148] Furthermore, in one possible implementation of this application embodiment, the decomposition module 802 is used for: For any type of data, determine the initial high-frequency center and the initial low-frequency center; Based on the data value, retrieve the first [item] in the current data type. i The fourth Euclidean distance between the data and the initial high-frequency center, the... i The fifth Euclidean distance between each data point and the initial low-frequency center, where i It is a positive integer; Based on the fourth and fifth Euclidean distances, determine the... i The data belongs to the first membership degree of the initial high-frequency center and the second... i The data belongs to the second membership degree of the initial low-frequency center; The initial high-frequency center and the initial low-frequency center are iteratively updated based on the first membership degree and the second membership degree until the preset iteration stop condition is met. Get the number of iterations after it stops i The first target membership degree and the second target membership degree of each data point are used to determine the first target membership degree and the second target membership degree. i The data is categorized by type, including high-frequency and low-frequency data. Based on the classification identifier, determine the high-frequency and low-frequency information particles corresponding to each type of data in the target dataset.
[0149] Furthermore, in one possible implementation of this application embodiment, the membership degree is calculated as follows:
[0150] in, For the first i The membership degree of each data point to the k-th initial center; For the first i Euclidean distance between each data point and the k-th initial center; For the first i The data and the first j The Euclidean distance between the initial centers; m is the fuzzy weighted exponent; c is the total number of initial centers.
[0151] Furthermore, in one possible implementation of this application embodiment, the generation module 803 is used for: Determine the local target data sets corresponding to L time steps, where L is a positive integer; Based on the local target data set, determine the high-frequency and low-frequency information particles corresponding to each type of data; Feature embedding is performed based on high-frequency and low-frequency information granules respectively, resulting in high-frequency and low-frequency information matrices for each data type. Both the high-frequency and low-frequency information matrices have a dimension of [missing value]. L OK Column, among which This is the preset embedding dimension, and its value is a positive integer. Based on the high-frequency and low-frequency information matrices of all data types, an input feature matrix is constructed. The dimension of the input feature matrix is... , where N is the number of data types.
[0152] Furthermore, in one possible implementation of this application embodiment, the prediction module 804 is used for: Based on scaled dot product attention calculation, the output vector corresponding to each attention head in multi-head granular attention analysis is obtained; The output vectors corresponding to each attention head are concatenated and dimensionality reduced to obtain feature vectors; The formula for calculating scaled dot product attention is:
[0153] in, For the output vector, For query vector, For key vectors, For value vectors, The preset embedding dimension is used; the Q, K, and V vectors are obtained by linearly mapping the input feature matrix through the independent weight matrix of each attention head.
[0154] Furthermore, in one possible implementation of this application embodiment, the prediction module 804 is used for: Intragranular temporal analysis is performed based on two attention heads to obtain the first output vector and the second output vector. Intragranular temporal analysis is used to quantify the contribution weight of historical time steps to the prediction of future drug dosage. Interparticle cross-analysis is performed based on two attention heads to obtain the third and fourth output vectors. Interparticle cross-analysis is used to calculate the degree of synergistic association between different types of data information particles. Based on the importance weighted analysis of the particles performed by two attention heads, the fifth and sixth output vectors are obtained. The importance weighted analysis of the particles is used to adjust the weight ratio of high-frequency information particles and low-frequency information particles. The first, second, third, fourth, fifth, and sixth output vectors are concatenated and dimensionality reduced to obtain the feature vector. Among them, intragranular temporal analysis, intergranular cross-analysis, and granular importance weighted analysis are executed in parallel through attention heads, and each attention head has an independent learnable weight matrix.
[0155] Furthermore, in one possible implementation of this application embodiment, the prediction module 804 is further configured to: In response to the relative fluctuation of coal slurry water concentration exceeding a first threshold within a first preset time period, the weight of the high-frequency information particles corresponding to the coal slurry water concentration is increased. In response to the fact that the fluctuation range of pH value within a second preset time period is less than a second threshold, the weight of the low-frequency information particles corresponding to the pH value is increased, where the coal slurry water concentration and pH value are coal slurry water treatment condition data; the weights of all information particles after adjustment are normalized, and feature vectors are obtained by multi-head granular attention analysis based on the normalized weights.
[0156] It should be noted that the foregoing explanation of the intelligent dosage prediction method embodiment also applies to the intelligent dosage prediction device of this embodiment, and will not be repeated here.
[0157] In this embodiment, multi-source time-series data of the coal slurry water treatment system are acquired and preprocessed to obtain a target data set, thereby improving data quality from the source and laying a solid foundation for accurate prediction. The data is split into high-frequency and low-frequency information particles through granular decomposition to accurately capture instantaneous fluctuations and long-term trends in operating conditions. A high-dimensional input feature matrix is constructed based on the information particles to provide richer reference information for the model. Simultaneously, multi-head granular attention analysis is used to complete intra-particle time-series analysis, inter-particle cross-analysis, and particle importance weighting analysis within a unified framework, avoiding model bloat and error accumulation, significantly improving the model's adaptability to complex operating conditions, and increasing the efficiency of obtaining the initial predicted dosage. The initial predicted dosage is corrected based on the residuals to obtain the final target predicted dosage, weakening the influence of various on-site interferences and further optimizing prediction accuracy. This achieves accurate, real-time, and adaptive prediction of dosage, effectively improving the stability of coal slurry water treatment and reducing reagent consumption costs.
[0158] To implement the above embodiments, this application also proposes an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.
[0159] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0160] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0161] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0162] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.
[0163] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.
[0164] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0165] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0166] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0167] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0168] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0169] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0170] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0171] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for predicting chemical dosage in coal slurry water treatment based on granulated attention mechanism, characterized in that, The method includes: Acquire multi-source time-series data of the coal slurry water treatment system, and preprocess the multi-source time-series data to obtain a target data set. The multi-source time-series data includes at least multiple types of time-series data used to characterize the coal slurry water treatment conditions, reagent dosing status, and treatment effect. The target data set is granularly decomposed for each type of data, and high-frequency and low-frequency information particles are obtained from each type of data based on the data values. Construct an input feature matrix based on the high-frequency information particles and the low-frequency information particles within a preset time period; The input feature matrix is input into the pre-trained prediction model for multi-head granular attention analysis to obtain feature vectors. The feature vectors are then mapped according to the fully connected layers of the prediction model to obtain the initial predicted dosage. The multi-head granular attention analysis includes intra-particle temporal analysis, inter-particle crossover analysis, and particle importance weighting analysis. The initial predicted dosage is corrected based on the residual between the actual dosage and the predicted dosage at a historical moment to obtain the target predicted dosage.
2. The method according to claim 1, characterized in that, The initial predicted dosage is corrected based on the residual between the actual dosage and the predicted dosage at a historical moment to obtain the target predicted dosage, including: Obtain the residual between the actual dosage and the predicted dosage at the previous moment based on historical data; The membership set of the residuals is obtained based on a clustering algorithm. The membership set includes the low-frequency residual membership, mid-frequency residual membership, and high-frequency residual membership corresponding to the residuals. Based on the residual and the membership set, the initial predicted dosage is corrected to obtain the target predicted dosage.
3. The method according to claim 2, characterized in that, The step of correcting the initial predicted dosage based on the residual and the membership set to obtain the target predicted dosage includes: Obtain the compensation weight for each type of residual, and perform a weighted calculation on the corresponding membership degree based on the compensation weight; The weighted calculation results and the residuals are multiplied to obtain the weighted results corresponding to the low-frequency residual, the mid-frequency residual, and the high-frequency residual, respectively. The weighted results are summed to obtain the corrected value; The target predicted dosage is obtained by summing the corrected value with the initial predicted dosage.
4. The method according to claim 2, characterized in that, The step of obtaining the membership set of the residuals based on the clustering algorithm includes: Clustering is performed based on historical residual data to obtain pre-determined high-frequency residual centers, mid-frequency residual centers, and low-frequency residual centers; Calculate the first Euclidean distance, the second Euclidean distance, and the third Euclidean distance between the residual and the center of the high-frequency residual, the center of the mid-frequency residual, and the center of the low-frequency residual, respectively; Based on the first Euclidean distance, the second Euclidean distance, and the third Euclidean distance, determine the high-frequency residual membership degree, the mid-frequency residual membership degree, and the low-frequency residual membership degree corresponding to the residual.
5. The method according to claim 1, characterized in that, The step of granular decomposition of each type of data in the target data set, and obtaining high-frequency and low-frequency information particles in each type of data based on data values, includes: For any type of data, determine the initial high-frequency center and the initial low-frequency center; Based on the data value, retrieve the first [item] in the current data type. i The fourth Euclidean distance between the data and the initial high-frequency center, the... i The fifth Euclidean distance between each data point and the initial low-frequency center, where i It is a positive integer; Based on the fourth Euclidean distance and the fifth Euclidean distance, determine the first... i The data belongs to the first membership degree of the initial high-frequency center and the said... i The data belongs to the second membership degree of the initial low-frequency center; The initial high-frequency center and the initial low-frequency center are iteratively updated according to the first membership degree and the second membership degree until the preset iteration stop condition is met; Get the number of iterations after it stops i The first target membership degree and the second target membership degree of each data point are used to determine the first target membership degree and the second target membership degree. i The data is categorized by identifiers, which include high-frequency and low-frequency data. Based on the classification identifier, determine the high-frequency information particles and low-frequency information particles corresponding to each type of data in the target data set.
6. The method according to claim 4 or 5, characterized in that, The method for calculating membership degree is as follows: in, For the first i The membership degree of each data point to the k-th initial center; For the first i Euclidean distance between each data point and the k-th initial center; For the first i The data and the first j The Euclidean distance between the initial centers; m is the fuzzy weighted exponent; c is the total number of initial centers.
7. The method according to claim 1, characterized in that, The step of constructing an input feature matrix based on the high-frequency information particles and the low-frequency information particles within a preset time period includes: Determine the local target data sets corresponding to L time steps, where L is a positive integer; Based on the local target data set, determine the high-frequency information particles and low-frequency information particles corresponding to each type of data; Feature embedding is performed based on the high-frequency information particles and the low-frequency information particles respectively to obtain the high-frequency information matrix and the low-frequency information matrix corresponding to each type of data. The dimensions of the high-frequency information matrix and the low-frequency information matrix are both 1 / 2. L OK Column, among which This is the preset embedding dimension, and its value is a positive integer. Based on the high-frequency and low-frequency information matrices of all data types, an input feature matrix is constructed, the dimension of which is... , where N is the number of data types.
8. The method according to claim 7, characterized in that, The step of inputting the input feature matrix into the pre-trained prediction model and performing multi-head granular attention analysis to obtain feature vectors includes: Based on scaled dot product attention calculation, the output vector corresponding to each attention head in the multi-head granular attention analysis is obtained; The output vectors corresponding to each attention head are concatenated and dimensionality reduced to obtain the feature vectors. The formula for calculating the scaled dot product attention is: in, For the output vector, For query vector, For key vectors, For value vectors, The preset embedding dimension is used; the Q, K, and V vectors are obtained by linearly mapping the input feature matrix through the independent weight matrix of each attention head.
9. The method according to claim 8, characterized in that, The method includes: Intragranular temporal analysis is performed based on two attention heads to obtain a first output vector and a second output vector. The intragranular temporal analysis is used to quantify the contribution weight of historical time steps to the prediction of future drug dosage. Inter-particle cross-analysis is performed based on two attention heads to obtain a third and a fourth output vector. The inter-particle cross-analysis is used to calculate the degree of co-correlation between different types of data information particles. Based on the importance weighted analysis of the particles performed by two attention heads, the fifth output vector and the sixth output vector are obtained. The importance weighted analysis of the particles is used to adjust the weight ratio of high-frequency information particles and low-frequency information particles. The first, second, third, fourth, fifth, and sixth output vectors are concatenated and dimensionality reduced to obtain the feature vector; wherein the intragranular temporal analysis, intergranular cross-analysis, and granular importance weighted analysis are executed in parallel by attention heads, and each attention head has an independent learnable weight matrix.
10. The method according to claim 9, characterized in that, The step of inputting the input feature matrix into the pre-trained prediction model for multi-head granular attention analysis to obtain feature vectors further includes: In response to the relative fluctuation of coal slurry water concentration exceeding a first threshold within a first preset time period, the weight of the high-frequency information particle corresponding to the coal slurry water concentration is increased. In response to the pH value fluctuating less than a second threshold within a second preset time period, the weight of the low-frequency information particle corresponding to the pH value is increased, wherein the coal slurry water concentration and the pH value are coal slurry water treatment condition data. The weights of all adjusted information particles are normalized, and feature vectors are obtained by multi-head granular attention analysis based on the normalized weights.