A gasoline product adulteration risk intelligent discrimination method and system
By generating gasoline fingerprint representations and serial number fingerprint prototypes, performing classification probability calibration and consistency coupling blending ratio inversion, the instability and unquantifiable problems of gasoline blending risk judgment are solved, and stable, traceable risk quantification and disposal are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG INST FOR PROD QUALITY INSPECTION
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for identifying gasoline blending risks are unstable under cross-oil source time-period drift, the classification probabilities are not calibrated and are difficult to use as risk evidence, and it is difficult to quantify the blending ratio and lack traceable parameter version constraints, making it difficult to verify and handle the results.
By acquiring the feature vector of gasoline samples, a gasoline fingerprint representation is generated and a gasoline grade fingerprint prototype is established. Classification probability calculation and calibration are performed, and the adulteration risk is quantified and output by combining the consistency coupling blending ratio inversion solution.
It achieves stable discrimination across oil source periods, provides interpretable blending ratios and risk quantification, ensures traceability and verifiability of results, and supports effective risk management and supervision.
Smart Images

Figure CN122153533A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent gasoline data processing technology, specifically to an intelligent method and system for identifying the risk of adulteration in gasoline products. Background Technology
[0002] In recent years, gasoline quality supervision has evolved from manual sampling to a data-driven judgment system centered on electronic computing equipment. With the widespread adoption of multi-dimensional detection and in-station trading systems, indicators such as density, vapor pressure, distillation range, and volume fraction can be structurally collected and formed into feature vectors. Combined with representation learning, metric learning, and probabilistic inference, automatic identification of fuel grade, batch, and abnormal conditions can be achieved. To address distribution drift caused by seasonality and oil source fluctuations, online updates, adaptive prototypes, and calibrated confidence expressions are gradually becoming engineering directions.
[0003] However, existing oil product identification methods mostly remain at the level of single-detection value threshold determination or direct classification output of labels. For scenarios where the differences between labels such as 92, 95, and 98 are subtle and there are fluctuations across oil sources and time periods, the models often do not explicitly maintain fingerprint prototypes that evolve with batches. This leads to distortion of distance metrics and decision boundaries due to distribution drift, making it difficult to stably reproduce common classification probabilities without calibration. The output probabilities are difficult to correspond to the true error rate, and cannot be used as risk evidence to link with subsequent decision thresholds. It is also difficult to unify thresholds across multiple sites. Most solutions only provide suspected or not suspected conclusions, lacking a computational link to invert the mixing ratio under probabilistic constraints. They cannot obtain interpretable ratios under simplex constraints, and therefore cannot simultaneously satisfy the dual constraints of fingerprint reconstructibility and probability consistency when there is a small amount of cross-label mixing. The lack of metadata binding such as calibration mapping identifiers and prototype versions makes it difficult to trace the results to specific batches, time periods, and model parameter versions. The event handling chain is fragmented, making it difficult to form verifiable risk records and trigger conditions, and it is difficult to run online for a long time. These shortcomings make it difficult for existing technologies to achieve mixing ratio quantification and treatment triggering based on the consistent coupling of calibration probability and fingerprint prototype. Summary of the Invention
[0004] In view of the above-mentioned problems, the present invention is proposed.
[0005] Therefore, the technical problem solved by this invention is that existing gasoline blending risk identification methods have problems such as unstable identification under cross-oil source time period drift, uncalibrated classification probability which is difficult to use as risk evidence, outputting only the category and making it difficult to quantify the blending ratio, and how to output the blending risk amount and trigger the disposal under the constraints of traceable parameter version.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for intelligently identifying the risk of adulteration of gasoline products, including performing gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and performing gasoline grade fingerprint prototype generation.
[0007] The gasoline grade classification probability is calculated based on the gasoline fingerprint representation and the gasoline grade fingerprint prototype, and the gasoline grade classification probability is calibrated.
[0008] Based on the gasoline grade classification probability calibration results and the gasoline grade fingerprint prototype, a consistent coupling mixing ratio inversion solution is performed, and the adulteration risk quantification output is executed.
[0009] As a preferred embodiment of the intelligent method for identifying adulterated gasoline risks according to the present invention, the steps of obtaining gasoline sample feature vectors and generating gasoline fingerprint representations include: reading multidimensional detection data of the gasoline to be tested and assembling it into a gasoline sample feature vector; performing a missing item check on the gasoline sample feature vector and determining it based on the gasoline feature missing percentage limit; samples exceeding the gasoline feature missing percentage limit are marked as unusable samples and discarded; performing dimensional unification and normalization processing on samples that do not exceed the gasoline feature missing percentage limit to form a standardized gasoline sample feature vector; inputting the standardized gasoline sample feature vector into the gasoline fingerprint representation generation model; outputting the gasoline fingerprint representation; and writing the gasoline fingerprint representation into a storage record associated with the sample timestamp.
[0010] As a preferred embodiment of the intelligent method for identifying adulterated gasoline products according to the present invention, the step of generating gasoline grade fingerprint prototypes includes: establishing a qualified sample library divided by gasoline grade and indexing gasoline fingerprint representations with gasoline grade labels; performing robust central estimation on the gasoline fingerprint representation set for each gasoline grade to generate a corresponding gasoline grade fingerprint prototype; and storing the gasoline grade fingerprint prototype in association with the generation time period and the oil source batch identifier. When the average difference between the gasoline fingerprint representation set of the latest time period and the existing gasoline grade fingerprint prototype exceeds the gasoline prototype update trigger difference, the gasoline grade fingerprint prototype for the gasoline grade is recalculated and updated.
[0011] As a preferred embodiment of the intelligent method for identifying the risk of adulteration of gasoline products according to the present invention, the calculation of gasoline grade classification probability based on gasoline fingerprint representation and gasoline grade fingerprint prototype includes: calculating the prototype distance between the gasoline fingerprint representation to be tested and each gasoline grade fingerprint prototype; scaling the prototype distance according to the gasoline prototype distance temperature coefficient and inputting it into a normalized exponential mapping to obtain the gasoline grade classification probability; the smaller the prototype distance, the higher the gasoline grade classification probability. The gasoline grade classification probability is then passed to the gasoline grade classification probability calibration. If any gasoline grade classification probability is lower than the gasoline classification confidence limit, the sample is marked as a low-confidence sample and passed to the gasoline grade classification probability calibration along with all prototype distances.
[0012] As a preferred embodiment of the intelligent method for identifying gasoline adulteration risk described in this invention, the gasoline grade classification probability calibration includes: maintaining a gasoline probability calibration sample set associated with the fuel source batch identifier, and performing gasoline probability calibration temperature scaling on the gasoline grade classification probability based on the gasoline probability calibration sample set to obtain the gasoline grade classification probability calibration result. A gasoline probability calibration deviation metric is calculated and compared with a gasoline probability calibration deviation limit. When the gasoline probability calibration deviation metric exceeds the gasoline probability calibration deviation limit, a re-estimation of the gasoline probability calibration temperature scaling parameter is triggered. When outputting the gasoline grade classification probability calibration result, the calibration mapping identifier corresponding one-to-one with the gasoline grade classification probability is retained.
[0013] As a preferred embodiment of the intelligent method for identifying gasoline adulteration risk according to the present invention, the solution for the consistency-coupled blending ratio inversion includes: constructing a blending ratio variable and applying a simplex constraint with non-negativity and a sum of one; constructing a joint objective function containing a fingerprint reconstruction residual term and a probability consistency term; the fingerprint reconstruction residual term is calculated by the sum of squares of the differences between the gasoline fingerprint representation to be tested and the gasoline grade fingerprint prototype weighted by the blending ratio; the probability consistency term is calculated by the information divergence between the blending ratio distribution and the gasoline grade classification probability calibration result and is weighted by the gasoline consistency coupling weight. The joint objective function is iteratively solved using projection gradients, and the consistency-coupled blending ratio is output as the stopping condition, using the combination of the gasoline ratio inversion convergence tolerance and the maximum number of iterations.
[0014] As a preferred embodiment of the intelligent judgment method for gasoline adulteration risk described in this invention, the step of performing adulteration risk quantification output includes: calculating the adulteration risk quantity based on the consistent coupling blending ratio and generating a result record associated with the gasoline to be tested. The adulteration risk quantity includes the adulteration risk quantity calculated based on the maximum component of the consistent coupling blending ratio and the proportion of low-grade blending into the target grade calculated by summing the non-target grade components corresponding to the target grade. The target grade is parsed from the transaction record, and the calculation caliber of the proportion of low-grade blending into the target grade is selected. The consistent coupling blending ratio, gasoline grade classification probability calibration result, fingerprint reconstruction residual measurement, and adulteration risk quantity are written into the memory and sent to the risk judgment result receiving end via the output interface. When the adulteration risk quantity exceeds the gasoline adulteration risk handling threshold, a risk event record containing a sample timestamp and oil source batch identifier is triggered and stored in association with the result record.
[0015] As a preferred embodiment of the intelligent identification system for gasoline adulteration risk described in this invention, it includes a fingerprint construction and prototype generation module, a classification probability calculation and calibration module, and a consistent coupling inversion and risk detection module.
[0016] The fingerprint construction and prototype generation module is used to perform gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and to perform gasoline grade fingerprint prototype generation.
[0017] The classification probability calculation and calibration module is used to calculate the classification probability of gasoline grade based on the gasoline fingerprint representation and the gasoline grade fingerprint prototype, and to perform gasoline grade classification probability calibration.
[0018] The consistent coupling inversion and risk assessment module is used to perform consistent coupling mixing ratio inversion solution based on the gasoline grade classification probability calibration results and gasoline grade fingerprint prototype, and to perform adulteration risk quantification output.
[0019] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement a method for intelligently identifying the risk of adulteration in gasoline products.
[0020] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of an intelligent method for identifying the risk of adulteration in gasoline products.
[0021] The beneficial effects of this invention are: By mapping multidimensional detection data to fixed-dimensional feature vectors according to a preset feature dictionary, filtering out unusable samples based on the missing percentage, and then performing standardization and interval pruning, the input data is ensured to be controllable in terms of dimension and numerical domain. Subsequently, a low-dimensional gasoline fingerprint representation is output using an offline-fixed embedding model and stored in conjunction with timestamps, fuel batches, and version numbers, providing a traceable data link for subsequent calculations. Furthermore, a gasoline grade fingerprint prototype is generated using robust center estimation and updated based on sliding window differences, enabling the prototype to adaptively maintain itself according to changes in fuel batches and time periods, thereby providing a stable and reproducible fingerprint and prototype benchmark for S2 and S3.
[0022] By calculating the prototype distance between the fingerprint representation of the gasoline under test and the prototype fingerprints of each gasoline grade, and mapping the gasoline prototype distance temperature coefficient with the normalization index, the classification probability of the gasoline grade is obtained. Then, low-confidence samples are marked with the lower confidence limit of gasoline classification and enter the calibration link with the distance set, so that the distance evidence can be quantified into probabilistic evidence. At the same time, a gasoline probability calibration sample set is maintained according to the oil source batch identifier. Gasoline probability calibration temperature scaling is performed on the classification probability, and gasoline probability calibration deviation metric and deviation limit are used to trigger the re-estimation of calibration parameters. The calibration probability with calibration mapping identifier is output, making the relationship between probability and actual error rate more controllable and traceable, thereby providing S3 with evidence probability that can be used as a consistency constraint.
[0023] By constructing a consistent coupling mixing ratio under simplex constraints, the fingerprint reconstruction residual term and the probabilistic consistency term are coupled into the same minimizeable criterion. The projected gradient is then projected back onto the simplex after each update. Combined with stopping conditions such as step size backtracking, convergence tolerance, and maximum iteration steps, an interpretable consistent coupling mixing ratio is obtained. Based on this ratio, the mixing risk and the proportion of low-standard mixing into the target label are calculated and linked with the target label parsed from the transaction record, writing them into the result record or triggering a risk event. This allows the output to be used for both regulatory intervention and for review, tracing, and batch tracking. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is an overall flowchart of a method for intelligently identifying the risk of adulteration in gasoline provided in Embodiment 1 of the present invention. Detailed Implementation
[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0027] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for intelligently identifying the risk of adulteration in gasoline is provided, comprising: S1: Perform gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and perform gasoline grade fingerprint prototype generation.
[0028] The system reads multidimensional detection data of the gasoline to be tested and assembles it into a gasoline sample feature vector. A missing item check is performed on the gasoline sample feature vector, and the system is judged based on the percentage of missing gasoline features. Samples exceeding this percentage are marked as unusable and discarded. Samples not exceeding this percentage are subjected to dimensional unification and normalization to form a standardized gasoline sample feature vector. This standardized feature vector is then input into the gasoline fingerprint representation generation model, which outputs a gasoline fingerprint representation. This gasoline fingerprint representation is written to a storage record associated with the sample timestamp.
[0029] Furthermore, the multidimensional detection data includes density, vapor pressure, distillation range characteristic points, sulfur content, aromatics volume fraction, olefins volume fraction, oxygen content, and octane number-related indicators. The electronic computing device maps the multidimensional detection data into fixed-dimensional gasoline sample feature vectors according to a preset feature dictionary. The preset feature dictionary includes sub-feature expansion fields for distillation range characteristic points and octane number-related indicators to fill up to 32 dimensions. Missing item checks are calculated based on the missing percentage of the number of missing features / total number of features. The gasoline feature missing percentage threshold is set at 0.05, which is derived from the 95th percentile of the missing percentage obtained from statistical analysis of the qualified sample library and rounded down to 0.05 in 0.01 increments to ensure the stability of the input dimensions for the subsequent fingerprint representation generation model. For gasoline sample feature vectors that do not exceed the gasoline feature missing percentage threshold but still have missing dimensions, missing data is filled using the mean of the corresponding dimension from the qualified sample library according to the preset feature dictionary dimensions, followed by dimensional unification and normalization.
[0030] Furthermore, the dimension unification and normalization process includes standardizing each dimension of the gasoline sample feature vector according to the mean and standard deviation of the corresponding dimension in the qualified sample library, and performing interval pruning on the standardized gasoline sample feature vector to limit the influence of outliers. The pruning interval is [-3, 3]. The mean and standard deviation of each dimension are recalculated synchronously by the electronic computing device when the qualified sample library is updated, and are versioned and stored with oil source batch identifier. When processing the gasoline to be tested, the version consistent with its oil source batch identifier is used first. If it does not exist, the latest version is used to ensure that the source of the normalization parameters is clear and reproducible.
[0031] Furthermore, the gasoline fingerprint representation generation model is an embedded model trained offline and whose parameters are fixed on an electronic computing device. Its input is a standardized gasoline sample feature vector, and its output is a low-dimensional gasoline fingerprint representation vector. In this embodiment, the vector dimension is 16 dimensions. The embedded model can adopt an autoencoder structure and use minimizing reconstruction error as the training objective. After training, only the encoder is retained for online inference. After generating the gasoline fingerprint representation, the electronic computing device writes it, along with the sample timestamp, oil source batch identifier, and feature dictionary version number, into the same storage record to ensure that subsequent prototype generation and probability calculation can trace the same data processing link.
[0032] A qualified sample library is established, categorized by gasoline octane rating, and gasoline fingerprint representations are indexed using gasoline octane rating labels. Robust central estimation is performed on the gasoline fingerprint representation set for each gasoline octane rating to generate a corresponding gasoline octane fingerprint prototype. This prototype is then stored in association with the generation time period and fuel source batch identifier. When the average difference between the latest gasoline fingerprint representation set and the existing gasoline octane fingerprint prototype exceeds the gasoline prototype update trigger difference threshold, the gasoline octane fingerprint prototype for that gasoline octane rating is recalculated and updated.
[0033] Furthermore, the criteria for inclusion in the qualified sample library are as follows: samples must have a gasoline octane rating label, the percentage of missing gasoline features must not exceed 0.05, and the standardized gasoline sample feature vectors, after interval pruning, must not contain any unattainable values (NaN or infinity) in any dimension. The sample library is maintained separately for each gasoline octane rating, and at least 200 samples must be accumulated for each octane rating before a gasoline octane fingerprint prototype can be generated. Robust center estimation uses the geometric median and is implemented through Weiszfeld iteration. The iteration stops when the change in the L2 norm between two consecutive center updates is less than 1 × 10⁻⁶. -4 Alternatively, the number of iterations can reach 100 to ensure that the gasoline grade fingerprint prototype is insensitive to a small number of outlier fingerprint representations and that the computation process is executable.
[0034] Furthermore, the latest time period is maintained as a sliding window for each gasoline grade, with the window length being the earlier of the 200 most recently entered samples or the samples from the last 7 days. The average difference is defined as the average cosine distance between the gasoline fingerprint representation within the window and the existing gasoline grade fingerprint prototype. This is calculated by first normalizing each fingerprint representation within the window using the L2 norm, then subtracting the cosine similarity from 1, and taking the average. The gasoline prototype update trigger difference is set to 0.12. This value is derived from the 99th percentile obtained from the statistical analysis of the average difference of windows in historically stable operating months and fixed at 0.12. When the average difference exceeds 0.12, the electronic computing device triggers a recalculation and overwrite update of the gasoline grade fingerprint prototype for that gasoline grade, while the old gasoline grade fingerprint prototype is retained as the previous version prototype for traceability.
[0035] It should be noted that this step unifies detection data from different sources using fixed-dimensional fingerprints, and employs data statistics to determine missing and update thresholds, ensuring stable and reproducible input. An embedding model is used to generate a low-dimensional gasoline fingerprint representation, reducing noise and facilitating subsequent computation. A robust center is used to generate a prototype gasoline octane rating fingerprint, and updates are triggered by sliding window differences, maintaining the prototype's adaptability across batches and time periods.
[0036] S2: Calculate the gasoline grade classification probability based on the gasoline fingerprint representation and the gasoline grade fingerprint prototype, and perform gasoline grade classification probability calibration.
[0037] For each gasoline fingerprint to be tested, the prototype distance between the fingerprint and the prototype of each gasoline grade is calculated. This prototype distance is then scaled according to the gasoline prototype distance temperature coefficient and input into a normalized exponential mapping to obtain the gasoline grade classification probability. The smaller the prototype distance, the higher the corresponding gasoline grade classification probability. The gasoline grade classification probability is then passed to the gasoline grade classification probability calibration. If the classification probability of any gasoline grade is lower than the lower confidence limit for gasoline classification, the sample is marked as a low-confidence sample and, along with all prototype distances, is passed to the gasoline grade classification probability calibration.
[0038] Furthermore, the electronic computing device selects the prototype version of the gasoline grade fingerprint from the same batch as the gasoline to be tested, based on the batch identifier of the gasoline source. If no prototype version exists, the latest version is selected. Before calculating the prototype distance, the fingerprint representation of the gasoline to be tested and the prototype fingerprints of each gasoline grade are normalized using L2 norm. The prototype distance is calculated using cosine distance. The cosine distance is obtained by subtracting the cosine similarity from 1 and forming distance sets corresponding to gasoline grades 92, 95, and 98, respectively.
[0039] Furthermore, the gasoline prototype distance temperature coefficient is used to convert the distance set into a comparable probability scale. Its scaling method involves taking the inverse of the prototype distance for each gasoline grade, multiplying it by the gasoline prototype distance temperature coefficient, and then inputting it into a normalized exponential mapping. The normalized exponential mapping is then normalized by summing the exponential values for each gasoline grade so that the sum of the classification probabilities of the gasoline grades is 1. In this embodiment, the gasoline prototype distance temperature coefficient is set to 12. This value is determined and fixedly stored on the validation set of the qualified sample library using a grid search that minimizes the negative log-likelihood.
[0040] Furthermore, the lower confidence limit for gasoline classification is used to determine the reliability of the classification probability. In this embodiment, the lower confidence limit for gasoline classification is set to 0.60. The rule for setting this lower limit is to select the maximum lower limit value on the valid sample library validation set, ensuring that the misclassification rate does not exceed 1%. When the classification probability of any gasoline grade is lower than 0.60, the sample is marked as a low-confidence sample, and its gasoline grade classification probability, along with the distance set, sample timestamp, and oil source batch identifier, is written into the same storage record and transmitted to the gasoline grade classification probability calibration. For gasoline samples not marked as low-confidence samples, only their gasoline grade classification probability is transmitted to the gasoline grade classification probability calibration to generate the gasoline grade classification probability calibration result. For gasoline samples not marked as low-confidence samples, while transmitting the gasoline grade classification probability, the distance set is written into the storage record associated with the sample timestamp for the gasoline grade classification probability calibration to read and generate the gasoline grade logarithmic score.
[0041] Maintain a gasoline probability calibration sample set associated with the fuel source batch identifier, and perform gasoline probability calibration temperature scaling on the gasoline octane rating classification probability based on the gasoline probability calibration sample set to obtain the gasoline octane rating classification probability calibration result. Calculate the gasoline probability calibration deviation metric and compare it with the gasoline probability calibration deviation limit. When the gasoline probability calibration deviation metric exceeds the gasoline probability calibration deviation limit, trigger a re-estimation of the gasoline probability calibration temperature scaling parameter. When outputting the gasoline octane rating classification probability calibration result, retain the calibration mapping identifier that corresponds one-to-one with the gasoline octane rating classification probability.
[0042] Furthermore, the gasoline probability calibration sample set is maintained in batches in memory using the oil source batch identifier as the primary key. Sample inclusion criteria include the sample having a gasoline octane rating label and the generation of its gasoline fingerprint representation, gasoline octane rating classification probability, and prototype distance. The gasoline octane rating label originates from the vehicle's laboratory test report, the oil depot's factory inspection report, or the on-site verification results confirmed after subsequent verification. The gasoline probability calibration sample set is updated using a sliding window. The window length is the earlier of the most recent 500 included samples or the samples from the most recent 14 days. When the number of valid samples in the window is less than 300, the calibration process degenerates into calling the calibration parameters of the most recent batch with the same oil source identifier or calling the global calibration parameters to ensure that calibration can be executed.
[0043] Furthermore, the gasoline probability calibration temperature scaling uses the gasoline grade logarithmic score as input instead of directly scaling the probability. The gasoline grade logarithmic score is calculated by combining the prototype distance of the same sample and the gasoline prototype distance temperature coefficient, and then scaled by the gasoline probability calibration temperature scaling parameter before being output as the gasoline grade classification probability calibration result through normalized exponential mapping. The gasoline grade logarithmic score is obtained by taking the negative of the prototype distance of that gasoline grade and multiplying it by the gasoline prototype distance temperature coefficient. The gasoline probability calibration temperature scaling parameter is initialized to 1.80. During re-estimation, a one-dimensional search is performed in the interval [0.50, 5.00] with a step size of 0.01 to select the parameter that minimizes the negative log-likelihood in the gasoline probability calibration sample set and writes it into the parameter record associated with the oil source batch identifier.
[0044] Furthermore, the calculation of gasoline probability calibration temperature scaling is expressed as follows:
[0045] in, Indicates the gasoline grade The corresponding gasoline grade classification probability calibration results. This indicates the gasoline being tested has the correct octane rating. The logarithmic score of the gasoline octane rating is used for calibration input. This represents the gasoline probability calibration temperature scaling parameter, with a value range of [0.50, 5.00]. The default initial value is 1.80, and it can be re-estimated according to the trigger condition. This represents the gasoline grade enumeration variable in the set {92, 95, 98}.
[0046] The electronic computing device first obtains the value of each gasoline sample to be tested. Then, substitute it into the calculation of gasoline probability calibration temperature scaling to generate The result is then written to a storage record. This gasoline grade classification probability calibration result serves as the consistency constraint input for subsequent consistency coupling blending ratio inversion solutions, and the same parameter version is ensured to be called through calibration mapping identifiers.
[0047] Furthermore, the gasoline probability calibration deviation metric is calculated on the gasoline probability calibration sample set. It is obtained by dividing the sample into 10 equally wide confidence intervals based on the highest gasoline octane rating, and then statistically analyzing the average confidence and true accuracy within each interval. The gasoline probability calibration deviation threshold is set at 0.030, derived from the 95th quantile obtained from statistical analysis of gasoline probability calibration deviation metrics for historically stable operating months, and fixed at 0.030. When the gasoline probability calibration deviation metric exceeds 0.030, a re-estimation of the gasoline probability calibration temperature scaling parameter is triggered, and the trigger time, fuel source batch identifier, and parameter versions before and after the update are written into the calibration event record.
[0048] Furthermore, the calculation of the gasoline probability calibration deviation metric is expressed as follows:
[0049] in, This represents a gasoline probability calibration deviation metric, used to measure the consistency between the calibrated probability and the true accuracy. This indicates the number of bins in the confidence interval; in this embodiment, it is set to 10. This represents the total number of valid samples used for metric calculations in the gasoline probability calibration sample set. Indicates falling into the first Number of samples in each confidence interval. Indicates the first The true accuracy rate within a confidence interval is calculated based on the proportion of predicted grades that are equal to gasoline grade labels. Indicates the first The average confidence level within each confidence interval is calculated as the mean of the calibration results based on the highest gasoline grade classification probability of the sample.
[0050] After each sliding window update, the electronic computing device calculates the gasoline probability calibration sample set under the current oil source batch identifier. And compared with the gasoline probability calibration deviation limit of 0.030. When Time-triggered re-estimation of gasoline probability calibration temperature scaling parameters It generates a new calibration mapping identifier, and then outputs the gasoline grade classification probability calibration result carrying the calibration mapping identifier for the newly entered sample, thereby ensuring that the subsequent inversion steps refer to the bias-controlled calibration probability.
[0051] Furthermore, the calibration mapping identifier is generated by the electronic computing device each time a gasoline octane rating classification probability calibration result is generated and stored concurrently with the result. The inputs for generating the calibration mapping identifier include at least the oil source batch identifier, the start and end timestamps of the gasoline probability calibration sample set window, the version number of the gasoline probability calibration temperature scaling parameter, and the version number of the feature dictionary. The calibration mapping identifier is generated using a hash or serial number method and is guaranteed to monotonically increase over time under the same oil source batch identifier. When outputting the gasoline octane rating classification probability calibration result, the calibration mapping identifier and the result are written together into a storage record associated with the sample timestamp, enabling subsequent consistency coupling mixing ratio inversion solutions to call the calibration result corresponding to the same calibration mapping identifier.
[0052] It should be noted that this step establishes usable evidence probabilities using a two-level probability chain of prototype distance, probability, and calibration. First, the distance to the prototype gasoline grade fingerprint is represented by a gasoline fingerprint. The gasoline grade classification probability is obtained by mapping the gasoline prototype distance temperature coefficient to the normalization exponent. Then, a calibration sample set is maintained according to the oil source batch identifier. Gasoline probability calibration temperature scaling is performed on the classification probabilities, and a re-evaluation of calibration parameters is triggered by the gasoline probability calibration deviation metric. The calibration result of the gasoline grade classification probability, carrying the calibration mapping identifier, is output. Compared to existing solutions that only output uncalibrated probabilities or fixed threshold alarms, this step provides traceable and updatable calibration probabilities across batches. This allows subsequent S3 steps to use the calibration probability as a consistency constraint in the blending ratio inversion, thereby achieving a closed-loop linkage between probabilistic evidence and ratio solution.
[0053] S3: Based on the gasoline grade classification probability calibration results and gasoline grade fingerprint prototype, perform consistency coupling mixing ratio inversion solution and perform adulteration risk quantification output.
[0054] The electronic computing device reads the fingerprint representation of the gasoline to be tested and the prototype fingerprint of the gasoline grade from S1, and reads the gasoline grade classification probability calibration result corresponding to the same calibration mapping identifier of the gasoline to be tested from S2. The blending ratio variable is defined as a vector composed of the proportional components of gasoline grades 92, 95, and 98, and always satisfies the simplex constraint that it is non-negative and the sum of its components is one during the solution process. Furthermore, when any component in the gasoline grade classification probability calibration result is 0, a 1×10⁻⁶ value is applied. -12 Lower limit truncation is performed to avoid unattainable values in subsequent information divergence calculations, and the gasoline grade classification probability calibration results are normalized to make the sum of each component equal to one.
[0055] A blending ratio variable is constructed and a simplex constraint with non-negativity and a sum of one is applied. A joint objective function is constructed, comprising a fingerprint reconstruction residual term and a probability consistency term. The fingerprint reconstruction residual term is calculated as the sum of squares of the differences between the gasoline fingerprint representation to be tested and the gasoline grade fingerprint prototype weighted by the blending ratio. The probability consistency term is calculated as the information divergence between the blending ratio distribution and the gasoline grade classification probability calibration result, and is weighted by the gasoline consistency coupling weight. The joint objective function is iteratively solved using the projected gradient, and the consistency coupling blending ratio is output as the stopping condition, which is the combination of the gasoline ratio inversion convergence tolerance and the maximum number of iterations.
[0056] Furthermore, the joint objective function couples fingerprint reconfigurability and calibration probability consistency into a single, minimizeable objective. The calculation principle is as follows: the electronic computing device first performs a weighted summation of the gasoline grade fingerprint prototypes according to the current consistency coupling mixing ratio to obtain the reconstructed fingerprint. Then, it calculates the dimension-wise differences between the tested gasoline fingerprint representation and the reconstructed fingerprint, squares these differences, and sums them to obtain the fingerprint reconstruction residual term. Simultaneously, the probability consistency term is calculated: for each gasoline grade, the logarithmic ratio of its proportional component to the calibration result of its classification probability is calculated, and the information divergence is obtained by weighting the proportional component as a weight. Finally, the information divergence is multiplied by the gasoline consistency coupling weight and added to the fingerprint reconstruction residual term to obtain the joint objective function value. A smaller joint objective function value indicates that the current consistency coupling mixing ratio better conforms to the joint constraints.
[0057] Furthermore, the electronic computing device simultaneously calculates the fingerprint error and deviation from the calibration probability distribution after prototype-weighted reconstruction for the same gasoline sample, and outputs the consistency coupling mixing ratio bound to the sample based on minimizing the joint objective function. In this embodiment, the gasoline consistency coupling weight is set to 0.60, which is determined by grid search on the qualified sample library validation set based on the rule that the numerical magnitudes of the fingerprint reconstruction residual term and the probability consistency term are similar on typical samples and the inversion results are stable, and then fixed into the configuration table.
[0058] Furthermore, the projected gradient is used to project the blending ratio back to the simplex after each update. The iterative update process is as follows: In the m-th iteration, the electronic computing device first calculates the gradient direction of the joint objective function for each ratio component based on the current consistent coupling blending ratio, and updates each ratio component once along the gradient inverse direction according to the gasoline ratio inversion step size to obtain a temporary ratio vector. m is the iteration count variable. Then, simplex projection is performed on the temporary ratio vector to ensure that each component is non-negative and the sum of the components is one. The projection rule is: sort the components of the temporary ratio vector in descending order, find the truncation threshold that makes the sum of the truncated components equal to one, and subtract the truncation threshold from each component and set the negative value to zero to obtain the projected ratio vector. The projected ratio vector is used as the consistent coupling blending ratio input for the (m+1)-th iteration to continue iterating. The gradient direction is obtained by taking the analytical partial derivatives of each component of the joint objective function. If the analytical partial derivatives are not obtained, a step size of 1×10 is used. -6 The central difference is obtained by taking the numerical derivative.
[0059] Furthermore, the electronic computing device is initialized with a uniform vector. In this embodiment, the gasoline ratio inversion step size is set to 0.05, and if the joint objective function value does not decrease after the update, the gasoline ratio inversion step size is rolled back by 0.5 times until it decreases. The gasoline ratio inversion convergence tolerance in the stopping condition is set to 1 × 10⁻⁶. -6 (Convergence is determined by the difference between two consecutive joint objective function values being less than this value). The maximum number of iterations is 200 (the source is to ensure that the time consumption of single-sample solution is controllable on the target hardware and that the convergence rate meets the requirements on the validation set). If any condition is met, the consistent coupling mixing ratio is output.
[0060] The blending risk is calculated based on the consistent coupling blending ratio, and a result record associated with the gasoline to be tested is generated. The blending risk includes the blending risk calculated based on the maximum component of the consistent coupling blending ratio and the proportion of low-grade gasoline blended into the target grade, calculated by summing the non-target grade components corresponding to the target grade. The target grade is parsed from the transaction record, and the calculation caliber of the proportion of low-grade gasoline blended into the target grade is selected. The consistent coupling blending ratio, gasoline grade classification probability calibration result, fingerprint reconstruction residual metric, and blending risk are written into the memory and sent to the risk judgment result receiving end via the output interface. When the blending risk exceeds the gasoline blending risk handling threshold, a risk event record containing the sample timestamp and oil source batch identifier is generated and stored in association with the result record.
[0061] Furthermore, the electronic computing device uses the largest proportional component in the consistent coupling mixing ratio as the maximum component, and calculates the mixing risk as 1 minus the maximum component. Simultaneously, the proportion of low-standard mixing into the target label is calculated as the sum of all proportional components except the target label. Specifically, when the target label is 98, the proportion of low-standard mixing into the target label is the sum of components 92 and 95 in the consistent coupling mixing ratio; when the target label is 95, the proportion is component 92 in the consistent coupling mixing ratio; and when the target label is 92, the proportion is 0. Both the mixing risk and the proportion of low-standard mixing into the target label are retained to four decimal places and written into the result record along with the sample timestamp.
[0062] Furthermore, the transaction record must include at least the pump number, transaction time, label identifier, and transaction amount. The electronic computing device prioritizes reading the label identifier field as the target label. If the label identifier field is missing from the transaction record, the target label is parsed from the pump number in the pump-label mapping table within the station. The output interface sends the result record using a message queue or interface call method. The result record fields must include at least the sample timestamp, oil source batch identifier, calibration mapping identifier, consistency coupling blending ratio, gasoline label classification probability calibration result, fingerprint reconstruction residual measurement, blending risk amount, proportion of low-label blending into the target label, and the target label. This allows the risk judgment result receiving end to trace the S2 output according to the same calibration mapping identifier and trace the S1 prototype version according to the oil source batch identifier.
[0063] Furthermore, in this embodiment, the risk threshold for handling gasoline blending is set at 0.10. The rule is to calculate the empirical distribution of blending risk in a qualified sample library from historically stable operating months, take its 99th percentile, and round it up by 0.01 steps to obtain 0.10, which is then fixed. When the blending risk is greater than 0.10, the electronic computing device generates a risk event record and writes a unique event number. At the same time, the sample timestamp corresponding to the trigger time, the oil source batch identifier, the target label, the blending risk, and the proportion of the lower standard blended into the target label are stored as key fields of the event and associated with the result record, facilitating subsequent retrieval of the same batch of sample sequences by event number for verification.
[0064] It should be noted that this step focuses on consistent coupling inversion, simultaneously minimizing two types of quantities under simplex constraints. One type is the fingerprint reconstruction residual metric between the gasoline fingerprint representation to be tested and the gasoline grade fingerprint prototype weighted by the blending ratio. The other type is the probability consistency metric between the blending ratio distribution and the gasoline grade classification probability calibration result. A unified trade-off is achieved through gasoline consistent coupling weights, ensuring that the output consistent coupling blending ratio simultaneously satisfies the requirements of being reconstructable from the prototype and consistent with the calibration probability. Compared to existing methods that only classify or only regress, embedding calibration probability evidence into the ratio calculation process and using projected gradients to guarantee the ratio's validity allows for the output of interpretable ratios and the formation of traceable risk records and event triggering chains even in scenarios with minimal cross-grade blending.
[0065] Example 2, an embodiment of the present invention, provides a smart system for identifying the risk of adulteration of gasoline products, including a fingerprint construction and prototype generation module, a classification probability calculation and calibration module, and a consistent coupling inversion and risk detection module.
[0066] The fingerprint construction and prototype generation module is used to perform gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and to perform gasoline grade fingerprint prototype generation.
[0067] The classification probability calculation and calibration module is used to calculate the classification probability of gasoline grade based on the gasoline fingerprint representation and the gasoline grade fingerprint prototype, and to perform gasoline grade classification probability calibration.
[0068] The Consistent Coupled Inversion and Risk Detection Module is used to perform consistent coupled mixing ratio inversion solution based on the gasoline grade classification probability calibration results and gasoline grade fingerprint prototype, and to perform adulteration risk quantification output.
Claims
1. A method for intelligently identifying the risk of adulteration in gasoline, characterized in that, include: Perform gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and perform gasoline grade fingerprint prototype generation; Based on the gasoline fingerprint representation and the gasoline grade fingerprint prototype, the gasoline grade classification probability is calculated, and the gasoline grade classification probability is calibrated. Based on the gasoline grade classification probability calibration results and the gasoline grade fingerprint prototype, a consistent coupling mixing ratio inversion solution is performed, and the adulteration risk quantification output is executed.
2. The intelligent method for identifying the risk of adulteration in gasoline as described in claim 1, characterized in that: The process of obtaining gasoline sample feature vectors and generating gasoline fingerprint representations includes, Read the multidimensional detection data of the gasoline to be tested and assemble it into a gasoline sample feature vector. Perform a missing item check on the gasoline sample feature vector and judge it based on the gasoline feature missing percentage limit. Samples exceeding the gasoline feature missing percentage limit are marked as unusable samples and discarded. For samples whose proportion of missing gasoline features does not exceed the limit, dimensional unification and normalization are performed to form a standardized gasoline sample feature vector. The standardized gasoline sample feature vector is then input into the gasoline fingerprint representation generation model, which outputs the gasoline fingerprint representation and writes it into a storage record associated with the sample timestamp.
3. The intelligent method for identifying the risk of adulteration in gasoline as described in claim 2, characterized in that: The process of generating a gasoline grade fingerprint prototype includes, Establish a qualified sample library divided by gasoline grade and index gasoline fingerprint representation with gasoline grade label. Perform robust central estimation on the gasoline fingerprint representation set of each gasoline grade to generate the corresponding gasoline grade fingerprint prototype. Store the gasoline grade fingerprint prototype in association with the generation time and oil source batch identifier. When the average difference between the latest gasoline fingerprint representation set and the existing gasoline grade fingerprint prototype exceeds the gasoline prototype update trigger difference, the gasoline grade fingerprint prototype is recalculated and overwritten for update.
4. The intelligent method for identifying the risk of adulteration in gasoline as described in claim 3, characterized in that: The calculation of gasoline grade classification probability based on gasoline fingerprint representation and gasoline grade fingerprint prototype includes, The prototype distance between the gasoline fingerprint representation to be tested and the prototype of each gasoline grade fingerprint is calculated. The prototype distance is scaled according to the gasoline prototype distance temperature coefficient and then input into the normalization index mapping to obtain the gasoline grade classification probability. The smaller the prototype distance, the greater the corresponding gasoline grade classification probability. The classification probability of gasoline grade is passed to the gasoline grade classification probability calibration. If the classification probability of any gasoline grade is lower than the lower confidence limit of gasoline classification, the sample is marked as a low confidence sample and passed to the gasoline grade classification probability calibration along with all prototype distances.
5. The intelligent method for identifying the risk of adulteration in gasoline as described in claim 4, characterized in that: The gasoline grade classification probability calibration includes, Maintain a gasoline probability calibration sample set associated with the oil source batch identifier, and perform gasoline probability calibration temperature scaling on the gasoline grade classification probability based on the gasoline probability calibration sample set to obtain the gasoline grade classification probability calibration result; Calculate the gasoline probability calibration deviation metric and compare it with the gasoline probability calibration deviation limit. When the gasoline probability calibration deviation metric exceeds the gasoline probability calibration deviation limit, trigger a re-estimation of the gasoline probability calibration temperature scaling parameter. When outputting the calibration results for gasoline octane rating classification probabilities, retain the calibration mapping identifier that corresponds one-to-one with the gasoline octane rating classification probability.
6. The intelligent method for determining the risk of adulteration in gasoline as described in claim 5, characterized in that: The solution for the consistency coupling mixing ratio inversion includes... Construct a mixing ratio variable and apply a simplex constraint that is non-negative and sums to one. Construct a joint objective function that includes a fingerprint reconstruction residual term and a probability consistency term. The fingerprint reconstruction residual term is calculated by the sum of squares of the differences between the gasoline fingerprint representation to be tested and the gasoline grade fingerprint prototype weighted by the mixing ratio. The probability consistency term is calculated by the information divergence between the mixing ratio distribution and the gasoline grade classification probability calibration result and is weighted by the gasoline consistency coupling weight. The joint objective function is solved iteratively using the projection gradient, and the consistent coupling blending ratio is output by using the combination of the gasoline ratio inversion convergence tolerance and the maximum number of iterations as the stopping condition.
7. The intelligent method for determining the risk of adulteration in gasoline as described in claim 6, characterized in that: The output of the adulteration risk quantification includes, The blending risk is calculated based on the consistent coupling blending ratio and a result record associated with the gasoline to be tested is generated. The blending risk includes the blending risk calculated based on the maximum component of the consistent coupling blending ratio and the proportion of low grade blended into the target grade calculated by summing the non-target grade components corresponding to the target grade. The target label is parsed from the transaction record and the calculation method of the proportion of low label mixed into the target label is selected. The consistency coupling mixing ratio, gasoline label classification probability calibration result, fingerprint reconstruction residual measurement and mixing risk amount are written into the memory and sent to the risk judgment result receiving end through the output interface. When the risk of blending exceeds the threshold for handling gasoline blending risks, a risk event record containing a sample timestamp and oil source batch identifier is generated and stored in association with the result record.
8. A gasoline adulteration risk intelligent judgment system, employing the gasoline adulteration risk intelligent judgment method as described in any one of claims 1 to 7, characterized in that: It includes a fingerprint construction and prototype generation module, a classification probability calculation and calibration module, and a consistent coupling inversion and risk detection module; The fingerprint construction and prototype generation module is used to perform gasoline sample feature vector acquisition and gasoline fingerprint representation generation, and to perform gasoline grade fingerprint prototype generation. The classification probability calculation and calibration module is used to calculate the classification probability of gasoline grade based on gasoline fingerprint representation and gasoline grade fingerprint prototype, and to perform gasoline grade classification probability calibration. The consistent coupling inversion and risk assessment module is used to perform consistent coupling mixing ratio inversion solution based on the gasoline grade classification probability calibration results and gasoline grade fingerprint prototype, and to perform adulteration risk quantification output.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the intelligent method for identifying the risk of adulteration of gasoline products as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the intelligent method for identifying the risk of adulteration of gasoline products as described in any one of claims 1 to 7.