Salinity time sequence prediction method and device

By preprocessing historical observation data and building prediction models, the problems of insufficient data sets and low accuracy in timing prediction are solved, and high-precision salinity timing prediction is achieved.

CN119474678APending Publication Date: 2025-02-18GUANGDONG HAIQIXING MARINE TECH CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411559389.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art has problems in the shortage of data sets, low model accuracy and lack of hydrological elements in timing prediction, especially in multi-step prediction, time invariance reduces model learning ability.

Method used

By obtaining historical observation data sets for preprocessing, including time series inspection, clustering algorithm evaluation and anomaly detection, the prediction model architecture is built and trained and tested, the prediction model is generated, and salinity observation data is collected in real time for prediction.

Benefits of technology

The accuracy of the salinity timing prediction model is improved, the data quality is ensured, the problem of insufficient data sets and lack of hydrological elements is solved, and the salinity timing prediction results are provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474678A_ABST
    Figure CN119474678A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a salinity time sequence prediction method and device, and the method comprises the steps: obtaining a historical observation data set, carrying out the preprocessing of the historical observation data set, and carrying out the normalization processing of the preprocessed historical observation data set; constructing a prediction model architecture, and inputting the historical observation data set into the prediction model architecture for training and testing to generate a prediction model; and collecting real-time salinity observation data, and inputting the real-time salinity observation data into the prediction model to output a salinity prediction result. A large amount of historical observation data is collected to construct and test the model, salinity observation data is collected in real time and input into the model to output a prediction result in real time, the problems that data sets are insufficient and hydrological elements are lacked in time sequence prediction in industrial application are solved, the prediction model is higher in precision, and the prediction efficiency is improved. Due to the data quality control process of preprocessing the historical observation data, the data quality is ensured, the problem of low data quality is solved, and reliable salinity time sequence prediction is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a salinity time series prediction method and device. Background Art

[0002] At present, the rise of artificial intelligence and machine learning is gradually changing human production, living, and thinking, and has a significant and far-reaching impact on economic development, social progress, and other aspects. There are many existing hydrological forecasting methods. The data-driven runoff forecast model based on machine learning has attracted much attention because it does not require an in-depth understanding of the physical mechanism of the hydrological process. Among them, the recurrent neural network RNN ​​and its variant short-term memory model are widely used. This type of neural network model will generate a set of structural units with a fixed system. These units are replicated over time and are time-invariant models. In multi-step prediction, time invariance will reduce the model's ability to learn across multiple time steps, causing the accuracy of multi-step predictions to gradually decrease.

[0003] Existing technologies still have some shortcomings in time series prediction, such as the need for a large number of data sets and low model accuracy. Existing time series prediction models are mostly meteorological forecasts, and the models for hydrological elements are accurate but have low generalization. There is a lack of data quality control when observation sites automatically detect data during monitoring. Summary of the invention

[0004] In view of the above-mentioned defects, an embodiment of the present invention discloses a salinity time series prediction method and device, which provide a high-precision model prediction for hydrological elements.

[0005] A first aspect of an embodiment of the present invention discloses a salinity time series prediction method, comprising:

[0006] Acquire a historical observation data set, preprocess the historical observation data set, and normalize the preprocessed historical observation data set, wherein the preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection;

[0007] Constructing a prediction model architecture, inputting the historical observation data set into the prediction model architecture for training and testing to generate a prediction model;

[0008] Real-time salinity observation data is collected and input into a prediction model to output a salinity prediction result.

[0009] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the time series inspection includes:

[0010] Get the observation value at any time in all time series from the historical observation data set, and set the corresponding prediction value at that time;

[0011] Compare the absolute value of the difference between the observed value and the predicted value to see if it is greater than the set threshold. If it is greater than the set threshold, the observed value is defined as abnormal.

[0012] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the clustering algorithm evaluation includes:

[0013] The historical observation data set is divided into multiple samples, and the number of samples for each sample is obtained based on the DBSCAN clustering algorithm;

[0014] Determine whether the number of samples is greater than the set density threshold. When the number of samples is greater than or equal to the set density threshold, the sample is defined as core data.

[0015] Core samples are obtained based on the core data, and non-core samples are eliminated from the historical observation data set.

[0016] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the abnormality detection includes:

[0017] Based on the Gaussian kernel function, the data center of the historical observation data set is matched with the index of the time series, and the data points in the target adjacent area of ​​the data center are focused to obtain the prior association points;

[0018] Based on the Transformer attention mechanism, the weight distribution point of any data point in the time series is focused to obtain the sequence association point; the weight distribution point is the corresponding row data of the center of the matrix corresponding to the data point;

[0019] Anomaly detection is performed on historical observation data sets based on prior correlation points and serial correlation points.

[0020] As an optional implementation, in the first aspect of the embodiment of the present invention, the performing anomaly detection on the historical observation data set according to the prior association points and the sequence association points includes:

[0021] The outlier is calculated according to the formula L(x)=E(x)+D(x), where L(x) is the outlier, E(x) is the sequence association point, D(x) is the prior association point, and x is the time series.

[0022] As an optional implementation, in the first aspect of the embodiments of the present invention, after constructing the prediction model architecture, the normalized historical observation data set is divided into a training set and a test set. Accordingly, the historical observation data set is input into the prediction model architecture for training and testing. Specifically, the training set is input into the prediction model architecture for training, and the test set is input into the trained prediction model architecture for testing.

[0023] As an optional implementation, in the first aspect of the embodiment of the present invention, the prediction model includes prediction models for multiple different time intervals, and the time intervals include 1 hour interval, 3 hour interval, 6 hour interval and 24 hour interval.

[0024] A second aspect of an embodiment of the present invention discloses a salinity time series prediction device, comprising:

[0025] Historical data processing module: used to obtain historical observation data sets, preprocess the historical observation data sets, and normalize the preprocessed historical observation data sets. The preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection.

[0026] Prediction model building module: used to build a prediction model architecture, input historical observation data sets into the prediction model architecture for training and testing to generate a prediction model;

[0027] Prediction result output module: used to collect real-time salinity observation data, input the real-time salinity observation data into the prediction model to output the salinity prediction result.

[0028] As an optional implementation, in the second aspect of the embodiment of the present invention, the time series inspection includes:

[0029] Get the observation value at any time in all time series from the historical observation data set, and set the corresponding prediction value at that time;

[0030] Compare the absolute value of the difference between the observed value and the predicted value to see if it is greater than the set threshold. If it is greater than the set threshold, the observed value is defined as abnormal.

[0031] As an optional implementation, in the second aspect of the embodiment of the present invention, the clustering algorithm evaluation includes:

[0032] The historical observation data set is divided into multiple samples, and the number of samples for each sample is obtained based on the DBSCAN clustering algorithm;

[0033] Determine whether the number of samples is greater than the set density threshold. When the number of samples is greater than or equal to the set density threshold, the sample is defined as core data.

[0034] Core samples are obtained based on the core data, and non-core samples are eliminated from the historical observation data set.

[0035] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the abnormality detection includes:

[0036] Based on the Gaussian kernel function, the data center of the historical observation data set is matched with the index of the time series, and the data points in the target adjacent area of ​​the data center are focused to obtain the prior association points;

[0037] Based on the Transformer attention mechanism, the weight distribution point of any data point in the time series is focused to obtain the sequence association point; the weight distribution point is the corresponding row data of the center of the matrix corresponding to the data point;

[0038] Anomaly detection is performed on historical observation data sets based on prior correlation points and serial correlation points.

[0039] As an optional implementation, in the second aspect of the embodiment of the present invention, the performing anomaly detection on the historical observation data set according to the prior association points and the sequence association points includes:

[0040] The outlier is calculated according to the formula L(x)=E(x)+D(x), where L(x) is the outlier, E(x) is the sequence association point, D(x) is the prior association point, and x is the time series.

[0041] As an optional implementation, in the first aspect of the embodiments of the present invention, after constructing the prediction model architecture, the normalized historical observation data set is divided into a training set and a test set. Accordingly, the historical observation data set is input into the prediction model architecture for training and testing. Specifically, the training set is input into the prediction model architecture for training, and the test set is input into the trained prediction model architecture for testing.

[0042] As an optional implementation, in the second aspect of the embodiment of the present invention, the prediction model includes prediction models for multiple different time intervals, and the time intervals include 1 hour interval, 3 hour interval, 6 hour interval and 24 hour interval.

[0043] A third aspect of an embodiment of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the salinity time series prediction method disclosed in the first aspect of the embodiment of the present invention.

[0044] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the salinity time series prediction method disclosed in the first aspect of an embodiment of the present invention.

[0045] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0046] In the embodiment of the present invention, a large amount of historical observation data is collected to build and test the model, and salinity observation data is collected in real time and input into the model to output the prediction result in real time, thereby solving the problem of insufficient data set and lack of hydrological elements in industrial application of time series prediction. The model is trained and tested by a large amount of observation data, so that the prediction model is more accurate. Due to the preprocessing of historical observation data, including the data quality control process of time series inspection, clustering algorithm evaluation and anomaly detection, the data quality is guaranteed and the problem of low data quality is solved. At the same time, the guarantee of data quality can ensure that the trained model has good convergence and provide reliable salinity time series prediction. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0048] Figure 1 It is a flow chart of a salinity time series prediction method disclosed in an embodiment of the present invention;

[0049] Figure 2 It is a structural schematic diagram of a salinity time series prediction device provided by an embodiment of the present invention;

[0050] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0052] It should be noted that the terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present invention and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0053] The embodiments of the present invention disclose a salinity time series prediction method, device, electronic device and storage medium. In the embodiments, a large amount of historical observation data is collected to build and test a model, and the salinity observation data is collected in real time and input into the model to output the prediction result in real time, thereby solving the problem of insufficient data set and lack of hydrological elements in industrial application of time series prediction. The model is trained and tested by a large amount of observation data, so that the prediction model is more accurate. Due to the preprocessing of the historical observation data, including the data quality control process of time series inspection, clustering algorithm evaluation and anomaly detection, the data quality is guaranteed and the problem of low data quality is solved. At the same time, the guarantee of data quality can ensure that the trained model has good convergence and provide reliable salinity time series prediction.

[0054] Embodiment 1

[0055] See also Figure 1 , Figure 1 It is a flow chart of a salinity time series prediction method disclosed in an embodiment of the present invention. Among them, the execution subject of the method described in the embodiment of the present invention is an execution subject composed of software and / or hardware, and the execution subject can receive relevant information by wired or / and wireless means, and can send certain instructions. Of course, it can also have certain processing functions and storage functions. The execution subject can control multiple devices, such as a remote physical server or cloud server and related software, or it can be a local host or server and related software that performs related operations on a device placed somewhere. In some scenarios, multiple storage devices can also be controlled, and the storage devices can be placed in the same place or different places as the devices. For example Figure 1 As shown, the salinity time series prediction method includes the following steps:

[0056] 101. Obtain a historical observation data set, preprocess the historical observation data set, and normalize the preprocessed historical observation data set, wherein the preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection.

[0057] Collect historical salinity-related observation data from relevant data sources, such as ocean monitoring stations, sensor networks, etc. The historical observation data values ​​usually contain a timestamp and the corresponding salinity value.

[0058] The preprocessing of the embodiment is actually a quality control process for the data, the purpose of which is to ensure the quality of the data. Among them, the time series check usually verifies whether the data is arranged in chronological order to ensure that there are no missing or repeated time points. Clustering algorithm evaluation is to evaluate the core data and eliminate non-core data. Anomaly detection is to identify and process outliers or noise in the data to avoid interfering with the training of the model.

[0059] Normalization is the process of scaling data to a standard range (such as 0 to 1), which helps the model learn and generalize better. Since salinity data may have different ranges at different locations and times, normalization ensures that all data has the same scale when the model is trained.

[0060] In the embodiment, the quality control of data is carried out from three aspects, namely time series inspection, clustering algorithm evaluation and anomaly detection. Among them, the time series inspection includes: obtaining the observation value at any time in all time series from the historical observation data set, and setting the corresponding prediction value at each time; comparing whether the absolute value of the difference between the observation value and the prediction value is greater than the set threshold, and if it is greater than the set threshold, the observation value is defined as abnormal.

[0061] When checking time series, choose a model-based method. If the difference between the observed value and the expected value of a point is too large and greater than a certain threshold, it means that the point is an outlier, such as the formula:

[0062] Among them, x t Represents the observed value of the time series at time t. Represents the expected value or model predicted value at time t. It represents the absolute difference between the observed value and the expected value, that is, the absolute error between them. τ represents a constant, that is, the expected value of the sequence at a certain point. If the difference between the new sequence value and the expected value is too large, it means that the sequence data obtained at the site is abnormal. By comparing the observed value and the predicted value (or the observed value at the previous time point), it can be checked whether the data is recorded completely in chronological order without missing or repeating time points. Setting thresholds and comparing the absolute values ​​of the differences can effectively identify abnormal observations that deviate significantly from historical trends. Through time series inspection, it can be ensured that the data input into the prediction model is accurate and reliable, thereby improving the prediction accuracy and stability of the model.

[0063] The clustering algorithm evaluation includes: dividing the historical observation data set into multiple samples, and obtaining the sample number of each sample based on the DBSCAN clustering algorithm; judging whether the sample number is greater than a set density threshold, and when the sample number is greater than or equal to the set density threshold, defining the sample as core data; obtaining core samples based on the core data, and removing non-core samples from the historical observation data set. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a relatively representative density-based clustering algorithm. Unlike partitioning and hierarchical clustering methods, it defines a cluster as the largest set of density-connected points, can divide areas with sufficiently high density into clusters, and can find clusters of arbitrary shapes in a noisy spatial database. Using the DBSCAN algorithm, a spatial clustering algorithm with good robustness can be used for data with noise (i.e., isolated values ​​or outliers). DBSCAN works well in multivariate nonlinear data. When applied, the steps are to first find the number of samples in the neighborhood of each sample. If the number is greater than or equal to MinPts, the sample is a core point; then find the density-direct and density-reachable samples of each core sample, and the sample is also a core sample, ignoring all non-core samples; finally, if the non-core sample is in the neighborhood of the core sample, the non-core sample is a boundary sample, otherwise it is noise. The core formula of DBSCAN is as follows: Definition of core point: Sample point p is a core point if N(p)≥MinPts, where N(p) represents the number of sample points in the neighborhood centered on p, and MinPts is the minimum number of neighborhood samples set in advance. The distance formula is used as a distance measure between sample points, and its formula is dist(p,q) represents the distance between sample points p and q, and the evaluation method is Euclidean distance. i and q iRespectively represent the coordinates of the sample points p and q in the i-th dimension of the data space. n represents the dimension of the data space. Sample points in the neighborhood: The formula represents the set of sample points centered on the sample point p and whose distance does not exceed ε. The size of N(p) is the number of sample points in the neighborhood. The specific formula is: N(p) = {q∈D:dist(p,q)≤ε}. N(p) represents the number of sample points in the neighborhood centered on the sample point p. q∈D represents the sample point q in the data set D. dist(p,q)≤ε means that the distance between the sample points p and q is less than or equal to the predetermined threshold ε, that is, the point in the ε neighborhood of p. The DBSCAN algorithm can automatically identify the number of clusters in the data, avoiding the subjectivity of specifying the number of clusters in advance. The algorithm can identify and process noise points (i.e., non-core data) in the data, thereby improving the accuracy and robustness of clustering. Compared with traditional clustering algorithms such as k-means, DBSCAN can find clusters of any shape, not just spherical or clumping clusters.

[0064] The anomaly detection of the embodiment includes: based on the Gaussian kernel function, the data center of the historical observation data set is matched with the index of the time series, and the data points in the target adjacent area of ​​the data center are focused to obtain the prior association points; based on the Transformer attention mechanism, the weight distribution points of any data point in the time series are focused to obtain the sequence association points; the weight distribution points are the corresponding row data of the center of the matrix corresponding to the data point; and the historical observation data set is subjected to anomaly detection according to the prior association points and the sequence association points.

[0065] In this anomaly detection, the Anomaly transformer inspection is used, which is an anomaly detection model based on Transformer. It is similar to the standard Transformer model in structure, but differs in training and detecting anomalies. The standard Transformer model may have difficulties in handling outliers because outliers may have large differences in feature space from the normal data around them. Anomaly Transformer introduces a new type of attention module-the Anomaly Attention Module. The module is divided into two branches, one branch is used to capture the temporal association (Series Association) in the sequence, and the other branch is used to capture the prior association (Prior Association). The embodiment has two associations, namely prior association and sequence association, to calculate the association difference. The prior association uses a learnable Gaussian kernel function, whose center is on the index of the corresponding time point. The unimodal characteristics of the Gaussian distribution can be used to make the data pay more attention to neighboring points. At the same time, in order to make the prior association adapt to different time series patterns, the Gaussian kernel function contains a learnable scale sigma parameter. The sequence association is obtained by the attention calculation in the standard Transformer. The sequence association of a point is the attention weight distribution of the corresponding row of the point in the attention matrix. In this way, the association in the original sequence can be better mined, allowing the model to adaptively capture the most effective association. The prior association adopts a normal distribution with a unimodal characteristic. When an anomaly occurs, the current surrounding adjacent points are very likely to be abnormal, so the prior association and the sequence association both focus on local information, so that the two associations have a small difference. When the sequence has an extreme value, there will be a big difference between the two association differences, which is applied to anomaly detection. The two association formulas of this embodiment calculate the outlier through L(x)=E(x)+D(x), where L(x) is the outlier, E(x) is the sequence association point, D(x) is the prior association point, and x is the time series. Specifically, the input time series x is divided into multiple subsequences of length N, and then each subsequence is encoded to obtain the corresponding encoding representation E(x).

[0066] By combining the Gaussian kernel function and the Transformer attention mechanism, the spatial and temporal characteristics of the data can be fully utilized to improve the accuracy and efficiency of anomaly detection; by focusing on the data points in the adjacent areas of the data center and the weight distribution points of any data points in the time series, potential anomalies can be more accurately identified; through anomaly detection, outliers in the data can be identified and processed, thereby avoiding the impact of these outliers on the prediction model and improving the robustness and generalization ability of the model. The preprocessing method of the embodiment can ensure that the data input into the prediction model is accurate and reliable, and improve the prediction accuracy and stability of the model.

[0067] 102. Construct a prediction model architecture, and input the historical observation data set into the prediction model architecture for training and testing to generate a prediction model.

[0068] In this step, a suitable model framework is selected, and the embodiment preferably uses the ForecastNet model. In the embodiment, the ForecastNet model is optimized using hyperparameter search, network structure optimization, optimizer and output strategy optimization, and is matched with a data quality control module to ensure that the data of the observation site is normal and input into the model.

[0069] There are many hyperparameters in neural network training, such as learning rate, batch size, etc. In different tasks, reasonable adjustment of hyperparameters can improve the performance of downstream tasks; some hyperparameters may even affect the convergence of the model. Use appropriate hyperparameter search methods to select the hyperparameters that have the best effect on model convergence, thereby obtaining the best model prediction effect. The definition of the hyperparameter search problem is: given a hyperparameter x, for each set of hyperparameters x i , y can be calculated on the objective function i The goal is to find the optimal hyperparameter configuration based on limited observation points, so as to maximize or minimize the objective function f(x). i is defined as: a specific hyperparameter configuration in the hyperparameter space, represented by a point in the parameter space. i is defined as: given a hyperparameter configuration x i The value of the objective function f(x) is the specific embodiment of the model performance. There are many hyperparameters in neural network training, such as learning rate, batch size, etc. Reasonable adjustment of hyperparameters can improve the performance of downstream tasks on different tasks; some hyperparameters may even affect the convergence of the model. Use appropriate hyperparameter search methods to select the hyperparameters that have the best effect on model convergence, thereby obtaining the best model prediction effect. The definition of the hyperparameter search problem is: given a hyperparameter x, for each set of hyperparameters x i , y can be calculated on the objective function i The goal is to find the optimal hyperparameter configuration based on limited observation points, so as to maximize or minimize the objective function f(x). i is defined as: a specific hyperparameter configuration in the hyperparameter space, represented by a point in the parameter space. i is defined as: given a hyperparameter configuration x i Under this condition, the value of the objective function f(x) is the specific embodiment of the model performance. The formula is, x * =argminf(x)x∈X, where x *Represents the hyperparameter combination that achieves the best value for the objective function f(x). argminf(x) represents the search for the parameters that achieve the best value for the objective function f(x). x is a specific hyperparameter combination in the parameter space X. X represents the range of the hyperparameter, that is, the parameter space to be searched.

[0070] In this hyperparameter optimization, the strategy selected is Bayesian optimization. The main process of Bayesian optimization is to generate a set of observed points, then find a point that may be an extreme value based on these observed points, add the point to the set, repeat this step until the iteration ends, and finally find the extreme point from these points as the solution to the problem. The core of the Bayesian optimization algorithm consists of two parts: the surrogate function and the constructed acquisition function. The surrogate function is to model the objective function, that is, to calculate the mean and variance of the function value at each point. This time, Gaussian process regression is used to implement it; the formula is: Y = f(x) ~ N (0, Σ), where Y represents the output value of the objective function, that is, the prediction result of the model, f(x) is the objective function, which represents the true output value corresponding to the input x, ~ N (0, Σ) means "distributed in" multivariate normal distribution (Gaussian distribution), where 0 is the mean and Σ is the covariance function. The constructed acquisition function is used to determine at which point to sample during this iteration. This acquisition function uses the optimized PI acquisition function. Since the PI acquisition function will select the function with the greatest possibility to reduce the current minimum f(x + ) value as the next query point. Specifically, the goal of the PI acquisition function is to find the point at the current minimum value f(x + ) is expected to achieve a greater increase in sampling points. + )-μ(x)) represents the difference between the known minimum value and the mean of the objective function at position x, and the denominator σ(x) represents the uncertainty of the objective function at position x. By calculating the standard normal distribution function Φ, we can get f(x + ) is expected to be exceeded. The specific formula is: Among them, PI(x) is the probability of improvement, which is the probability that the objective function f is expected to improve (improve) at a given sampling point x; P(f(x + )>f(x)) means f(x + ) is greater than f(x), Φ is the standard normal distribution function, represents the cumulative distribution function, f(x + ) is the known minimum objective function value, usually the minimum value among the historical sampling points, μ(x) is the mean prediction of the objective function at position x, and σ(x) is the standard deviation prediction of the objective function at position x.

[0071] The above formula has an obvious disadvantage: it only considers the maximum possibility to reduce the current minimum value, without using the variance information, and it is easy to fall into the local optimal solution. Therefore, an ∈ parameter is added to the original formula (∈ here can be regarded as an exploration item, which is used to guide the algorithm to explore the objective function to a greater extent.) At the beginning of sampling, ∈ is set to a large value, and as the number of sampling increases, ∈ gradually decreases, so that at the beginning of sampling, it tends to be in the place with large variance, and it is easier to jump out of the local optimal solution. The specific formula is as follows:

[0072]

[0073] The embodiment further optimizes the network structure of the model. In the original network structure, the model has only two convolutional layers, and can only obtain good convergence effects for relatively regular elements such as temperature. Therefore, two convolutional layers are added to the network of the forward propagation of the model to increase the network depth of the model, and a dropout layer is added to prevent the model from overfitting, thereby obtaining a better convergence effect.

[0074] An optimizer is an algorithm or method used to minimize the loss function during the training of a neural network. The goal of the optimizer is to adjust the parameters of the model so that the model can better fit the objective function on the training data. The default optimizer of ForecastNet is the adam optimizer, which is characterized by the ability to adaptively adjust the learning rate and momentum, so that it performs well on the training set when dealing with complex problems and nonlinear optimization problems, but it is prone to overfitting, resulting in poor performance on the test set. Adam (Adaptive Moment Estimation) is an adaptive learning rate optimization algorithm that combines the first-order moment estimation of the gradient (moving average of the gradient) and the second-order moment estimation (moving average of the square of the gradient). The specific formula is, This optimization replaces the adam optimizer with the NAdam optimizer. NAdam is more stable when dealing with problems with complex parameter ranges, can perform better gradient descent when facing sparse gradients and noise, and has better convergence effect on the test set. The formula of NAdam is The specific meanings of the parameters in the above two formulas are: t+1 Represents the parameters after t+1 iterations. θ t represents the gradient at time t, η is the learning rate, m and v are the estimates of the first-order moment and the second-order moment, which are statistics used to estimate the gradient of the objective function. Indicates v t The moving average of the square root of tis the exponentially weighted moving average of the squared gradient. After bias correction, the properties of the gradient can be better estimated, thereby accelerating the convergence process. ∈ is a smoothing term used to prevent division by zero. β1 is the momentum parameter, the decay rate of the exponentially weighted moving average of the gradient, which is usually close to 1. Refers to m t The exponentially weighted moving average of t is the exponentially weighted moving average of the gradient. g t is the gradient at the t-th iteration. is the learning rate adjustment term, which adaptively adjusts the learning rate by taking a moving average of the square root of the squared gradient. is the modified gradient using Nesterov momentum, where is the gradient of the predicted next step, is a correction term used to correct the direction of the gradient. NAdam combines the adaptive learning rate and momentum techniques in the Adam optimization algorithm and introduces the Nesterov momentum to provide more stable and excellent convergence when dealing with complex parameter ranges, sparse gradients, and noise.

[0075] The embodiment also optimizes the model output strategy. In order to alleviate the iteration error, this time, a model with four different forecast intervals will be adopted. The four forecast intervals are: 1 hour interval, 3 hour interval, 6 hour interval, and 24 hour interval. A greedy algorithm is used when calling the model so that the model maintains the minimum number of iterations when predicting salinity models at different time intervals. For example: for a 2-day salinity forecast, it is necessary to call the 24-hour salinity forecast model twice; for a 5-hour salinity forecast, it is necessary to call the 3-hour salinity forecast model twice, and then call the 1-hour interval salinity forecast model once; for a 22-hour salinity forecast, it is necessary to call the 6-hour interval salinity forecast model three times, the 3-hour salinity forecast model once, and the 1-hour interval salinity forecast model once. By using multiple different time interval models to capture different time series relationships, this salinity prediction model not only reduces the iteration error, but also avoids the consumption of training resources caused by recursive training. During model training, there is no need to monitor the conditions of factors that affect salinity changes at multiple time points to reduce iteration errors. Only the conditions of factors that affect salinity changes at a single time point need to be used to supervise model training, thereby reducing the consumption of computing resources and training time.

[0076] In an embodiment, after constructing the prediction model architecture, the normalized historical observation data set is divided into a training set and a test set. Accordingly, the historical observation data set is input into the prediction model architecture for training and testing. Specifically, the training set is input into the prediction model architecture for training, and the test set is input into the trained prediction model architecture for testing.

[0077] 103. Collect real-time salinity observation data, and input the real-time salinity observation data into a prediction model to output a salinity prediction result.

[0078] After the model training is completed, it is necessary to collect real-time salinity observation data for prediction. The real-time salinity observation data is input into the trained prediction model, and the model will output future salinity prediction results, which can be used in various applications such as marine environmental monitoring, fishery resource management, and marine ecological protection.

[0079] In fact, the embodiment also performs data quality control on the collected real-time salinity observation data, and also performs time series inspection, clustering algorithm evaluation, and anomaly detection operations. In addition, it also determines whether the collected data is real-time data. The data that has undergone data quality control is substituted into the model to predict the future salinity trend.

[0080] Embodiment 2

[0081] See also Figure 2 , Figure 2 Schematic diagram of the structure of a salinity time series prediction device disclosed in an embodiment of the present invention. Figure 2 As shown, the salinity time series prediction device may include: a historical data processing module 201, a prediction model construction module 202 and a prediction result output module 203, wherein the historical data processing module 201 is used to obtain a historical observation data set, preprocess the historical observation data set, and normalize the preprocessed historical observation data set, wherein the preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection; the prediction model construction module 202 is used to construct a prediction model architecture, input the historical observation data set into the prediction model architecture for training and testing to generate a prediction model; the prediction result output module 203 is used to collect real-time salinity observation data, input the real-time salinity observation data into the prediction model to output a salinity prediction result.

[0082] The preprocessing in the historical data processing module 201 includes time series inspection, clustering algorithm evaluation, and anomaly detection. Specifically, the time series inspection includes: obtaining the observation value at any time in all time series from the historical observation data set, and setting the prediction value corresponding to each time; comparing whether the absolute value of the difference between the observation value and the prediction value is greater than the set threshold, and when it is greater than the set threshold, defining the observation value as abnormal. The clustering algorithm evaluation includes: dividing the historical observation data set into multiple samples, and obtaining the number of samples for each sample based on the DBSCAN clustering algorithm; judging whether the number of samples is greater than the set density threshold, when the number of samples is greater than or equal to the set density threshold, defining the sample as core data; obtaining core samples based on the core data, and eliminating non-core samples from the historical observation data set. The anomaly detection includes: based on the Gaussian kernel function, the data center of the historical observation data set is matched with the index of the time series, and the data points in the target adjacent area of ​​the data center are focused to obtain the prior association points; based on the Transformer attention mechanism, the weight distribution points of any data point in the time series are focused to obtain the sequence association points; the weight distribution points are the corresponding row data of the center of the matrix corresponding to the data point; the historical observation data set is detected according to the prior association points and the sequence association points. By comparing the observed values ​​and the predicted values ​​(or the observed values ​​at the previous time point), it can be checked whether the data is recorded completely in chronological order without missing or repeating time points. Setting the threshold and comparing the absolute value of the difference can effectively identify abnormal observations that deviate significantly from the historical trend. Through the time series inspection, it can be ensured that the data input into the prediction model is accurate and reliable, thereby improving the prediction accuracy and stability of the model. The DBSCAN algorithm can automatically identify the number of clusters in the data, avoiding the subjectivity of specifying the number of clusters in advance. The algorithm can identify and process noise points (i.e., non-core data) in the data, thereby improving the accuracy and robustness of clustering. Compared with traditional clustering algorithms such as k-means, DBSCAN can find clusters of any shape, not just spherical or clumping clusters. By combining the Gaussian kernel function and the Transformer attention mechanism, the spatial and temporal characteristics of the data can be fully utilized to improve the accuracy and efficiency of anomaly detection; by focusing on the data points in the adjacent areas of the data center and the weight distribution points of any data points in the time series, potential anomalies can be more accurately identified; through anomaly detection, outliers in the data can be identified and processed, thereby avoiding the impact of these outliers on the prediction model and improving the robustness and generalization ability of the model. The preprocessing method of the embodiment can ensure that the data input into the prediction model is accurate and reliable, and improve the prediction accuracy and stability of the model.

[0083] The embodiment also includes a classification module for dividing the normalized historical observation data set into a training set and a test set, based on which the historical observation data set is input into the prediction model framework for training and testing, specifically, the training set is input into the prediction model framework for training, and the test set is input into the trained prediction model framework for testing. The prediction model includes prediction models for multiple different time intervals, and the time intervals include 1 hour interval, 3 hour interval, 6 hour interval and 24 hour interval.

[0084] Embodiment 3

[0085] See also Figure 3 , Figure 3 Schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may be a computer, a server, etc. Of course, in certain circumstances, it may also be a smart device such as a mobile phone, a tablet computer, a monitoring terminal, and an image acquisition device with processing functions. Figure 3 As shown, the electronic device may include:

[0086] A memory 301 storing executable program codes;

[0087] a processor 302 coupled to the memory 301;

[0088] The processor 302 calls the executable program code stored in the memory 301 to execute part or all of the steps in the salinity time series prediction method in the first embodiment.

[0089] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute part or all of the steps in the salinity time series prediction method in the first embodiment.

[0090] The embodiment of the present invention further discloses a computer program product, wherein when the computer program product is run on a computer, the computer is enabled to execute part or all of the steps in the salinity time series prediction method in the first embodiment.

[0091] An embodiment of the present invention further discloses an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps in the salinity time series prediction method in embodiment one.

[0092] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0093] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0094] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the method described in each embodiment of the present invention.

[0096] In the embodiments provided by the present invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0097] A person of ordinary skill in the art can understand that some or all of the steps in the various methods of the embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0098] The salinity time series prediction method, device, electronic device and storage medium disclosed in the embodiments of the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A salinity time series prediction method, characterized in that: include: Acquire a historical observation data set, preprocess the historical observation data set, and normalize the preprocessed historical observation data set, wherein the preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection; Constructing a prediction model architecture, inputting the historical observation data set into the prediction model architecture for training and testing to generate a prediction model; Real-time salinity observation data is collected and input into a prediction model to output a salinity prediction result.

2. The salinity time series prediction method according to claim 1, characterized in that: The time series inspection includes: Get the observation value at any time in all time series from the historical observation data set, and set the corresponding prediction value at that time; Compare the absolute value of the difference between the observed value and the predicted value to see if it is greater than the set threshold. If it is greater than the set threshold, the observed value is defined as abnormal.

3. The salinity time series prediction method according to claim 1, characterized in that: The clustering algorithm evaluation includes: The historical observation data set is divided into multiple samples, and the number of samples for each sample is obtained based on the DBSCAN clustering algorithm; Determine whether the number of samples is greater than the set density threshold. When the number of samples is greater than or equal to the set density threshold, define the sample as core data; Core samples are obtained based on the core data, and non-core samples are eliminated from the historical observation data set.

4. The salinity time series prediction method according to claim 1, characterized in that: The anomaly detection includes: Based on the Gaussian kernel function, the data center of the historical observation data set is matched with the index of the time series, and the data points in the target adjacent area of ​​the data center are focused to obtain the prior association points; Based on the Transformer attention mechanism, the weight distribution point of any data point in the time series is focused to obtain the sequence association point; the weight distribution point is the corresponding row data of the center of the matrix corresponding to the data point; Anomaly detection is performed on historical observation data sets based on prior correlation points and serial correlation points.

5. The salinity time series prediction method according to claim 4, characterized in that: The anomaly detection of the historical observation data set according to the prior association points and the sequence association points includes: The outlier is calculated according to the formula L(x)=E(x)+D(x), where L(x) is the outlier, E(x) is the sequence association point, D(x) is the prior association point, and x is the time series.

6. The salinity time series prediction method according to claim 1, characterized in that: After constructing the prediction model architecture, the normalized historical observation data set is divided into a training set and a test set. Correspondingly, the historical observation data set is input into the prediction model architecture for training and testing. Specifically, the training set is input into the prediction model architecture for training, and the test set is input into the trained prediction model architecture for testing.

7. The salinity time series prediction method according to claim 1, characterized in that: The prediction model includes prediction models for multiple different time intervals, and the time intervals include 1 hour interval, 3 hour interval, 6 hour interval and 24 hour interval.

8. A salinity time series prediction device, characterized in that: include: Historical data processing module: used to obtain historical observation data sets, preprocess the historical observation data sets, and normalize the preprocessed historical observation data sets. The preprocessing includes time series inspection, clustering algorithm evaluation, and anomaly detection. Prediction model building module: used to build a prediction model architecture, input historical observation data sets into the prediction model architecture for training and testing to generate a prediction model; Prediction result output module: used to collect real-time salinity observation data, input the real-time salinity observation data into the prediction model to output the salinity prediction result.

9. An electronic device, characterized in that: include: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the salinity time series prediction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the salinity time series prediction method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Estuary region light taking probability prediction model construction method and device

    CN120493558A

  • Salinity prediction method coupling Bayesian optimization deep learning network and Gaussian likelihood

    CN120722457A

  • A method for predicting salinity by coupling Bayesian optimization deep learning networks with Gaussian likelihood.

    CN120722457B

  • Water body environment pollution detection method based on marine high-precision salinity sensor

    CN120744553A

  • Maritime statistical data modeling prediction method and device

    CN121031903A