A method and system for real-time fault prediction of oil well dynamometer cards

By processing oil well sensor data streams using sliding window buffering and dynamic time warping techniques, combined with principal component analysis and online learning algorithms, the problems of data processing efficiency and time sequence alignment in oil well fault monitoring are solved, enabling real-time prediction and dynamic model updating of oil well faults.

CN121092974BActive Publication Date: 2026-03-24BENGBU SUNMOON ELECTRONICS TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing oil well fault monitoring technologies, the asynchronous processing efficiency of multi-channel sensor data streams is low, the timing alignment accuracy is insufficient in high-frequency acquisition scenarios, and model updates lag behind dynamic changes in operating conditions, making it difficult to achieve real-time prediction of oil well faults.

Method used

A sliding window buffer and dynamic time warping technique is used to process oil well sensor data streams. A hot-switching-ready model is generated through principal component analysis and online learning algorithms to achieve fault feature extraction and real-time prediction.

Benefits of technology

It enables real-time prediction of oil well faults in high-frequency data acquisition scenarios, ensuring data integrity and temporal consistency, dynamically updating the model to adapt to changes in operating conditions, and improving the confidence and real-time performance of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121092974B_ABST
    Figure CN121092974B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of oil well fault monitoring, and discloses an oil well indicator diagram real-time fault prediction method and system. The method comprises: obtaining an oil well sensor data stream, verifying data integrity through a sliding window buffer, applying a dynamic time warping algorithm to align multi-channel sensor data to generate a standardized data stream; extracting time domain features based on the data stream, comparing the features with a historical feature library after dimensionality reduction by principal component analysis to generate a feature difference index; triggering a multi-level threshold strategy according to the difference index, collecting an incremental training data set, fine-tuning the model using an elastic weight maintenance algorithm and generating a hot switching ready model; loading the model and generating a fault probability value through GPU accelerated inference, generating a timestamped early warning event; finally, analyzing the early warning protocol message edge transmission, and dynamically optimizing system resources based on logs. The present application effectively overcomes the delay problem under high-frequency data flow, significantly improving the accuracy of fault prediction and the system response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil well fault monitoring technology, and in particular to a method and system for real-time fault prediction using oil well dynamometer diagrams. Background Technology

[0002] In the field of oil well fault monitoring technology, existing solutions related to a real-time fault prediction method and system for oil well dynamometer diagrams usually rely on fixed-period data acquisition and offline feature analysis, which have limitations such as low efficiency of asynchronous processing of multi-channel sensor data streams, insufficient time alignment accuracy in high-frequency acquisition scenarios, and model updates lagging behind dynamic changes in operating conditions.

[0003] Existing methods often employ batch processing for feature extraction and pattern matching, which can lead to issues in real-time data stream scenarios, such as missing window data integrity checks, high latency in dynamic time warping calculations, and the inability to synchronously feed prediction results back to the control unit. These shortcomings make it difficult to achieve stable real-time prediction of oil well faults. Regarding the joint processing of sliding window buffering, data integrity checks, and time series alignment for multi-channel sensor real-time data streams, existing technologies generally lack a collaborative mechanism for dynamic segmentation of streaming data and online model hot-switching. This makes it difficult to form a continuous processing chain of data buffering—verification—alignment—prediction—update in high-frequency data acquisition scenarios, resulting in delayed fault feature extraction, decreased model generalization ability, and insufficient confidence in prediction results. Summary of the Invention

[0004] This invention provides a method and system for real-time fault prediction of oil well dynamometer diagrams, in order to solve the problem of how to achieve real-time fault prediction of oil wells in high-frequency data acquisition scenarios based on real-time data streams from multi-channel sensors at the oil well site, through sliding window buffering and dynamic time warping.

[0005] To address the aforementioned technical problems, this invention provides a real-time fault prediction method for oil well dynamometer cards, comprising:

[0006] The system acquires oil well sensor data streams, employs a preset 500ms time window length and 100ms sliding step size, performs sliding window buffering, and implements millisecond-level data caching through a memory circular buffer. An improved Shannon entropy is used to detect abnormal intervals in the timestamp sequence, and data integrity verification is performed. A dynamic time warping algorithm is applied to interpolate and synchronize multi-channel pressure / displacement sensor data, generating a standardized data stream.

[0007] Based on standardized data streams, time-domain features including pressure / displacement signal amplitude statistics and waveform energy are extracted; principal component analysis algorithm is applied to zero-mean and covariance decomposition of multidimensional features; principal components with cumulative contribution rates reaching a preset threshold are selected, dimensionality compression and comparison with historical feature database are performed, and feature difference index is generated.

[0008] A multi-level threshold strategy is triggered based on the feature difference index to collect incremental training datasets; the elastic weight preservation algorithm is used to constrain parameter offsets to perform model fine-tuning; and a hot-switching ready model is generated based on the hot-switching ready score.

[0009] Load the hot-swap ready model and generate fault probability values ​​through a GPU-accelerated forward inference framework; adopt a four-level early warning system and a dynamic probability trend smoothing strategy, combined with a preset dynamic threshold strategy for graded evaluation; integrate the unique event identifier and start and end timestamps to generate timestamped early warning events.

[0010] The system performs structured parsing of timestamped early warning events, generates standard early warning protocol messages, transmits them at the edge, and records them to generate complete early warning logs.

[0011] Based on the early warning log, the system collects resource load data, dynamically allocates computing resources, and generates a system health status report by feeding back the execution status.

[0012] Furthermore, time-domain features including pressure / displacement signal amplitude statistics and waveform energy are extracted, specifically including:

[0013] Multidimensional signal data corresponding to the time period are extracted from the standardized data stream and used as input for time-domain feature extraction;

[0014] Temporal feature extraction is performed through a predefined feature calculation submodule, covering a variety of temporal indicators such as statistical calculation, peak detection, mean, variance, autocorrelation coefficient, and energy distribution.

[0015] Based on the discrete signal points within the window to be processed, the sliding sub-window technique is used to segment the signal for analysis, calculate the feature parameters of each sub-window, and summarize them to form the original feature set.

[0016] During feature calculation, outlier removal and noise filtering are performed, using median filtering and adaptive threshold filtering algorithms to remove sudden abnormal data points.

[0017] Furthermore, principal component analysis (PCA) algorithms are applied to perform zero-mean normalization and covariance decomposition on the multidimensional features, specifically including:

[0018] Principal component analysis algorithm is applied to the original feature set for dimensionality compression.

[0019] The PCA algorithm first centers the input multidimensional feature data, calculates the mean of each feature dimension and subtracts the corresponding mean to obtain a zero-mean feature matrix.

[0020] Calculate the covariance matrix of the zero-mean characteristic matrix;

[0021] Based on the covariance matrix, perform eigenvalue decomposition to obtain eigenvalues ​​and their corresponding eigenvectors;

[0022] The feature vectors are arranged in descending order of their feature values. The top principal components whose cumulative contribution rate reaches a preset threshold are selected to form a set of reduced-dimensional basis vectors.

[0023] The original feature set is mapped to the reduced-dimensional basis vector space to obtain the reduced-dimensional feature vector.

[0024] Furthermore, dimensionality compression is performed and compared with the historical feature library to generate a feature difference index, specifically including:

[0025] The feature difference calculation module uses a multi-dimensional distance metric method, including Euclidean distance, Mahalanobis distance and cosine similarity, to calculate the similarity distribution between the current dimensionality-reduced feature vector and the historical feature vector;

[0026] By combining the dynamic time warping algorithm for time series, the time alignment error of the feature vector is corrected.

[0027] The difference index is normalized using statistical analysis methods to generate a uniform difference score.

[0028] Furthermore, a multi-level threshold strategy is triggered based on the feature difference index to collect incremental training datasets, specifically including:

[0029] The system has a multi-level threshold strategy that is preset to monitor and determine the feature difference index in real time, triggering the conditions for starting the online learning process.

[0030] The threshold strategy includes normal range, warning range, and fault range;

[0031] Based on the threshold determination result, execute the model update trigger logic;

[0032] The incremental training dataset consists of a standardized data stream within the current time window and the corresponding dimensionality-reduced feature vectors;

[0033] Data filtering uses a threshold-triggered mechanism to select data within time periods associated with abnormal or warning events;

[0034] The annotation process combines historical fault records of the system with expert experience to automatically or semi-automatically generate training labels.

[0035] Furthermore, the model fine-tuning is performed by using the elastic weight preservation algorithm to constrain parameter offsets, specifically including:

[0036] Model fine-tuning employs an incremental learning algorithm, which performs local updates based on the parameters of the currently deployed base model.

[0037] Incremental learning algorithms include online gradient descent, elastic weight preservation, and adaptive learning rate adjustment techniques;

[0038] To prevent overfitting and catastrophic forgetting, the model fine-tuning process integrates regularization mechanisms and historical knowledge preservation strategies.

[0039] By dynamically adjusting the batch size and using multi-threaded parallel computing, training efficiency and resource utilization are optimized.

[0040] Furthermore, a hot handover readiness model is generated based on the hot handover readiness score, specifically including:

[0041] Load the updated model parameters into the validation environment and build the corresponding model instance;

[0042] The validation environment uses a test dataset that is independent of the real-time prediction process;

[0043] Perform multi-dimensional performance evaluation on the hot-swap ready model, including prediction accuracy, recall, F1 score and inference latency metrics;

[0044] Hot-switch deployment employs seamless switching technology, supporting dynamic replacement of model versions and avoiding service interruptions.

[0045] Furthermore, the expressions for generating standardized data streams include:

[0046] Set time window length parameter With sliding step parameters Define the window trigger conditions:

[0047]

[0048] in, Index of the current window; This is the current system timestamp; This is the initial sampling timestamp; This refers to the sliding step size parameter;

[0049] when Window splitting is triggered when a preset value or time threshold is reached;

[0050] Furthermore, a timestamp sequence is extracted from the buffered data window, data integrity checks are performed, and an improved Shannon entropy is defined to detect abnormal timestamp intervals:

[0051]

[0052] in, To improve Shannon entropy; For the first The interval between adjacent timestamps; This is the sum of all timestamp intervals within the window; This represents the number of timestamps within the window. The average interval; The attenuation coefficient;

[0053] when When it is determined to be an abnormal window, among which, Entropy threshold;

[0054] Furthermore, time series alignment is performed on the valid data segments, interpolation synchronization is performed on the multi-channel pressure / displacement sensor data, a standardized data stream is generated, and the alignment error of the Dynamic Time Warping (DTW) algorithm is defined:

[0055]

[0056] in, This refers to DTW alignment error; and These are the sampled values ​​of the multi-channel pressure / displacement sensor signals. This is the penalty coefficient; Time index for different channels;

[0057] Time axis alignment is achieved by solving for the minimum cumulative distance using dynamic programming.

[0058] Furthermore, the expression for generating the hot-switching-ready model includes:

[0059] Using the characteristic difference index As input, trigger the online learning process, defining a multi-level threshold triggering strategy:

[0060]

[0061] in, This is a trigger flag; It is a feature difference index; and These are the fault and warning thresholds, respectively. These are the weighting coefficients;

[0062] when Incremental training dataset collection is triggered immediately upon arrival;

[0063] Furthermore, the elastic weight preservation algorithm is used to constrain parameter offsets on the incremental training dataset to perform model fine-tuning, and an improved elastic weight preservation loss function is defined:

[0064]

[0065] in, The loss function is EWC. Basic loss; This represents the total number of model parameters. These are the diagonal elements of the Fisher information matrix; These are the current model parameters; These are parameters for the historical model; For regularization weights;

[0066] To prevent catastrophic forgetting, the model is fine-tuned by constraining parameter offsets.

[0067] Furthermore, the updated model parameters are validated, and a hot-swap readiness score is defined:

[0068]

[0069] in, Scoring for hot-swap readiness; The number of categories in the test set; and These are the true positive rate and the true negative rate, respectively. For reasoning delay; For delay weighting coefficients;

[0070] when Hot switching is allowed at times, where, This is the hot-switching threshold.

[0071] Furthermore, a real-time fault prediction system for oil well dynamometer diagrams, applied to any of the methods described above, includes:

[0072] The data buffer module is used to acquire oil well sensor data streams and perform sliding window buffering processing.

[0073] The data verification module is used to extract the timestamp sequence from the buffer data window and perform integrity verification.

[0074] The time-series alignment module is used to perform time-series alignment operations on valid data segments;

[0075] The online learning module is used to trigger incremental training data collection based on a feature difference index threshold.

[0076] The model fine-tuning module is used to update parameters using the incremental training dataset;

[0077] The model validation module is used to perform validation set tests on the updated model parameters;

[0078] The real-time prediction module is used to load the hot-switching-ready model and output the fault classification results.

[0079] The key innovations of this invention include:

[0080] (1) By using sliding window buffering technology, the oil well sensor data stream is organized into a buffered data window to achieve efficient data stream management and real-time data processing.

[0081] (2) Use time series alignment method to generate a standardized data flow structure from the effective data segment to ensure the temporal consistency and alignment accuracy of the data.

[0082] (3) Introduce an online learning process, trigger the feature difference index threshold, obtain incremental training datasets and fine-tune the model to realize dynamic updates and hot switching of the model.

[0083] The following are its main beneficial effects:

[0084] (1) The sliding window buffering technology is applied to the oil well sensor data stream to build a stable data stream management link, effectively solving the problem of missing data integrity verification in the background technology, and is suitable for high-frequency data acquisition scenarios.

[0085] (2) The time series alignment method is applied to the effective data segment to form a standardized data flow structure, ensuring the temporal consistency of data in the processing link and effectively addressing the common problem of insufficient temporal alignment accuracy in the background technology.

[0086] (3) The online learning process is applied to the incremental training dataset, dynamically adjusts the model parameters and generates a hot-swap ready model, realizing the synchronization of model updates and operating condition changes, which is suitable for the requirements of real-time fault prediction. Attached Figure Description

[0087] Figure 1 A flowchart illustrating a real-time fault prediction method for oil well dynamometer diagrams provided in this application embodiment;

[0088] Figure 2 This is a structural block diagram of a real-time fault prediction system for oil well dynamometer diagrams provided in an embodiment of this application. Detailed Implementation

[0089] Example 1: Refer to Figure 1 This is a flowchart illustrating a real-time fault prediction method for oil well dynamometer diagrams provided in an embodiment of the present invention. The process may include at least steps S100-S600:

[0090] S100: Acquire oil well sensor data stream, use preset 500ms time window length and 100ms sliding step size parameters to perform sliding window buffering, and achieve millisecond-level data caching through memory circular buffer; use improved Shannon entropy to detect abnormal intervals for timestamp sequences and perform data integrity verification; apply dynamic time warping algorithm to perform interpolation synchronization on multi-channel pressure / displacement sensor data to generate standardized data stream;

[0091] S200: Based on standardized data streams, extract time-domain features including pressure / displacement signal amplitude statistics and waveform energy; apply principal component analysis algorithm to perform zero-mean and covariance decomposition on multidimensional features; select principal components whose cumulative contribution rate reaches a preset threshold; perform dimensionality compression and comparison with historical feature library to generate feature difference index;

[0092] S300: Trigger a multi-level threshold strategy based on the feature difference index to collect incremental training datasets; use the elastic weight preservation algorithm to constrain parameter offsets and perform model fine-tuning; generate a hot-switching ready model based on the hot-switching ready score;

[0093] S400 loads a hot-swap ready model and generates fault probability values ​​through a GPU-accelerated forward inference framework; it adopts a four-level early warning system and a dynamic probability trend smoothing strategy, combined with a preset dynamic threshold strategy for graded evaluation; it integrates the unique event identifier and start and end timestamps to generate timestamped early warning events.

[0094] S500 performs structured parsing on timestamped early warning events, generates standard early warning protocol messages, transmits them at the edge, and records them to generate complete early warning log records;

[0095] S600 collects system resource load data based on early warning logs, dynamically allocates computing resources, and generates a system health status report by feeding back the execution status.

[0096] Step S100 includes at least steps S110-S130:

[0097] S110. Acquire the oil well sensor data stream, perform sliding window buffering processing, and obtain a buffered data window;

[0098] First, real-time dynamometer data streams are continuously acquired from multi-channel sensors deployed at the oil well site. These sensors include, but are not limited to, pressure sensors, displacement sensors, and temperature sensors. The data streams are transmitted to the system in real time using a high-frequency sampling method. Specifically, the oil well sensor data streams are used as input, and the data streams enter the sliding window buffer processing unit through the buffer interface of the data receiving submodule. This buffer processing unit divides the real-time data stream using time-series sliding window technology based on preset time window length and sliding step parameters, forming continuous and overlapping buffer data windows. The division of buffer windows is based on millisecond-level time scales to ensure the timeliness and continuity of the data. Further, during the sliding window buffering process, the system performs cache management on the raw data within each buffer window, achieving millisecond-level data caching through a memory circular buffer. Specifically, a memory circular buffer is used to achieve efficient data storage and fast access, avoiding data loss and delay accumulation. The buffer data windows contain the acquired raw signals from the multi-channel sensors and their corresponding sampling timestamp information. To ensure the real-time performance of the data stream, the buffer processing unit is equipped with a trigger mechanism. When the buffer window is full or a time threshold is reached, a buffer data window is automatically generated for subsequent use by the fast feature extraction module S200. The buffer data window serves as the output field name for this step and is explicitly passed to the "to-process window" input of S210, completing the initial batch processing and caching of the data stream and ensuring the continuity and real-time performance of subsequent feature extraction.

[0099] S120. Extract the timestamp sequence from the buffer data window, perform data integrity verification, and generate a valid data segment;

[0100] Specifically, the timestamp sequence in the buffer data window is extracted and analyzed. The timestamp sequence is the time identifier corresponding to each sensor data sampling point, ensuring data time synchronization and sequential integrity. The timestamp extraction submodule constructs a continuous time series mapping by parsing the timestamp field within the buffer data window, further verifying the continuity and integrity of the time series. This data integrity verification includes, but is not limited to, detecting anomalies such as abnormal timestamp intervals, missing sampling data, duplicate data points, and transmission delays. For detected anomalies, the system employs predefined anomaly handling strategies, including discarding abnormal data segments, interpolating to compensate for missing data, or marking abnormal time periods, ensuring the data quality for subsequent processing. Furthermore, the generation of valid data segments is based on the verified timestamp sequence and corresponding sensor data. The system extracts continuous and complete time series data segments to form valid data segments that meet timing requirements. These valid data segments not only contain the corrected sensor signals but also include verification status identifiers and timestamp metadata, facilitating subsequent time series alignment and standardization. As the output field of this step, the valid data segment is explicitly passed to the "input data" interface of S130, completing data quality screening and validity assurance, ensuring the accuracy of subsequent time series processing.

[0101] S130. Perform time series alignment on the valid data segments to generate a standardized data stream;

[0102] Specifically, the valid data segments are used as input to perform time series alignment processing. This time series alignment involves uniformly mapping and synchronizing the timestamps of multi-channel sensor data, employing interpolation algorithms and timestamp resampling techniques to eliminate time offsets caused by differences in sampling frequency or transmission delays, ensuring that all sensor data correspond under a unified time reference. Furthermore, the time series alignment module uses linear interpolation, spline interpolation, and other methods to fill in data in cases of missing timestamps or abnormal intervals, ensuring the continuity and integrity of the time series. After alignment, the system reorganizes the multi-channel data according to a unified time node, forming a standardized data stream structure. This structure uses a unified data format and field definitions, including timestamp indexes, multi-dimensional sensor signals, and data integrity identifiers, facilitating efficient calls by the subsequent feature extraction module. This standardized data stream, as the output field of this step, is explicitly passed to the "input data stream" interface of S210, achieving seamless data connection across modules. Through this time series alignment and standardization processing, the system achieves unified management and efficient utilization of real-time dynamometer card data streams, meeting the real-time processing requirements of high-frequency data acquisition scenarios.

[0103] In summary, the technical effects of this step are as follows: Through the continuous implementation of steps S110 to S130, the system achieves efficient acquisition, sliding window buffering, integrity verification, and time series alignment of the real-time dynamometer data stream from the oil well sensor, and outputs a standardized data stream structure, providing a high-quality, low-latency data foundation for subsequent rapid feature extraction and model prediction.

[0104] In another embodiment, the oil well sensor data stream is acquired by receiving raw data streams from multi-channel sensors at the oil well site, including pressure, displacement, and temperature signals. The data stream is then input into a sliding window buffer processing unit, where millisecond-level data caching is achieved through a memory circular buffer. A time window length parameter is set. With sliding step parameters Formula ① defines the window triggering condition:

[0105]

[0106] in, The index of the current window, calculated as an integer, controls the window splitting sequence; This is the current system timestamp, derived from the pressure sensor sampling timestamp; This is the initial sampling timestamp, recorded when the system starts. The sliding step size parameter is configured by the sliding step size strategy table.

[0107] when Window splitting is triggered when a preset value or time threshold is reached.

[0108] Specifically, the "sampling timestamp" is extracted by the "pressure sensor" and recorded as... Extract the "step size parameter" from the "sliding step size strategy table" and record it as... Together, they constitute the window segmentation logic of Formula ①. The output buffer data window is sent to the "to-be-processed window" input terminal of S210.

[0109] Further, step S120 extracts the timestamp sequence from the buffered data window and performs data integrity verification. Formula ② defines the improved Shannon entropy for detecting abnormal timestamp intervals:

[0110]

[0111] in, To improve Shannon entropy for timestamp anomaly detection; For the first The interval between adjacent timestamps is calculated by the difference of the timestamp sequence of the displacement sensor; This is the sum of all timestamp intervals within the window; This represents the number of timestamps within the window. The average interval; This is the attenuation coefficient.

[0112] when When it is determined to be an abnormal window, among which, Entropy threshold, provided by the anomaly statistics library.

[0113] Specifically, the "timestamp interval" is extracted by the "displacement sensor" and recorded as... The "entropy threshold" is extracted from the "anomaly statistics library" and recorded as... This constitutes the verification condition for Formula ②. Output the valid data segment to the "Input Data" interface of S130.

[0114] Furthermore, step S130 performs time series alignment on the valid data segments and interpolates and synchronizes the multi-channel pressure / displacement sensor data to generate a standardized data stream. Formula ③ defines the Dynamic Time Warping (DTW) alignment error:

[0115]

[0116] in, This refers to DTW alignment error; and These are the sampled values ​​of the multi-channel pressure / displacement sensor signals. This is the penalty coefficient; The time indexes for different channels are derived from the timestamp sequence of valid data segments.

[0117] Time axis alignment is achieved by solving for the minimum cumulative distance using dynamic programming.

[0118] Specifically, the "sampled values" extracted by the "pressure sensor" and the "displacement sensor" are recorded as follows: and This forms the alignment target of Formula ③. The normalized data stream is output to the "Input Data Stream" interface of S210.

[0119] Formula references and data flow closure: ①→②→③: Window index in formula ① Used by module S110 to control the sliding window segmentation, outputting a data window to S120; S120 calculates the timestamp entropy based on formula ② based on the window data. The anomaly detection is completed, and valid data segments are selected and passed to S130; S130 uses the DTW alignment error from formula ③. Time series alignment is performed on the multi-channel data, and a standardized data stream is output to S210. This is the closed-loop link of the data preprocessing stage.

[0120] By utilizing the sliding window buffering and dynamic time warping technology in the S100 module, high-concurrency, low-latency, and standardized preprocessing of multi-channel sensor data from oil well sites is achieved, ensuring data quality and timing consistency.

[0121] Step S200 includes at least steps S210-S230:

[0122] S210. Obtain the window to be processed from the standardized data stream, extract temporal features, and generate the original feature set;

[0123] The system takes the standardized data stream structure as input, specifically, it obtains a processing window from the standardized data stream. This processing window is divided based on a sliding window buffer mechanism and contains multi-channel sensor signals within a continuous time series, covering key physical quantities such as pressure, displacement, and temperature. Specifically, multi-dimensional signal data corresponding to the time period in the standardized data stream is extracted as input for time-domain feature extraction. The time-domain feature extraction is performed through a predefined feature calculation submodule, covering various time-domain indicators such as statistical calculation, peak detection, mean, variance, autocorrelation coefficient, and energy distribution. Specifically, the feature calculation submodule, based on discrete signal points within the processing window, uses a sliding sub-window technique to segment and analyze the signal, calculates the feature parameters of each sub-window, and summarizes them to form an original feature set. During the feature calculation process, the system further performs outlier removal and noise filtering, employing median filtering and adaptive threshold filtering algorithms to remove sudden abnormal data points and improve the robustness of the features. Furthermore, the time-domain feature extraction module dynamically adjusts the calculation indicators according to the configured feature template, supporting the addition or removal of feature items, thus achieving flexible expansion of the feature set.

[0124] Furthermore, time-domain features including pressure / displacement signal amplitude statistics and waveform energy are extracted. Specifically, the original feature set contains multi-dimensional numerical features, covering amplitude statistics, waveform energy morphology, and trend change information, specifically recorded as feature name, value, and corresponding timestamp. This original feature set, as the output field of this step, is explicitly passed to the "input feature" interface of S220 for subsequent dimensionality reduction processing modules to call, enabling continuous flow and processing of feature data.

[0125] S220. Apply principal component analysis algorithm to the original feature set to compress the dimension and generate a dimension-reduced feature vector;

[0126] After receiving the original feature set as input, principal component analysis (PCA) is applied to perform zero-mean reduction and covariance decomposition on the multidimensional features. Specifically, PCA is used to compress the dimensions of the original feature set. The PCA algorithm first centers the input multidimensional feature data, calculates the mean of each feature dimension, and subtracts the corresponding mean to obtain a zero-mean feature matrix. Further, the covariance matrix of the zero-mean feature matrix is ​​calculated to reflect the correlation between features. Based on the covariance matrix, eigenvalue decomposition is performed to obtain eigenvalues ​​and corresponding eigenvectors. The eigenvectors are arranged in descending order of eigenvalue size, and the top principal components whose cumulative contribution rate reaches a preset threshold are selected to form a reduced-dimensionality basis vector set. Specifically, the original feature set is mapped to the reduced-dimensionality basis vector space to obtain the reduced-dimensionality feature vectors. The reduced-dimensionality feature vectors effectively compress the dimensions of the original features, retain the main data information and trends, and reduce redundancy and noise. Furthermore, the dimensionality reduction process integrates an automated parameter adjustment mechanism, dynamically adjusting the number of retained principal components based on the statistical characteristics of the input data to meet the feature expression requirements under different oil well operating conditions. The dimensionality-reduced feature vector contains the values ​​of each principal component after dimensionality reduction and their corresponding time indices. As an output field of this step, it is explicitly passed to the "input vector" interface of S230 for subsequent feature difference calculation module to call, realizing the effective transmission and utilization of feature data.

[0127] S230. Compare the dimensionality-reduced feature vectors with the historical feature database to generate a feature difference index;

[0128] Based on the reduced-dimensional feature vector as input, the reduced-dimensional feature vector is compared with a historical feature database to generate a feature difference index. The historical feature database contains reduced-dimensional feature vector samples accumulated during system operation, covering various oil well operating states and fault modes, serving as a reference benchmark. Specifically, the feature difference calculation module employs multi-dimensional distance measurement methods, including Euclidean distance, Mahalanobis distance, and cosine similarity, to calculate the similarity distribution between the current reduced-dimensional feature vector and historical feature vectors. Furthermore, a Dynamic Time Warping (DTW) algorithm is used to correct the time alignment error of the feature vector, improving the accuracy of the difference calculation. The difference index is normalized using statistical analysis methods to generate a unified difference score, reflecting the degree of deviation of the current feature vector from its historical normal state. The system further sets a multi-level threshold strategy to classify the difference index into three levels: normal fluctuation, abnormal warning, and potential fault. Specifically, the feature difference calculation module integrates an anomaly detection algorithm to mark abnormal indicators in real time and synchronously record the abnormal information to the log management module. The feature difference index, as the output field of this step, is explicitly passed to the "model update trigger signal" interface of S310 to drive the training trigger of the subsequent online learning model dynamic update module, thereby realizing the adaptive optimization and real-time adjustment of the model.

[0129] In summary, the technical effects of this step are as follows: Through the continuous implementation of steps S210 to S230, the system achieves temporal feature extraction, principal component analysis dimensionality reduction, and historical feature comparison of the standardized data stream, and outputs a feature difference index, providing accurate trigger signals and data support for the dynamic updating of the online learning model.

[0130] Step S300 includes at least steps S310-S330:

[0131] S310. Based on the feature difference index threshold, trigger the online learning process and obtain the incremental training dataset;

[0132] Specifically, the feature difference index output from step S230 is used as input. This feature difference index reflects the degree of deviation between the current well dynamometer data and the historical feature database. Specifically, the system presets a multi-level threshold strategy to monitor and determine the feature difference index in real time, triggering the online learning process. The threshold strategy includes normal intervals, warning intervals, and fault intervals, corresponding to different model update requirements. Further, based on the threshold determination results, the system executes model update triggering logic to determine whether to collect an incremental training dataset. The incremental training dataset consists of a standardized data stream within the current time window and corresponding dimensionality-reduced feature vectors, covering real-time signals and feature expressions from multi-channel sensors, representing the latest well operating status. Specifically, the acquisition process of the incremental training dataset includes data filtering, labeling, and formatting. Data filtering uses a threshold trigger mechanism to select time period data associated with abnormal or warning events, excluding invalid or noisy data. The labeling process combines historical fault records and expert experience to automatically or semi-automatically generate training labels reflecting the fault category and severity. The formatting process converts the dataset into a unified data format required for model training, including the input feature matrix and target output labels. Furthermore, the online learning process employs an asynchronous scheduling mechanism to avoid blocking the real-time prediction process and ensure overall system response performance. The system caches the incremental training dataset, supporting both batch training and incremental update modes. The incremental training dataset, as the output field of this step, is explicitly passed to the "training input" interface of S320 for the model fine-tuning module to call, enabling dynamic adjustment and optimization of model parameters. Through step S310, the system achieves intelligent triggering and data preparation based on real-time feature differences, supporting the continuous learning and adaptation of the online model.

[0133] S320. Use the incremental training dataset to fine-tune the model and generate updated model parameters;

[0134] Specifically, the system receives the incremental training dataset from step S310 as input. This dataset contains the dimensionality-reduced feature vectors and corresponding labels of the latest acquired multi-channel sensor signals. Specifically, the system first preprocesses the incremental training dataset, including data normalization, outlier removal, and sample balancing, to improve the quality and representativeness of the training data. Further, the model fine-tuning employs an incremental learning algorithm, performing local updates based on the currently deployed base model parameters to avoid full retraining and conserve computational resources. The incremental learning algorithm includes, but is not limited to, online gradient descent, Elastic Weight Consolidation (EWC), and adaptive learning rate adjustment techniques. Specifically, the system calculates the loss function and performs backpropagation based on the feature distribution and label information of the incremental training dataset, adjusting the model weight parameters to improve the model's adaptability to the latest data features. To prevent overfitting and catastrophic forgetting, the model fine-tuning process integrates regularization mechanisms and historical knowledge retention strategies to ensure that the model accurately captures new feature changes while retaining existing knowledge. Further, the system optimizes training efficiency and resource utilization through dynamic batch size adjustment and multi-threaded parallel computation. During training, the system continuously monitors training error, gradient changes, and model convergence, automatically adjusting training hyperparameters to ensure stability and efficiency. After training, the fine-tuned model generates updated model parameters, including the weight matrix, bias vector, and model structure configuration. These updated model parameters are serialized for easy loading and hot-swapping of subsequent models. As the output field of this step, the updated model parameters are explicitly passed to the "parameters to be loaded" interface in S330, enabling seamless transfer and dynamic replacement of model parameters. Through step S320, the system completes model fine-tuning based on incremental data, improving model real-time performance and prediction accuracy.

[0135] S330. Perform validation set testing on the updated model parameters and generate a hot-swap-ready model.

[0136] Specifically, the updated model parameters output from step S320 are used as input to perform model validation and hot-swap preparation. First, the system loads the updated model parameters into the validation environment and constructs the corresponding model instance. The validation environment uses a test dataset independent of the real-time prediction process, containing diverse oil well operating status samples and fault scenarios, covering different time periods and equipment conditions. Further, the system performs multi-dimensional performance evaluation on the hot-swap-ready model, including indicators such as prediction accuracy, recall, F1 score, and inference latency. This performance evaluation process incorporates an automated testing framework, supporting batch testing and real-time feedback. The system automatically generates diagnostic reports and triggers a rollback mechanism for abnormal outputs, overfitting signs, and performance fluctuations that occur during model testing. Specifically, if the performance indicators of the hot-swap-ready model reach or exceed those of the currently running model, the system marks it as available, preparing for hot-swap deployment. Hot-swap deployment employs seamless switching technology, supporting dynamic replacement of model versions and avoiding prediction service interruptions. The system records the version number, training time, and performance indicators of the hot-swap-ready model through a model version management module, ensuring complete tracking of the model's lifecycle. Furthermore, the system synchronizes the information of the hot-switching-ready model to step S410 of the real-time fault probability prediction module S400, using it as input to the "prediction model" to drive subsequent fault probability calculations. The hot-switching-ready model, as an output field of this step, is explicitly passed to the "prediction model" interface of S410, enabling dynamic loading and real-time application of the model. Through step S330, the system completes model verification, evaluation, and hot-switching preparation, ensuring the safety and reliability of model updates.

[0137] In another embodiment, step S310 outputs a feature difference index as described in step S230. This serves as input, triggering the online learning process. Formula ④ defines a multi-level threshold triggering strategy:

[0138]

[0139] in, This serves as a trigger flag to control the initiation of online learning; This is a feature difference index, derived from the feature extraction module; and These are the fault and warning thresholds, respectively. These are the weighting coefficients.

[0140] when Incremental training dataset collection is triggered immediately.

[0141] Specifically, the "current difference" is extracted from the "feature difference index" and recorded as... The threshold parameters are extracted from the fault case library to form the triggering condition for formula ④. The incremental training dataset is output to the "training input" interface of S320.

[0142] Furthermore, step S320 employs the Elastic Weight Preservation (EWC) algorithm to constrain parameter offsets and perform model fine-tuning on the incremental training dataset. Equation ⑤ defines the improved Elastic Weight Preservation (EWC) loss function:

[0143]

[0144] in, This is the EWC loss function, used for model fine-tuning; Basic loss; This represents the total number of model parameters. These are the diagonal elements of the Fisher information matrix; These are the current model parameters; These are parameters for the historical model; For regularization weights.

[0145] To prevent catastrophic amnesia, the model is fine-tuned by constraining parameter offsets.

[0146] Specifically, the "feature vector" is extracted from the "incremental training dataset" and then calculated. Extracted from the "historical model parameter library" The constraint terms constitute formula ⑤. The updated model parameters are output to the "Parameters to be Loaded" interface of S330.

[0147] Furthermore, step S330 verifies the updated model parameters. Formula ⑥ defines the hot-swap readiness score:

[0148]

[0149] in, Scoring for hot-swap readiness; The number of categories in the test set; and These are the true positive rate and the true negative rate, respectively. For reasoning delay; This is the delay weighting coefficient.

[0150] when Hot switching is allowed at times, where, This is the hot-switching threshold.

[0151] Specifically, the "performance metrics" are extracted from the "validation set" and denoted as... The "delay weight" is extracted from the "real-time strategy table" to form the scoring item in formula ⑥.

[0152] Formula reference and data flow closure: ④→⑤→⑥: Formula ④ Trigger S310 data acquisition and output to S320; Formula ⑤ Optimize model parameters and output to S330; Equation ⑥ Evaluate the model performance and output the results to S410.

[0153] This section summarizes the technical effects: Based on the multi-level threshold triggering mechanism and elastic weight preservation algorithm of the S300 module, an incremental learning model that can be dynamically updated and supports hot switching is constructed, realizing online adaptive optimization and security verification of the model, ensuring that the system has high accuracy and high reliability in real-time prediction, and forming a complete closed-loop system from data acquisition, preprocessing, model training to deployment.

[0154] Step S400 includes at least steps S410-S430:

[0155] S410: Load the hot-switching-ready model, input the real-time dimensionality-reduced feature vector, and generate the fault probability value;

[0156] Specifically, the hot-switch-ready model output from step S330 is used as input. This hot-switch-ready model includes validated model parameters and structural configurations that meet performance standards. Specifically, this step first loads the hot-switch-ready model into the fault probability prediction engine, completing model initialization and environment configuration to ensure the model is in a usable state. The fault probability prediction engine further receives a real-time dimensionality-reduced feature vector output from step S220. This dimensionality-reduced feature vector contains multi-dimensional feature values ​​processed by Principal Component Analysis (PCA), reflecting key time-domain information of the current well dynamometer card data. Specifically, the real-time dimensionality-reduced feature vector is used as input and passed to the loaded hot-switch-ready model for prediction calculation. The prediction calculation process employs a forward inference mechanism, based on the model's weight parameters and activation function, performing layer-by-layer mapping and nonlinear transformation on the input features to generate the corresponding fault probability distribution. Furthermore, the system designs multiple output nodes for multiple fault types, using the Softmax or Sigmoid function to convert the model output into probability values, reflecting the probability of occurrence of each fault type. To ensure real-time prediction, the fault probability prediction module employs a high-efficiency inference framework. It generates fault probability values ​​using a GPU-accelerated forward inference framework, supporting GPU acceleration and multi-threaded concurrency to reduce computational latency. The system also integrates an anomaly detection mechanism to identify abnormal fluctuations in input features and dynamically adjust the weight responses during model inference, improving prediction robustness. The fault probability value, as the output field of this step, is explicitly passed to the "decision-pending data" interface of S420 for subsequent early warning level assessment, enabling continuous flow and real-time application of model prediction results.

[0157] S420. Based on the preset dynamic threshold strategy, the fault probability value is graded and evaluated to generate an early warning level.

[0158] Specifically, using the fault probability value output from step S410 as input, and combining it with the system's preset dynamic threshold strategy, a graded assessment is performed to generate a warning level. Specifically, the dynamic threshold strategy is based on historical operating data and real-time environmental parameters, employing a multi-dimensional threshold adjustment mechanism that covers dynamic adjustment of the time window, adaptive fault probability thresholds, and multi-level warning threshold settings. The system first extracts key indicators from the fault probability value, including the maximum fault probability, fault category confidence level, and probability distribution characteristics. Further, the key indicators are compared with the corresponding dynamic thresholds to determine whether the current state is normal, warning, or fault level. The graded assessment process uses a hybrid judgment method combining a rule engine and machine learning. The rule engine sets initial thresholds based on expert experience, while the machine learning model adjusts threshold parameters based on real-time data feedback, forming a closed-loop adaptive mechanism. Specifically, the system executes a dynamic probability trend smoothing strategy to smooth the fault probability sequence within a continuous time window, eliminating misjudgments caused by occasional noise, and simultaneously calculates the probability trend change rate to assist in judging the stability and persistence of the warning level. The warning levels are divided into multiple levels, including four levels: normal level, low warning, medium warning, and high-level fault warning, each corresponding to different response measures. For each detected warning level, the system records the decision-making basis and relevant parameters of the evaluation process, forming a detailed decision log. The warning level, as an output field of this step, is explicitly transmitted to the "level signal" interface of S430 for subsequent use by the warning event generation module, effectively converting fault prediction results into warning information.

[0159] S430: Record the warning level and corresponding time window, and generate a warning event with a timestamp;

[0160] Specifically, the system uses the warning level and corresponding time window output from step S420 as input to record and generate warning events. First, the system integrates the warning level and corresponding time window information to form a structured warning data unit, including a warning level identifier, start and end timestamps, and associated fault probability values. Further, this step performs timestamp synchronization processing on the warning data unit to ensure strict correspondence between the warning event and the timeline of the oil well dynamometer card data stream, using a unified time format and time zone standard. Through the warning event management submodule, the system integrates the event's unique identifier and start and end timestamps, assigning unique identifiers to warning events and supporting the start and end times, tracking, and querying of events. During the warning event generation process, the system also integrates historical warning records and fault diagnosis information to form a rich event context, enhancing the semantic expression capability of the warning events. Further, the system performs formatting processing on the warning events, using a unified data structure definition to facilitate parsing and calling by the subsequent warning signal generation module S500. The warning events are simultaneously written to the warning log management module, including the event generation time, warning level, and related model prediction data, supporting subsequent system performance analysis and fault tracing. The timestamped early warning event is used as the output field of this step and is explicitly transmitted to the "Pending Events" interface of S510 to complete the closed-loop conversion from fault probability prediction to early warning event, ensuring the integrity and real-time transmission of early warning information.

[0161] In summary, the technical effects of this step are as follows: Through the continuous implementation of steps S410 to S430, the system achieves real-time loading and updating of the model, performs fault probability prediction based on dimensionality-reduced feature vectors, generates multi-level early warning levels by combining dynamic threshold strategies, and forms structured early warning events with timestamps, providing accurate and real-time input data for subsequent early warning signal generation and transmission.

[0162] Step 500 includes at least steps S510-S530:

[0163] S510: Parse the timestamped early warning event and generate a standard early warning protocol message;

[0164] Specifically, the timestamped warning event output in step S430 is used as input. This timestamped warning event includes a warning level identifier, start and end timestamps, and associated fault probability values. Specifically, step S510 first performs structured parsing of the timestamped warning event through the warning event parsing submodule, extracting key fields from the event, including the warning level, time window range, fault probability value, and related model prediction information. Further, the system maps the parsed warning event data to a unified data format based on a predefined standard warning protocol template. This standard warning protocol supports multiple communication protocol formats, such as MQTT (Message Queuing Telemetry Transport), HTTP (Hypertext Transfer Protocol), and a custom lightweight binary protocol, meeting the compatibility requirements of different control terminals. Specifically, the warning protocol generation module constructs a standard warning message based on the event data. The message structure includes a message header, event body, and verification field. The message header contains the message type, timestamp, and unique event identifier. The event body describes the warning level and corresponding fault probability in detail, and the verification field is used for data integrity verification. The generation process integrates message encryption and signature mechanisms, employing symmetric encryption algorithms and digital signature technology to ensure the security and tamper-proof nature of early warning messages during transmission. Furthermore, the system supports dynamically adjusting message priority and redundant transmission strategies based on the early warning level; high-level early warnings trigger multi-channel parallel broadcasting, improving transmission reliability. The standard early warning message, as an output field of this step, is explicitly passed to the "Data to be Transmitted" interface of the S520 for subsequent transmission modules to call, achieving standardized encapsulation and cross-system interaction of early warning information.

[0165] S520: Transmit standard early warning messages through edge computing nodes and generate transmission confirmation receipts;

[0166] Specifically, the standard early warning message output from step S510 is used as input and transmitted through edge computing nodes. These edge computing nodes are deployed in or near the oil well site in a distributed computing environment, possessing high-bandwidth, low-latency network access capabilities. The transmission processing includes connection management, packet assembly, network protocol stack invocation, and transmission status monitoring. The system first establishes a long or short connection with the control terminal through the connection management module, selecting TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) for data transmission based on the transmission protocol of the early warning message. Specifically, the transmission module employs an asynchronous non-blocking I / O mechanism to achieve stable transmission of high-concurrency data streams. Furthermore, the transmission process integrates a retransmission mechanism and congestion control strategy, automatically retransmitting data in case of network anomalies or packet loss, and dynamically adjusting the transmission rate to ensure the complete delivery of early warning messages. The system also supports multi-path transmission, combined with load balancing strategies among edge nodes, to improve the fault tolerance and timeliness of transmission. The transmission status monitoring module collects transmission confirmation information in real time, including ACK (Acknowledgement) responses, delay duration, and error codes, forming transmission quality indicators. In case of transmission anomalies, the system triggers an alarm and performs a backup path switch. The transmission confirmation receipt, generated by the transmission status monitoring module, includes an acknowledgment code, timestamp, and transmission status summary. As an output field of this step, it is explicitly transmitted to the "log input" interface of the S530 for subsequent merging and storage by the early warning log management module, completing the reliable transmission and status tracking of early warning information.

[0167] S530: Merge transmission confirmation receipts and early warning events to generate a complete early warning log record;

[0168] Specifically, the system uses the transmission confirmation receipt output from step S520 and the timestamped warning event input from step S510 as input to generate and manage a complete warning log. Specifically, the log merging submodule first correlates and matches the transmission confirmation receipt and the warning event, aligning the data based on the event's unique identifier and timestamp to ensure the accuracy and completeness of the log records. Furthermore, the system integrates the structured information of the warning event with the transmission confirmation status into a unified log entry, including the event generation time, warning level, fault probability, transmission confirmation code, transmission time, and anomaly marker. The log entries are stored in an efficient serialization format, supporting multiple formats such as JSON (JavaScript Object Notation) and Protocol Buffers (Protocol Buffers), facilitating log querying and analysis. The system uses a log management module to classify, store, and index the warning logs, supporting fast retrieval based on time, level, and event type. Furthermore, this module integrates log compression and archiving mechanisms, periodically cleaning up expired logs and optimizing storage resources. The warning log also includes records of abnormal events and their processing history, supporting fault tracking and system performance evaluation. The system uses a log synchronization mechanism to synchronize complete early warning logs to the remote monitoring center and security audit module in real time, achieving cross-system data sharing and security compliance. The complete early warning logs, as an output field of this step, are explicitly passed to the "System Status Input" interface of the S610, for use by the system self-check feedback adjustment module, forming a closed-loop feedback for early warning information processing and improving the overall operational transparency and responsiveness of the system.

[0169] In summary, the technical effects of this step are as follows: Through the continuous implementation of S510 to S530, the system realizes the standardized protocol message generation, multi-channel secure transmission, and merged management of complete early warning logs for timestamped early warning events, ensuring the accurate transmission, status tracking, and closed-loop feedback of early warning information, and supporting the high-reliability early warning output and system adaptive adjustment of the real-time fault prediction system for oil well dynamometer diagrams.

[0170] Step S600 includes at least steps S610-S630:

[0171] S610 monitors system resource utilization and obtains real-time CPU / memory load data;

[0172] Specifically, the complete early warning log output from step S530 is used as input. This complete early warning log includes structured information about the early warning event, transmission confirmation receipts, and system runtime log records. Specifically, the system self-check feedback adjustment module first continuously collects system resource utilization data from the complete early warning log, covering key performance indicators such as CPU (Central Processing Unit) utilization, memory utilization, and network bandwidth utilization. The resource monitoring submodule obtains multi-dimensional hardware resource status in real time by calling the performance monitoring interface provided by the operating system, using a high-precision timer to achieve a millisecond-level sampling frequency, ensuring the timeliness and accuracy of the collected data. Furthermore, the system self-check feedback adjustment module preprocesses the collected raw performance data, including outlier detection, noise filtering, and data smoothing, using moving average and exponentially weighted moving average (EWMA) algorithms to reduce the impact of sampling fluctuations on subsequent analysis. The resource monitoring submodule also combines event timestamps from the system runtime log to align resource utilization data with early warning events in time, assisting in diagnosing the correlation between system load and early warning generation. Specifically, the system self-check feedback adjustment module sets multi-level resource thresholds, defining normal, warning, and critical state ranges for different resource indicators. It supports a dynamic threshold adjustment mechanism, automatically updating threshold parameters based on historical load trends and changes in the operating environment. The threshold determination module performs continuous state evaluation based on real-time collected resource data, generating alarm signals for abnormal load conditions and writing anomaly records to the system log management unit for subsequent traceability and analysis. The real-time load data, as an output field of this step, is explicitly passed to the "adjustment basis" interface of S620 for subsequent use by the dynamic resource allocation module, enabling real-time monitoring and feedback adjustment of system resources.

[0173] S620: Dynamically allocate computing resources based on real-time load data and generate node configuration instructions;

[0174] Specifically, using the real-time load data output from step S610 as input, and combining it with the system's preset resource management strategy, the system executes dynamic allocation of computing resources and generates node configuration instructions. Specifically, the resource management strategy library contains multi-dimensional resource adjustment rules, covering CPU core allocation, memory capacity adjustment, network bandwidth configuration, and edge computing node load balancing, supporting both threshold-triggered and predictive scheduling modes. The system first performs a comprehensive evaluation of the real-time load data using multiple indicators, employing a weighted scoring mechanism combined with indicators such as CPU utilization, memory usage, and network latency to calculate the overall resource pressure index. Further, the computing resource adjustment module determines a resource adjustment plan based on the pressure index and preset strategies, specifically including increasing or decreasing the number of computing nodes, adjusting the resource quotas for each node, and optimizing task scheduling priorities. The resource adjustment process achieves elastic scaling of computing nodes by calling the virtualization management interface and container orchestration platform API. Specifically, the system supports automated node start-up and shutdown operations, and prepares resources in advance using a load prediction model to avoid response delays. The node configuration instruction generation module automatically generates a standardized configuration instruction set based on the adjustment plan. The instructions cover node identifiers, resource allocation parameters, task scheduling strategies, and network configuration parameters, using a unified instruction protocol format for easy parsing and implementation by downstream execution units. Furthermore, the system executes an instruction verification process, simulating instruction execution effects, detecting potential conflicts and resource bottlenecks, and ensuring the rationality and security of the instructions. The node configuration instructions, as output fields of this step, are explicitly passed to the S630's "Execute Instruction" interface, enabling dynamic allocation of computing resources and intelligent adjustment of system load.

[0175] S630 executes node configuration commands and returns the execution results, generating a system health status report;

[0176] Specifically, using the node configuration instructions output in step S620 as input, the system executes the distribution and execution result feedback of these instructions, generating a system health status report. Specifically, the system distributes the node configuration instructions to each computing node management unit via a distributed control bus. The management unit is responsible for parsing the instruction content and calling the local resource management interface to perform adjustments to resources such as CPU, memory, and network. During execution, the management unit continuously collects execution status information, including configuration success rate, adjustment latency, abnormal error codes, and resource usage changes, forming a detailed execution log. Furthermore, the system integrates a fault detection mechanism, triggering automatic retry and fault isolation processes for nodes that fail to execute or have abnormal responses, employing a multi-level redundancy strategy to ensure system stability. The execution result feedback is transmitted back to the system self-test feedback adjustment module in real time via a secure communication channel, combining the execution log and real-time monitoring data to form a comprehensive execution status assessment. Based on the assessment results, the system health status report generation module constructs a structured report, covering node resource configuration change records, execution success rate statistics, abnormal event descriptions, and current system load status, using a unified data format to support cross-module sharing. The system health status report, as an output field of this step, is explicitly transmitted to the "feedback input" interface of step S130 of the real-time data stream buffer module S100, forming a system self-check feedback closed loop to assist in the dynamic optimization of time series alignment and standardized data stream structure. Through this feedback mechanism, the system achieves real-time verification and continuous improvement of the effects of computing resource adjustments, enhancing the overall stability and responsiveness of the real-time fault prediction system for oil well dynamometer cards.

[0177] In summary, the technical effects of this step are as follows: Through the continuous implementation of steps S610 to S630, the system achieves comprehensive monitoring, dynamic adjustment, and execution feedback of the resources of the real-time fault prediction system for oil well dynamometer diagrams, outputs real-time load data, node configuration instructions, and system health status reports, constructs a closed-loop self-checking feedback mechanism, and improves the stability and adaptability of the system operation.

[0178] Example 2: Figure 2 A structural block diagram of a real-time fault prediction system for oil well dynamometer cards according to an embodiment of the present invention is shown. Figure 2 As shown, the structure may include:

[0179] The data buffer module 01 is used to acquire oil well sensor data streams and perform sliding window buffering. Specifically, it receives data streams from oil well sensors as input, buffers the data streams using a configured sliding window technique, and forms a buffered data window that can be used by subsequent modules. The buffered data window is continuously updated over time to ensure the real-time performance and integrity of the data. The buffered data window is then passed to the data verification module as data to be verified, while buffer records are retained for subsequent data traceability and updates.

[0180] Data verification module 02 is used to extract the timestamp sequence from the buffered data window and perform integrity verification. Specifically, it receives the buffered data window output from the data buffer module, extracts the timestamp sequence, and performs integrity verification on the timestamp sequence, including checking the continuity and validity of the timestamps. According to the preset verification strategy, a valid data segment after verification is formed. The valid data segment is passed as verification data to the timing alignment module for invocation, and the corresponding time information is registered in the verification log for subsequent modules to read.

[0181] The time-series alignment module 03 is used to perform time-series alignment operations on valid data segments. Specifically, it receives verification data from the data verification module, performs time-series alignment operations in conjunction with the system's time base, and ensures the consistency and accuracy of the data segments in the time dimension. When the alignment rules are met, aligned data segments are generated, and these aligned data segments are handed over to the online learning module as learning data. The correspondence between the aligned data segments and the time base is recorded in the alignment record.

[0182] The online learning module 04 is used to trigger incremental training data collection based on a feature difference index threshold. Specifically, it performs feature extraction and difference analysis based on the learning data from the time-series alignment module, generating a feature difference index. When the feature difference index exceeds a preset threshold, the incremental training data collection process is triggered. The incremental training data is output to the model fine-tuning module, and the trigger status is sent back to the model validation module for registration.

[0183] Model fine-tuning module 05 is used to update parameters using the incremental training dataset. Specifically, it receives incremental training data from the online learning module, performs model fine-tuning operations based on the existing model parameters, and updates the model parameters to adapt to the new data features. The updated model parameters are then provided to the model validation module as validation data, maintaining an index relationship consistent with the version.

[0184] Model validation module 06 is used to perform validation set testing on the updated model parameters. Specifically, it receives validation data from the model fine-tuning module, performs validation set testing on the updated model parameters, and ensures the model's accuracy and robustness on the new data. It then generates validation results, returns them to the real-time prediction module for model loading, and updates the validation records.

[0185] The real-time prediction module 07 is used to load the hot-switch-ready model and output the fault classification result. Specifically, it loads the model marked as hot-switch-ready from the validation results of the model validation module, uses this model to perform fault classification on the real-time input data, and outputs the fault classification result. The fault classification result is transmitted to the system's output interface, and the fault type and time information are recorded in the fault log.

Claims

1. A method for real-time fault prediction of oil well dynamometer diagrams, characterized in that, include: The oil well sensor data stream is acquired, and a sliding window buffering process is performed using a preset time window length of 500ms and a sliding step size of 100ms to obtain a buffered data window. Extract the timestamp sequence from the buffered data window, perform data integrity verification, and generate valid data segments; The valid data segments are time-series aligned to generate a standardized data stream; Specifically, it includes: Set time window length parameter With sliding step parameters Define the window trigger conditions: ; in, Index of the current window; This is the current system timestamp; This is the initial sampling timestamp; This refers to the sliding step size parameter; when Window splitting is triggered when a preset value or time threshold is reached; Furthermore, a timestamp sequence is extracted from the buffered data window, data integrity checks are performed, and an improved Shannon entropy is defined to detect abnormal timestamp intervals: ; in, To improve Shannon entropy; For the first The interval between adjacent timestamps; This is the sum of all timestamp intervals within the window; This represents the number of timestamps within the window. The average interval; The attenuation coefficient; when When it is determined to be an abnormal window, among which, Entropy threshold; Furthermore, time series alignment is performed on the valid data segments, interpolation synchronization is performed on the multi-channel pressure / displacement sensor data, a standardized data stream is generated, and the alignment error of the Dynamic Time Warping (DTW) algorithm is defined: ; in, This refers to DTW alignment error; and These are the sampled values ​​of the multi-channel pressure / displacement sensor signals. This is the penalty coefficient; Time index for different channels; Time axis alignment is achieved by solving for the minimum cumulative distance using dynamic programming. Based on standardized data streams, time-domain features including pressure / displacement signal amplitude statistics and waveform energy are extracted; principal component analysis algorithm is applied to zero-mean and covariance decomposition of multidimensional features; principal components with cumulative contribution rates reaching a preset threshold are selected, dimensionality compression and comparison with historical feature database are performed, and feature difference index is generated. A multi-level threshold strategy is triggered based on the feature difference index to collect incremental training datasets; the elastic weight preservation algorithm is used to constrain parameter offsets to perform model fine-tuning; and a hot-switching ready model is generated based on the hot-switching ready score. Load the hot-swap ready model and generate fault probability values ​​through a GPU-accelerated forward inference framework; adopt a four-level early warning system and a dynamic probability trend smoothing strategy, combined with a preset dynamic threshold strategy for graded evaluation; integrate the unique event identifier and start and end timestamps to generate timestamped early warning events. The system performs structured parsing of timestamped early warning events, generates standard early warning protocol messages, transmits them at the edge, and records them to generate complete early warning logs. Based on the early warning log, the system collects resource load data, dynamically allocates computing resources, and generates a system health status report by feeding back the execution status.

2. The method according to claim 1, characterized in that, Extracting time-domain features including pressure / displacement signal amplitude statistics and waveform energy, specifically including: Multidimensional signal data corresponding to the time period are extracted from the standardized data stream and used as input for time-domain feature extraction; Temporal feature extraction is performed through a predefined feature calculation submodule, covering a variety of temporal indicators such as statistical calculation, peak detection, mean, variance, autocorrelation coefficient, and energy distribution. Based on the discrete signal points within the window to be processed, the sliding sub-window technique is used to segment the signal for analysis, calculate the feature parameters of each sub-window, and summarize them to form the original feature set. During feature calculation, outlier removal and noise filtering are performed, using median filtering and adaptive threshold filtering algorithms to remove sudden abnormal data points.

3. The method according to claim 1, characterized in that, Principal component analysis (PCA) is applied to perform zero-mean and covariance decomposition on multidimensional features, specifically including: Principal component analysis algorithm is applied to the original feature set for dimensionality compression. The PCA algorithm first centers the input multidimensional feature data, calculates the mean of each feature dimension and subtracts the corresponding mean to obtain a zero-mean feature matrix. Calculate the covariance matrix of the zero-mean characteristic matrix; Based on the covariance matrix, perform eigenvalue decomposition to obtain eigenvalues ​​and their corresponding eigenvectors; The feature vectors are arranged in descending order of their feature values. The top principal components whose cumulative contribution rate reaches a preset threshold are selected to form a set of reduced-dimensional basis vectors. The original feature set is mapped to the reduced-dimensional basis vector space to obtain the reduced-dimensional feature vector.

4. The method according to claim 1, characterized in that, Perform dimensionality compression and compare with the historical feature library to generate a feature difference index, specifically including: The feature difference calculation module uses a multi-dimensional distance metric method, including Euclidean distance, Mahalanobis distance and cosine similarity, to calculate the similarity distribution between the current dimensionality-reduced feature vector and the historical feature vector; By combining the dynamic time warping algorithm for time series, the time alignment error of the feature vector is corrected. The difference index is normalized using statistical analysis methods to generate a uniform difference score.

5. The method according to claim 1, characterized in that, A multi-level threshold strategy is triggered based on the feature difference index to collect incremental training datasets, specifically including: The system has a multi-level threshold strategy that is preset to monitor and determine the feature difference index in real time, triggering the conditions for starting the online learning process. The threshold strategy includes normal range, warning range, and fault range; Based on the threshold determination result, execute the model update trigger logic; The incremental training dataset consists of a standardized data stream within the current time window and the corresponding dimensionality-reduced feature vectors; Data filtering uses a threshold-triggered mechanism to select data within time periods associated with abnormal or warning events; The annotation process combines historical fault records of the system with expert experience to automatically or semi-automatically generate training labels.

6. The method according to claim 1, characterized in that, The model fine-tuning is performed using the elastic weight preservation algorithm to constrain parameter offsets, specifically including: Model fine-tuning employs an incremental learning algorithm, which performs local updates based on the parameters of the currently deployed base model. Incremental learning algorithms include online gradient descent, elastic weight preservation, and adaptive learning rate adjustment techniques; To prevent overfitting and catastrophic forgetting, the model fine-tuning process integrates regularization mechanisms and historical knowledge preservation strategies. By dynamically adjusting the batch size and using multi-threaded parallel computing, training efficiency and resource utilization are optimized.

7. The method according to claim 1, characterized in that, A hot handover readiness model is generated based on the hot handover readiness score, specifically including: Load the updated model parameters into the validation environment and build the corresponding model instance; The validation environment uses a test dataset that is independent of the real-time prediction process; Perform multi-dimensional performance evaluation on the hot-swap ready model, including prediction accuracy, recall, F1 score and inference latency metrics; Hot-switch deployment employs seamless switching technology, supporting dynamic replacement of model versions and avoiding service interruptions.

8. The method according to claim 1, characterized in that, The expressions for generating a hot-switching-ready model include: Using the characteristic difference index As input, trigger the online learning process, defining a multi-level threshold triggering strategy: ; in, This is a trigger flag; It is a feature difference index; and These are the fault and warning thresholds, respectively. These are the weighting coefficients; when Incremental training dataset collection is triggered immediately upon arrival; Furthermore, the elastic weight preservation algorithm is used to constrain parameter offsets on the incremental training dataset to perform model fine-tuning, and an improved elastic weight preservation loss function is defined: ; in, The loss function is EWC. Basic loss; This represents the total number of model parameters. These are the diagonal elements of the Fisher information matrix; These are the current model parameters; These are parameters for the historical model; For regularization weights; To prevent catastrophic forgetting, the model is fine-tuned by constraining parameter offsets. Furthermore, the updated model parameters are validated, and a hot-swap readiness score is defined: ; in, Scoring for hot-swap readiness; The number of categories in the test set; and These are the true positive rate and the true negative rate, respectively. For reasoning delay; This refers to the delay weighting coefficient; when Hot switching is allowed at times, where, This is the hot-switching threshold.

9. A real-time fault prediction system for oil well dynamometer cards, applied to the method according to any one of claims 1-8, characterized in that, include: The data buffer module is used to acquire oil well sensor data streams and perform sliding window buffering processing. The data verification module is used to extract the timestamp sequence from the buffer data window and perform integrity verification. The time-series alignment module is used to perform time-series alignment operations on valid data segments; The online learning module is used to trigger incremental training data collection based on a feature difference index threshold. The model fine-tuning module is used to update parameters using the incremental training dataset; The model validation module is used to perform validation set tests on the updated model parameters; The real-time prediction module is used to load the hot-switching-ready model and output the fault classification results.

Citation Information

Patent Citations

  • Transform-based oil well abnormity determination method

    CN117033989A

  • Oil pipeline quality monitoring and evaluating method and system based on data processing

    CN120488143A