Petrochemical intelligent storage and transportation quantitative loading optimization method and system based on big data
By combining big data and neural network models, high-precision metering and safety control of the petrochemical storage and transportation quantitative loading system have been achieved, solving the problems of flow meter metering error and shut-off deviation, and improving the reliability and safety of the loading process.
Patent Information
- Application Number
- CN202610582979.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-14
AI Technical Summary
Existing quantitative loading systems suffer from flow meter measurement errors during petrochemical storage and transportation due to variations in the density and viscosity of petrochemical media with temperature and pressure. These errors are particularly pronounced during the loading start-up and shutdown phases, and the shutdown strategy lacks dynamic predictive capabilities, leading to measurement deviations and safety hazards.
A big data-based optimization method for intelligent petrochemical storage and transportation quantitative loading is adopted. Fluid state data is collected synchronously through a field programmable logic controller, dynamic error compensation is performed using a long short-term memory neural network model, and the loading process is precisely controlled by combining a kinetic energy prediction model. This includes multi-dimensional synchronous data frame processing, dynamic error compensation coefficient calculation, and dynamic pre-shutdown quantity prediction.
It enables real-time response to complex nonlinear errors during petrochemical loading, improves measurement accuracy and loading repeatability, reduces measurement errors and shut-off deviations, and enhances the fairness and security of trade settlement.
Smart Images

Figure CN122386879A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent storage and transportation in petrochemicals, specifically involving a method and system for optimizing quantitative loading in intelligent petrochemical storage and transportation based on big data. Background Technology
[0002] The quantitative loading system is a key piece of equipment in the petrochemical storage and transportation process. Its metering accuracy and control reliability directly affect the fairness of trade settlement and the safety of operations. In existing technologies, quantitative loading systems typically use programmable logic controllers to collect temperature, pressure, and flow meter pulse signals, and perform volume conversion based on preset fixed pulse equivalents to achieve the measurement and control of cumulative loading.
[0003] However, during actual loading, the physical properties of the petrochemical medium, such as density and viscosity, fluctuate significantly with changes in temperature and pressure, causing the flow meter's actual instrument coefficient to deviate from its nominal value. Especially during the start-up and shutdown phases of loading, the flow field is unsteady, the Reynolds number changes drastically, and the flow meter exhibits complex nonlinear error characteristics. Traditional fixed pulse equivalent methods cannot respond to such dynamic disturbances in real time, resulting in cumulative measurement deviations and affecting the repeatability and accuracy of loading.
[0004] Furthermore, existing systems typically employ a simple proportional threshold-triggered shutdown strategy at the loading end, lacking the ability to dynamically predict the inertia and residual kinetic energy of the fluid within the pipeline. Due to the inherent response delay of valve action, some fluid continues to flow into the tanker truck after the shutdown command is issued, easily leading to shutdown errors. This can cause the actual loading volume to deviate from the preset target, potentially triggering trade disputes or even safety hazards.
[0005] Therefore, there is an urgent need for a quantitative loading optimization scheme that can compensate for nonlinear measurement errors in real time and accurately predict shut-off margins in order to improve the overall performance of petrochemical storage and transportation loading operations. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for optimizing the quantitative loading of petrochemical intelligent storage and transportation based on big data, which can effectively solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A big data-based intelligent storage and transportation quantitative loading optimization method for petrochemicals includes the following specific steps:
[0009] Step S1: After the loading operation starts, the fluid state data in the loading pipeline is collected synchronously through the field programmable logic controller, and the instantaneous temperature, instantaneous pressure and fluid density are latched synchronously based on the pulse signal generated by the dual rotor flow meter to form a multi-dimensional synchronous data frame with consistent timestamps.
[0010] Step S2: Using a long short-term memory neural network model deployed in the edge computing gateway, the fluid state parameters in the multidimensional synchronous data frame are processed to output dynamic error compensation coefficients in real time. When the dynamic error compensation coefficients exceed the preset allowable range, the system automatically switches to the redundancy compensation mode, calculates the instantaneous Reynolds number based on the instantaneous flow velocity and the kinematic viscosity of the medium, and obtains the redundancy compensation coefficients from the pre-stored instrument coefficient curve table accordingly.
[0011] Step S3: In each sampling period, the nominal basic pulse equivalent of the flow meter is corrected in real time according to the received dynamic error compensation coefficient or the redundancy compensation coefficient to obtain the corrected pulse equivalent. Combined with the number of original pulses generated by the dual rotor flow meter in the sampling period, the cumulative loading amount is obtained.
[0012] Step S4: When the cumulative loading amount reaches the preset proportional threshold, switch to the pre-shutdown mode and adjust the CNC valve to a low opening state; in the pre-shutdown mode, call the built-in kinetic energy prediction model to calculate the dynamic pre-shutdown amount; when the remaining loading amount is equal to the dynamic pre-shutdown amount, send a complete shutdown command to the CNC valve to complete the loading.
[0013] Furthermore, the output data of all sensors are synchronously acquired at a preset sampling frequency through the backplane bus or opto-isolated signal acquisition module of the field programmable logic controller; and the rising edge of the pulse generated by the dual rotor flowmeter is used as the reference trigger signal. At the same millisecond moment, the field programmable logic controller synchronously latches the instantaneous temperature acquired by the high-precision platinum resistance temperature sensor, the instantaneous pressure acquired by the pressure transmitter, and the current value of the fluid density output by the Coriolis mass flowmeter to form the multidimensional synchronous data frame with consistent timestamps.
[0014] Further, in step S1, the fluid density is determined in the following way: the first density value directly measured and output by the Coriolis mass flow meter is compared in real time with the second density value calculated in real time based on instantaneous temperature and instantaneous pressure and combined with the medium compressibility coefficient equation. If the difference between the two exceeds a preset density threshold and the duration exceeds a preset time threshold, a sensor abnormality alarm is triggered. Under normal operating conditions, the first density value is preferentially used as the primary density data.
[0015] Further, in step S2, the fluid state parameters in the multidimensional synchronous data frame are processed using a long short-term memory neural network model deployed in the edge computing gateway, specifically including:
[0016] The edge computing gateway performs deviation standardization processing on various fluid state parameters in the multidimensional synchronous data frame, and maps the original physical quantities with different dimensions to a preset numerical range.
[0017] The standardized data is organized into a six-dimensional feature vector sequence that includes instantaneous temperature, instantaneous pressure, instantaneous flow rate, viscosity correction factor, ambient temperature, and pumping frequency.
[0018] The six-dimensional feature vector sequence is input into the long short-term memory neural network model deployed in the edge computing gateway to output the dynamic error compensation coefficient corresponding to the current sampling time in real time.
[0019] Further, in step S2, the preset allowable range of the dynamic error compensation coefficient is a closed interval from 0.985 to 1.015; the automatic switching to the redundancy compensation mode specifically includes:
[0020] When the coefficient value output by the long short-term memory neural network model exceeds the closed interval, the current inference result is determined to be unreliable.
[0021] The instantaneous Reynolds number is calculated based on the instantaneous flow rate of the current sampling period and the temperature-corrected kinematic viscosity of the medium.
[0022] Using the calculated instantaneous Reynolds number as the query index, the corresponding compensation coefficient value is retrieved from the instrument coefficient curve table pre-stored in the local memory of the edge computing gateway. The intermediate value between adjacent data points is calculated using a linear interpolation method, and the relative deviation value of the instrument coefficient obtained by retrieval or interpolation is used as the redundancy compensation coefficient.
[0023] In the redundancy compensation mode, if the coefficient values output by the long short-term memory neural network model all return to the closed interval within a preset number of sampling periods, the mode will automatically switch back to the mode where the dynamic error compensation coefficients are output by the long short-term memory neural network model.
[0024] Furthermore, in step S3, the cumulative loading volume since the start of the loading operation is obtained by summing up the data, and the calculation follows the formula below:
[0025]
[0026] in, Represents the period from the start of loading operations to the [number]th [year]. Cumulative loading volume per sampling period; Representative at the The number of raw pulses generated by the dual rotor flowmeter within each sampling period; This represents the nominal basic pulse equivalent determined by the flow meter under calibration conditions; Representative at the The dynamic error compensation coefficient or the redundancy compensation coefficient applied at each sampling period.
[0027] Further, in step S4, when the cumulative loading amount reaches a preset proportional threshold, the system switches to a pre-shutdown mode and adjusts the numerical control valve to a low opening state, specifically including:
[0028] When the cumulative loading volume reaches 95% of the target loading volume, the system automatically switches from normal loading mode to pre-shutdown mode;
[0029] The field programmable logic controller sends an opening adjustment command to the numerically controlled valve, controlling the valve opening to linearly decrease from a fully open state to a low opening state of 15% to 20%;
[0030] In pre-shutdown mode, the system acquires data from pressure monitoring points set at different positions upstream of the CNC valve in real time, and calculates pressure gradient parameters to reflect the current flow field stability.
[0031] Furthermore, in step S4, the built-in kinetic energy prediction model is invoked to calculate the dynamic pre-shutdown amount, and the calculation formula is as follows:
[0032]
[0033] in, This represents the dynamic pre-shutdown amount; Represents the instantaneous flow velocity at the current sampling moment; The nominal cross-sectional area representing the loading pipeline; Represents the overall system response delay time; This represents the velocity decay acceleration term during valve closure; This represents the pressure gradient correction factor; This represents the pressure gradient parameter; The bulk modulus correction factor represents the medium. This represents the estimated sudden increase in upstream pressure at the moment the valve closes.
[0034] Further, in step S4, when the remaining load is equal to the dynamic pre-shutdown amount, a complete shutdown command is sent to the numerical control valve, specifically including: the system calculates the remaining load in real time, where the remaining load is the target load minus the current cumulative load;
[0035] When the remaining load is equal to the dynamic pre-shutdown amount, the field programmable logic controller immediately sends a complete shutdown command to the numerical control valve, and the numerical control valve performs a rapid shutdown action after receiving the command.
[0036] A petrochemical intelligent storage and transportation quantitative loading optimization system based on big data includes:
[0037] A multi-dimensional sensor array, deployed at different locations in the loading pipeline, is used to collect fluid state data in real time. It includes at least a high-precision platinum resistance temperature sensor, a pressure transmitter, a Coriolis mass flow meter, a dual rotor flow meter, an environmental transmitter, and a pumping frequency feedback module.
[0038] A field-programmable logic controller, electrically connected to the multidimensional sensor array, is used to synchronously latch and generate a multidimensional synchronous data frame with consistent timestamps, using the rising edge of the pulse generated by the dual rotor flowmeter as a reference trigger signal.
[0039] An edge computing gateway is communicatively connected to the field-programmable logic controller. It has an offline-trained long short-term memory neural network model and a kinetic energy prediction model. The edge computing gateway is used to calculate the dynamic error compensation coefficient in real time based on the multi-dimensional synchronous data frame, perform redundancy compensation mode switching, calculate the cumulative load based on the dynamic error compensation coefficient or redundancy compensation coefficient, and call the kinetic energy prediction model to calculate the dynamic pre-shutdown amount in the pre-shutdown mode.
[0040] The numerical control actuator includes at least a numerical control valve, which is electrically connected to the field programmable logic controller (PLC) and is used to receive opening adjustment commands and complete shut-off commands issued by the PLC to control the flow and flow rate of fluid in the loading pipeline.
[0041] In summary, this application includes at least one of the following beneficial technical effects:
[0042] 1. This invention introduces a long short-term memory neural network model to achieve in-depth capture of complex nonlinear errors during petrochemical loading. Compared with traditional metering methods based on fixed pulse equivalents, this invention can respond in real time to drastic fluctuations in fluid temperature, pressure, and flow regime. Especially during the loading start-up and shutdown phases when Reynolds numbers frequently change, the dynamic error compensation technology significantly reduces overall metering errors and improves the fairness of trade settlement.
[0043] 2. The multidimensional feature space established in this invention covers core variables such as fluid density, viscosity correction factor, and pumping frequency, enabling the system to have strong adaptability to petrochemical media with different viscosities and compositions. Even under conditions of significant changes in ambient temperature due to seasonal changes, or pressure pulsations caused by fluctuations in the pump speed, the system can still maintain stable compensation accuracy and significantly reduce repeatability errors.
[0044] 3. By combining a dynamic pre-shutdown algorithm based on pressure gradient and fluid kinetic energy, this invention solves the common problem of excessive shut-off deviation in traditional quantitative loading. The system can accurately predict the dynamic pre-shutdown amount during valve operation, achieving highly timely shut-off command issuance. In high-speed loading environments, end-load deviation is strictly controlled within a very small range, completely eliminating the measurement risk caused by inaccurate calculation of pipeline residual kinetic energy.
[0045] 4. This invention achieves closed-loop management of data acquisition, model inference, and control feedback based on an edge computing architecture. The incremental learning characteristics of the Long Short-Term Memory Neural Network ensure that the system can self-optimize as equipment wear and operating conditions drift, extending the effective maintenance cycle of the flow meter. Simultaneously, the fault diagnosis function achieved through real-time feature comparison can quickly identify abnormal operating conditions such as cavitation and leakage, greatly improving the inherent safety level of petrochemical storage and transportation operations. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the overall technical solution for a big data-based intelligent storage and transportation quantitative loading optimization method for petrochemicals.
[0047] Figure 2 This is a schematic diagram illustrating the core principle of dynamic error compensation coefficient calculation based on a long short-term memory neural network model.
[0048] Figure 3 It is a flowchart of the logic for high-precision correction of instantaneous flow rate based on dynamic error compensation coefficient;
[0049] Figure 4 It is a flowchart of the refined control logic for end-to-end shutdown based on the kinetic energy prediction model;
[0050] Figure 5 This is a schematic diagram of the multi-level interaction and data flow between the sensor array, edge computing gateway, and CNC actuator. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this invention clearer, the following description is provided in conjunction with the appendix. Figure 1 To be continued Figure 5 The present invention will be further described in detail below with reference to specific embodiments.
[0052] In the petrochemical storage and transportation quantitative loading system, the first aspect is the petrochemical intelligent storage and transportation quantitative loading optimization method based on big data disclosed in the embodiments of this application, which realizes precise control and high-precision metering of the fluid loading process. It operates on a hardware architecture composed of a multi-dimensional sensor array, an edge computing gateway, a field-programmable logic controller, and a numerical control actuator, preferably a numerical control valve in this embodiment. The specific implementation steps include the following:
[0053] Regarding the solution provided by this invention, the first step, S1, involves accurately sensing the fluid state within the loading pipeline. This method performs data acquisition and preprocessing operations after the loading operation begins, constructing a multi-dimensional, synchronous fluid state data sensing system. Its specific implementation is achieved through the following sub-steps.
[0054] Step S101: Deploy a multi-dimensional sensor array. High-precision platinum resistance temperature sensors, pressure transmitters, Coriolis mass flow meters, and dual rotor flow meters are deployed at the inlet of the loading pipeline, the straight pipe sections before and after the flow meter, and the monitoring position near the CNC valve. The high-precision platinum resistance temperature sensor uses a four-wire PT1000 probe, installed on the loading arm's main pipeline, and penetrates approximately one-third of the pipe diameter into the fluid center through a protective sleeve. The pressure transmitter uses a diffused silicon pressure core, with a range of 0 MPa to 1.6 MPa and an accuracy of 0.05 class, and is installed upstream and downstream of the flow meter. The Coriolis mass flow meter is used to acquire the fluid mass flow rate and density in real time, and the transmitter synchronously outputs a frequency signal and an analog signal of 4 mA to 20 mA. The dual rotor flow meter, as a volumetric metering device, generates a raw pulse frequency signal proportional to the fluid volume.
[0055] Step S102: Perform synchronous signal acquisition. Synchronously acquire all sensor output data at a sampling frequency of 100Hz via the backplane bus of the field-programmable logic controller or an opto-isolated signal acquisition module.
[0056] Step S103: Implement time reference alignment. Using the rising edge of the pulse generated by the dual rotor flowmeter as the reference trigger signal, at the same millisecond moment, the field programmable logic controller synchronously latches the current values of instantaneous temperature, instantaneous pressure, and fluid density, forming a multi-dimensional synchronous data frame with consistent timestamps.
[0057] Step S104: Perform fluid density redundancy calculation. In the synchronous data frame, the fluid density is obtained in two ways. The first is by directly measuring the output density value from the Coriolis mass flow meter. The second method involves real-time calculation based on instantaneous temperature and pressure, combined with the medium compressibility coefficient equation. The calculation formula is as follows:
[0058]
[0059] The meanings of the symbols in the formula are as follows: To compensate for the calculated density value, the unit is kilograms per cubic meter; β is the nominal density of the medium under reference conditions, in kilograms per cubic meter; β is the coefficient of thermal expansion of the medium, in degrees Celsius. The instantaneous temperature latched in step S103, in degrees Celsius; For reference temperature, 20 degrees Celsius is used; The isothermal compressibility coefficient of the medium is expressed in megapascals (MPa). The instantaneous pressure latched in step S103 is expressed in megapascals. For reference pressure, take 0.101325 MPa.
[0060] The above , , Parameters are preset in the system depending on the type of medium. For example, 92-octane gasoline corresponds to... 735 kg per cubic meter 0.00106 per degree Celsius It is 0.0012 MPa; corresponding to 95-octane gasoline 745 kg per cubic meter 0.00105 per degree Celsius It is 0.0012 per megapascal; No. 0 diesel corresponds to 840 kg per cubic meter 0.00083 per degree Celsius It is 0.0009 per megapascal; aviation kerosene corresponds to 800 kg per cubic meter 0.00095 per degree Celsius The value is 0.0011 MPa. When loading begins, the system reads the media code and automatically retrieves the corresponding parameter set.
[0061] The system will and Real-time comparison is performed. If the difference exceeds 5 kg / m³ and persists for 2 seconds, a sensor malfunction alarm is triggered. Under normal operating conditions, the system prioritizes using... Used as primary density data.
[0062] In summary, step S1 establishes a data acquisition system for synchronously acquiring temperature, pressure, flow rate, and density. A unified trigger alignment mechanism addresses the asynchronous nature of multi-sensor data, and density redundancy calculation ensures the reliability of key parameters. The output multi-dimensional synchronous data frames provide the data foundation for subsequent step S2 to construct a high-dimensional feature space and input it into a long short-term memory neural network model.
[0063] The next step, S2, involves using the long short-term memory neural network model deployed within the edge computing gateway to calculate the dynamic error compensation coefficient under the current operating conditions in real time. This process is implemented through the following sub-steps.
[0064] Step S201, Feature Vector Standardization Preprocessing. The edge computing gateway first standardizes the fluid state parameters in the multidimensional synchronous data frame generated in step S1. The standardization method adopts deviation standardization, i.e., Min-Max standardization. The edge computing gateway has a pre-stored mapping table of preset maximum and minimum values for each parameter. Based on this mapping table, the gateway uniformly maps the original physical quantities with different dimensions to a numerical range of 0 to 1.
[0065] For example, temperature data ranging from 0 to 50 degrees Celsius is linearly mapped to 0 to 1, and pressure data ranging from 0 MPa to 1.0 MPa is similarly mapped to 0 to 1. This standardization process eliminates the adverse effects of the order-of-magnitude differences between different physical quantities on the convergence speed and weight allocation of subsequent neural network models.
[0066] Step S202: Construct a high-dimensional feature vector sequence. After standardization, the edge computing gateway organizes the standardized data into a 6-dimensional feature vector sequence. This sequence contains the following 6 feature dimensions: instantaneous temperature, instantaneous pressure, instantaneous flow velocity converted from the original pulse frequency, viscosity correction factor calculated based on temperature and medium composition, ambient temperature provided by an environmental transmitter deployed outside the station, and pumping frequency fed back in real time by the variable frequency pump controller. These 6 dimensions together construct a high-dimensional feature space reflecting the flow field distribution, medium viscosity changes, and system dynamic characteristics.
[0067] Step S203: Input the feature vector sequence into the Long Short-Term Memory (LSTM) neural network model. The constructed 6-dimensional feature vector sequence is input in real time into the LTM neural network model deployed in the edge computing gateway.
[0068] The input layer of this model is set to 6 dimensions to receive 6-dimensional feature vectors. The model extracts nonlinear temporal features in the flow evolution process through its internal gating structure and outputs dynamic error compensation coefficients corresponding to the current sampling time in real time.
[0069] Step S204: Long Short-Term Memory Neural Network Model Structure and Parameter Settings. The Long Short-Term Memory Neural Network model used in this step consists of one input layer, three hidden layers, and one output layer. Each hidden layer is configured with 128 neurons.
[0070] Neurons within each hidden layer utilize a gating structure consisting of forget gates, input gates, and output gates to handle long-term and short-term dependencies in time-series data. The activation function of the hidden layers employs the hyperbolic tangent function to handle nonlinear mappings, while the output layer uses a linear activation function to directly output the dynamic error compensation coefficient. This coefficient is a dimensionless scalar value used for real-time correction of the flowmeter's baseline pulse equivalent.
[0071] Step S205: Offline training process of the neural network model. To ensure that the above neural network model can accurately output dynamic error compensation coefficients during actual deployment, the model undergoes a complete offline training phase before being deployed to the edge computing gateway.
[0072] Regarding the construction of the training data, the training sample set is derived from over 1 million historical loading records stored in the petrochemical storage and transportation database. Each training sample corresponds to a complete loading operation process curve, and the samples cover diverse operating conditions under different seasons, time periods, and pumping pressure levels. The input features of the samples are the 6-dimensional feature vector sequence described in step S202 above, namely, the sequence data composed of instantaneous temperature, instantaneous pressure, instantaneous flow rate, viscosity correction factor, ambient temperature, and pumping frequency in chronological order.
[0073] The sample label value, i.e. the target value that the model needs to learn to predict, is the true dynamic error compensation coefficient obtained through post-event analysis. The method for obtaining this true coefficient is as follows: for each historical loading record, the actual loading amount calibrated by a high-precision platform scale or weighbridge after loading is completed is compared with the uncompensated loading amount obtained by converting the cumulative pulse count of the dual rotor flowmeter during the loading process, and the average measurement error of the entire operation is calculated.
[0074] Subsequently, based on the temperature and pressure change curves during the operation, a numerical inversion method was used to decompose the average error to each sampling time, obtaining the instantaneous error contribution value at each time. The ratio of this instantaneous error contribution value to the nominal basic pulse equivalent of the flowmeter at the corresponding time constitutes the true label of the sample at that time.
[0075] Regarding the loss function and optimization objective, the mean squared error (MSE) is used as the loss function during training. The MSE loss function measures the mean of the squared Euclidean distance between the model's predicted output and the true label, and its expression is:
[0076]
[0077] in, Represents the value of the loss function; This represents the number of samples in each training batch; Representative model for the first The prediction dynamic error compensation coefficient for each sample output; Representing the The true label value of each sample.
[0078] The goal of training is to minimize the loss function by iteratively updating the weights and bias parameters within the model, thereby making the model's predicted output as close as possible to the true label.
[0079] The training process used the Adam optimizer for parameter updates, with a learning rate set to 0.001. The entire training set was iterated 500 times. After this training process, the model achieved a goodness of fit of over 0.995 to the measurement error of the unsteady flow field on the validation set. Goodness of fit is a statistical indicator that measures the correlation between the model's predicted values and the actual values; a value closer to 1 indicates a stronger explanatory power of the model.
[0080] Step S206, Model Inference and Coefficient Output. After offline training is completed and the model is deployed to the edge computing gateway, whenever a new feature vector sequence is input into the model, the model calculates and outputs the dynamic error compensation coefficients for the current time step through forward propagation. These coefficients are then passed to the subsequent traffic correction stage in real time.
[0081] In summary, step S2 utilizes a long short-term memory neural network model to learn the complex nonlinear error patterns inherent in historical loading data, and accurately infers the dynamic error compensation coefficients during real-time operations. Standardized preprocessing and high-dimensional feature construction ensure the input quality of the model, while detailed network structure design and a complete training process description ensure the model's feasibility. The dynamic error compensation coefficients output in this step provide the core compensation basis for the high-precision correction of instantaneous flow rate in the subsequent step S3.
[0082] The next step, S3, involves real-time correction of the raw pulse signal generated by the flow meter to obtain high-precision instantaneous flow rate and cumulative load. This process is implemented through the following sub-steps.
[0083] Step S301: Receive dynamic error compensation coefficients. The edge computing gateway receives the dynamic error compensation coefficients output from the long short-term memory neural network model in real time. These coefficients are continuously updated at a refresh rate of 100Hz, consistent with the sampling frequency of the sensor data in step S102. Each sampling period corresponds to an independent compensation coefficient value, which is generated by the forward propagation calculation of the model in step S206 and used to correct the original pulse signals acquired at the same sampling time.
[0084] Step S302: Calculate the corrected pulse equivalent. The edge computing gateway corrects the nominal basic pulse equivalent of the flow meter in real time based on the received dynamic error compensation coefficient. The nominal basic pulse equivalent is the fluid volume corresponding to a single pulse measured under standard operating conditions during the flow meter's factory calibration or periodic verification process. The corrected pulse equivalent is calculated by multiplying the nominal basic pulse equivalent by the dynamic error compensation coefficient at the current sampling time; the product is the pulse equivalent value adapted to the current actual operating conditions.
[0085] Step S303: The cumulative loading volume is calculated by accumulating data over each sampling period. Within each sampling period, the system multiplies the number of original pulses generated by the flow meter within that period by the corresponding corrected pulse equivalent to obtain the actual fluid volume increment for that period. The volume increments from all sampling periods since the start of the loading operation are accumulated to obtain the cumulative loading volume at the current moment. This calculation process follows the formula below:
[0086]
[0087] in, Represents the period from the start of loading operations to the [number]th [year]. The cumulative loading volume per sampling period, unit according to The unit is determined, if If the unit is liters per pulse, then The unit is liter; Representative at the The number of raw pulses generated by the dual rotor flowmeter within each sampling period is a dimensionless integer. This represents the nominal basic pulse equivalent determined by the flow meter under calibrated conditions. In practical applications, the unit can be selected as liters per pulse or cubic meters per pulse according to the metering requirements. The following explanation uses liters per pulse as an example. Representative at the The dynamic error compensation coefficient, which is output by the long short-term memory neural network model at each sampling period and applied to the calculation of that period, is a dimensionless scalar.
[0088] Step S304: Setting the sampling period and integration time. In this method, the duration of each sampling period is set to 100 milliseconds, synchronized with the 100Hz sampling frequency of the sensor data in step S102. The corrected instantaneous flow rate is represented by the volumetric flow rate per unit time, calculated from the corrected pulse equivalent and the original number of pulses. Its value is equal to the volume increment within the current sampling period divided by the sampling period duration. The cumulative load is updated and stored by the accumulator inside the edge computing gateway at the end of each sampling period. The updated cumulative load is synchronously sent to the field programmable logic controller for process monitoring and shutdown control.
[0089] Step S305, Dynamic Error Compensation Coefficient Boundary Limitation. To ensure the continuity and safety of the metering system under abnormal operating conditions, the value range of the dynamic error compensation coefficient is strictly limited to a closed interval of 0.985 to 1.015. This interval is the preset allowable range for error compensation. If the coefficient value output by the Long Short-Term Memory Neural Network model exceeds this range, the edge computing gateway will determine that the current inference result is unreliable and trigger the redundancy compensation mechanism.
[0090] Step S306, Redundancy Compensation Mode Switching. When the dynamic error compensation coefficient is detected to exceed the preset range of 0.985 to 1.015, the system automatically switches from the neural network-based adaptive compensation mode to the Reynolds number-based linear interpolation compensation mode. In this redundancy mode, the system performs the following operations:
[0091] First, the instantaneous Reynolds number is calculated based on the instantaneous flow velocity and the temperature-corrected kinematic viscosity of the medium during the current sampling period. The instantaneous flow velocity is obtained by converting the number of original pulses within the current sampling period into the sampling period duration. The kinematic viscosity is calculated by combining the fluid density and temperature values obtained in step S1 with the medium's viscosity-temperature characteristic curve. The formula for calculating the Reynolds number is as follows: ,in For instantaneous flow velocity, The inner diameter of the flow meter measuring tube. This represents the kinematic viscosity of the medium.
[0092] Secondly, using the calculated Reynolds number as the query index, the corresponding compensation coefficient value is retrieved from the instrument coefficient curve table pre-stored in the local memory of the edge computing gateway. This instrument coefficient curve table is an offline data file generated during the flowmeter's factory calibration or periodic verification according to national metrological verification regulations. It is generated by experimentally determining the deviation relationship between the actual instrument coefficient and the nominal basic pulse equivalent under different Reynolds number operating conditions. The curve table uses the Reynolds number as the abscissa and the relative deviation of the instrument coefficient as the ordinate, stored in the form of discrete data points. Intermediate values between adjacent data points are calculated using a linear interpolation method.
[0093] Finally, the relative deviation value of the instrument coefficient obtained by retrieval or interpolation is used as the redundancy compensation coefficient to replace the abnormal coefficient of the original neural network output. This coefficient is then substituted into the formula in step S303 to continue the correction calculation of the pulse equivalent. The system continuously monitors the recovery of the neural network output in redundancy mode. If the output coefficient returns to the range of 0.985 to 1.015 for 10 consecutive sampling cycles, it automatically switches back to neural network compensation mode.
[0094] In summary, step S3 applies the dynamic error compensation coefficient generated in step S2 to the flow metering process. By correcting the pulse equivalent of each sampling cycle point by point, the nonlinear measurement error introduced by Reynolds number changes and temperature and pressure fluctuations is eliminated. The obtained cumulative loading volume It serves as the core data for real-time monitoring and display of the loading process, and also provides a cumulative reference for accurately determining the timing of the end-point shutdown in the subsequent step S4.
[0095] Finally, in step S4, the timing of the shutdown at the loading end is precisely controlled to eliminate shutdown errors caused by fluid inertia and residual kinetic energy in the pipeline. This process is specifically implemented through the following sub-steps.
[0096] Step S401: Threshold determination for entering pre-shutdown mode; the system continuously monitors the cumulative load output in step S303. .when When the preset first percentage threshold, i.e., 95% of the target loading volume, is reached, the system automatically switches from normal loading mode to pre-shutdown mode. The target loading volume is set by the operator via a host computer and sent to the field programmable logic controller before the loading operation begins.
[0097] Step S402: Adjust the CNC valve to a low opening state. In pre-shutdown mode, the field-programmable logic controller (FPGA) sends an opening adjustment command to the CNC valve, controlling the valve opening to linearly decrease from 100% fully open to a low opening state of 15% to 20%. The linear ramp time for opening adjustment is set to 2 seconds to ensure a smooth decrease in fluid velocity. The purpose of this operation is to reduce the fluid velocity in the pipeline in advance, thereby reducing the water hammer effect impact at the final shut-off moment.
[0098] Step S403: Real-time acquisition of pressure gradient parameters. In pre-shutdown mode, the system acquires data from multiple pressure monitoring points before and after the CNC valve in real time and calculates the pressure gradient accordingly. The pressure monitoring points are located 5 meters and 10 meters upstream of the CNC valve, respectively, and pressure transmitters are installed at both locations. The pressure gradient is calculated by taking the pressure value at 5 meters upstream. Subtract the pressure value at 10 meters upstream Then divide the difference by the distance of 5 meters between the two monitoring points, that is... This pressure gradient parameter reflects the stability of the current flow field.
[0099] Step S404: Calculate the relevant parameters of fluid kinetic energy, combining the fluid density obtained in step S1. and the instantaneous flow rate at the current moment To assess the kinetic energy of the fluid within the pipeline. Instantaneous flow velocity. It is obtained by converting the number of original pulses in the current sampling period in step S303 with the nominal cross-sectional area of the pipeline.
[0100] Step S405: Calculate the dynamic pre-shutdown amount using the kinetic energy prediction model. Specifically, the system invokes the kinetic energy prediction model deployed in the edge computing gateway to calculate the dynamic pre-shutdown amount caused by fluid inertia. This dynamic pre-shutdown amount represents the volume of fluid that will continue to flow through the valve and into the tanker from the moment the field-programmable logic controller issues a full-close command until the moment the CNC valve spool completely cuts off the fluid. The formula for calculating this volume is as follows:
[0101]
[0102] in, Represents the dynamic pre-shutdown quantity, in cubic meters or liters; The instantaneous flow velocity at the current sampling moment is expressed in meters per second. The nominal cross-sectional area of the loading pipeline, in square meters; The system's overall response delay time is the sum of the electrical delay from the edge computing gateway issuing the shutdown command to the start of the CNC valve core's movement, and the mechanical movement time of the valve core. The unit is seconds, and the value ranges from 0.2 seconds to 0.5 seconds. The specific value is determined by the factory parameters of the CNC valve and preset in the system.
[0103] This represents the velocity decay acceleration term during valve closing, measured in meters per second squared. Its value is pre-calibrated based on the valve closing characteristic curve. For CNC valves with linear closing characteristics... Values ; This represents the pressure gradient correction coefficient, a dimensionless empirical coefficient with a value ranging from 0.01 to 0.05. The specific value is determined through on-site commissioning based on pipeline specifications and media type. The pressure gradient calculated in step S403 is represented by megapascals per meter. The bulk modulus correction factor represents the medium, with the unit being cubic meters per megapascal. Its value is determined by the type of medium. For example, the value is 0.0012 cubic meters per megapascal for 92-octane gasoline and 0.0008 cubic meters per megapascal for 0-grade diesel. This represents the estimated sudden increase in upstream pressure at the instant the valve closes, expressed in megapascals (MPA). This value is derived from an empirical formula based on the current flow velocity and pipeline characteristics. Estimate, of which This is the pipeline resistance coefficient, which is pre-calibrated based on the pipeline layout.
[0104] The physical meaning of each term in the formula is as follows: First term This represents the baseline residual flow rate that is stable at the current flow rate during the response delay time.
[0105] Second item This represents the reduction in flow volume due to the decrease in flow velocity after the valve begins to close;
[0106] Third item This represents the contribution of the pressure gradient to the correction of the excess flow rate. A larger pressure gradient indicates a more unstable flow field, requiring additional margin to be reserved.
[0107] Fourth item This represents the volume compensation introduced due to the compression of the liquid caused by the sudden increase in pressure at the moment of shutdown.
[0108] Step S406: Calculate the remaining load capacity and trigger a shutdown command. The system calculates the remaining load capacity in real time, and its value is equal to the target load capacity minus the current cumulative load capacity output in step S303. When the remaining load is exactly equal to the dynamic pre-shutdown amount calculated in step S405. At that moment, the field-programmable logic controller (FPGA) immediately sends a complete shut-off command to the numerically controlled valve (NCV). Upon receiving the command, the NCV executes a rapid shut-off action, completing full closure within its own mechanical response time.
[0109] In summary, by using a kinetic energy prediction model to accurately predict the shut-off residual flow at the loading end in step S4, and by advancing the issuance of the shut-off command to the instant when the dynamic pre-shut-off amount exactly equals the remaining loading amount, this control strategy effectively solves the shut-off error problem caused by valve response lag and fluid inertia in traditional quantitative loading, achieving high-precision zero-error pump shutdown at the loading end.
[0110] On the other hand, the petrochemical intelligent storage and transportation quantitative loading optimization system based on big data disclosed in the embodiments of this application includes:
[0111] A multi-dimensional sensor array, deployed at different locations in the loading pipeline, is used to collect fluid state data in real time. It includes at least a high-precision platinum resistance temperature sensor, a pressure transmitter, a Coriolis mass flow meter, a dual rotor flow meter, an environmental transmitter, and a pumping frequency feedback module.
[0112] The field-programmable logic controller is electrically connected to the multidimensional sensor array and is used to synchronously latch and generate multidimensional synchronous data frames with consistent timestamps, based on the rising edge of the pulse generated by the dual rotor flowmeter as a trigger signal.
[0113] The edge computing gateway communicates with the field programmable logic controller and has an offline-trained long short-term memory neural network model and a kinetic energy prediction model deployed inside. The edge computing gateway is used to calculate the dynamic error compensation coefficient in real time based on multi-dimensional synchronous data frames, perform redundancy compensation mode switching, calculate the cumulative load based on the dynamic error compensation coefficient or redundancy compensation coefficient, and call the kinetic energy prediction model to calculate the dynamic pre-shutdown amount in the pre-shutdown mode.
[0114] The numerical control actuator includes at least a numerical control valve, which is electrically connected to a field programmable logic controller (PLC) to receive opening adjustment commands and complete shut-off commands from the PLC, so as to control the flow and flow of fluid in the loading pipeline.
[0115] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects.
[0116] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for optimizing the quantitative loading of petrochemical intelligent storage and transportation based on big data, characterized in that, Includes the following steps: Step S1: After the loading operation starts, the fluid state data in the loading pipeline is collected synchronously through the field programmable logic controller, and the instantaneous temperature, instantaneous pressure and fluid density are latched synchronously based on the pulse signal generated by the dual rotor flow meter to form a multi-dimensional synchronous data frame with consistent timestamps. Step S2: Using a long short-term memory neural network model deployed in the edge computing gateway, the fluid state parameters in the multidimensional synchronous data frame are processed to output dynamic error compensation coefficients in real time. When the dynamic error compensation coefficients exceed the preset allowable range, the system automatically switches to the redundancy compensation mode, calculates the instantaneous Reynolds number based on the instantaneous flow velocity and the kinematic viscosity of the medium, and obtains the redundancy compensation coefficients from the pre-stored instrument coefficient curve table accordingly. Step S3: In each sampling period, the nominal basic pulse equivalent of the flow meter is corrected in real time according to the received dynamic error compensation coefficient or the redundancy compensation coefficient to obtain the corrected pulse equivalent. Combined with the number of original pulses generated by the dual rotor flow meter in the sampling period, the cumulative loading amount is obtained. Step S4: When the cumulative loading amount reaches the preset proportional threshold, switch to the pre-shutdown mode and adjust the CNC valve to a low opening state. In pre-shutdown mode, the built-in kinetic energy prediction model is invoked to calculate the dynamic pre-shutdown amount; when the remaining load is equal to the dynamic pre-shutdown amount, a complete shutdown command is sent to the numerical control valve to complete the loading.
2. The method according to claim 1, characterized in that, Step S1 specifically includes: The output data of all sensors are synchronously acquired through the backplane bus or opto-isolated signal acquisition module of the field programmable logic controller at a preset sampling frequency; and the pulse rising edge generated by the dual rotor flow meter is used as the reference trigger signal. At the same millisecond moment, the field programmable logic controller synchronously latches the instantaneous temperature acquired by the high-precision platinum resistance temperature sensor, the instantaneous pressure acquired by the pressure transmitter, and the current value of the fluid density output by the Coriolis mass flow meter to form the multidimensional synchronous data frame with consistent timestamps.
3. The method according to claim 1, characterized in that, In step S1, the fluid density is determined in the following way: the first density value directly measured and output by the Coriolis mass flow meter is compared in real time with the second density value calculated in real time based on instantaneous temperature and instantaneous pressure and combined with the medium compressibility coefficient equation. If the difference between the two exceeds the preset density threshold and the duration exceeds the preset time threshold, the sensor abnormality alarm is triggered. Under normal operating conditions, the first density value is preferred as the main density data.
4. The method according to claim 1, characterized in that, In step S2, the fluid state parameters in the multidimensional synchronous data frame are processed using a long short-term memory neural network model deployed in the edge computing gateway, specifically including: The edge computing gateway performs deviation standardization processing on various fluid state parameters in the multidimensional synchronous data frame, and maps the original physical quantities with different dimensions to a preset numerical range. The standardized data is organized into a six-dimensional feature vector sequence that includes instantaneous temperature, instantaneous pressure, instantaneous flow rate, viscosity correction factor, ambient temperature, and pumping frequency. The six-dimensional feature vector sequence is input into the long short-term memory neural network model deployed in the edge computing gateway to output the dynamic error compensation coefficient corresponding to the current sampling time in real time.
5. The method according to claim 1, characterized in that, In step S2, the preset allowable range of the dynamic error compensation coefficient is a closed interval from 0.985 to 1.015; the automatic switching to the redundancy compensation mode specifically includes: When the coefficient value output by the long short-term memory neural network model exceeds the closed interval, the current inference result is determined to be unreliable. The instantaneous Reynolds number is calculated based on the instantaneous flow rate of the current sampling period and the temperature-corrected kinematic viscosity of the medium. Using the calculated instantaneous Reynolds number as the query index, the corresponding compensation coefficient value is retrieved from the instrument coefficient curve table pre-stored in the local memory of the edge computing gateway. The intermediate value between adjacent data points is calculated using a linear interpolation method, and the relative deviation value of the instrument coefficient obtained by retrieval or interpolation is used as the redundancy compensation coefficient. In the redundancy compensation mode, if the coefficient values output by the long short-term memory neural network model all return to the closed interval within a preset number of sampling periods, the mode will automatically switch back to the mode where the dynamic error compensation coefficients are output by the long short-term memory neural network model.
6. The method according to claim 1, characterized in that, In step S3, the cumulative loading volume since the start of the loading operation is obtained by summing up the data, and the calculation follows the formula below: in, Represents the period from the start of loading operations to the [number]th [year]. Cumulative loading volume per sampling period; Representative at the The number of raw pulses generated by the dual rotor flowmeter within each sampling period; This represents the nominal basic pulse equivalent determined by the flow meter under calibration conditions; Representative at the The dynamic error compensation coefficient or the redundancy compensation coefficient applied at each sampling period.
7. The method according to claim 1, characterized in that, In step S4, when the cumulative loading amount reaches a preset proportional threshold, the system switches to a pre-shutdown mode and adjusts the CNC valve to a low opening state, specifically including: When the cumulative loading volume reaches 95% of the target loading volume, the system automatically switches from normal loading mode to pre-shutdown mode; The field programmable logic controller sends an opening adjustment command to the numerically controlled valve, controlling the valve opening to linearly decrease from a fully open state to a low opening state of 15% to 20%; In pre-shutdown mode, the system acquires data from pressure monitoring points set at different locations upstream of the CNC valve in real time, and calculates pressure gradient parameters to reflect the stability of the current flow field.
8. The method according to claim 7, characterized in that, In step S4, the built-in kinetic energy prediction model is invoked to calculate the dynamic pre-shutdown amount, and the calculation formula is as follows: in, This represents the dynamic pre-shutdown amount; Represents the instantaneous flow velocity at the current sampling moment; The nominal cross-sectional area representing the loading pipeline; Represents the overall system response delay time; This represents the velocity decay acceleration term during valve closure; This represents the pressure gradient correction factor; This represents the pressure gradient parameter; The bulk modulus correction factor represents the medium. This represents the estimated sudden increase in upstream pressure at the instant the valve closes.
9. The method according to claim 1, characterized in that, In step S4, when the remaining load is equal to the dynamic pre-shutdown amount, a complete shutdown command is sent to the numerical control valve. Specifically, this includes: the system calculates the remaining load in real time, where the remaining load is the target load minus the current cumulative load. When the remaining load is equal to the dynamic pre-shutdown amount, the field programmable logic controller immediately sends a complete shutdown command to the numerical control valve, and the numerical control valve performs a rapid shutdown action after receiving the command.
10. A petrochemical intelligent storage and transportation quantitative loading optimization system based on big data, characterized in that, The system for implementing the method as described in any one of claims 1 to 9 includes: A multi-dimensional sensor array, deployed at different locations in the loading pipeline, is used to collect fluid state data in real time. It includes at least a high-precision platinum resistance temperature sensor, a pressure transmitter, a Coriolis mass flow meter, a dual rotor flow meter, an environmental transmitter, and a pumping frequency feedback module. A field-programmable logic controller, electrically connected to the multidimensional sensor array, is used to synchronously latch and generate a multidimensional synchronous data frame with consistent timestamps, using the rising edge of the pulse generated by the dual rotor flowmeter as a reference trigger signal. An edge computing gateway is communicatively connected to the field-programmable logic controller. It has an offline-trained long short-term memory neural network model and a kinetic energy prediction model. The edge computing gateway is used to calculate the dynamic error compensation coefficient in real time based on the multi-dimensional synchronous data frame, perform redundancy compensation mode switching, calculate the cumulative load based on the dynamic error compensation coefficient or redundancy compensation coefficient, and call the kinetic energy prediction model to calculate the dynamic pre-shutdown amount in the pre-shutdown mode. The numerical control actuator includes at least a numerical control valve, which is electrically connected to the field programmable logic controller (PLC) and is used to receive opening adjustment commands and complete shut-off commands issued by the PLC to control the flow and flow rate of fluid in the loading pipeline.