Pumping unit operation data processing system based on edge-cloud cooperation
The edge-cloud collaborative pumping unit operation data processing system solves the problems of heterogeneous data compatibility and data privacy and security in oil fields, realizes efficient and accurate pumping unit condition diagnosis, is compatible with domestic edge hardware, and meets the needs of digital operation and maintenance in oil fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (EAST CHINA)
- Filing Date
- 2026-04-23
- Publication Date
- 2026-06-23
AI Technical Summary
Existing technologies are difficult to be compatible with the heterogeneous data of new and old equipment in oil fields, lack domestically produced edge computing hardware adaptation, have insufficient data privacy and security, and traditional fault diagnosis is inefficient, failing to meet the needs of digital operation and maintenance in oil fields.
We constructed a data processing system for oil pumping unit operation based on edge-cloud collaboration. We reconstructed the MobileNetV4 and Mamba models using the MindSpore framework, adapted them to domestically produced edge hardware, and achieved data privacy protection and efficient diagnosis through federated learning, forming a closed-loop optimization of local training and cloud aggregation.
It achieves high-precision, real-time operational condition diagnosis, reduces operation and maintenance costs, meets the real-time diagnostic needs of oilfield sites, ensures data privacy and security, and is compatible with various edge devices.
Smart Images

Figure CN122065133B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of information processing methods for oil production equipment, specifically relating to an edge-cloud collaborative oil pumping unit operation data processing system. Background Technology
[0002] In oilfield production, rod pumping units are the most widely used artificial lifting equipment, and their operating conditions directly affect crude oil production and equipment safety. Dynamometer diagrams (DDTs) are key graphical representations of the pumping unit's operating status. By analyzing the correlation curves between displacement and load, various typical faults such as insufficient fluid supply, gas lock, and sand jamming can be diagnosed. However, in actual production, oil wells are widely distributed and geographically dispersed, resulting in DDTs and related production data often existing in isolated "information silos" at different well sites. On the one hand, this data is sensitive and involves core production secrets, making secure sharing across well sites and regions difficult, hindering the implementation of traditional centralized data modeling and diagnosis. On the other hand, oilfield equipment varies in age; older equipment typically only provides raw displacement-load time-series data, while newer digital equipment can directly generate DDT images. This heterogeneity in data format increases the difficulty of unified analysis and diagnosis. In addition, traditional dynamometer fault diagnosis mainly relies on manual experience analysis, which is inefficient, inconsistent, and unable to process and warn of massive amounts of data in real time, making it difficult to meet the urgent needs of digital operation and maintenance and refined management in oilfields.
[0003] To address these issues, researchers explored various technical approaches. For instance, deep learning models were used to directly classify faults in dynamometer images, and transfer learning and improved loss functions were employed to address the problem of imbalanced data samples, thereby improving the accuracy of single-well diagnosis. Other methods focused on enhancing the model's fine-grained ability to recognize morphological features in dynamometer images by constructing positive and negative sample pairs to train a similarity judgment model, thus more accurately identifying changes in operating conditions.
[0004] However, existing solutions still have significant limitations. First, most solutions focus on processing single data modalities (such as images or time-series data), failing to effectively address the heterogeneous data source issues caused by the coexistence of old and new equipment in oilfields, thus limiting their application capabilities across all scenarios. Second, although federated learning is implemented in the cloud or within a single framework, there is a lack of deep adaptation and optimization for domestically produced, lightweight edge computing hardware (such as low-power embedded devices), making it difficult to achieve a complete local training and inference loop at the resource-constrained edge of oilfields. Third, existing solutions often focus on optimizing diagnostic algorithms, failing to deeply integrate with on-site operation and maintenance processes (such as fault teaching and remote control) to form a "monitoring-diagnosis-decision-execution" operation and maintenance loop, thus the industrial applicability and practicality of the overall solution need to be strengthened. Finally, regarding data privacy protection, existing federated learning solutions mostly rely on general frameworks, lacking enhanced security mechanisms that are deeply integrated with domestic technology stacks and address the strong privacy requirements of industrial data (such as oilfield production and equipment parameters).
[0005] Therefore, how to build a high-precision, practical pumping unit condition diagnosis system that can simultaneously accommodate heterogeneous data, adapt to domestically produced edge hardware, ensure data privacy and security, and be deeply integrated with on-site operation and maintenance has become a key technical problem that urgently needs to be solved in the current digital transformation of oilfields. Summary of the Invention
[0006] The purpose of this invention is to provide a data processing system for pumping unit operation based on edge-cloud collaboration, which solves the problems of scattered dynamometer diagram data of existing pumping units, making it difficult to centrally model and diagnose, and the difficulty in unified analysis and diagnosis of data due to the different ages of the equipment.
[0007] The technical solution adopted in this invention is: a pumping unit operation data processing system based on edge-cloud collaboration, including several edge nodes deployed at different pumping unit well sites, each edge node communicating with a cloud server, the edge nodes, the cloud server communicating with a visualization platform, and the visualization platform receiving and displaying the operating condition diagnosis results;
[0008] Each edge node is used to collect local pumping unit operation data, build a local training dataset, train the local operating condition diagnostic model, obtain the local model weights, and upload them to the cloud server.
[0009] The cloud server aggregates the received local model weights to generate global model weights, which are then distributed to each edge node to update the local operating condition diagnostic model of each edge node. The diagnostic model outputs a visualized operating condition diagnostic result.
[0010] The invention is further characterized by:
[0011] The operating data of the local pumping unit includes load-displacement time series data and indicator diagram image data generated from the time series data.
[0012] After collecting the local pumping unit's operating data from each edge node, the operating data is preprocessed, including normalization, third-order spline interpolation, and median filtering for noise reduction.
[0013] The local working condition diagnostic model is a dual-input fusion diagnostic model, which includes an image diagnostic sub-model for processing dynamometer card image data and a time-series diagnostic sub-model for processing load-displacement time-series data. The image diagnostic sub-model is a MobileNetV4 model natively reconstructed based on the MindSpore framework, and the time-series diagnostic sub-model is a Mamba model natively reconstructed based on the MindSpore framework.
[0014] The method for constructing the MobileNetV4 dynamometer image diagnostic model is as follows:
[0015] (1) MindSpore native refactoring implementation
[0016] Based on the MindSpore framework, we have engineered and adapted the existing lightweight MobileNetV4 architecture: We encapsulate adaptive 2D convolution processing functions, supporting depthwise separable convolution, SAME padding, and grouped convolution modes to match the inverse residual structure computation requirements of image data processing; we replicate the general inverse bottleneck UIB processing unit, integrating depthwise convolution and channel hybridization mechanisms, and determine the optimal configuration through architecture parameter optimization to balance image data processing efficiency and spatial feature extraction integrity; we embed a lightweight MobileMQA attention processing unit, employing a multi-query shared key-value mechanism, coupled with space reduction optimization strategies, to reduce the memory usage of feature computation and improve the image data processing speed at the edge without losing image features; we build a processing structure according to the process of initial convolution processing, multi-unit stacking, adaptive pooling, and feature output, and flexibly adjust the processing volume through parameter configuration to adapt to the low computing power hardware constraints of edge nodes;
[0017] (2) Lightweight design and hardware compatibility optimization
[0018] Model compression: The "overall width scaling + structured channel pruning" strategy is adopted, which reduces the number of network channels by 40%-50%, reduces inference latency by 20%-30%, and compresses the model size to 6-8MB, effectively improving the model's running efficiency and adapting it to the Orange Pi development board NPU and HarmonyOS tablet hardware.
[0019] First, the proportion of channels in each layer is uniformly reduced from a global perspective by scaling the overall width, thus establishing the basic lightweight scale of the model. Second, a structured channel pruning algorithm is used to selectively remove redundant channels that contribute little to the extraction of working condition features, achieving a 40%-50% deep reduction in the number of network channels while maintaining the regularity of tensor operations.
[0020] Functional positioning: Focus on extracting the spatial morphological features of dynamometer diagrams, adapting to old well sites without time-series data, and accurately distinguishing the morphological differences of different working conditions;
[0021] The method for constructing the Mamba time-series diagnostic model is as follows:
[0022] (1) MindSpore cross-framework reconstruction and core implementation
[0023] Based on the MindSpore framework, the Mamba model is natively reconstructed. According to the core computational paradigm of Mamba, it is decomposed into five processing units: input projection, local convolutional modeling, Selective State Space Model (SSM) hidden state update, gated fusion, and output projection. All units are encapsulated based on MindSpore computational units and strictly follow the framework design specifications. Input projection and bi-branch splitting are achieved through fully connected layers and tensor segmentation operators, one-dimensional convolutional layers are used to extract temporal local features, basic arithmetic operators are used to update temporal state cyclically, and activation functions and element-wise multiplication operators are used to achieve feature gated fusion. Finally, normalized temporal features are output through fully connected layers to meet the long-term feature extraction requirements of pumping unit load-displacement time series data.
[0024] The specific restructuring plan is as follows:
[0025] Overall architecture decomposition and adaptation: Based on the underlying operator library, the original time series data processing logic is decoupled and reconstructed; according to the core mathematical calculation paradigm of discretized state evolution, it is decomposed into five core digital processing units: input signal mapping, local sequence feature sliding extraction, time series evolution state update, feature modulation fusion, and feature output mapping; all units are encapsulated based on the basic modular units of the underlying framework, following the "module-basic mathematical operator" electrical digital data processing design specification, avoiding highly integrated black-box computation;
[0026] Precise adaptation of core operators:
[0027] Input projection and branch splitting: The input time-series digital sequence is mapped to an extended high-dimensional data space of 2×d_inner dimension through the basic matrix transformation operator. Then, the data stream is accurately split into two parallel branches, the main feature data stream x and the modulation feature data stream z, using the tensor partitioning operator to realize the parallel processing path of the electronic digital signal.
[0028] Local convolution modeling: One-dimensional discrete sliding kernel operation logic is used to perform feature extraction within a local window range on time series data; and data format conversion is completed through tensor dimension rearrangement and transpose operators to adapt to the matrix input dimension requirements of subsequent modules, while keeping the number of time steps of the sequence unchanged;
[0029] Core of the selective state-space model:
[0030] Parameterized mathematical constraints: The time-series state transition matrix is defined as a dynamically adjustable matrix parameter, and mathematical smoothing and logarithmic stabilization are performed on it using an exponential function to ensure the numerical stability of the subsequent iterative calculation process;
[0031] Time-series state cyclic synchronization: The time-series linear scanning logic is constructed by calling basic algebraic operators such as element-wise multiplication and element-wise addition. The digital parameters such as discretized time step, driving coefficient, and output state are calculated in sequence to realize the cyclic synchronous update of the internal evolution state with time step, ensuring the continuity of feature transmission and computational efficiency of long time-series signals.
[0032] Gated fusion and output: For the modulation feature data stream z, the corresponding normalized modulation signal is generated through a nonlinear mapping function; using the element-wise multiplication operator, the modulation signal is fused and the updated backbone feature data stream x element-wise and the feature is filtered.
[0033] Finally, the fused digital features are mapped back to the standard output dimension via matrix transformation operations;
[0034] (2) Network-level reconstruction and classification architecture construction:
[0035] Based on the reconstructed underlying core processing unit described above, an end-to-end data processing pipeline for load-displacement time series is constructed:
[0036] Initial feature mapping unit: The preprocessed original load-displacement sequence is mapped into a high-dimensional feature vector using the basic linear transformation matrix to meet the requirements of subsequent high-dimensional space operations;
[0037] Multi-level deep feature parsing pipeline: It adopts a multi-level cascaded processing architecture, that is, multi-level feature processing modules are stacked. Each processing unit integrates a composite structure of "pre-set data normalization + time-series evolution calculation core + bypass direct connection transition data flow + feedforward nonlinear transformation logic + random feature mask operation". It replaces the high-complexity global correlation matrix operation with lightweight linear evolution calculation logic, which can efficiently analyze the dynamic evolution law of long time-series data while ensuring the numerical iteration stability of the multi-level cascaded architecture.
[0038] Comprehensive status assessment output unit: After the extracted time-series feature sequence is normalized by hierarchical data, it is compressed globally along the time dimension by the aggregation mean operator and the feature representative value is extracted. Finally, through the multi-level matrix mapping dimensionality reduction module, the standardized feature matching coefficients of each preset working condition type are output.
[0039] (3) Hardware adaptation and lightweight optimization:
[0040] NPU computing power adaptation: Optimize the operator scheduling order in the model based on the computing power characteristics of the Orange Pi development board's NPU, and use MindSpore's graph compilation optimization capabilities to achieve the fusion and simplification of the computation graph;
[0041] Lightweight processing: The reconstructed Mamba model is dynamically quantized with INT8, and the model size is compressed to about 11MB without significant loss of accuracy, enabling it to perform efficient local training and real-time side-end inference on edge devices.
[0042] Functional positioning: This model directly processes the raw load-displacement time series data without generating dynamometer diagrams, thus skipping redundant plotting steps and focusing on capturing the dynamic evolution trend of pumping unit operating conditions.
[0043] Edge nodes use the Orange Pi development board, HarmonyOS tablet, and PC as the core domestic hardware carriers, deploying the MindSpore Lite framework and lightweight data processing modules. They are dedicated to completing the local multi-source heterogeneous data standardization processing, feature extraction, and desensitized data weight calculation. All original dynamometer images and load-displacement time series data are stored locally for processing, and no core sensitive production data is uploaded, thus avoiding the risk of data privacy leakage from the source.
[0044] The cloud server is deployed on the Huawei Cloud platform and configured with Ascend Snt9B computing acceleration cards. The specific architecture is as follows:
[0045] Based on a cloud-based distributed data processing and weight aggregation platform, it is dedicated to global data processing task scheduling, de-identified data weight mathematical aggregation, global standardized parameter management and version iteration; at the same time, it uses the computing power of the cloud platform to complete the regularization and optimization of global parameters after aggregation, ensuring the universality and stability of global data processing parameters, and adapting to the data processing needs of various oil pumping plant well sites.
[0046] After completing local data processing and anonymization weight calculation, the edge data nodes upload the local anonymized data weights to the cloud data processing platform. The cloud data processing server performs distributed mathematical aggregation calculations on the anonymized data weights uploaded by each edge node using either the FedAvg weighted average algorithm or the FedProx constrained weighted average algorithm. Differential privacy anonymization protection is achieved through L2 norm pruning and Gaussian noise injection, blocking the reverse path of the original data and strictly safeguarding data security. The aggregated and optimized global standardized data parameters are redistributed to each edge data processing node to complete the iterative update of local processing parameters, continuously improving the data processing accuracy and operational condition discrimination stability of the entire system, forming a digital collaborative optimization closed loop of "local data processing - cloud weight aggregation - parameter synchronous update".
[0047] The system achieves edge-cloud collaborative distributed data processing through edge nodes and cloud servers. It constructs a heterogeneous collaborative parsing mechanism for MindSpore cloud-based full data processing parameters and MindSpore Lite edge-based lightweight processing parameters. This enables unified parsing, weighted aggregation, and bidirectional synchronization of data parameters across both frameworks, perfectly adapting to the differences in computing power and storage between edge and cloud devices. It breaks down barriers to cross-hardware data processing, ensuring smooth edge-cloud data collaboration, as detailed below:
[0048] (1) Implementation of core collaborative mechanism
[0049] Communication Protocol and Link: The WebSocket protocol is used to realize bidirectional real-time communication between edge nodes and the cloud side, and the TCP protocol is used to complete the transmission of model weights and training task instructions. It supports breakpoint resume and heartbeat detection to ensure the stability of the training link in weak network environment.
[0050] Weighted aggregation algorithm: It integrates FedAvg weighted average operation and FedProx constrained weighted average operation dual aggregation algorithm, and switches the appropriate algorithm according to the difference in data volume and computing power of edge nodes; it allocates aggregation weights according to the proportion of the local standardized data volume of each edge node to the total global data volume, thereby improving the sample adaptability of the global standardized parameters;
[0051] Dynamic node management: The cloud server identifies and connects newly entered edge computing devices with legitimate identities in real time through a preset communication protocol, realizing automatic discovery, dynamic addition and removal of edge nodes. When a new node is connected, the basic model and training configuration are automatically synchronized. When the edge node is offline, it does not affect the overall aggregation process, adapting to the characteristics of the scenario of dispersed well sites and fluctuating equipment status in oil pumping plants.
[0052] (2) Localization adaptation and training process
[0053] The entire process relies on domestically developed technology stacks, forming a standardized training closed loop:
[0054] Edge node initialization: The cloud server distributes the initial model to each edge node, which is the MobileNetV4 / Mamba base model trained on MindSpore, training hyperparameters, including learning rate, batch size, number of iterations, and data preprocessing rules. The edge nodes complete the training environment configuration based on the local dataset.
[0055] Local training execution: Edge nodes rely on the NPU computing power of the Orange Pi development board to complete local model training through the MindSpore Lite framework and generate model weight update volume; only weight data is retained during training, and the original production data is stored locally throughout the process to avoid the risk of privacy leakage.
[0056] Cloud server aggregation optimization: Each edge node uploads the weight update to the Huawei Cloud training platform. The cloud server completes the global weight calculation through the selected aggregation algorithm. During this process, the optimization capabilities of the Huawei Cloud platform are used to improve model performance. At the same time, the aggregated global model is lightweighted to ensure that it is adapted to edge computing power.
[0057] Model delivery and update: The cloud server delivers the optimized global lightweight model to each edge node. The nodes automatically complete the local model replacement and update, and start the next round of iterative training until the model diagnostic accuracy converges, that is, the accuracy is ≥85%.
[0058] After the edge nodes complete the global parameter iteration update, the optimized dual-input fusion diagnostic model, namely the lightweight MobileNetV4 image model and the lightweight Mamba time series model, is deployed to the Orange Pi development board or HarmonyOS tablet domestic device. Relying on the dedicated computing power of the Orange Pi NPU and the native adaptation capability of the MindSpore Lite edge inference framework, combined with the computing power optimization strategy of the local hardware of the edge, the optimized model can be deployed locally in a lightweight manner and run efficiently. Based on the deployed optimized model, the edge node device performs inference on the preprocessed pumping unit load-displacement time series data and dynamometer image data, and outputs the working condition diagnosis results, discrimination confidence and standardized treatment suggestions in milliseconds. It supports independent emergency diagnosis in the absence of network, fully meeting the practical needs of real-time diagnosis in oilfields.
[0059] (3) Data security and fault tolerance design
[0060] Privacy protection mechanism: The differential privacy scheme of "L2 norm pruning + Gaussian noise injection" is adopted to de-identify the weight update amount uploaded by each edge node, so as to prevent the original data from being inferred through the weight and meet the data security management requirements of the oilfield.
[0061] Fault tolerance mechanism design: Supports the dynamic addition or removal of training nodes to resume training after a breakpoint. After each edge node pauses training due to network interruption or hardware failure, it can automatically resume the unfinished training steps upon reconnection, avoiding the impact of abnormal weights of a single node on the global aggregation result.
[0062] The system also includes a visualization platform, which communicates and connects with edge nodes and cloud servers for:
[0063] Receive and display device status, operational diagnostic results, and distributed collaborative computing status information from cloud servers and various edge nodes;
[0064] It provides an interface for remote start / stop control and operation and maintenance scheduling commands for oil pumping unit equipment.
[0065] The edge node also includes a working condition teaching module, which stores the dynamometer characteristics, causes and handling solutions for 10 typical working conditions, and can perform emergency reasoning and result display based on the local model in a network-free environment.
[0066] The beneficial effects of this invention are:
[0067] (1) Diagnostic accuracy index
[0068] Single-model diagnostic accuracy: After federated learning collaborative training, the Mamba time series model achieves a stable diagnostic accuracy of over 85% for load-displacement sequence data, adapting to time series data scenarios of new equipment; the MobileNetV4 image model achieves a diagnostic accuracy of over 87% for dynamometer diagrams, accurately identifying 10 typical working conditions in old well sites.
[0069] Dual-input fusion diagnostic model fusion accuracy: Through a weighted fusion strategy (time-series feature weight 0.6, image feature weight 0.4), the comprehensive diagnostic accuracy for all scenarios is 87%+.
[0070] (2) Marginal reasoning performance indicators
[0071] Orange Pi development board deployment performance: After lightweight optimization, the dual-input fusion diagnostic model achieves a single-sample inference latency of ≤30ms and an inference throughput of ≥30 samples / second on the Orange Pi development board NPU.
[0072] HarmonyOS tablet emergency performance: Based on the side-end inference function of MindSpore Lite Kit, the single-sample diagnosis latency is ≤50ms in the absence of network, which meets the real-time requirements of on-site operation and maintenance personnel for emergency response.
[0073] (3) Operation and maintenance cost and efficiency optimization indicators
[0074] Reduced labor costs: Replacing the traditional manual inspection mode, a single well site can reduce the number of full-time inspection personnel by 2. Based on an annual labor cost of 180,000 yuan per well site, the annual reduction in operation and maintenance costs for 10 well sites is ≥ 1.2 million yuan.
[0075] Fault handling efficiency: Through the teaching system and real-time diagnostic function, the fault location time is shortened from the traditional 2-4 hours to within 15 minutes, reducing unplanned downtime losses.
[0076] (4) Domestic deployment and adaptation indicators
[0077] Hardware compatibility: 100% compatibility with domestically produced edge devices such as Orange Pi development board and HarmonyOS tablet.
[0078] Cost control: The deployment cost of core edge hardware (Orange Pi development board + HarmonyOS tablet) per well site is about RMB 20,000, which is lower than the cost of imported edge computing equipment and has the conditions for large-scale promotion. Attached Figure Description
[0079] Figure 1 This is an architecture diagram of the oil pumping unit operation data processing system based on edge-cloud collaboration of the present invention;
[0080] Figure 2 This is a functional flowchart of the diagnostic system of the present invention. Detailed Implementation
[0081] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0082] This invention provides a data processing system for oil pumping unit operation based on edge-cloud collaboration, such as... Figure 1 As shown, the details are as follows:
[0083] I. System Architecture: Domestically Produced Edge-Cloud Collaborative Layered Design
[0084] This system adopts a layered architecture of "multi-terminal interaction layer - distributed logic layer - local parsing layer - infrastructure layer", relying on a fully domestic software and hardware stack to achieve efficient edge-cloud collaboration and heterogeneous device adaptation, including cloud servers and several edge nodes.
[0085] Multi-terminal Interaction Layer: As the core of human-computer interaction, the interaction layer is divided into two main entry points: a web terminal and an edge device APP terminal, namely the cloud server and the edge node. The web terminal supports global visualization functions such as 3D simulation modeling of the pumping unit, real-time equipment monitoring, and operating condition early warning through a visualization management platform. The visualization management platform is developed based on Vue (Vue.js, a progressive JavaScript framework), the 3D graphics library Three.js, and EChart (Apache ECharts, an open-source visualization chart library based on JavaScript) technologies, providing a centralized management interface for managers. The edge device APP terminal is built using the HarmonyOS operating system and QT (a cross-platform C++ application development framework) technology stack, and is divided into HarmonyOS tablet application and Orange Pi development board application. It focuses on the needs of on-site operation and integrates core functions such as equipment control, operating condition teaching system, and local side-end inference (both implemented on Orange Pi and HarmonyOS terminals), adapting to the mobile operation scenarios of maintenance personnel.
[0086] Distributed Logic Layer: Located on a cloud server, the distributed logic layer serves as the core module for system digital data processing. It is responsible for building core capabilities for data collaboration and feature analysis, supporting standardized processing of multi-source heterogeneous data throughout the entire process. It comprises two core units: an edge-cloud data collaboration module and a dual-input fusion diagnostic model data feature analysis module. The edge-cloud data collaboration module uses the WebSocket full-duplex communication protocol to achieve cross-node data interaction between the cloud and the edge, and is compatible with all data processing parameters adapted to the MindSpore AI computing framework. The Lite edge-side inference engine features lightweight data processing parameters that flexibly adapt to the computing power and storage characteristics of heterogeneous hardware at the edge and in the cloud. It also supports dynamic access and offline exit of edge data processing nodes, ensuring the flexibility of data interaction. The dual-input fusion diagnostic model data feature parsing module is specifically adapted to the multi-source heterogeneous data types of pumping units. Based on the adapted and optimized MobileNetV4 architecture, it realizes spatial feature extraction of dynamometer image data, and based on the lightweight adapted Mamba architecture, it realizes evolution feature capture of load-displacement time series data. Both modules have undergone pruning quantization and operator simplification optimization, perfectly matching the lightweight deployment requirements of edge hardware and ensuring the efficiency and completeness of data feature extraction.
[0087] By leveraging edge-cloud collaborative management and control to cover both the cloud and edge sides, a collaborative data processing foundation is built to achieve closed-loop management and control of the entire process, including local data organization, cloud parameter aggregation, and global parameter synchronization. Edge nodes rely on the MindSpore / MindSpore Lite framework to complete the collection, standardized preprocessing, feature extraction, and de-identification weight calculation of local raw operating data on domestically produced edge hardware. All raw sensor data is stored on local nodes, and only de-identified weight data is uploaded, fully meeting the privacy protection requirements of core production data in oilfields. On the cloud side, a data processing and management foundation is built around the Huawei Cloud platform. With the help of Huawei Cloud computing power, global data weight aggregation and optimization are completed. Adapted and improved weighted average calculation and constrained weighted average calculation algorithms are used to achieve global fusion calculation of de-identified weights uploaded from the edge, forming a digital processing closed loop of "edge-side local data processing - cloud data weight aggregation - edge-side processing parameter update", which balances data processing efficiency and global parameter universality.
[0088] Local parsing layer: Edge nodes rely on the MindSpore / lite framework to complete local model training on edge hardware. The lite framework, combined with HarmonyOS, enables tablet-side federated learning training. All data processing is completed locally, without the need to upload raw data, fully meeting the on-site data privacy protection requirements. The cloud side uses the Huawei Cloud platform as the core to build the training base, and also uses the Huawei Cloud platform to complete model optimization. It is equipped with federated averaging and federated near-end algorithms to handle global model weight aggregation, forming a closed-loop training system of "edge training - cloud aggregation - edge update", which balances training efficiency and model performance.
[0089] Infrastructure Layer: Edge nodes and cloud servers are deployed at the infrastructure layer, using domestically produced hardware as the core carrier to provide stable computing power support; edge nodes include: Orange Pi development boards, HarmonyOS tablets (mobile terminals) and PC terminals, to meet the needs of on-site data collection and local processing; cloud servers are equipped with Ascend Snt9B computing accelerator cards and Huawei Cloud servers, providing strong computing power and reliable storage guarantees for global model training, data storage and task scheduling;
[0090] II. Functional Flow: Closed-Loop Diagnostic Full-Link
[0091] 1) Data Acquisition and Preprocessing
[0092] Edge nodes collect pumping unit operation data in real time through infrastructure, forming two types of core data sequences: load-displacement time series data generated from equipment operating parameters, and dynamometer image data generated by image acquisition equipment.
[0093] After serialization, the raw data undergoes a preprocessing workflow of median filtering for noise reduction, third-order spline interpolation, and Min-Max normalization to optimize data quality and provide high-quality data support for subsequent diagnosis.
[0094] 2) Real-time operational status diagnosis of edge nodes
[0095] The preprocessed standardized data is input to the local dual-input fusion diagnostic model digital processing module at the edge, completing feature analysis and working condition discrimination. The local digital processing module is adapted to the edge hardware computing power for lightweight deployment. The overall architecture is a dual-parallel mode: including a spatial morphology processing submodule (image diagnostic sub-model) dedicated to processing dynamometer diagram image data and a time-series evolution processing submodule (time-series diagnostic sub-model) dedicated to processing load-displacement time-series data. The spatial morphology processing submodule is a lightweight processing module of MobileNetV4 natively adapted to the MindSpore framework, and the time-series evolution processing submodule is a lightweight processing module of Mamba natively reconstructed based on the MindSpore framework.
[0096] The dynamometer image data is fed into the MobileNetV4 module to extract spatial morphological features, while the load-displacement time series data is sent to the Mamba module to capture the dynamic evolution trend of the working condition. After parallel operation and feature fusion of the two modules, the working condition type, discrimination confidence level and corresponding standardized handling suggestions are directly output, realizing millisecond-level real-time working condition discrimination. In offline environments with no network or weak network, the local side data processing function of the edge device APP can still independently complete the working condition discrimination operation, fully ensuring the practical needs of emergency response in the oilfield.
[0097] 3) Cloud server federated collaborative optimization
[0098] After completing local data processing and anonymization weight calculation, the edge data processing nodes upload the local anonymized data weights to the cloud data processing platform. The cloud data processing server performs distributed mathematical aggregation calculations on the anonymized data weights uploaded by each edge node using either the FedAvg weighted average algorithm or the FedProx constrained weighted average algorithm. Differential privacy anonymization protection is achieved through L2 norm pruning and Gaussian noise injection, blocking the reverse path of the original data and strictly safeguarding data security. The aggregated and optimized global standardized data parameters are redistributed to each edge data processing node to complete the iterative update of local processing parameters, continuously improving the data processing accuracy and operational condition discrimination stability of the entire system, forming a digital collaborative optimization closed loop of "local data processing - cloud weight aggregation - parameter synchronous update".
[0099] 4) Edge model deployment and real-time inference diagnostics
[0100] After completing the global parameter iteration update, the edge device deploys the optimized dual-input fusion diagnostic model architecture (lightweight MobileNetV4 image model and lightweight Mamba time series model) to domestic edge devices such as Orange Pi development boards and HarmonyOS tablets. Relying on the dedicated computing power of Orange Pi NPU and the native adaptation capability of the MindSpore Lite edge inference framework, combined with the computing power optimization strategy of the edge device's local hardware, the optimized model is deployed locally in a lightweight manner and runs efficiently. Based on the deployed optimized model, the edge device performs inference on the preprocessed pumping unit load-displacement time series data and dynamometer image data, and outputs the working condition diagnosis results, discrimination confidence and standardized treatment suggestions in milliseconds. It supports independent emergency diagnosis in the absence of network, fully meeting the practical needs of real-time diagnosis in oilfields.
[0101] 5) Global visual management
[0102] All diagnostic results, equipment status, distributed collaborative computing status and other key information are synchronized to the visualization dashboard in real time;
[0103] The large visualization screen can display core information such as node network topology, real-time operating condition warnings, and fault ranking. Managers can monitor the status of the entire well site through the screen and remotely issue instructions for equipment start-up and shutdown, operation and maintenance scheduling through the APP; forming a complete closed loop of "monitoring-diagnosis-optimization-control-execution" to fully support oilfield operation and maintenance decision-making.
[0104] III. Introduction to Key Technology Modules (such as dataset selection and data processing, model implementation, training, inference, deployment, etc.)
[0105] Dynamometer data preprocessing
[0106] 1) Dataset selection and construction
[0107] Data Source: The baseline sample set is based on real pumping unit load-displacement time series data and indicator diagram image data collected from a digital project of an oilfield. It covers 10 typical operating conditions, including normal operation, insufficient fluid supply, gas influence, gas lock, upper collision pump, lower collision pump, slow valve closure, plunger dislodgement, floating valve leakage, and sand influence. The sample closely matches the actual production scenario of the oilfield, and the data has strong authenticity and industry adaptability. It can directly provide reliable sample support for subsequent standardized data processing and digital identification of operating conditions.
[0108] Data cleaning: The original benchmark sample set contains 30,228 JPG format dynamometer diagram images and corresponding CSV format load displacement time series data. After deduplication screening, removal of duplicate copies, and removal of abnormal and incomplete samples, 21,895 valid standardized samples were finally selected and retained to eliminate data redundancy and disorder and ensure the accuracy of subsequent data processing.
[0109] Splitting strategy: Randomly split the training set (15322 samples) and the test set (6573 samples) in a 7:3 ratio.
[0110] Core preprocessing workflow:
[0111] 1) Normalization processing
[0112] The Min-Max normalization method is adopted to uniformly map the load and displacement data of the dynamometer card to the [0, 1] interval, eliminating the influence of dimensional differences and numerical range fluctuations of different pumping units. The calculation formulas are displacement x*=(x-x_min) / (x_max-x_min) and load y*=(y-y_min) / (y_max-y_min). At the same time, the dynamometer card image is converted into a single-channel grayscale image, and the pixel values are normalized to the [0.0, 1.0] interval, which simplifies the data volume, optimizes the data transmission efficiency, and improves the smoothness of data processing at the edge.
[0113] 2) Third-order spline interpolation
[0114] To address the issue of inconsistent sampling frequencies and different acquisition cycles among heterogeneous sensing devices leading to differences in the number of sampling points in time-series data, a third-order spline interpolation algorithm is employed to resample the load-displacement time-series sequences. This process unifies and expands all time-series sequences to 240 standardized sampling points, achieving forced alignment of data dimensions. Compared to linear interpolation, this algorithm can more accurately fit the true shape of the load-displacement curve, fully preserve the core features of the working condition, and meet the batch input requirements for parallel data processing at the edge and cloud.
[0115] 3) Median filtering noise reduction
[0116] A median filtering digital processing algorithm with a window length of n=3 is used to perform nonlinear smoothing and denoising on the load-displacement time series signal. This algorithm specifically filters out sawtooth-like random jitter noise and isolated noise points generated during signal acquisition and transmission. At the same time, it fully preserves the sharp extreme value characteristics of typical working conditions such as upper and lower impact pumps, avoiding the loss of working condition characteristics due to over-filtering. This lays a solid data foundation for subsequent data feature extraction and digital identification of working conditions.
[0117] Oil pumping unit indicator diagram operating condition diagnostic model (local operating condition diagnostic model)
[0118] 1) Image Diagnostic Sub-model: MobileNetV4 Dysfunction Diagram Image Diagnostic Model
[0119] (1) MindSpore native refactoring implementation
[0120] To address the data processing requirements of pumping unit dynamometer diagrams, the existing lightweight MobileNetV4 architecture was engineered and adapted based on the MindSpore framework, and customized to fit the characteristics of oilfield data and the computing power of edge hardware.
[0121] Core Adaptation Operations: It encapsulates adaptive 2D convolution processing functions, supporting depthwise separable convolution, SAME padding, and grouped convolution modes to match the inverse residual structure operation requirements of image data processing; it replicates the general inverse bottleneck UIB processing unit, integrating depthwise convolution and channel hybridization mechanisms, and determines the optimal configuration through architecture parameter optimization to balance image data processing efficiency and spatial feature extraction integrity; it embeds a lightweight MobileMQA attention processing unit, employing a multi-query shared key-value mechanism combined with space reduction optimization strategies to reduce feature computation memory usage, improving edge image data processing speed without sacrificing image features; and it builds a processing structure based on the flow of initial convolution processing, multi-unit stacking, adaptive pooling, and feature output, flexibly adjusting the processing volume through parameter configuration to adapt to low-computing-power hardware constraints at the edge.
[0122] (2) Lightweight design and hardware compatibility optimization
[0123] Model compression: The "overall width scaling + structured channel pruning" strategy is adopted to reduce the number of network channels by 43%, reduce inference latency by 21.7%, and compress the model size to 8MB, which is compatible with the Orange Pi development board NPU.
[0124] Functional positioning: Focused on extracting spatial morphological features of dynamometer diagrams, adapting to old well sites without time-series data, accurately distinguishing morphological differences under different working conditions, with a diagnostic accuracy rate of over 87%.
[0125] 2) Mamba time-series diagnostic model
[0126] (1) MindSpore cross-framework reconstruction and core implementation
[0127] To adapt to the deployment environment of the domestic MindSpore + Ascend / Orange Pi system, cross-framework adaptation modifications were made to the existing Mamba time-series processing architecture to ensure that the core logic of time-series data processing is consistent with the native architecture. The electro-digital data processing flow was implemented based on MindSpore native operators, and optimizations were made for the domestic framework and hardware adaptation.
[0128] The existing Mamba architecture is decomposed into five processing units: input projection, local convolutional feature modeling, selective state space latent state update, gated feature fusion, and output projection. All units are encapsulated based on MindSpore computing units and strictly follow the framework design specifications. Input projection and bi-branch splitting are achieved through fully connected layers and tensor segmentation operators, temporal local feature extraction is achieved through one-dimensional convolutional layers, temporal state cyclic updates are achieved through basic arithmetic operators, and feature gating fusion is achieved through activation functions and element-wise multiplication operators. Finally, normalized temporal features are output through fully connected layers, which is suitable for the long-term temporal feature extraction requirements of pumping unit load-displacement time series data.
[0129] The specific restructuring plan is as follows:
[0130] Overall architecture decomposition and adaptation: Based on the underlying operator library, the original time series data processing logic is decoupled and reconstructed; according to the core mathematical calculation paradigm of discretized state evolution, it is decomposed into five core digital processing units: input signal mapping, local sequence feature sliding extraction, time series evolution state update, feature modulation fusion, and feature output mapping; all units are encapsulated based on the basic modular units of the underlying framework, following the electrical digital data processing design specification of "module-basic mathematical operator", avoiding highly integrated black box calculations.
[0131] Precise adaptation of core operators:
[0132] Input projection and branch splitting: The input time-series digital sequence is mapped to an extended high-dimensional data space of 2×d_inner dimension through the basic matrix transformation operator. Then, the data stream is accurately split into two parallel branches, the main feature data stream x and the modulation feature data stream z, using the tensor partitioning operator to realize the parallel processing path of the electronic digital signal.
[0133] Local convolution modeling: One-dimensional discrete sliding kernel operation logic is used to perform feature extraction within a local window range on time series data; and data format conversion is completed through tensor dimension rearrangement and transpose operators to adapt to the matrix input dimension requirements of subsequent modules, while keeping the number of time steps of the sequence unchanged.
[0134] The core of the Selective State-Space Model (SSM):
[0135] Parameterized mathematical constraints: The time-series state transition matrix is defined as a dynamically adjustable matrix parameter, and mathematical smoothing and logarithmic stabilization are performed on it using an exponential function to ensure the numerical stability of the subsequent iterative calculation process.
[0136] Timing state cyclic synchronization: The timing linear scan logic is constructed by calling basic algebraic operators such as element-wise multiplication and element-wise addition. It sequentially completes the calculation of digital parameters such as discretized time step, driving coefficient, and output state, realizing the cyclic synchronous update of internal evolution state with time step, ensuring the continuity of feature transmission and computational efficiency of long-time-series signals.
[0137] Gated fusion and output: For the modulation feature data stream z, the corresponding normalized modulation signal is generated through a nonlinear mapping function; using the element-wise multiplication operator, the modulation signal is fused and the updated backbone feature data stream x element-wise and the feature is filtered.
[0138] Finally, the fused digital features are mapped back to the standard output dimension via matrix transformation operations.
[0139] (2) Network-level reconstruction and classification architecture construction
[0140] Based on the reconstructed underlying core processing unit described above, an end-to-end data processing pipeline for load-displacement time series is constructed:
[0141] Initial feature mapping unit: The preprocessed original load-displacement sequence is mapped into a high-dimensional feature vector using the basic linear transformation matrix to meet the requirements of subsequent high-dimensional space operations.
[0142] Multi-level deep feature parsing pipeline: It adopts a multi-level cascaded processing architecture (i.e., multi-layer feature processing modules stacked); each processing unit integrates a composite structure of "pre-set data normalization + time-series evolution calculation core + bypass direct connection transition data flow + feedforward nonlinear transformation logic + random feature mask operation", replacing the high-complexity global correlation matrix operation with lightweight linear evolution calculation logic, while ensuring the numerical iteration stability of the multi-level cascaded architecture and efficiently parsing the dynamic evolution law of long time-series data.
[0143] The comprehensive state assessment output unit: After the extracted time-series feature sequence is normalized by hierarchical data, the global data compression and feature representative value extraction are performed along the time dimension by the aggregation mean operator. Finally, the standardized feature matching coefficients of each preset working condition type are output through the multi-level matrix mapping dimensionality reduction module.
[0144] (3) Hardware adaptation and lightweight optimization
[0145] NPU Computing Power Adaptation: Targeting the computing power characteristics of the Orange Pi development board's NPU (Neural Processing Unit), the operator scheduling order in the model is optimized, and MindSpore's graph compilation optimization capabilities are utilized to achieve the fusion and simplification of the computation graph.
[0146] Lightweight processing: The reconstructed Mamba model is dynamically quantized with INT8 (INT8, 8-bit Integer) to compress the model size to about 11MB without significant loss of accuracy, enabling it to perform efficient local training and real-time side-end inference on edge devices.
[0147] Functional positioning: This model directly processes the raw load-displacement time series data without generating dynamometer diagrams, thus skipping redundant drawing steps and focusing on capturing the dynamic evolution trend of pumping unit operating conditions; it complements the MobileNetV4 image model to form a dual-input fusion diagnostic model diagnostic system, comprehensively covering different data scenarios of new and old equipment in the oilfield.
[0148] Edge-cloud collaborative distributed data processing and edge infrastructure deployment
[0149] 1) Overall architecture design
[0150] Edge processing nodes: Using the Orange Pi development board (edge computing node), HarmonyOS tablet, and PC as the core domestic hardware carriers, the MindSpore Lite framework and lightweight data processing module (.ms format) are deployed to complete the local multi-source heterogeneous data standardization processing, feature extraction, and de-identified data weight calculation. All original dynamometer images and load-displacement time series data are stored locally for processing, and no core sensitive production data is uploaded, thus avoiding the risk of data privacy leakage from the source.
[0151] The core cloud server platform is a distributed data processing and weight aggregation platform built on the cloud. It is dedicated to global data processing task scheduling, de-identified data weight mathematical aggregation, global standardized parameter management and version iteration. At the same time, it uses the computing power of the cloud platform to complete the regularization and optimization of global parameters after aggregation, ensuring the universality and stability of global data processing parameters and adapting to the data processing needs of various oil pumping plant well sites.
[0152] Cross-framework adaptation layer: Constructs a heterogeneous collaborative parsing mechanism for the full data processing parameters of MindSpore cloud and the lightweight processing parameters of MindSpore Lite edge, realizing unified parsing, weighted aggregation and bidirectional synchronization of data parameters under the two frameworks, perfectly adapting to the differences in computing power and storage between edge and cloud heterogeneous devices, breaking down the barriers to cross-hardware data processing, and ensuring smooth edge-cloud data collaboration.
[0153] 2) Implementation of core collaborative mechanisms
[0154] Communication Protocol and Link: The WebSocket full-duplex communication protocol is used to realize bidirectional real-time data interaction between edge nodes and the cloud. The TCP transmission control protocol is used to complete the stable transmission of de-identified data weights and data processing instructions. It supports breakpoint resume and link heartbeat detection to ensure smooth data transmission links in oilfield weak network and remote well site environments, eliminate data packet loss and transmission interruption problems, and ensure the stability of edge-cloud data collaboration.
[0155] Weighted aggregation algorithm: It integrates FedAvg weighted average operation and FedProx constrained weighted average operation dual aggregation algorithm, which can switch the appropriate algorithm according to the data processing volume and hardware computing power differences of each edge node; it allocates aggregation weights according to the proportion of the local standardized data volume of each edge node to the total global data volume, improves the sample adaptability of the global standardized parameters, solves the convergence fluctuation problem of a single aggregation algorithm in heterogeneous edge node scenarios, and ensures that the parameter aggregation process is stable and efficient.
[0156] Dynamic node management: Supports automatic discovery, dynamic access and offline exit of edge data processing nodes. When a new node joins the network, it automatically synchronizes global basic data processing parameters and preprocessing rules. When a node goes offline and disconnects, it does not affect the global weight aggregation process. It is perfectly adapted to the actual scenario characteristics of oil pumping plant well sites being distributed in a dispersed manner and the status of field equipment fluctuating.
[0157] 3) Domestic adaptation and training process
[0158] The entire process relies on domestically developed technology stacks, forming a standardized training closed loop:
[0159] Edge node initialization: The cloud server sends the initial model (based on the MindSpore-trained MobileNetV4 / Mamba basic model), training hyperparameters (learning rate, batch size, number of iterations) and data preprocessing rules to each edge node. The edge nodes complete the training environment configuration based on the local dataset.
[0160] Local training execution: Edge nodes rely on the NPU computing power of the Orange Pi development board and use the MindSpore lightweight framework to complete the standardized preprocessing, feature extraction and de-identification weight calculation of local multi-source heterogeneous data, and generate local data weight update volume; during the processing, only the de-identified weight data is transmitted, and the original production data and equipment operating parameters are retained locally throughout the process, completely blocking the core data leakage path.
[0161] Cloud server aggregation optimization: Each edge node uploads the de-identified weight update to the cloud data processing base. The cloud server completes the global standardized parameter calculation through the selected aggregation algorithm. During this process, the computing power of the cloud platform is used to optimize the parameter regularity and improve global adaptability. At the same time, the global parameters are lightweighted (channel pruning, precision quantization) to compress the parameter size and ensure adaptability to various low computing power hardware constraints of edge terminals.
[0162] Model updates: The cloud server distributes the optimized global lightweight standardized parameters to each edge node. Each node automatically replaces and updates its local processing parameters, starts the next data processing cycle, and continues until the data processing accuracy stabilizes and converges (operating condition discrimination fit ≥85%), meeting the oilfield on-site operation and maintenance management standards.
[0163] 4) Data security and fault tolerance design
[0164] Privacy protection mechanism: A differential privacy scheme of "L2 norm pruning + Gaussian noise injection" is adopted to de-identify the weight update amount uploaded by each edge node, so as to prevent the original data from being inferred through the weight and meet the data security management requirements of the oilfield.
[0165] Fault tolerance mechanism design: Supports the dynamic addition or removal of training nodes to resume training after a breakpoint. After each edge node pauses training due to network interruption or hardware failure, it can automatically resume the unfinished training steps upon reconnection, avoiding the impact of abnormal weights of a single node on the global aggregation result.
[0166] Edge node infrastructure deployment
[0167] This module's core functionality involves the lightweight deployment of a dual-input fusion diagnostic model architecture on two types of domestically produced edge terminals: the Orange Pi development board, serving as the core edge computing node, runs on the Ubuntu operating system and the MindSpore 2.7 framework, handling local training and real-time inference computation of the dual-input fusion diagnostic model and providing computing power support for the local training process; and the HarmonyOS tablet, using the HarmonyOS 5 system, develops applications using the ArkTS language and integrates the MindSpore Lite Kit (Ascend Inference Framework Service), focusing on implementing on-site practical functions such as side-end model inference and operational teaching system operation, meeting the emergency diagnostic and maintenance assistance needs in network-free environments.
[0168] The technical solution of the present invention will be further illustrated below through embodiments.
[0169] Example 1
[0170] The edge-cloud collaborative pumping unit operation data processing system includes several edge nodes deployed at different pumping unit well sites. Each edge node is connected to a cloud server. The edge nodes, cloud server, and visualization platform are connected to a visualization platform, which receives and displays the operating condition diagnosis results.
[0171] Each edge node is used to collect local pumping unit operation data, build a local training dataset, train the local operating condition diagnostic model, obtain the local model weights, and upload them to the cloud server.
[0172] The cloud server aggregates the received local model weights to generate global model weights, which are then distributed to each edge node to update the local operating condition diagnostic model of each edge node. The diagnostic model outputs a visualized operating condition diagnostic result.
[0173] Example 2
[0174] Based on Example 1:
[0175] The operational data includes load-displacement time-series data and indicator diagram image data generated from the time-series data.
[0176] After collecting the local pumping unit's operating data from each edge node, the operating data is preprocessed, including normalization, third-order spline interpolation, and median filtering for noise reduction.
[0177] Preprocessing includes:
[0178] Normalization: The Min-Max normalization method is used to map the load and displacement data of the dynamometer diagram to the [0, 1] interval, thereby eliminating the influence of dimensional differences and numerical range fluctuations of different specifications of pumping units;
[0179] The calculation formula is: displacement: x*=(x-x_min) / (x_max-x_min);
[0180] Load: y*=(y-y_min) / (y_max-y_min); At the same time, the dynamometer image is converted to grayscale to a single channel, and the pixel values are normalized to [0.0, 1.0] to speed up model training;
[0181] Third-order spline interpolation:
[0182] To address the issue of inconsistent sampling frequency among different sensors leading to differences in the number of sampling points, third-order spline interpolation was used to uniformly expand all load displacement sequences to 240 sampling points. Compared to linear interpolation, this method better fits the true shape of the curve, ensures uniform data length, and meets the requirements for batch model input.
[0183] Median filtering for noise reduction:
[0184] A median filtering algorithm with a window size of n=3 is used to perform nonlinear smoothing on the sawtooth jitter noise of the load displacement curve. This effectively eliminates isolated noise points while preserving the sharp features of conditions such as pump impact, avoiding feature loss due to over-filtering and ensuring the accuracy of subsequent feature extraction.
[0185] Example 3
[0186] Based on Example 2: The local working condition diagnostic model is a dual-input fusion diagnostic model architecture, including an image diagnostic sub-model for processing dynamometer card image data and a time-series diagnostic sub-model for processing load-displacement time-series data. The image diagnostic sub-model is a MobileNetV4 model natively reconstructed based on the MindSpore framework, and the time-series diagnostic sub-model is a Mamba model natively reconstructed based on the MindSpore framework.
[0187] The method for constructing the MobileNetV4 dynamometer image diagnostic model is as follows:
[0188] (1) MindSpore native refactoring implementation
[0189] Based on the MindSpore framework, we have engineered and adapted the existing lightweight MobileNetV4 architecture: We encapsulate adaptive 2D convolution processing functions, supporting depthwise separable convolution, SAME padding, and grouped convolution modes to match the inverse residual structure computation requirements of image data processing; we replicate the general inverse bottleneck UIB processing unit, integrating depthwise convolution and channel hybridization mechanisms, and determine the optimal configuration through architecture parameter optimization to balance image data processing efficiency and spatial feature extraction integrity; we embed a lightweight MobileMQA attention processing unit, employing a multi-query shared key-value mechanism, coupled with space reduction optimization strategies, to reduce the memory usage of feature computation and improve the image data processing speed at the edge without losing image features; we build a processing structure according to the process of initial convolution processing, multi-unit stacking, adaptive pooling, and feature output, and flexibly adjust the processing volume through parameter configuration to adapt to the low computing power hardware constraints of edge nodes;
[0190] (2) Lightweight design and hardware compatibility optimization
[0191] Model compression: The "overall width scaling + structured channel pruning" strategy is adopted, which reduces the number of network channels by 40%-50%, reduces inference latency by 20%-30%, and compresses the model size to 6-8MB, effectively improving the model's running efficiency and adapting it to the Orange Pi development board NPU and HarmonyOS tablet hardware.
[0192] First, the proportion of channels in each layer is uniformly reduced from a global perspective by scaling the overall width, thus establishing the basic lightweight scale of the model. Second, a structured channel pruning algorithm is used to selectively remove redundant channels that contribute little to the extraction of working condition features, achieving a 40%-50% deep reduction in the number of network channels while maintaining the regularity of tensor operations.
[0193] Functional positioning: Focus on extracting the spatial morphological features of dynamometer diagrams, adapting to old well sites without time-series data, and accurately distinguishing the morphological differences of different working conditions;
[0194] The method for constructing the Mamba time-series diagnostic model is as follows:
[0195] (1) MindSpore cross-framework reconstruction and core implementation
[0196] Based on the MindSpore framework, the Mamba model is natively reconstructed. According to the core computational paradigm of Mamba, it is decomposed into five processing units: input projection, local convolutional modeling, Selective State Space Model (SSM) hidden state update, gated fusion, and output projection. All units are encapsulated based on MindSpore computational units and strictly follow the framework design specifications. Input projection and bi-branch splitting are achieved through fully connected layers and tensor segmentation operators, one-dimensional convolutional layers are used to extract temporal local features, basic arithmetic operators are used to update temporal state cyclically, and activation functions and element-wise multiplication operators are used to achieve feature gated fusion. Finally, normalized temporal features are output through fully connected layers to meet the long-term feature extraction requirements of pumping unit load-displacement time series data.
[0197] The specific restructuring plan is as follows:
[0198] Overall architecture decomposition and adaptation: Based on the underlying operator library, the original time series data processing logic is decoupled and reconstructed; according to the core mathematical calculation paradigm of discretized state evolution, it is decomposed into five core digital processing units: input signal mapping, local sequence feature sliding extraction, time series evolution state update, feature modulation fusion, and feature output mapping; all units are encapsulated based on the basic modular units of the underlying framework, following the "module-basic mathematical operator" electrical digital data processing design specification, avoiding highly integrated black-box computation;
[0199] Precise adaptation of core operators:
[0200] Input projection and branch splitting: The input time-series digital sequence is mapped to an extended high-dimensional data space of 2×d_inner dimension through the basic matrix transformation operator. Then, the data stream is accurately split into two parallel branches, the main feature data stream x and the modulation feature data stream z, using the tensor partitioning operator to realize the parallel processing path of the electronic digital signal.
[0201] Local convolution modeling: One-dimensional discrete sliding kernel operation logic is used to perform feature extraction within a local window range on time series data; and data format conversion is completed through tensor dimension rearrangement and transpose operators to adapt to the matrix input dimension requirements of subsequent modules, while keeping the number of time steps of the sequence unchanged;
[0202] Core of the selective state-space model:
[0203] Parameterized mathematical constraints: The time-series state transition matrix is defined as a dynamically adjustable matrix parameter, and mathematical smoothing and logarithmic stabilization are performed on it using an exponential function to ensure the numerical stability of the subsequent iterative calculation process;
[0204] Time-series state cyclic synchronization: The time-series linear scanning logic is constructed by calling basic algebraic operators such as element-wise multiplication and element-wise addition. The digital parameters such as discretized time step, driving coefficient, and output state are calculated in sequence to realize the cyclic synchronous update of the internal evolution state with time step, ensuring the continuity of feature transmission and computational efficiency of long time-series signals.
[0205] Gated fusion and output: For the modulation feature data stream z, the corresponding normalized modulation signal is generated through a nonlinear mapping function; using the element-wise multiplication operator, the modulation signal is fused and the updated backbone feature data stream x element-wise and the feature is filtered.
[0206] Finally, the fused digital features are mapped back to the standard output dimension via matrix transformation operations;
[0207] (2) Network-level reconstruction and classification architecture construction:
[0208] Based on the reconstructed underlying core processing unit described above, an end-to-end data processing pipeline for load-displacement time series is constructed:
[0209] Initial feature mapping unit: The preprocessed original load-displacement sequence is mapped into a high-dimensional feature vector using the basic linear transformation matrix to meet the requirements of subsequent high-dimensional space operations;
[0210] Multi-level deep feature parsing pipeline: It adopts a multi-level cascaded processing architecture, that is, multi-level feature processing modules are stacked. Each processing unit integrates a composite structure of "pre-set data normalization + time-series evolution calculation core + bypass direct connection transition data flow + feedforward nonlinear transformation logic + random feature mask operation". It replaces the high-complexity global correlation matrix operation with lightweight linear evolution calculation logic, which can efficiently analyze the dynamic evolution law of long time-series data while ensuring the numerical iteration stability of the multi-level cascaded architecture.
[0211] Comprehensive status assessment output unit: After the extracted time-series feature sequence is normalized by hierarchical data, it is compressed globally along the time dimension by the aggregation mean operator and the feature representative value is extracted. Finally, through the multi-level matrix mapping dimensionality reduction module, the standardized feature matching coefficients of each preset working condition type are output.
[0212] (3) Hardware adaptation and lightweight optimization:
[0213] NPU computing power adaptation: Optimize the operator scheduling order in the model based on the computing power characteristics of the Orange Pi development board's NPU, and use MindSpore's graph compilation optimization capabilities to achieve the fusion and simplification of the computation graph;
[0214] Lightweight processing: The reconstructed Mamba model is dynamically quantized with INT8, and the model size is compressed to about 11MB without significant loss of accuracy, enabling it to perform efficient local training and real-time side-end inference on edge devices.
[0215] Functional positioning: This model directly processes the raw load-displacement time series data without generating dynamometer diagrams, thus skipping redundant plotting steps and focusing on capturing the dynamic evolution trend of pumping unit operating conditions.
[0216] Example 4
[0217] Based on Example 3:
[0218] Edge nodes use the Orange Pi development board, HarmonyOS tablet, and PC as the core domestic hardware carriers, deploying the MindSpore Lite framework and lightweight data processing modules. They are dedicated to completing the local multi-source heterogeneous data standardization processing, feature extraction, and desensitized data weight calculation. All original dynamometer images and load-displacement time series data are stored locally for processing, and no core sensitive production data is uploaded, thus avoiding the risk of data privacy leakage from the source.
[0219] The cloud server is deployed on the Huawei Cloud platform and configured with Ascend Snt9B computing acceleration cards. The specific architecture is as follows:
[0220] Based on a cloud-based distributed data processing and weight aggregation platform, it is dedicated to global data processing task scheduling, de-identified data weight mathematical aggregation, global standardized parameter management and version iteration; at the same time, it uses the computing power of the cloud platform to complete the regularization and optimization of global parameters after aggregation, ensuring the universality and stability of global data processing parameters, and adapting to the data processing needs of various oil pumping plant well sites.
[0221] After completing local data processing and anonymization weight calculation, the edge data nodes upload the local anonymized data weights to the cloud data processing platform. The cloud data processing server performs distributed mathematical aggregation calculations on the anonymized data weights uploaded by each edge node using either the FedAvg weighted average algorithm or the FedProx constrained weighted average algorithm. Differential privacy anonymization protection is achieved through L2 norm pruning and Gaussian noise injection, blocking the reverse path of the original data and strictly safeguarding data security. The aggregated and optimized global standardized data parameters are redistributed to each edge data processing node to complete the iterative update of local processing parameters, continuously improving the data processing accuracy and operational condition discrimination stability of the entire system, forming a digital collaborative optimization closed loop of "local data processing - cloud weight aggregation - parameter synchronous update".
[0222] Example 5
[0223] Building upon Example 4: The system achieves edge-cloud collaborative distributed data processing through edge nodes and cloud servers. It constructs a heterogeneous collaborative parsing mechanism for MindSpore cloud-based full data processing parameters and MindSpore Lite edge-based lightweight processing parameters. This enables unified parsing, weighted aggregation, and bidirectional synchronization of data parameters across both frameworks, perfectly adapting to the differences in computing power and storage between edge and cloud heterogeneous devices. It breaks down barriers to cross-hardware data processing, ensuring smooth edge-cloud data collaboration, as detailed below:
[0224] (1) Implementation of core collaborative mechanism
[0225] Communication Protocol and Link: The WebSocket protocol is used to realize bidirectional real-time communication between edge nodes and the cloud side, and the TCP protocol is used to complete the transmission of model weights and training task instructions. It supports breakpoint resume and heartbeat detection to ensure the stability of the training link in weak network environment.
[0226] Weighted aggregation algorithm: It integrates FedAvg weighted average operation and FedProx constrained weighted average operation dual aggregation algorithm, and switches the appropriate algorithm according to the difference in data volume and computing power of edge nodes; it allocates aggregation weights according to the proportion of the local standardized data volume of each edge node to the total global data volume, thereby improving the sample adaptability of the global standardized parameters;
[0227] Dynamic node management: The cloud server identifies and connects newly entered edge computing devices with legitimate identities in real time through a preset communication protocol, realizing automatic discovery, dynamic addition and removal of edge nodes. When a new node is connected, the basic model and training configuration are automatically synchronized. When the edge node is offline, it does not affect the overall aggregation process, adapting to the characteristics of the scenario of dispersed well sites and fluctuating equipment status in oil pumping plants.
[0228] (2) Localization adaptation and training process
[0229] The entire process relies on domestically developed technology stacks, forming a standardized training closed loop:
[0230] Edge node initialization: The cloud server distributes the initial model to each edge node, which is the MobileNetV4 / Mamba base model trained on MindSpore, training hyperparameters, including learning rate, batch size, number of iterations, and data preprocessing rules. The edge nodes complete the training environment configuration based on the local dataset.
[0231] Local training execution: Edge nodes rely on the NPU computing power of the Orange Pi development board to complete local model training through the MindSpore Lite framework and generate model weight update volume; only weight data is retained during training, and the original production data is stored locally throughout the process to avoid the risk of privacy leakage.
[0232] Cloud server aggregation optimization: Each edge node uploads the weight update to the Huawei Cloud training platform. The cloud server completes the global weight calculation through the selected aggregation algorithm. During this process, the optimization capabilities of the Huawei Cloud platform are used to improve model performance. At the same time, the aggregated global model is lightweighted to ensure that it is adapted to edge computing power.
[0233] Model delivery and update: The cloud server delivers the optimized global lightweight model to each edge node. The nodes automatically complete the local model replacement and update, and start the next round of iterative training until the model diagnostic accuracy converges, that is, the accuracy is ≥85%.
[0234] After the edge nodes complete the global parameter iteration update, the optimized dual-input fusion diagnostic model, namely the lightweight MobileNetV4 image model and the lightweight Mamba time series model, is deployed to the Orange Pi development board or HarmonyOS tablet domestic device. Relying on the dedicated computing power of the Orange Pi NPU and the native adaptation capability of the MindSpore Lite edge inference framework, combined with the computing power optimization strategy of the local hardware of the edge, the optimized model can be deployed locally in a lightweight manner and run efficiently. Based on the deployed optimized model, the edge node device performs inference on the preprocessed pumping unit load-displacement time series data and dynamometer image data, and outputs the working condition diagnosis results, discrimination confidence and standardized treatment suggestions in milliseconds. It supports independent emergency diagnosis in the absence of network, fully meeting the practical needs of real-time diagnosis in oilfields.
[0235] (3) Data security and fault tolerance design
[0236] Privacy protection mechanism: The differential privacy scheme of "L2 norm pruning + Gaussian noise injection" is adopted to de-identify the weight update amount uploaded by each edge node, so as to prevent the original data from being inferred through the weight and meet the data security management requirements of the oilfield.
[0237] Fault tolerance mechanism design: Supports the dynamic addition or removal of training nodes to resume training after a breakpoint. After each edge node pauses training due to network interruption or hardware failure, it can automatically resume the unfinished training steps upon reconnection, avoiding the impact of abnormal weights of a single node on the global aggregation result.
[0238] Example 6
[0239] Based on Example 5: The visualization platform communicates with edge nodes and the cloud server for the following purposes:
[0240] Receive and display device status, operational diagnostic results, and distributed collaborative computing status information from cloud servers and various edge nodes;
[0241] It provides an interface for remote start / stop control and operation and maintenance scheduling commands for oil pumping unit equipment.
[0242] The edge node also includes a working condition teaching module, which stores the dynamometer characteristics, causes and handling solutions for 10 typical working conditions, and can perform emergency reasoning and result display based on the local model in a network-free environment.
[0243] Example 7
[0244] Based on the system of Example 6, the following tests and verifications were conducted:
[0245] I. Test Hardware and Software Environment Configuration
[0246] 1. Edge inference hardware: ① The edge computing node uses the Orange Pi AI PRO development board as the core diagnostic terminal to complete normal operation inference; ② The emergency diagnostic terminal uses the HUAWEI MatePad Pro HarmonyOS tablet to meet the emergency response needs in the well site environment without network.
[0247] 2. Software framework and system version: The deep learning training framework uses MindSpore version 2.7.1; the HarmonyOS tablet is equipped with the HarmonyOS 5 operating system, and the model side inference is based on the native adaptation of MindSpore Lite Kit;
[0248] Lightweight optimization methods: For the trained Mamba time series model and MobileNetV4 image model, a lightweight combination strategy of quantization and pruning is adopted simultaneously to complete model compression and operator optimization, adapting to the computing power characteristics of domestic edge devices.
[0249] II. Test Dataset and Preprocessing Flow
[0250] The test dataset of this invention includes two types of modal data: dynamometer image data of well site conditions and load-displacement time series data, totaling 21,895 samples. The dataset is randomly divided in a 7:3 ratio, resulting in 15,322 training set samples and 6,573 test set samples. The condition category distribution of the training set and the test set is consistent, and there is no sample category skew problem.
[0251] The dataset contains 10 typical well site operating conditions. The number of training and test set samples and their corresponding labels for each condition are as follows: ① Normal operation (A01, label 0): 1992 samples in the training set, 855 samples in the test set; ② Insufficient fluid supply (A02, label 1): 5492 samples in the training set, 2354 samples in the test set; ③ Gas influence (A03, label 2): 4063 samples in the training set, 1742 samples in the test set; ④ Gas lock (A04, label 3): 203 samples in the training set, 87 samples in the test set; ⑤ Pump impact (A05 ...⑤ Pump impact (A05, label 0): 1992 samples in the training set, 855 samples in the test set; ⑥ Pump impact (A05, label 0): 1992 samples in the training set, 855 samples in the test set; ⑦ Pump impact (A06, label 0): 1992 samples in the training set, 855 samples in the test set; ⑧ Pump impact (A06, label 0): 1992 samples in the training set, 855 samples in the test set; ⑨ Pump impact (A05, label 0): 1992 samples in the training set, 8 4: Training set 737, test set 316; 6: Lower-impact pump (A06, tag 5): Training set 512, test set 220; 7: Slow valve closure (A07, tag 6): Training set 730, test set 314; 8: Plunger dislodgement (A08, tag 7): Training set 798, test set 342; 9: Floating valve leakage (A09, tag 8): Training set 392, test set 169; 10: Sand effect (A10, tag 9): Training set 403, test set 174.
[0252] Standardized preprocessing operations are performed on the dataset. The preprocessing flow is as follows:
[0253] 1. Min-Max normalization processing: Min-Max normalization is performed on both the dynamometer image data and the load-displacement time series data to map the values of all data to the [0, 1] interval, eliminate the interference of dimensional differences on model training, and improve the model convergence efficiency.
[0254] 2. Third-order spline interpolation for point supplementation: For load-displacement time series data, the original single sequence contains 120 sampling points. Using the scipy.interpolate.interp1d function, the interpolation parameter kind is specified as cubic to complete the third-order spline interpolation calculation. After interpolation, the sampling points of a single load-displacement sequence are expanded to 240, realizing the fine extraction of time series features and avoiding feature loss.
[0255] 3. Median Filtering Noise Reduction: For the interpolated load-displacement curve, median filtering is used for noise suppression. After comparing the noise reduction effects of neighborhood window n=3 and n=5, the optimal parameter is determined: Although neighborhood window n=5 has more significant noise reduction, it will lose the curve's sharp features. Neighborhood window n=3 can effectively eliminate the curve's burr noise while completely preserving the key feature points of the load-displacement curve. Finally, n=3 is selected as the fixed parameter for median filtering.
[0256] III. Model Training and Fusion Strategies
[0257] 1. Federated Collaborative Training: This invention uses the FedAvg algorithm as the core algorithm for global parameter aggregation to complete the collaborative training of Mamba time series models and MobileNetV4 image models across multiple nodes. This ensures the privacy and security of data at each well site while improving the model's generalization ability to different well site equipment and different working conditions.
[0258] 2. Single-modal model training: Based on the preprocessed dataset, the Mamba time series model was trained for load-displacement sequence data for working condition diagnosis, and the MobileNetV4 image model was trained for dynamometer card data for working condition diagnosis. After the model training was completed, the diagnostic accuracy was verified based on the test set.
[0259] 3. Weighted fusion of dual-input fusion diagnostic model: The dual-input fusion diagnostic model is deployed by adopting a feature layer weighted fusion strategy. The optimal weight allocation is determined by testing and verification: the weight of time series features is 0.6 and the weight of image features is 0.4. This weight ratio is the optimal value obtained by searching the validation set, which can maximize the complementarity of the two types of modal data.
[0260] IV. Testing Evaluation Standards and Testing Methods
[0261] 1. Diagnostic accuracy assessment: The overall accuracy of the test set is used as the core assessment indicator for the accuracy of the working condition diagnosis. There is no category weighting. The ratio of the number of correct diagnoses in the entire test set to the total number of samples is directly calculated to ensure the objectivity of the accuracy indicator.
[0262] 2. Edge Inference Performance Evaluation: The inference latency metric is the time consumed during the pure model inference stage, excluding data reading, decoding, and post-processing. In each test scenario, 100 single-sample inferences were completed and the average time was taken as the final inference latency value. The inference throughput metric is the number of effective inference samples per unit time, and the actual test was completed based on the computing power limit of the edge device.
[0263] V. Test Results
[0264] (1) Single model diagnostic accuracy: After federated learning collaborative training, the Mamba time series model has a stable diagnostic accuracy of over 85% for load-displacement sequence data, which is suitable for new equipment time series data scenarios; the MobileNetV4 image model has a diagnostic accuracy of over 87% for dynamometer diagrams, which can accurately identify 10 typical working conditions of old well sites.
[0265] Dual-input fusion diagnostic model fusion accuracy: Through a weighted fusion strategy (time-series feature weight 0.6, image feature weight 0.4), the comprehensive diagnostic accuracy for all scenarios is 87%+.
[0266] (2) Marginal reasoning performance indicators
[0267] Orange Pi development board deployment performance: After lightweight optimization, the dual-input fusion diagnostic model achieves a single-sample inference latency of ≤30ms and an inference throughput of ≥30 samples / second on the Orange Pi development board NPU.
[0268] HarmonyOS tablet emergency performance: Based on the side-end inference function of MindSpore Lite Kit, the single-sample diagnosis latency is ≤50ms in the absence of network, which meets the real-time requirements of on-site operation and maintenance personnel for emergency response.
Claims
1. A data processing system for pumping unit operation based on edge-cloud collaboration, characterized in that, This includes several edge nodes deployed at different pumping unit well sites. Each edge node is connected to a cloud server. The edge nodes, the cloud server, and the visualization platform are connected to a visualization platform, which receives and displays the operational condition diagnostic results. Each edge node is used to collect local pumping unit operation data, build a local training dataset, train the local operating condition diagnostic model, obtain the local model weights, and upload them to the cloud server. The cloud server aggregates the received local model weights to generate global model weights, which are then distributed to each edge node to update the local operating condition diagnostic model of each edge node. The diagnostic model outputs a visualized operating condition diagnostic result. The operating data of the local pumping unit includes load-displacement time series data and indicator diagram image data generated from the time series data; The local working condition diagnostic model is a dual-input fusion diagnostic model, including an image diagnostic sub-model for processing dynamometer card image data and a time-series diagnostic sub-model for processing load-displacement time-series data. The image diagnostic sub-model is a MobileNetV4 model natively reconstructed based on the MindSpore framework, and the time-series diagnostic sub-model is a Mamba model natively reconstructed based on the MindSpore framework. The method for constructing the MobileNetV4 dynamometer image diagnostic model is as follows: (1) MindSpore native refactoring implementation Based on the MindSpore framework, we have made engineering adaptations to the existing lightweight MobileNetV4 architecture: We have encapsulated an adaptive 2D convolution processing function to support depthwise separable convolution, SAME padding, and grouped convolution modes to match the inverse residual structure operation requirements of image data processing; We have replicated the general inverse bottleneck UIB processing unit, integrated depthwise convolution and channel mixing mechanism, and determined the optimal configuration through architecture parameter optimization to balance image data processing efficiency and spatial feature extraction integrity. It embeds a lightweight MobileMQA attention processing unit, adopts a multi-query shared key-value mechanism, and is equipped with a space reduction optimization strategy to reduce the memory usage of feature operation and improve the processing speed of image data at the edge without losing image features. The processing structure is built according to the process of initial convolution processing, multi-unit stacking, adaptive pooling, and feature output. The processing volume can be flexibly adjusted through parameter configuration to adapt to the low computing power hardware constraints of edge nodes. (2) Lightweight design and hardware compatibility optimization Model compression: The "overall width scaling + structured channel pruning" strategy is adopted, which reduces the number of network channels by 40%-50%, reduces inference latency by 20%-30%, and compresses the model size to 6-8MB, effectively improving the model's running efficiency and adapting it to the Orange Pi development board NPU and HarmonyOS tablet hardware. First, the proportion of channels in each layer is uniformly reduced from a global perspective by scaling the overall width, thus establishing the basic lightweight scale of the model. Second, a structured channel pruning algorithm is used to selectively remove redundant channels that contribute little to the extraction of working condition features, achieving a 40%-50% deep reduction in the number of network channels while maintaining the regularity of tensor operations. Functional positioning: Focus on extracting the spatial morphological features of dynamometer diagrams, adapting to old well sites without time-series data, and accurately distinguishing the morphological differences of different working conditions; The method for constructing the Mamba time-series diagnostic model is as follows: (1) MindSpore cross-framework reconstruction and core implementation Based on the MindSpore framework, the Mamba model is natively reconstructed. According to the core computational paradigm of Mamba, it is decomposed into five processing units: input projection, local convolutional modeling, Selective State Space Model (SSM) hidden state update, gated fusion, and output projection. All units are encapsulated based on MindSpore computational units and strictly follow the framework design specifications. Input projection and bi-branch splitting are achieved through fully connected layers and tensor segmentation operators, one-dimensional convolutional layers are used to extract temporal local features, basic arithmetic operators are used to update temporal state cyclically, and activation functions and element-wise multiplication operators are used to achieve feature gated fusion. Finally, normalized temporal features are output through fully connected layers to meet the long-term feature extraction requirements of pumping unit load-displacement time series data. The specific restructuring plan is as follows: Overall architecture decomposition and adaptation: Based on the underlying operator library, the original time series data processing logic is decoupled and reconstructed; according to the core mathematical computation paradigm of discretized state evolution, it is decomposed into five core digital processing units: input signal mapping, local sequence feature sliding extraction, time series evolution state update, feature modulation fusion, and feature output mapping; all units are encapsulated based on the basic modular units of the underlying framework, following the "module-basic mathematical operator" electrical digital data processing design specification, avoiding highly integrated black-box computation; Precise adaptation of core operators: Input projection and branch splitting: The input time-series digital sequence is mapped to an extended high-dimensional data space of 2×d_inner dimension through the basic matrix transformation operator. Then, the data stream is accurately split into two parallel branches, the main feature data stream x and the modulation feature data stream z, using the tensor partitioning operator to realize the parallel processing path of the electronic digital signal. Local convolution modeling: One-dimensional discrete sliding kernel operation logic is used to perform feature extraction within a local window range on time series data; and data format conversion is completed through tensor dimension rearrangement and transpose operators to adapt to the matrix input dimension requirements of subsequent modules, while keeping the number of time steps of the sequence unchanged; Core of the selective state-space model: Parameterized mathematical constraints: The time-series state transition matrix is defined as a dynamically adjustable matrix parameter, and mathematical smoothing and logarithmic stabilization are performed on it using an exponential function to ensure the numerical stability of the subsequent iterative calculation process; Time-series state cyclic synchronization: The time-series linear scanning logic is constructed by calling basic algebraic operators such as element-wise multiplication and element-wise addition. The digital parameters such as discretized time step, driving coefficient, and output state are calculated in sequence to realize the cyclic synchronous update of the internal evolution state with time step, ensuring the continuity of feature transmission and computational efficiency of long time-series signals. Gated fusion and output: For the modulation feature data stream z, the corresponding normalized modulation signal is generated through a nonlinear mapping function; using the element-wise multiplication operator, the modulation signal is fused and the updated backbone feature data stream x element-wise and the feature is filtered. Finally, the fused digital features are mapped back to the standard output dimension via matrix transformation operations; (2) Network-level reconstruction and classification architecture construction: Based on the reconstructed underlying core processing unit described above, an end-to-end data processing pipeline for load-displacement time series is constructed: Initial feature mapping unit: The preprocessed original load-displacement sequence is mapped into a high-dimensional feature vector using the basic linear transformation matrix to meet the requirements of subsequent high-dimensional space operations; Multi-level deep feature parsing pipeline: It adopts a multi-level cascaded processing architecture, that is, multi-level feature processing modules are stacked. Each processing unit integrates a composite structure of "pre-set data normalization + time-series evolution calculation core + bypass direct connection transition data flow + feedforward nonlinear transformation logic + random feature mask operation". It replaces the high-complexity global correlation matrix operation with lightweight linear evolution calculation logic, which can efficiently analyze the dynamic evolution law of long time-series data while ensuring the numerical iteration stability of the multi-level cascaded architecture. Comprehensive status assessment output unit: After the extracted time-series feature sequence is normalized by hierarchical data, it is compressed globally along the time dimension by the aggregation mean operator and the feature representative value is extracted. Finally, through the multi-level matrix mapping dimensionality reduction module, the standardized feature matching coefficients of each preset working condition type are output. (3) Hardware adaptation and lightweight optimization: NPU computing power adaptation: Optimize the operator scheduling order in the model based on the computing power characteristics of the Orange Pi development board's NPU, and use MindSpore's graph compilation optimization capabilities to achieve the fusion and simplification of the computation graph; Lightweight processing: The reconstructed Mamba model is dynamically quantized with INT8, and the model size is compressed to about 11MB without significant loss of accuracy, enabling it to perform efficient local training and real-time side-end inference on edge devices. Functional positioning: This model directly processes the raw load-displacement time series data without generating dynamometer diagrams, thus skipping redundant plotting steps and focusing on capturing the dynamic evolution trend of pumping unit operating conditions.
2. The system according to claim 1, characterized in that, After each edge node collects the local pumping unit's operating data, it performs preprocessing on the operating data, including normalization, third-order spline interpolation, and median filtering for noise reduction.
3. The system according to claim 2, characterized in that, The edge nodes use the Orange Pi development board, HarmonyOS tablet, and PC as the core domestic hardware carriers, deploy the MindSpore Lite framework and lightweight data processing module, and are dedicated to completing the local multi-source heterogeneous data standardization processing, feature extraction and desensitized data weight calculation. All original dynamometer images and load-displacement time series data are stored locally for processing, and no core sensitive production data is uploaded, thus avoiding the risk of data privacy leakage from the source. The cloud server is deployed on the Huawei Cloud platform and is equipped with an Ascend Snt9B computing acceleration card. The specific architecture is as follows: Based on a cloud-based distributed data processing and weight aggregation platform, it is dedicated to global data processing task scheduling, de-identified data weight mathematical aggregation, global standardized parameter management and version iteration; at the same time, it uses the computing power of the cloud platform to complete the regularization and optimization of global parameters after aggregation, ensuring the universality and stability of global data processing parameters, and adapting to the data processing needs of various oil pumping plant well sites. After completing local data processing and de-identification weight calculation, the edge data nodes upload the local de-identified data weights to the cloud data processing platform. The cloud data processing server performs distributed mathematical aggregation calculations on the de-identified data weights uploaded by each edge node using either the FedAvg weighted average algorithm or the FedProx constrained weighted average algorithm. Differential privacy de-identification protection is achieved through L2 norm pruning and Gaussian noise injection, blocking the original data reverse path and strictly safeguarding data security. The aggregated and optimized global standardized data parameters will be redistributed to each edge data processing node to complete the iterative update of local processing parameters, continuously improve the data processing accuracy and operational condition judgment stability of the entire system, and form a digital collaborative optimization closed loop of "local data processing - cloud weight aggregation - parameter synchronous update".
4. The system according to claim 3, characterized in that, The system achieves edge-cloud collaborative distributed data processing through edge nodes and cloud servers. It constructs a heterogeneous collaborative parsing mechanism for MindSpore cloud-based full data processing parameters and MindSpore Lite edge-based lightweight processing parameters. This enables unified parsing, weighted aggregation, and bidirectional synchronization of data parameters across both frameworks, perfectly adapting to the differences in computing power and storage between edge and cloud heterogeneous devices. It breaks down barriers to cross-hardware data processing, ensuring smooth edge-cloud data collaboration, as detailed below: (1) Implementation of core collaborative mechanism Communication Protocol and Link: The WebSocket protocol is used to realize bidirectional real-time communication between edge nodes and the cloud side, and the TCP protocol is used to complete the transmission of model weights and training task instructions. It supports breakpoint resume and heartbeat detection to ensure the stability of the training link in weak network environment. Weighted aggregation algorithm: It integrates FedAvg weighted average operation and FedProx constrained weighted average operation dual aggregation algorithm, and switches the appropriate algorithm according to the difference in data volume and computing power of edge nodes; it allocates aggregation weights according to the proportion of the local standardized data volume of each edge node to the total global data volume, thereby improving the sample adaptability of the global standardized parameters; Dynamic node management: The cloud server identifies and connects newly entered edge computing devices with legitimate identities in real time through a preset communication protocol, realizing automatic discovery, dynamic addition and removal of edge nodes. When a new node is connected, the basic model and training configuration are automatically synchronized. When the edge node is offline, it does not affect the overall aggregation process, adapting to the characteristics of the scenario of dispersed well sites and fluctuating equipment status in oil pumping plants. (2) Localization adaptation and training process The entire process relies on domestically developed technology stacks, forming a standardized training closed loop: Edge node initialization: The cloud server distributes the initial model to each edge node, which is the MobileNetV4 / Mamba base model trained on MindSpore, training hyperparameters, including learning rate, batch size, number of iterations, and data preprocessing rules. The edge nodes complete the training environment configuration based on the local dataset. Local training execution: Edge nodes rely on the NPU computing power of the Orange Pi development board to complete local model training through the MindSpore Lite framework and generate model weight update volume; only weight data is retained during training, and the original production data is stored locally throughout the process to avoid the risk of privacy leakage. Cloud server aggregation optimization: Each edge node uploads the weight update to the Huawei Cloud training platform. The cloud server completes the global weight calculation through the selected aggregation algorithm. During this process, the optimization capabilities of the Huawei Cloud platform are used to improve model performance. At the same time, the aggregated global model is lightweighted to ensure that it is adapted to edge computing power. Model delivery and update: The cloud server delivers the optimized global lightweight model to each edge node. The nodes automatically complete the local model replacement and update, and start the next round of iterative training until the model diagnostic accuracy converges, that is, the accuracy is ≥85%. After the edge nodes complete the global parameter iteration update, the optimized dual-input fusion diagnostic model, namely the lightweight MobileNetV4 image model and the lightweight Mamba time series model, is deployed to the Orange Pi development board or HarmonyOS tablet domestic device. Relying on the dedicated computing power of the Orange Pi NPU and the native adaptation capability of the MindSpore Lite edge inference framework, combined with the computing power optimization strategy of the local hardware of the edge, the optimized model can be deployed locally in a lightweight manner and run efficiently. Based on the deployed optimized model, the edge node device performs inference on the preprocessed pumping unit load-displacement time series data and dynamometer image data, and outputs the working condition diagnosis results, discrimination confidence and standardized treatment suggestions in milliseconds. It supports independent emergency diagnosis in the absence of network, fully meeting the practical needs of real-time diagnosis in oilfields. (3) Data security and fault tolerance design Privacy protection mechanism: The differential privacy scheme of "L2 norm pruning + Gaussian noise injection" is adopted to desensitize the weight update amount uploaded by each edge node, so as to prevent the original data from being inferred through the weight and meet the data security management requirements of the oilfield. Fault tolerance mechanism design: Supports the dynamic addition or removal of training nodes to resume training after a breakpoint. After each edge node pauses training due to network interruption or hardware failure, it can automatically resume the unfinished training steps upon reconnection, avoiding the impact of abnormal weights of a single node on the global aggregation result.
5. The system according to claim 4, characterized in that, The system also includes a visualization platform, which is communicatively connected to the edge nodes and the cloud server, and is used for: Receive and display device status, operational diagnostic results, and distributed collaborative computing status information from the cloud server and each edge node; It provides an interface for remote start / stop control and operation and maintenance scheduling commands for oil pumping unit equipment.
6. The system according to claim 5, characterized in that, The edge node also includes a working condition teaching module, which stores the dynamometer features, causes and handling schemes of 10 typical working conditions, and can perform emergency reasoning and result display based on a local model in a network-free environment.