Real-time monitoring method and system for oil mixing section of product oil pipeline
By using adaptive weighted statistics and Monte Carlo simulation to calculate control limits, oil density changes can be monitored in real time, solving the shortcomings of existing mixed oil monitoring technologies, enabling rapid identification of mixed oil sections and reducing false alarms, thereby improving oil quality and economic benefits.
Patent Information
- Application Number
- CN202510880305.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-10
AI Technical Summary
Existing oil mixing monitoring technology is unable to timely and effectively identify and warn of oil mixing interfaces in various application scenarios, resulting in oil quality deterioration and economic losses, and fails under sudden environmental disturbances.
By constructing adaptive weight statistics and Monte Carlo simulation to calculate control limits, combining the dichotomy method to monitor the change of oil density mean in real time, using the adaptive weight function to dynamically adjust the weight, and combining Monte Carlo simulation to optimize the control limits, rapid identification of mixed oil sections and reduction of false alarms can be achieved.
It improves the universality and sensitivity of oil mixing monitoring, reduces the false alarm rate, ensures the stability and economy of oil quality, and adapts to the data form of various practical application scenarios.
Smart Images

Figure CN120763451A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil mixing monitoring, and in particular to a real-time monitoring method and system for an oil mixing section of a finished oil pipeline. Background Art
[0002] During the continuous transportation of multiple batches of refined oil products through pipelines, the physical and chemical properties of different oil grades can lead to the formation of a mixed oil interface when adjacent batches come into contact. The oil composition at this interface is complex, making it difficult to directly utilize or easily separate it, and thus failing to meet the quality standards of a single oil product. If the arrival and expansion of this mixed oil interface during the transportation process is not promptly and accurately identified and warned of, it can lead to cross-contamination between adjacent batches, resulting in deterioration in the quality of the target oil product.
[0003] When untreated mixed oil enters storage and distribution, it disrupts downstream operations, causing finished oil products to deviate from national and industry quality standards and become unsuitable for critical applications in transportation, industry, and other sectors. The resulting economic losses extend beyond the loss of value inherent in the mixed oil, impacting supply chain efficiency and reputation, and even triggering legal and security risks. Therefore, precise identification of mixed oil, real-time monitoring of the transportation process, and intelligent alarm technology have become key areas of research to ensure efficient and high-quality refined oil pipeline transportation.
[0004] Currently, oil contamination monitoring technologies are primarily divided into two categories: The first, based on statistical process control, identifies the starting point of the contamination section and then combines it with a contamination length estimation model (physical formulas, machine learning algorithms, etc.) to predict the arrival time of the contamination at the site and execute the cut. Physical formulas, exemplified by the Austin-Palfrey formula, are subject to heterogeneity in pipeline materials, geographic parameters, and other factors, resulting in insufficient universality and accuracy. Machine learning algorithms rely on large-scale historical data for training and are difficult to accommodate interference from environmental variables, limiting their predictive effectiveness. The second approach relies on data from the contamination section at the previous site, integrating parameters such as oil flow rate, temperature, and pressure to deduce the state of the contamination section at the current site. However, abnormal events such as equipment failures and sudden environmental disturbances cannot be predicted using historical operating data, rendering these methods ineffective in emergency scenarios and making it difficult to output effective prediction results. Summary of the Invention
[0005] In view of this, the present invention provides a real-time monitoring method and system for the mixed oil section of a finished oil pipeline. By constructing a robust and sensitive online monitoring method, rapid alarms for the occurrence and end of mixed oil can be achieved and false alarms can be reduced, thereby addressing the deficiency of mixed oil monitoring technology in being unable to adapt to various application scenarios and provide timely and effective predictions.
[0006] In a first aspect, the present invention provides a real-time monitoring method for a mixed oil section of a product oil pipeline, comprising:
[0007] Obtain the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set;
[0008] Construct an adaptive weight statistic to monitor the change of the mean oil density;
[0009] Using the cleaned data set, the control limits were calculated by combining the bisection method and Monte Carlo simulation;
[0010] Real-time monitoring of oil density data and calculation of current monitoring statistics are performed. By comparing the current monitoring statistics with the control limits, the change state of the oil density mean is identified to determine the oil mixing section.
[0011] The embodiments of the present invention construct a universal method framework for online monitoring of continuous changes in mean oil density. The framework includes data cleaning of raw data, adaptive weight statistics, calculation of control limits using a combination of dichotomy and Monte Carlo simulation, and real-time monitoring and comparison to determine the oil mixing stage. This method is not targeted at a specific data distribution, which improves the universality of the method. It can efficiently process data, accurately capture changes in mean oil density, scientifically optimize parameters and control limits, significantly reduce false alarm rates, and more quickly identify the oil mixing endpoint. Furthermore, the method does not rely on large amounts of historical data, has moderate computing resource requirements, and can adapt to different data formats in various practical application scenarios.
[0012] In an optional implementation, the adaptive weight statistic is expressed as:
[0013]
[0014] in:
[0015]
[0016]
[0017] Where T1 represents the observation time corresponding to the starting point of the monitoring interval, L represents the length of the monitoring interval, indicating that there are L observations in the observation interval, and L samples are used to calculate the monitoring statistic each time, u, v represent the time point corresponding to a certain observation value in the monitoring interval, ω t represents the weight, ω t =ω(X t ;λ,a) represents the adaptive weight function, The l in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-L+1,u] compared to the interval [T1-L+1,v], where u≥v, The r in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-u+1, T1] compared to the interval [T1-v+1, T1].
[0018] Compared with the traditional equal weight statistical method (such as the EWMA control chart), the embodiment of the present application is more sensitive to the dynamic drift of the oil density mean value, and can quickly identify the starting and ending signals of the oil mixing section. At the same time, by comparing the sample mean value changes in different intervals, a two-way monitoring mechanism is formed, which can not only judge the mean value rising trend at the beginning of oil mixing, but also capture the mean value stable signal at the end of oil mixing, and realize the whole process dynamic monitoring of the oil mixing section. In addition, the statistical quantity does not depend on the data independence assumption, and can effectively adapt to the time correlation characteristics of the oil density data affected by temperature, pressure and other factors, reduce false positives and false negatives caused by data dynamics, and show higher sensitivity and robustness in actual product oil pipeline monitoring.
[0019] In an alternative embodiment, the adaptive weight function is represented as follows:
[0020]
[0021] wherein λ, a, b are constants, and
[0022] The adaptive weight function of the embodiment of the present application can dynamically adjust the weight for different intervals of oil density data by using a piecewise function. The piecewise structure is simple and clear, and the function form in each interval is not complex, so that the weight calculation can be quickly completed in actual engineering application, and the high-frequency data processing requirements of pipeline real-time monitoring can be adapted. At the same time, through parameter constraints and piecewise logic, the data fluctuations under different working conditions have a certain robustness. Even if the data is temporarily abnormal due to interference factors such as pipeline pressure and flow rate, the interval weight can also play a "buffer" role to avoid the statistical quantity from fluctuating sharply and ensure the stable operation of the system.
[0023] In an alternative embodiment, the weight parameters λ and a in the adaptive weight function are determined according to experience to obtain multiple initial values, and the optimal parameters that maximize the sensitivity of the statistical quantity to the mean value change are selected by simulating the monitoring performance under different parameter values.
[0024] The embodiment of the present application determines multiple initial values of the adaptive weight function parameters according to experience, combines the monitoring performance under different values by simulation, and selects the optimal parameters that maximize the sensitivity of the statistical quantity to the mean value change, so that the adaptive weight function can accurately adapt to the various working conditions of the product oil pipeline, and the response sensitivity to the density change during oil mixing is strengthened. In the pursuit of high sensitivity, the false positives, false negatives and other monitoring performances are balanced, the universality of the method is improved, the monitoring method is also given the ability to dynamically iterate and optimize with the pipeline operation, and the accuracy, reliability and long-term effectiveness of the oil mixing monitoring are ensured.
[0025] In an optional embodiment, the method of calculating control limits using the cleaned data set in combination with a dichotomy method and Monte Carlo simulation includes:
[0026] The upper and lower boundary candidate values of the initial control limits are set, and the control limits are iteratively adjusted using the dichotomy method and Monte Carlo simulation until the error between the average run length of the simulated data and the target average run length is less than the preset threshold, thus obtaining the control limits.
[0027] This embodiment of the present invention uses a bisection method to rapidly narrow the search range for control limits. Combined with Monte Carlo simulation, it fully simulates data variations under different operating conditions, and iteratively adjusts the control limits to match the actual data characteristics. By optimizing the average run length, the resulting control limits can quickly identify oil contamination when it occurs while effectively avoiding false alarms caused by normal fluctuations. This calculated control limit precisely balances monitoring sensitivity and stability, enabling more accurate and timely identification of contamination zones, reducing oil loss, and improving the safety and economic efficiency of pipeline operations. It also adapts to the complex operating conditions of different pipelines, enhancing the method's versatility and practicality.
[0028] In an optional embodiment, the step of comparing the current monitoring statistics with the control limits to identify the change state of the oil density mean and determine the oil mixing section includes:
[0029] When the monitoring statistic exceeds the control limit for the first time, it is determined that the oil density mean begins to change and oil mixing begins to occur, and a cutting signal is output; until the monitoring statistic is less than the control limit again, it is determined that the oil density mean stops changing continuously and oil mixing ends, and cutting stops.
[0030] An embodiment of the present invention provides a method for identifying the change state of the oil density mean and determining the oil mixing section by comparing the current monitoring statistics with the control limits. This method can accurately capture the start and end nodes of the oil mixing section, directly linking production cutting operations to reduce oil contamination and pure oil waste. The judgment rules are simple and easy to implement, and pipeline interference factors can be dynamically filtered. It forms a closed-loop collaboration with the control limit calculation process to ensure the accuracy and robustness of oil mixing monitoring.
[0031] In a second aspect, the present invention provides a real-time monitoring system for a mixed oil section of a product oil pipeline, the system comprising:
[0032] The finished oil data acquisition module is used to obtain the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set;
[0033] Statistics construction module, used to construct adaptive weight statistics for monitoring changes in the mean oil density;
[0034] The control limit calculation module is used to calculate the control limits using the cleaned data set by combining the dichotomy method and Monte Carlo simulation;
[0035] The mixed oil section monitoring module is used to monitor oil density data in real time and calculate the current monitoring statistics. By comparing the current monitoring statistics with the control limits, the change state of the oil density mean is identified to determine the mixed oil section.
[0036] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to thereby execute the real-time monitoring method for the mixed oil section of a finished oil pipeline according to the first aspect or any corresponding embodiment thereof.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the real-time monitoring method for the mixed oil section of a finished oil pipeline according to the first aspect or any corresponding embodiment thereof.
[0038] In a fifth aspect, the present invention provides a computer program product comprising computer instructions for causing a computer to execute the method for real-time monitoring of a mixed oil section in a finished oil pipeline according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 1 is a flow chart of a method for real-time monitoring of a mixed oil section in a product oil pipeline according to an embodiment of the present invention;
[0041] Figure 2 This is a schematic diagram of determining the oil mixing section by comparing the current monitoring statistics with the control limits to identify the change state of the oil density mean value according to an embodiment of the present invention;
[0042] Figures 3(A)-3(D) 1 is a comparison chart of the backtesting effects of four methods according to an embodiment of the present invention on the pure oil segment;
[0043] Figures 4(A)-4(D) 3. This is a comparison diagram of the effects of online monitoring of the oil mixing section using four methods according to an embodiment of the present invention;
[0044] Figure 5 A structural block diagram of a real-time monitoring system for a mixed oil section of a product oil pipeline according to an embodiment of the present invention;
[0045] Figure 6 A schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0047] In order to overcome the deficiency of existing oil mixing monitoring technology in being unable to adapt to various application scenarios and make timely and effective predictions, this embodiment provides a real-time monitoring method for the oil mixing section of a product oil pipeline. Figure 1 FIG. 1 is a flow chart of a method for real-time monitoring of a mixed oil section in a product oil pipeline according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0048] Step S1: Obtain the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set.
[0049] Specifically, the oil density data is cleaned by processing outliers, deleting 0 and -999, and deleting null values. The resulting dataset is represented as where X t represents the observed value of oil density at time t; t A Represents the observed value The observation time, which ranges from negative to 0, represents the observation value of the past period of time; n0 represents the total number of observations, θ0 is the data set The mean of the sample in .
[0050] In one embodiment, the data set is obtained by the following procedure:
[0051] Input: a list of type
[0052] Output: a new list
[0053] Initialize an empty list
[0054] Forifrom 1to n:
[0055] If the i-th element in data contains None, an empty string, a string with a value of 0 or -999, then skip this loop;
[0056] Otherwise, add the element to the list middle;
[0057] End for
[0058] By explicitly deleting outliers such as 0, -999, and null values, the embodiments of the present invention can effectively purify raw data, improve the quality of the data set, lay a reliable foundation for subsequent monitoring and analysis, avoid misjudgments due to abnormal data, and ensure the accuracy of subsequent statistical calculations and control limit determinations.
[0059] Step S2: construct an adaptive weight statistic to monitor the change of the mean oil density.
[0060] Specifically, an adaptive weighted statistic (AWSMM) is constructed to monitor changes in oil density characteristics. The introduction of adaptive weights into the monitoring statistic assigns higher weights to potential changes. Compared to equally weighted cumulative sum statistics, this allows for faster and more accurate monitoring of changes, reducing false alarm rates. Specifically:
[0061]
[0062] in:
[0063]
[0064] T1 represents the observation time corresponding to the starting point of the monitoring interval, L represents the length of the monitoring interval, indicating that there are L observations in the observation interval, and L samples are used each time to calculate the monitoring statistic (for example, the optimal value of L is 50. Increasing the value of L can tolerate sudden interference from external noise factors, reduce the false alarm rate, and improve monitoring stability. However, storing and processing more data, especially in high-frequency sampling and high-dimensional scenarios, will significantly increase computing and memory consumption; if there are sufficient computing resources, the value of L can be appropriately increased). u and v represent the time points corresponding to a certain observation value in the monitoring interval, ω t represents the weight, ω t =ω(X t ;λ,a) represents the adaptive weight function.
[0065] The l in the statistic indicates that the statistic is the change in the sample mean over the interval [T1-L+1, u] compared to the interval [T1-L+1, v], where u ≥ v. If the mean does not change over the interval [T1-L+1, u], the statistic is 0; otherwise, it is not 0. The r in the statistic indicates that the statistic is the change in the sample mean between the interval [T1-u+1, T1] and the interval [T1-v+1, T1]. The superscripts l and r in these two statistics are used to distinguish between the monitoring intervals, which can be understood as monitoring from two different directions, namely left and right.
[0066] Compared to traditional equally weighted statistical methods (such as EWMA control charts), it is more sensitive to the dynamic drift of the oil density mean and can quickly identify the start and end signals of the oil mixing section. At the same time, by comparing the changes in sample means in different intervals, a two-way monitoring mechanism is formed. It can not only determine the rising trend of the mean at the beginning of oil mixing, but also capture the mean stabilization signal at the end of oil mixing, thus achieving full dynamic monitoring of the oil mixing section. In addition, this statistic does not rely on the assumption of data independence and can effectively adapt to the time-correlation characteristics of oil density data affected by factors such as temperature and pressure, reducing false positives and false negatives caused by data dynamics, and demonstrating higher sensitivity and robustness in actual refined oil pipeline monitoring.
[0067] Furthermore, the adaptive weight function is expressed as follows:
[0068]
[0069] Among them, λ, a, and b are all constants, and
[0070] In one embodiment, when |X t When -θ0|<a, the weight ω(|X t -θ0|) is a small constant λ, for the observation value X t When observation errors are caused by external factors such as temperature, smaller errors will not affect the value of the weight. t When -θ0|>b, the weight ω(|X t -θ0|) is fixed to 1. When there are large outliers in the observations, the corresponding weights can be controlled.
[0071] The adaptive weight function provided by the embodiment of the present invention adopts a piecewise function to dynamically adjust the weight for different intervals of oil density data (such as the pure oil stable area, the mixed oil transition area, and the mixed oil stable area). <a(数据波动小、接近纯油特征)时,赋予基础权重λ,稳定低权重避免噪声干扰;当a≤x≤b(混油过渡阶段,数据变化敏感)时,通过二次函数嵌套的复杂计算,精准捕捉油密度均值的连续渐变,放大混油趋势信号;当x> When b (the oil mixture is basically stable or reaches a new steady state), the weight is reset to 1, strengthening the response to obvious changes and covering the entire change cycle of oil density. By assigning higher weights to potential change processes, the sensitivity of the monitoring statistics to identifying changes is improved, enabling the algorithm to issue early warnings quickly and accurately.
[0072] By The parameters are associated to form a synergistic regulation mechanism of λ, a and b. By adjusting λ, the "steepness" of the weight change of the transition section can be controlled, and in combination with the interval boundary defined by a and b, different pipe diameters and oil types of the pipeline can be adapted, the identification accuracy of the start and end of the mixed oil can be optimized, and the false alarm and missed alarm risks can be reduced.
[0073] In the adaptive weight function of the embodiment, the weight parameters λ and a are determined according to experience to obtain multiple initial values. The monitoring performance under different parameter values is simulated, and the optimal parameters that maximize the sensitivity of the statistical quantity to the mean value change are selected. Specifically, some reasonable values of the parameters λ and a are given according to experience, and the mixed oil start point and end point are obtained by simulation under different parameter values, wherein the average number of alarm signals required when the process is out of control is smaller, and the smaller the value is, the faster the drift can be found. A set of optimal parameters is found to minimize the mixed oil start point and end point.
[0074] Due to differences in pipe diameter, oil, transportation environment and the like, the oil density change law of the product oil pipeline is different. By pre-setting multiple initial parameters according to experience and then screening in combination with simulation calculation, the adaptive weight function can adapt to the actual working conditions of the specific pipeline, ensure accurate capture of the mean value change of the oil density (characteristic when mixed oil occurs) of the pipeline, and improve the monitoring pertinence.
[0075] The parameters are screened to maximize the sensitivity of the statistical quantity to the mean value change, so that the adaptive weight function can more sensitively detect the subtle gradual change of the oil density at the beginning of the mixed oil, and issue a mixed oil warning in advance. At the end of the mixed oil, the signal of the stable density regression can also be quickly identified, the mixed oil segment judgment error can be reduced, the timeliness and accuracy of the mixed oil cutting operation can be improved, and the oil product loss can be reduced. The present application is not limited to fixed parameters, but is optimized by experience and simulation, so that the adaptive weight function and the whole mixed oil monitoring method can be popularized to different product oil pipeline scenes, and even to medium interface monitoring of other fluid conveying pipelines, expand the technical application range, and enhance the universality and practicality of the method.
[0076] Step S3, using the cleaned data set, combining bisection method and Monte Carlo simulation calculation control limit.
[0077] Specifically, the upper boundary candidate value and the lower boundary candidate value of the initial control limit are set, the control limit is iteratively adjusted by using the bisection method and Monte Carlo simulation, until the error between the average run length of the simulation data and the target average run length is less than the preset threshold, and the control limit is obtained.
[0078] The control limit is calculated in this way, which has obvious advantages in the monitoring of mixed oil in product oil pipelines: the search range of the control limit is quickly narrowed by the dichotomy, the data changes under different working conditions are fully simulated by the Monte Carlo simulation, and the control limit is adjusted by iteration to adapt to the actual data characteristics. Taking the average run length (ARL) as the optimization objective, the obtained control limit can quickly identify the mixed oil (shorten the ARL and timely alarm) when the mixed oil occurs, and can effectively avoid false alarms caused by normal fluctuations (stabilize the ARL and ensure reliability). The control limit calculated in this way accurately balances the sensitivity and stability of monitoring, makes the mixed oil section more accurate and timely, reduces oil loss, improves the safety and economy of pipeline operation, and is also suitable for complex working conditions of different pipelines, enhancing the universality and practicality of the method.
[0079] In an embodiment, the control limit h is obtained by the following program flow A :
[0080] Input: data set Repeat simulation times Z, control upper limit h u , control lower limit h v , preset threshold ρ, target average run length ARL0 represents the average number of monitoring times before a false alarm occurs when the process is normal.
[0081] Output: control limit h A
[0082] Initialization: set h A = h v and arl0 = 0;
[0083]
[0084]
[0085] The control limit in the embodiment of the application is h A is determined by the following standard: in the unmixed oil state, the control chart has at most one false alarm in 12 hours. Then the alternative is to have at most one false alarm in a longer or shorter time than 12 hours. If the selected time is longer, the monitoring tends to be conservative, i.e., a larger h A , which is not prone to false alarms, but when mixed oil occurs, the alarm may be slightly late; on the contrary, if the selected time is shorter, the monitoring is more aggressive (smaller h A ), which will alarm faster when mixed oil occurs, but there may be more false alarms.
[0086] Step S4, real-time monitoring of oil density data and calculation of the current monitoring statistics, comparison of the current monitoring statistics with the control limit, and identification of the change state of the oil density mean to determine the mixed oil section.
[0087] Specifically, such as Figure 2 As shown, the present invention determines that the oil density mean starts to change and oil mixing begins to occur when the monitoring statistic exceeds the control limit for the first time, and outputs a cutting signal; until the monitoring statistic is less than the control limit again, it is determined that the oil density mean stops changing continuously and oil mixing ends, and the cutting is stopped.
[0088] The embodiment of the present invention uses the monitoring statistics crossing the control limit as the judgment basis, which fits the characteristic that the mean oil density changes continuously due to oil mixing. The first time it exceeds the limit, it accurately captures the start of oil mixing (the beginning of density gradient), and the second time it returns to the limit, it clearly shows the end of oil mixing (density returns to stability), so as to achieve full-cycle monitoring of the oil mixing section and avoid missing key nodes. The logic of outputting the cutting signal to stop cutting is directly related to the actual production action. Timely cutting at the beginning of oil mixing can reduce the contamination of mixed oils and reduce the subsequent separation cost; stopping cutting at the end can avoid excessive cutting and waste of pure oil, and improve the efficiency and economy of oil transportation. Real-time monitoring of the relationship between statistics and control limits can dynamically track the trend of oil density changes. In the face of interference factors such as flow and temperature in the finished oil pipeline, it can effectively filter noise based on the continuous calculation of statistics and comparison with control limits, stably identify the true state of oil mixing, and ensure the robustness of the monitoring system.
[0089] In one embodiment, the continuous changes of the oil density data characteristics are monitored online through the following program flow:
[0090] Input: constant L = 50, data set {X -L+1 ,…,X0}, control limit h A , weight parameters λ = 0.5 and a = 1.5, sample mean θ0.
[0091] Output: oil mixing cutting signal.
[0092]
[0093] This embodiment of the present invention compares current monitoring statistics with control limits to identify the changing state of the mean oil density and determine the oil mixing stage. This closed-loop connection is achieved with the aforementioned dichotomy method combined with Monte Carlo simulation to calculate control limits. The accuracy of the control limits ensures the reliability of the judgment logic. The application scenarios of this judgment logic also reversely verify the optimization direction of the control limits, promoting the continuous adaptation of the entire oil mixing monitoring method to pipeline operating conditions and forming a technical closed-loop advantage.
[0094] Since oil density is affected by various dynamic factors such as temperature, pressure, geographical location and operating conditions during pipeline transportation, its value changes continuously over time (dynamic). These factors have continuity and lag effects in time, which leads to strong time correlation between density data. Monitoring with traditional control charts will result in a large number of false alarms and delayed alarms. If the data observed at time t is Xt , the traditional EWMA control chart statistic The calculation method is as follows:
[0095]
[0096] is the EWMA control chart statistic at time t-1, λ e is a constant between 0 and 1, and the value is 0.1.
[0097] When exceeds the control limit h A , an alarm will be given. The form of the traditional Shewhart control chart statistic is
[0098]
[0099] Wherein μ0 and are the mean and variance of the data set . If μ0 and are unknown, they can be estimated using the data set . Since the EWMA control chart and the Shewhart control chart can only monitor the instantaneous change of the data characteristics and cannot monitor the continuous change, therefore, these two traditional control charts can only monitor the starting point of the mixed oil.
[0100] In addition, there is also an exponential weighted statistical control chart (EWSCC) that can monitor the continuous change of the data characteristics, as follows:
[0101]
[0102] Wherein
[0103]
[0104] And ω e is a fixed weight, and the value is 0.1.
[0105] Figures 3(A)-3(D) The comparison of the effects of the above four methods in the pure oil section back test is shown, the horizontal coordinate is time, the vertical coordinate is the corresponding oil density, the blue dotted line is the control limit of each method, if the value of the statistic exceeds the corresponding control limit, it is considered that the mixed oil has occurred, and the red marked point is the alarm point of the method. It can be seen that the EWMA control chart has the most false alarms, the false alarms of the Shewhart control chart and the EWSCC are significantly reduced compared with the EWMA control chart, but there are still false alarms. The monitoring statistic provided by the present application does not have false alarms, which can greatly reduce the waste of human resources.
[0106] Figures 4(A)-4(D)The effect of online monitoring of each method mixed with a section is shown, the abscissa is time, and the ordinate is the corresponding monitoring statistic. As shown in Figures 4(A)-4(D) All four methods can monitor the start of mixed oil, that is, the point where the red line intersects the black line on the left side of each subgraph. EWMA control chart, Shewhart control chart and the method provided by the present application alarm earliest, and the time is 00:47:58. EWSCC triggered the alarm at 00:48:10. Compared with EWMA control chart and Shewhart control chart, the method provided by the present application triggered the alarm at the same time, and much faster than EWSCC. For monitoring the end of mixed oil, that is, the intersection of the red line and the black line on the right side of the two graphs of Fig. 4(B) and Fig. 4(D), only EWSCC and the method provided by the present application can achieve this goal. EWSCC issued an alarm at 01:14:05, while the method provided by the present application embodiment has already issued an alarm at 01:08:59, which shows that the method provided by the present application embodiment identifies the end of mixed oil at a faster speed.
[0107] In this embodiment, a real-time monitoring system for a mixed oil section of a product oil pipeline is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0108] The present embodiment provides a real-time monitoring system for a mixed oil section of a product oil pipeline, as shown in Figure 5 , comprising:
[0109] The product oil data acquisition module 51 is used to acquire the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set;
[0110] The statistic construction module 52 is used to construct an adaptive weight statistic for monitoring the change of the oil density mean value;
[0111] The control limit calculation module 53 is used to calculate the control limit by using the cleaned data set in combination with the bisection method and Monte Carlo simulation;
[0112] The mixed oil section monitoring module 54 is used to monitor the oil density data in real time and calculate the current monitoring statistic, and to identify the change state of the oil density mean value by comparing the current monitoring statistic with the control limit to determine the mixed oil section.
[0113] In some optional embodiments, the adaptive weight statistic in the statistic construction module 52 is represented as:
[0114]
[0115] in:
[0116]
[0117] Where T1 represents the observation time corresponding to the starting point of the monitoring interval, L represents the length of the monitoring interval, indicating that there are L observations in the observation interval, and L samples are used to calculate the monitoring statistic each time, u, v represent the time point corresponding to a certain observation value in the monitoring interval, ω t represents the weight, ω t =ω(X t ;λ,a) represents the adaptive weight function, The l in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-L+1, u] compared to the interval [T1-L+1, v], where u ≥ v, The r in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-u+1, T1] compared to the interval [T1-v+1, T1].
[0118] In some optional implementations, the adaptive weight function is expressed as follows:
[0119]
[0120] Among them, λ, a, and b are all constants, and
[0121] In some optional embodiments, the parameter weight parameters λ and a in the adaptive weight function are determined to have multiple initial values based on experience, and the monitoring performance under different parameter values is simulated and calculated to select the optimal parameters that maximize the sensitivity of the statistic to the mean change.
[0122] In an optional embodiment, the control limit calculation module 53 includes:
[0123] an initial limit value setting unit, for setting an upper boundary candidate value and a lower boundary candidate value of an initial control limit;
[0124] The control limit determination unit is used to iteratively adjust the control limit using the dichotomy method and Monte Carlo simulation until the error between the average run length of the simulated data and the target average run length is less than a preset threshold, thereby obtaining the control limit.
[0125] In an optional embodiment, the mixed oil section monitoring module 54 specifically includes: when the monitoring statistic exceeds the control limit for the first time, it is determined that the oil density mean begins to change and oil mixing begins to occur, and a cutting signal is output; until the monitoring statistic is less than the control limit again, it is determined that the oil density mean stops continuously changing and oil mixing ends, and the cutting is stopped.
[0126] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0127] The real-time monitoring system for the mixed oil section of the finished oil pipeline in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0128] The embodiment of the present invention also provides a computer device having the above Figure 5 The real-time monitoring system of the mixed oil section of the finished oil pipeline is shown.
[0129] See also Figure 6 , Figure 6 Schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0130] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0131] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0132] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0133] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0134] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0135] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0136] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, can invoke or provide the method and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source files, executable files, installation package files and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0137] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A real-time monitoring method for a mixed oil section of a product oil pipeline, characterized in that: include: Obtain the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set; Construct an adaptive weight statistic to monitor the change of the mean oil density; Using the cleaned data set, the control limits were calculated by combining the bisection method and Monte Carlo simulation; Real-time monitoring of oil density data and calculation of current monitoring statistics are performed. By comparing the current monitoring statistics with the control limits, the change state of the oil density mean is identified to determine the oil mixing section.
2. The method according to claim 1, characterized in that The adaptive weight statistic is expressed as: in: Where T1 represents the observation time corresponding to the starting point of the monitoring interval, L represents the length of the monitoring interval, indicating that there are L observations in the observation interval, and L samples are used to calculate the monitoring statistic each time, u, v represent the time point corresponding to a certain observation value in the monitoring interval, ω t represents the weight, ω t =ω(X t ;λ,a) represents the adaptive weight function, The l in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-L+1, u] compared to the interval [T1-L+1, v], where u ≥ v, The r in the statistic indicates that the statistic is the change in the sample mean of the interval [T1-u+1, T1] compared to the interval [T1-v+1, T1].
3. The method according to claim 2, characterized in that The adaptive weight function is expressed as follows: Among them, λ, a, b are all constants, and 4. The method according to claim 3, characterized in that The parameter weight parameters λ and a in the adaptive weight function are determined to have multiple initial values based on experience. By simulating and calculating the monitoring performance under different parameter values, the optimal parameters that maximize the sensitivity of the statistic to the mean change are selected.
5. The method according to claim 1, wherein The control limits are calculated by combining the cleaned data set with the dichotomy method and Monte Carlo simulation, including: Set the upper and lower boundary candidate values of the initial control limits; The control limits are iteratively adjusted using the bisection method and Monte Carlo simulation until the error between the average run length of the simulated data and the target average run length is less than a preset threshold, and the control limits are obtained.
6. The method according to claim 1 or 5, characterized in that The method of comparing the current monitoring statistics with the control limits to identify the change state of the oil density mean and determine the oil mixing section includes: When the monitoring statistic exceeds the control limit for the first time, it is determined that the oil density mean begins to change and oil mixing begins to occur, and a cutting signal is output; until the monitoring statistic is less than the control limit again, it is determined that the oil density mean stops changing continuously and oil mixing ends, and cutting stops.
7. A real-time monitoring system for the mixed oil section of a product oil pipeline, characterized in that: include: The finished oil data acquisition module is used to obtain the oil density data of the pure oil section in the oil pipeline and perform data cleaning to obtain a cleaned data set; Statistics construction module, used to construct adaptive weight statistics for monitoring changes in the mean oil density; The control limit calculation module is used to calculate the control limits using the cleaned data set by combining the dichotomy method and Monte Carlo simulation; The mixed oil section monitoring module is used to monitor oil density data in real time and calculate the current monitoring statistics. By comparing the current monitoring statistics with the control limits, the change state of the oil density mean is identified to determine the mixed oil section.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the real-time monitoring method for the mixed oil section of a finished oil pipeline according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the real-time monitoring method for the oil mixing section of a finished oil pipeline according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the real-time monitoring method for the oil mixing section of a finished oil pipeline according to any one of claims 1 to 6.