Method, device and electronic equipment for detecting fuel dispenser meter tampering

By generating simulated cheating command frames and parsing response data, the problem of dynamic identification and evidence locking in fuel dispenser metering cheating detection is solved, achieving efficient and accurate cheating detection and law enforcement evidence collection, and adapting to different brands of fuel dispensers.

CN121247712BActive Publication Date: 2026-02-24INNER MONGOLIA AUTONOMOUS REGION PROD QUALITY TEST INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511821330.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-02-24
Estimated Expiration
2045-12-05

AI Technical Summary

Technical Problem

Existing methods for detecting metering fraud on fuel dispensers cannot identify dynamic fraudulent behavior, and the evidence chain is incomplete during law enforcement, making it difficult to lock down evidence of fraud. The detection efficiency is low, and it cannot adapt to the communication protocols of different brands of fuel dispensers.

Method used

By obtaining the brand information and cheating parameters of the fuel dispenser, a simulated cheating command frame is generated, sent to the fuel dispenser, and the response data is parsed to determine whether it has cheating function. Dynamic detection is achieved by using a multi-protocol communication interface and protocol template library.

Benefits of technology

It enables proactive detection of the fuel dispenser's control motherboard, accurately identifies cheating methods, improves detection efficiency, generates structured evidence reports, is suitable for widespread use, and improves law enforcement efficiency by 10 times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121247712B_ABST
    Figure CN121247712B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for detecting fuel dispenser metering cheating and electronic equipment, and relates to the field of fuel dispenser cheating detection, the method comprising: obtaining brand information and cheating parameters of a fuel dispenser to be detected; determining a protocol template from a preset protocol template library according to the brand information; generating a simulated cheating instruction frame of the fuel dispenser to be detected according to the protocol template and the cheating parameters; sending the simulated cheating instruction frame to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data; obtaining the response data; analyzing the response data according to the protocol template to obtain an analysis result; and judging whether the fuel dispenser to be detected has a cheating function corresponding to the cheating parameters according to the analysis result; the application can actively detect whether the fuel dispenser metering control mainboard is used fraudulently, verify whether the fuel dispenser metering control mainboard has a cheating function, accurately identify cheating means, lock cheating evidence, has high detection efficiency, is simple and convenient to operate, and is suitable for large-area popularization and use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of fuel dispenser cheating detection, and specifically relates to a fuel dispenser metering cheating detection method, device and electronic equipment. Background Technology

[0002] In recent years, cheating has been prevalent in the refined oil sales sector. This involves tampering with the fuel dispenser's control board, using backend computer software or remote control via mobile phone to manipulate the metering. This results in significant discrepancies between the displayed and actual fuel dispensed, or prevents the tax control chip from accumulating operational data. Fuel dispensers, as mandatory verification measuring instruments, undergo two metering verifications annually. However, during these verification periods, gas stations typically disable cheating systems, rendering the periodic verification ineffective. Currently, regulatory departments across the country are conducting extensive inspections to combat fuel dispenser cheating. However, due to the concealment and recoverability of software-based cheating, it is difficult to locate the computer host and cheating software used on-site. Furthermore, because the motherboard's metering program cannot be read, it is difficult to confirm whether the motherboard is tampering based solely on its appearance. Forcibly seizing the motherboard for testing by the manufacturer or testing agency also carries enforcement risks.

[0003] Existing methods for detecting metering fraud on fuel dispensers rely on static testing of standard measuring tanks (such as the JJG 443-2023 standard), which can only verify the metering error value of the fuel dispenser and cannot identify dynamic fraud. Current fuel dispenser calibration technology strictly follows the "JJG 443-2015 Fuel Dispenser Calibration Standard," the core of which is static volume comparison using a standard metal measuring vessel: law enforcement officers inject fuel into the standard measuring vessel, wait for the liquid level to stabilize, read the scale reading, and calculate the error between the fuel dispenser reading and the actual volume (formula: E = (V / V)). 示 -V 实 ) / V 实 The error was measured at ×100% and repeated three times to verify repeatability (required to be ≤0.10%). In real-world cases, the error of the cheating fuel dispenser was only 0.25% during static testing, but in actual operation, the amount of fuel dispensed could be controlled at will through the backend software, exposing the fatal weakness of this technology as a superficial solution.

[0004] Current static detection methods are passive and outdated, only supporting periodic manual spot checks. Cheating systems can automatically shut down during the verification period and revert to "compliant mode" to evade detection. Furthermore, they cannot address the root causes of cheating. Even if fuel dispenser metering fraud can be detected through surprise inspections, key evidence cannot be secured. If unscrupulous businesses revert to "compliant mode" through remote control or backend commands, law enforcement officers will be unable to reproduce the cheating, resulting in an incomplete chain of evidence and increased enforcement risks. Summary of the Invention

[0005] To address the aforementioned issues, this invention proposes a method, device, and electronic equipment for detecting metering fraud on fuel dispensers. This system can proactively detect whether the fuel dispenser's metering control mainboard is being used fraudulently, verify whether the mainboard has fraudulent functions, accurately identify fraudulent methods, and lock in evidence of fraud. It boasts high detection efficiency, simple and convenient operation, and is suitable for widespread application.

[0006] In a first aspect, the present invention provides a method for detecting metering fraud on fuel dispensers, comprising:

[0007] Obtain the brand information and cheating parameters of the fuel dispenser to be tested;

[0008] A protocol template is determined from a preset protocol template library based on the brand information;

[0009] A simulated cheating instruction frame for the fuel dispenser to be detected is generated based on the protocol template and the cheating parameters;

[0010] The simulated cheating instruction frame is sent to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data;

[0011] Obtain the response data;

[0012] The response data is parsed according to the protocol template to obtain the parsing result;

[0013] Based on the analysis results, it is determined whether the fuel dispenser under test has a cheating function corresponding to the cheating parameters.

[0014] In an optional implementation, the cheating parameters are either input by the user or obtained from the fuel dispenser under test.

[0015] In an optional implementation, the protocol template includes data frame structure rules, command word mapping rules, cheating parameter encoding rules, and checksum algorithm rules for the fuel dispenser to be detected.

[0016] In an optional implementation, the simulated cheating instruction frame includes a function code, an encoding parameter value, and a checksum; wherein the function code is determined according to the command word mapping rule; the encoding parameter value is obtained by converting the cheating parameter according to the cheating parameter encoding rule; and the checksum is obtained by assembling the function code and the encoding parameter value into an instruction frame and calculating the checksum according to the data frame structure rule and the checksum algorithm rule.

[0017] In an optional implementation, parsing the response data according to the protocol template to obtain the parsing result includes:

[0018] Load and parse the protocol template library to obtain the protocol parsing rule table;

[0019] Extract complete data frames from the response data according to the protocol parsing rule table;

[0020] The integrity of the complete data frame is verified according to the checksum algorithm rules in the protocol parsing rule table.

[0021] In response to successful verification, the address field and function code in the data frame are parsed according to the protocol parsing rule table to match the corresponding processing logic;

[0022] According to the data domain parsing rules in the protocol parsing rule table, valid information is extracted from the data frame; wherein, the valid information includes oil quantity parameter information, tax parameter information, and equipment status information;

[0023] The valid information is encapsulated into a structured format to obtain the parsing result.

[0024] In an optional implementation, the method further includes:

[0025] Retrieve the latest protocol template file sent from the cloud;

[0026] The latest protocol template file is stored in the protocol template library so as to perform metering fraud detection on the fuel dispenser to be tested according to the latest protocol template file.

[0027] In an optional implementation, before obtaining the brand information and cheating parameters of the fuel dispenser to be detected, the method further includes:

[0028] Send a cheating parameter reading command to the fuel dispenser under test. If no response is received, send a cheating parameter simulation command to the fuel dispenser under test to verify the cheating function.

[0029] In an optional implementation, sending the simulated cheating instruction frame to the refueling machine to be detected includes:

[0030] The simulated cheating instruction frame is sent to the fuel dispenser to be detected using a multi-protocol communication interface, which integrates at least RS485, CAN and Ethernet interfaces.

[0031] Secondly, the present invention provides a fuel dispenser metering fraud detection device, comprising:

[0032] The first acquisition module is used to acquire the brand information and cheating parameters of the fuel dispenser to be detected;

[0033] The protocol template module is used to determine a protocol template from a preset protocol template library based on the brand information;

[0034] The simulated cheating instruction module is used to generate a simulated cheating instruction frame for the fuel dispenser to be detected based on the protocol template and the cheating parameters.

[0035] The detection module is used to send the simulated cheating instruction frame to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data;

[0036] The second acquisition module is used to acquire the response data;

[0037] The parsing module is used to parse the response data according to the protocol template to obtain the parsing result;

[0038] The judgment module is used to determine whether the fuel dispenser under test has a cheating function corresponding to the cheating parameters based on the analysis results.

[0039] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in any of the foregoing embodiments.

[0040] Fourthly, the present invention provides a computer-readable medium having processor-executable non-volatile program code, the program code causing the processor to perform the method described in any of the foregoing embodiments.

[0041] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: The fuel dispenser metering cheating detection method, device, and electronic equipment of the present invention first obtain the brand information and cheating parameters of the fuel dispenser to be tested, and then determine whether the fuel dispenser to be tested has a cheating function corresponding to the cheating parameters based on the analysis results, thereby adapting to the communication protocols of different brands of fuel dispensers; since the simulated cheating instruction frame is generated according to the protocol template and cheating parameters, it can actively simulate cheating behavior and issue cheating instructions to the fuel dispenser, thereby triggering the cheating function of the fuel dispenser's metering control motherboard, realizing active detection of whether the fuel dispenser's metering control motherboard is being used deceptively, and achieving accurate detection of concealed cheating behavior; furthermore, since the simulated cheating instruction frame can be sent to the fuel dispenser to be tested, so that the fuel dispenser to be tested generates response data, it can realize real-time interaction with the fuel dispenser to be tested, realize timely detection of cheating behavior, and improve detection efficiency; it also parses the response data according to the protocol template and determines whether it has a cheating function, realizing the locking of cheating evidence, laying the foundation for ensuring law enforcement evidence collection and evidence preservation. The present invention has high detection efficiency, is simple and convenient to operate, and is suitable for widespread promotion and use. Attached Figure Description

[0042] Figure 1 This is a flowchart illustrating the fuel dispenser metering fraud detection method provided in an embodiment of the present invention.

[0043] Figure 2This is another flowchart illustrating the fuel dispenser metering fraud detection method provided in this embodiment of the invention;

[0044] Figure 3 This is a schematic diagram of the system principle of the fuel dispenser metering fraud detection device provided in an embodiment of the present invention;

[0045] Figure 4 A schematic diagram of the system principle of an electronic device provided in an embodiment of the present invention.

[0046] In the diagram: 100 - First acquisition module; 200 - Protocol template module; 300 - Simulated cheating instruction module; 400 - Detection module; 500 - Second acquisition module; 600 - Parsing module; 700 - Judgment module; 1000 - Electronic device; 1001 - Communication interface; 1002 - Processor; 1003 - Memory; 1004 - Bus. Detailed Implementation

[0047] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0048] Reference Figure 1 A method for detecting metering fraud in fuel dispensers includes the following steps S100 to S700.

[0049] Step S100: Obtain the brand information and cheating parameters of the fuel dispenser to be tested.

[0050] Specifically, the method of this embodiment can be applied to a fuel dispenser metering fraud detection tester. The tester connects to the fuel dispenser under test and obtains brand information and fraud parameters through user input, or directly from the fuel dispenser itself. Therefore, the fraud parameters here are either user-inputted or obtained from the fuel dispenser under test. The fraud parameters are configurable values ​​or status information used to control or characterize fuel dispenser metering fraud behavior. In this embodiment, the fraud parameters include fuel quantity parameters and tax rate parameters, for example, fuel: 5 (0.5 liters less per 100L), tax: 10 (one transaction is uploaded to the monitoring microprocessor for every 10 transactions). Obtaining the parameters from the fuel dispenser under test can be the parameter value currently set in the fuel dispenser's metering control mainboard, parsed from the response data of a query command sent by the tester to the fuel dispenser under test. For example, a fuel quantity correction value of 5. The query command can be a predefined hexadecimal code string. Each query command corresponds to a specific query function. For example: 01 02 03 10 01 63 01 40 17 E8 05 52 05 05 A3. The numbers in this query command have the following meanings: 01 represents the data header, 02 represents the gun number, 03, 10, and 01 are fixed values, 63 represents the number of transactions not subject to tax, 01 represents the amount of stolen oil per 100 liters, 40, 17, E8, 05, 52, and 05 are fixed values, and 05 and A3 represent the check digit.

[0051] In some embodiments, the tester is equipped with a multi-protocol interface, which is used to obtain brand information and cheating parameters from the fuel dispenser. The multi-protocol communication interface integrates at least RS485, CAN and Ethernet interfaces.

[0052] Step S200: Determine the protocol template from the preset protocol template library based on the brand information.

[0053] In an optional implementation, the protocol template includes the data frame structure rules, command word mapping rules, cheating parameter encoding rules, and checksum algorithm rules for the fuel dispenser to be detected.

[0054] Here, data frame structure rules define the macroscopic layout of the instruction frame, including the frame header identifier (e.g., 0xFA), command word position and meaning, data field length and offset, and frame tail or length field rules. For example, a brand's template might specify that the frame header is the first byte, with a fixed value of 0xFA; the command word is the second byte, with 0x03 indicating a read operation. Cheating parameter encoding rules define how to convert human-readable cheating parameters (e.g., fuel: 30) into a binary format recognizable by the fuel dispenser, such as 0x1E, 0x00. Cheating parameter encoding rules include parameter type (e.g., unsigned integer, floating-point number), number of bytes, byte order (big-endian / little-endian), and unit conversion factor. Checksum algorithm rules define data integrity verification methods, such as algorithm type (CRC-16, cumulative sum, etc.) and calculation range (e.g., from the command word to the end of the data field). Command word mapping rules establish the correspondence between function codes and operational intentions (e.g., 0x55 corresponds to the "set parameters" function).

[0055] A protocol template library is a database or collection of files stored in a testing device (such as a tablet), where each file corresponds to a communication rule for a specific brand of fuel dispenser. The communication protocol modules for different brands of fuel dispensers are usually different because each manufacturer develops its own proprietary communication protocol based on its product design, safety specifications, and functional requirements. These differences are mainly reflected in the following four aspects.

[0056] 1. Data frame format, such as frame header, address bits, and checksum method.

[0057] 2. Instruction set, for example, the instruction code for querying fuel level and controlling refueling.

[0058] 3. Data encoding method, such as ASCII code, binary code, or custom encryption format.

[0059] 4. Physical layer parameters such as baud rate and parity check.

[0060] Therefore, this embodiment develops independent communication protocol modules for different brands of fuel dispensers and builds a protocol template library.

[0061] In some possible implementations, the user selects or inputs the brand information of the fuel dispenser to be tested through the tester's interface. The system uses the brand information as an index key to retrieve the corresponding protocol template file from a pre-defined protocol template library. Once a matching template is found, the system loads it into memory, parses it into structured data (such as a JSON object or an in-memory structure), and forms a protocol parsing rule table that can be directly used by the CPU. This achieves "plug-and-play" multi-brand support for the testing system. No modification to the core code is required; new brands can be adapted simply by updating the template library, greatly improving the system's scalability and maintainability.

[0062] Step S300: Generate a simulated cheating instruction frame for the fuel dispenser to be detected based on the protocol template and cheating parameters.

[0063] In an optional implementation, the simulated cheating instruction frame includes a function code, an encoded parameter value, and a checksum; wherein, the function code is determined according to the command word mapping rule; the encoded parameter value is obtained by converting the cheating parameter according to the cheating parameter encoding rule; and the checksum is obtained by assembling the function code and the encoded parameter value into an instruction frame and calculating the checksum according to the data frame structure rules and checksum algorithm rules.

[0064] In some possible implementations, cheating instructions are obtained through software disassemblers and packet capture. Disassemblers are used to obtain the executable file of the fuel dispenser management software and decompile it using tools such as IDA Pro, converting the binary code into assembly code or pseudocode. Static analysis of the code identifies functions and code segments related to metering data processing and parameter settings, analyzes their logical structure, and identifies potential cheating instructions or key parameter setting points. Packet capture connects the fuel dispenser to the backend management system or other related devices. Network packet capture tools such as Wireshark are run, and packet filters are set to filter out network communication data packets related to the fuel dispenser. During refueling operations and parameter settings at the fuel dispenser, network data packets are captured, and their content and format are analyzed to find the contained instruction information. By comparing the differences in data packets during normal operation and potentially cheating operations, the transmission format and content of cheating instructions are determined.

[0065] In other possible embodiments, dynamic debugging and code injection are used to obtain cheating instructions. Dynamic debugging refers to starting the fuel dispenser management software and attaching to the software process using debugging tools such as OllyDbg. Breakpoints are set in the debugging tool, and these breakpoints can be placed at code locations related to key functions such as metering calculation and data verification. By single-stepping through the code and observing register and memory states, the software's execution flow is traced to understand variable changes and code execution paths during normal operation and potential cheating operations, thereby determining the specific location and execution method of the cheating instructions. Table 1 shows one cheating instruction format, and Table 2 shows another.

[0066] Table 1

[0067]

[0068] Tables 1 and 2 define the position and meaning of each field in the simulated cheating command frame. In Table 1, column 0 corresponds to the detection header. Column 1, "Gun Number + 2," corresponds to the function code 3, which is an example value. The value of this column is the gun number of the fuel dispenser under test plus 2, meaning function code 3 indicates gun number 1. The values ​​1 in columns 10 ("Oil") and 12 ("Tax") are both encoded parameter values; "Oil" and "Tax" represent parameter names. The encoded parameter values ​​convert human-readable cheating parameters into binary data according to the cheating encoding rules of the protocol template. Columns 13 and 14 correspond to the check bits. This embodiment uses CRC-16 / ARC as the verification algorithm. During verification, the detection header is removed, and other values ​​are verified. The verification URL is Online CRC-8 CRC-16 CRC-32 Calculator (crccalc.com).

[0069] In some possible embodiments, the CRC-16 / ARC check algorithm is a cyclic redundancy check algorithm widely used in data transmission and storage, whose core parameters include: the generator polynomial being x. 16 +x 15 +x 2 +x 1 (Represented in hexadecimal as 0x8005), the initial value is 0x0000 (lower byte first, higher byte last). Both input and output data need to be reversed, and the final XOR value is 0x0000 (the output result is XORed with this value). This verification algorithm is implemented in two ways: one is the lookup table method, which quickly calculates the checksum using a predefined CRC table, suitable for rapid verification scenarios; the other is the direct calculation method, which processes the input data bit by bit and calculates the checksum bit by bit using a polynomial.

[0070] Table 2

[0071]

[0072] In Table 2, the first column is the detection head; the second column represents the function code, for example, 0 represents gun number 2 and gun number 3; the third column is the specific gun number, for example, 0x01-1; the 15th and 16th columns represent "tax" and "fuel quantity"; and the last column is the check digit.

[0073] In a possible embodiment, the specific process of generating the instruction frame may be as follows: the tester constructs a complete binary frame according to its binary protocol template, which includes a function code (e.g., 0x55 indicates setting parameters) and parameter values ​​encoded according to a specified format (based on the cracked cheating instructions). For example, the fuel quantity parameter 30 may be encoded as 2 bytes 0x1E, 0x00, and the tax rate parameter 10 may be encoded as 1 byte 0x0A. The correct checksum algorithm rules (e.g., CRC-16 / ARC checksum algorithm) are then attached. These simulated parameters are called "simulated cheating parameters," used to trigger cheating behavior on the fuel dispenser. Subsequent actual refueling operations verify the tester's detection capabilities. For example, as shown in Table 2, a specific simulated cheating instruction binary frame could be: FA 0003 FF 00 12 6C 61 00 00 00 00 00 00 0005 02 00 6F BD.

[0074] Step S400: Send the simulated cheating instruction frame to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data.

[0075] Generating response data refers to the process by which the fuel dispenser's control board processes (executes or queries) the simulated cheating command frame sent by the detection system and returns a data frame containing the operation result or current status. This response data is the direct basis for the detection system's analysis and judgment. This embodiment's cheating tester has built-in multiple simulated cheating command frames (currently 6 types), which can simulate cheating software issuing cheating commands to the fuel dispenser to identify whether the fuel dispenser's control board has cheating functionality.

[0076] Step S500: Obtain response data.

[0077] The response data is a data interaction process between the tester and the fuel dispenser under test. The fuel dispenser under test may respond with a simple acknowledgment frame or a frame containing the operation result (success / failure code).

[0078] Step S600: Parse the response data according to the protocol template to obtain the parsing result.

[0079] Typically, the parsing template includes the fuel dispenser brand code, the communication protocol code used, the instruction set, checksum, etc. In an optional implementation, step S600 includes the following steps S601 to S606.

[0080] Step S601: Load and parse the protocol template library to obtain the protocol parsing rule table.

[0081] Step S602: Extract complete data frames from the response data according to the protocol parsing rule table.

[0082] Step S603: Perform integrity verification on the complete data frame according to the checksum algorithm rules in the protocol parsing rule table.

[0083] In step S604, in response to the successful verification, the address field and function code in the data frame are parsed according to the protocol parsing rule table to match the corresponding processing logic.

[0084] Step S605: Extract valid information from the data frame according to the data field parsing rules in the protocol parsing rule table; the valid information includes oil quantity parameter information, tax parameter information, and equipment status information.

[0085] Step S606: Encapsulate the valid information into a structured format to obtain the parsing result.

[0086] Here, a multi-protocol communication interface is used to send simulated cheating command frames to the fuel dispenser to be detected. The multi-protocol communication interface integrates at least RS485, CAN and Ethernet interfaces.

[0087] Specifically, the template loading process involves reading the corresponding brand's protocol template file (usually a binary or structured configuration file) from the smart hub's memory; parsing the template metadata (such as version number and checksum) to verify template integrity; loading template parameters (such as baud rate, frame structure, and instruction set) into a specified data structure in the CPU memory, and establishing a protocol parsing rule table. The template parsing process involves receiving a fuel dispenser data frame, first extracting the complete frame according to the frame header / tail rules in the template; verifying data integrity according to the template verification method (such as CRC or XOR checksum); parsing the address field and function code to match the corresponding processing logic in the template; and extracting a valid binary information byte stream (such as fuel quantity and status) according to the data field parsing rules (such as byte offset and unit conversion). This byte stream is initially a string of 00s or 11s, for example, 00 00 00 00 00... with an indefinite number of bits. The binary byte stream is then decoded according to the parameter encoding rules defined in the protocol template, and the decoded valid information is encapsulated into a unified format, such as converting to JSON or an internal data structure, before being passed to the host computer or used to execute corresponding control logic.

[0088] The processing logic in step S604 refers to the process of first determining the brand and model of the fuel dispenser through the address field and function code. This involves matching features such as the address field and function code with the protocol template library. Through feature matching, the fuel dispenser protocol brand is identified and locked to invoke the correct parsing rules. In some possible embodiments, this process may be: extracting protocol feature fingerprints from the current data frame, such as specific frame header / tail patterns, function code values ​​and positions, address field encoding methods, etc.; comparing these feature fingerprints with the features of all known brand protocol templates in the aforementioned protocol template library; when a protocol template with highly matching features is found, the system determines that the current fuel dispenser uses the communication protocol of that brand. Once the determination is successful, the system immediately locks and loads the complete protocol template corresponding to that brand, providing accurate parsing rules for subsequent steps (S605 data extraction).

[0089] The parsing of template metadata (such as version number and checksum) mentioned above to verify the integrity of the template can include the following steps 1 to 3.

[0090] Step 1: Obtain the protocol template data, including the template version number, file size, and checksum (such as CRC32 value).

[0091] Step 2: Determine if the version number is within the range supported by the system.

[0092] Step 3: Recalculate the checksum of the protocol template file and compare it with the checksum obtained in Step 1. If the checksums match, the verification passes.

[0093] Step S700: Determine whether the fuel dispenser under test has the cheating function corresponding to the cheating parameters based on the analysis results.

[0094] Finally, a test report is generated, detailing the test results as evidence of cheating. For example, an evidence report containing a blockchain electronic signature can be automatically generated.

[0095] The following two examples, 1 and 2, illustrate possible implementation processes.

[0096] Example 1 (Reading current cheat parameters):

[0097] Step 1: The operator connects the testing instrument to the control motherboard of the suspected cheating fuel dispenser via an interface;

[0098] Step 2: Select a brand in the host computer software to automatically load the protocol parsing template;

[0099] Step 3: The fuel dispenser metering cheating detection program software corresponding to the method in this embodiment reads the motherboard data in the tester and finds that the current cheating parameters are set to oil: 5 and tax: 10, triggering an alarm.

[0100] Example 1 aims to demonstrate how to detect existing and active cheating parameters on a fuel dispenser. First, a read command is sent to the fuel dispenser, and the returned response data is parsed to directly obtain the internally set cheating parameter values. In step 2, the corresponding protocol template is loaded according to the selected brand, and a read current parameter command frame conforming to the brand's communication protocol is automatically generated. This current parameter command frame is used as the cheating parameter. Following step S300 of this example, a simulated cheating command is generated and sent to the fuel dispenser's metering control mainboard. Upon receiving the command, the fuel dispenser's metering control mainboard reads the currently effective parameter settings from its internal memory and returns a response data frame. The fuel dispenser metering cheating detection program corresponding to this example in the tester receives the response frame and parses it according to the same protocol template to obtain the current cheating parameters: oil: 5, tax: 10. Then, step S700 is executed to determine that these parameters are cheating settings, triggering an alarm. The currently read cheating parameters are clearly displayed on the tester's software interface, and a detection report containing this evidence is automatically generated. This embodiment enables rapid, non-intrusive detection and evidence collection of cheating behavior.

[0101] Example 2 is the active verification mode. After the tester loads the communication protocol according to the different fuel dispensers, it first sends a communication request to the fuel dispenser based on the instructions it has already mastered. After receiving a response, it then sends a communication request for cheating instructions. If the fuel dispenser is in a cheating state, it will respond to the sent instructions. If it does not respond, it proves that the communication protocol or instruction set used in the motherboard contains cheating instructions. The specific steps are as follows.

[0102] Example 2 (Active Verification Mode):

[0103] Step 1: The operator first connects the tester to the fuel dispenser of a certain brand to be tested, and then enters the cheating parameters in the tester software interface, such as: fuel 30, tax 10 (for every 100L of fuel dispensed, 3L is underpaid, and one transaction is uploaded to the monitoring microprocessor for every 10 transactions).

[0104] Step 2: The tester sends simulated commands to the fuel dispenser's mainboard;

[0105] Step 3: Add 97L of standard oil, and the test reading changes to 100L, confirming that the cheating function exists.

[0106] For example, the tester generates a simulated cheating instruction frame (its function code is 0x55, and the data field contains encoded parameters such as 0x1E and 0x00) according to the locked protocol template and the input cheating parameters, and then sends it out.

[0107] Example 2 aims to illustrate how to proactively verify whether a fuel dispenser possesses the potential to perform a specific cheating behavior, even if that function is not currently activated. The core idea is to simulate the behavior of cheating software by sending a simulated command, such as a "set" command, to the fuel dispenser to proactively attempt to activate its cheating function, and then verifying its success through subsequent operations.

[0108] In step 2, the fuel dispenser metering fraud detection program corresponding to the method in this embodiment in the tester encodes and assembles the input parameters into a simulated fraud instruction frame according to the rules of the protocol template. The function code of this instruction frame (e.g., 0x55) represents the "set parameters" operation, and the data field contains the encoded parameter value. The tester sends this simulated fraud instruction frame to the metering control motherboard of the fuel dispenser under test. After receiving the instruction, the fuel dispenser metering control motherboard will treat it as an instruction from legitimate fraud software and execute it, thereby modifying the internal parameters to the value specified by the instruction. At this time, if it is found that the fuel dispenser displays a value of 100 liters, but the actual amount of fuel dispensed is only 97 liters, it confirms that the fraud instruction (stealing 3% of fuel) just issued has been successfully effective, and the fuel dispenser has this fraud function. The tester can record this process and preserve the evidence.

[0109] In an optional implementation, the method further includes:

[0110] Retrieve the latest protocol template file sent from the cloud;

[0111] Store the latest protocol template file in the protocol template library so that the fuel dispenser to be tested can be used to detect metering fraud based on the latest protocol template file.

[0112] This embodiment supports remote upgrades, which can be continuously upgraded via software network connection, and is compatible with new cheating methods without changing the hardware.

[0113] Furthermore, in the initial stage of building the protocol module library, the cheating software of mainstream fuel dispenser brands on the market was analyzed through reverse engineering, their communication messages were monitored, and their communication protocols were cracked through differential comparison analysis. The rules were then structured and stored. Subsequent updates to the protocol template can be performed using the update steps described in this embodiment.

[0114] In an optional implementation, before obtaining the brand information and cheating parameters of the fuel dispenser to be detected, the following steps are also included:

[0115] Send a cheating parameter reading command to the fuel dispenser under test. If no response is received, send a cheating parameter simulation command to the fuel dispenser under test to verify the cheating function.

[0116] In this embodiment, you only need to select the fuel dispenser brand and check the current cheating status. The software will directly display the current cheating status of the fuel dispenser. When issuing the cheating value, you can select the cheating value to issue. After issuance, test it according to the on-site situation to see if there are any inaccuracies in metering and tax calculation. The main function of the hardware is to translate the fuel dispenser communication protocol and has an interface function to connect to the fuel dispenser. Here, different brands of fuel dispensers have different interfaces, so we designed multiple interfaces. The data transmission and power supply of the hardware device use a USB interface, and only one interface is needed to connect to the tablet computer.

[0117] See Figure 2 In one possible embodiment, the fuel dispenser metering fraud detection method can be implemented as shown in steps S801 to S808 below.

[0118] Step S801: Connect the tester.

[0119] Step S802: Select the fuel dispenser brand.

[0120] Step S803: Automatically parse the communication protocol.

[0121] Step S804: Detect cheating parameters. If cheating parameters are detected, proceed to step S806; otherwise, continue to step S805.

[0122] Step S805: Send simulated cheating parameters. If the sending fails, proceed to step S808; otherwise, continue to step S806.

[0123] Step S806: Verify measurement deviation.

[0124] Step S807: Cheating detected.

[0125] Step S808: No cheating detected.

[0126] This embodiment, from an enforcement perspective, allows for direct testing of the fuel dispenser's control motherboard to determine if it can be used fraudulently. It bypasses the enforcement difficulties of traditional solutions, such as searching for the cheating host, cracking the cheating software (program) password, and locating the cheating software and hardware encryption key (USB key).

[0127] This embodiment has the following beneficial effects:

[0128] 1. Filling the gap in dynamic cheating detection technology: This embodiment is the first to achieve protocol-level dynamic data capture and cross-validation, breaking through the technical blind spots of traditional verification. By analyzing the communication protocols of different brands of fuel dispensers, it grasps the cheating instruction codes of fuel dispensers and accurately identifies cheating methods. Coupled with on-site operation reproduction to secure evidence, it fundamentally solves the industry-wide problem of "passing verification but actually cheating."

[0129] 2. Improved Efficiency of Law Enforcement and Evidence Collection: Law enforcement officers only need to connect the testing device, select the brand, and click "Cheating Parameter Detection / Cheating Parameter Distribution" to complete full data collection within 3 minutes (traditional law enforcement requires steps such as locating the cheating host, cracking the software password, and checking hidden software functions, a process that takes at least 1 hour). The testing device automatically generates an evidence collection report with a blockchain electronic signature, avoiding law enforcement interruptions caused by the concealment of hardware encryption keys (USB-KEY) and password locking, increasing the efficiency of a single law enforcement operation by 10 times and expanding the annual regulatory coverage from 20% to 100%.

[0130] 3. Eradicate industry-wide cheating: Through cloud-based sharing of cheating signature databases and OTA remote update mechanisms, regulatory authorities nationwide can synchronize new cheating methods in real time. When a testing device detects that a gas station is using a specific cheating method, all gas station cheating testing devices can be upgraded synchronously by updating the cheating signature database, forming a closed-loop governance network of "detection in one location, joint prevention nationwide".

[0131] This embodiment addresses the problem of poor universality in existing technologies by adapting protocol templates to different brands. It actively generates simulated cheating command frames, directly targeting the root cause of cheating and overcoming the limitation of static detection in detecting dynamic cheating. Through real-time interaction and parsing of response data, it achieves immediate detection and evidence collection of cheating behavior, significantly improving law enforcement efficiency. Based on a standardized parsing process using protocol templates, this embodiment automatically generates structured evidence reports, ensuring the accuracy and legal validity of the evidence results and addressing the pain point of incomplete evidence chains during law enforcement. Furthermore, the cloud-based protocol template library update mechanism enables the system to continuously evolve, quickly adapting to new cheating methods and forming a closed-loop governance system of "one-stop detection, nationwide joint prevention," fundamentally curbing industry cheating chaos. In summary, this embodiment not only breaks through the technical blind spots of traditional detection methods but also achieves a leap forward from passive defense to active detection, from single verification to continuous supervision, and from manual experience to intelligent judgment, providing a comprehensive, efficient, and reliable solution for fuel dispenser metering supervision.

[0132] See Figure 3This invention provides a fuel dispenser metering cheating detection device, comprising a first acquisition module 100, a protocol template module 200, a simulated cheating instruction module 300, a detection module 400, a second acquisition module 500, a parsing module 600, and a judgment module 700. The first acquisition module 100 acquires the brand information and cheating parameters of the fuel dispenser to be detected. The protocol template module 200 determines a protocol template from a preset protocol template library based on the brand information. The simulated cheating instruction module 300 generates a simulated cheating instruction frame for the fuel dispenser to be detected based on the protocol template and cheating parameters. The detection module 400 sends the simulated cheating instruction frame to the fuel dispenser to be detected, causing the fuel dispenser to generate response data. The second acquisition module 500 acquires the response data. The parsing module 600 parses the response data according to the protocol template to obtain a parsing result. The judgment module 700 determines whether the fuel dispenser to be tested possesses cheating functionality corresponding to the cheating parameters based on the parsing result.

[0133] In an optional embodiment, the cheating parameters are either input by the user or obtained from the fuel dispenser under test.

[0134] In an optional embodiment, the protocol template includes the data frame structure rules, command word mapping rules, cheating parameter encoding rules, and checksum algorithm rules for the fuel dispenser to be detected.

[0135] In an optional embodiment, the simulated cheating instruction frame includes a function code, an encoding parameter value, and a checksum; wherein, the function code is determined according to the command word mapping rule; the encoding parameter value is obtained by converting the cheating parameter according to the cheating parameter encoding rule; and the checksum is obtained by assembling the function code and the encoding parameter value into an instruction frame and calculating the checksum according to the data frame structure rule and the checksum algorithm rule.

[0136] In an optional embodiment, the parsing module 600 includes a protocol parsing rule table module, a data frame interception module, an integrity verification module, a logic matching module, a valid information extraction module, and an encapsulation module. The protocol parsing rule table module loads and parses the protocol template library to obtain the protocol parsing rule table. The data frame interception module extracts complete data frames from the response data according to the protocol parsing rule table. The integrity verification module performs integrity verification on the complete data frames according to the checksum algorithm rules in the protocol parsing rule table. The logic matching module, in response to successful verification, parses the address fields and function codes in the data frames according to the protocol parsing rule table to match the corresponding processing logic. The valid information extraction module extracts valid information from the data frames according to the data field parsing rules in the protocol parsing rule table; wherein, the valid information includes oil quantity parameter information, tax parameter information, and equipment status information. The encapsulation module encapsulates the valid information into a structured format to obtain the parsing result.

[0137] In an optional embodiment, the device further includes an update module and a storage module. The update module is used to obtain the latest protocol template file sent from the cloud. The storage module is used to store the latest protocol template file in a protocol template library for metering fraud detection of the fuel dispenser to be tested based on the latest protocol template file.

[0138] In an optional embodiment, the device further includes a detection and verification module for sending a cheating parameter reading command to the fuel dispenser under test, and if no response is received, sending a cheating parameter simulation command to the fuel dispenser under test to verify the cheating function.

[0139] In an optional embodiment, the detection module 400 is specifically used to: send a simulated cheating instruction frame to the fuel dispenser to be detected using a multi-protocol communication interface, wherein the multi-protocol communication interface integrates at least RS485, CAN and Ethernet interfaces.

[0140] The apparatus provided in the embodiments of this application has the same inventive concept as the method provided in the embodiments of this application. As long as the method can solve the technical problem, the apparatus can also solve the technical problem. This will not be elaborated here.

[0141] Reference Figure 4 This invention also provides an electronic device 1000, including a communication interface 1001, a processor 1002, a memory 1003, and a bus 1004. The processor 1002, the communication interface 1001, and the memory 1003 are connected via the bus 1004. The memory 1003 is used to store a computer program that supports the processor 1002 in executing the above-mentioned fuel dispenser metering fraud detection method. The processor 1002 is configured to execute the program stored in the memory 1003.

[0142] Optionally, embodiments of the present invention also provide a computer-readable medium having non-volatile program code executable by a processor 1002, the program code causing the processor 1002 to perform the fuel dispenser metering fraud detection method as described in the above embodiments.

[0143] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.

Claims

1. A method for detecting metering fraud in fuel dispensers, characterized in that, include: Obtain the brand information and cheating parameters of the fuel dispenser to be tested; A protocol template is determined from a preset protocol template library based on the brand information; A simulated cheating instruction frame for the fuel dispenser to be detected is generated according to the protocol template and the cheating parameters. The protocol template includes data frame structure rules, command word mapping rules, cheating parameter encoding rules, and checksum algorithm rules for the fuel dispenser to be detected. The simulated cheating instruction frame includes a function code, an encoded parameter value, and a checksum value. The function code is determined according to the command word mapping rules. The encoded parameter value is obtained by converting the cheating parameters according to the cheating parameter encoding rules. The checksum value is obtained by assembling the function code and the encoded parameter value into an instruction frame and calculating the checksum according to the data frame structure rules and the checksum algorithm rules. The simulated cheating instruction frame is sent to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data; Obtain the response data; The response data is parsed according to the protocol template to obtain the parsing result; Based on the analysis results, determine whether the fuel dispenser under test has a cheating function corresponding to the cheating parameters; The step of parsing the response data according to the protocol template to obtain the parsing result includes: Load and parse the protocol template library to obtain the protocol parsing rule table; Extract complete data frames from the response data according to the protocol parsing rule table; The integrity of the complete data frame is verified according to the checksum algorithm rules in the protocol parsing rule table. In response to successful verification, the address field and function code in the data frame are parsed according to the protocol parsing rule table to match the corresponding processing logic; According to the data domain parsing rules in the protocol parsing rule table, valid information is extracted from the data frame; wherein, the valid information includes oil quantity parameter information, tax parameter information, and equipment status information; The valid information is encapsulated into a structured format to obtain the parsing result.

2. The method for detecting metering fraud in fuel dispensers according to claim 1, characterized in that, The cheating parameters are either input by the user or obtained from the fuel dispenser being tested.

3. The method for detecting metering fraud in fuel dispensers according to claim 1, characterized in that, The method further includes: Retrieve the latest protocol template file sent from the cloud; The latest protocol template file is stored in the protocol template library so as to perform metering fraud detection on the fuel dispenser to be tested according to the latest protocol template file.

4. The method for detecting metering fraud in fuel dispensers according to claim 1, characterized in that, Before obtaining the brand information and cheating parameters of the fuel dispenser to be detected, the process also includes: Send a cheating parameter reading command to the fuel dispenser under test. If no response is received, send a cheating parameter simulation command to the fuel dispenser under test to verify the cheating function.

5. The method for detecting metering fraud in fuel dispensers according to claim 1, characterized in that, Sending the simulated cheating instruction frame to the refueling machine to be detected includes: The simulated cheating instruction frame is sent to the fuel dispenser to be detected using a multi-protocol communication interface, which integrates at least RS485, CAN and Ethernet interfaces.

6. A device for detecting metering fraud on fuel dispensers, characterized in that, The apparatus, applicable to the method of any one of claims 1-5, comprises: The first acquisition module is used to acquire the brand information and cheating parameters of the fuel dispenser to be detected; The protocol template module is used to determine a protocol template from a preset protocol template library based on the brand information; The simulated cheating instruction module is used to generate a simulated cheating instruction frame for the fuel dispenser to be detected based on the protocol template and the cheating parameters. The detection module is used to send the simulated cheating instruction frame to the fuel dispenser to be detected, so that the fuel dispenser to be detected generates response data; The second acquisition module is used to acquire the response data; The parsing module is used to parse the response data according to the protocol template to obtain the parsing result; The judgment module is used to determine whether the fuel dispenser under test has a cheating function corresponding to the cheating parameters based on the analysis results.

7. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Anti-cheat module of fueller and anti-cheat method therefor

    CN101481078A

  • Metrological verification method and system for fuel dispenser

    CN119079923A