Method and device for collecting transaction data of oiling machine

By installing a data collection device on the tanker to obtain and upload transaction data in real time, it solves the problems of untimely data and low reliability of traditional collection methods, achieves efficient data monitoring and management, and improves tax collection and oil quality assurance. .

CN118869730APending Publication Date: 2024-10-29SHANDONG YONGGONGBAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410764370.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The traditional way of collecting transaction data from tankers has problems such as untimely data, high labor costs and low data reliability, making it difficult to effectively monitor the refined oil circulation market and ensure oil quality.

Method used

Design a tanker transaction data collection device that connects to the tanker mainboard through the main control microcontroller to obtain tax control data and the number of encoder pulses in real time. It uses EEPROM memory chips and nor flash memory for data storage and comparison, combined with decryption. The card and communication module perform data decryption and remote transmission to realize real-time upload and analysis of data.

Benefits of technology

Real-time collection and remote monitoring of tanker transaction data are realized, which improves the timeliness and reliability of data, saves labor costs, and enhances tax collection and management efficiency and oil quality assurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869730A_ABST
    Figure CN118869730A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for collecting transaction data of an oiling machine, and relates to the technical field of data collection and monitoring of oil product sales, and the device comprises a main control microcontroller which is used for controlling the data collection, processing and transmission process of the whole device; and the external interface is used for being connected with each device of the oiling machine. According to the invention, by collecting the transaction data of the oiling machine in real time and uploading the transaction data to the server for processing, the real-time updating and remote monitoring of the data are realized, the labor cost is saved, and the timeliness and reliability of the data are improved. Meanwhile, through the design of an encryption tax declaration port and a decryption card, the difficulty of cheating and tampering data is increased, and the authenticity and accuracy of the data are further guaranteed, so that the system can be widely applied to the field of data acquisition and monitoring in the oil product sales industry; the tax collection and management efficiency can be improved, the market sales behavior can be standardized, and the oil quality and the metering accuracy can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data collection and monitoring of finished oil sales, and in particular to a method and device for collecting transaction data of a fuel dispenser. Background Art

[0002] A refueling machine is a machine used for refueling, usually installed in a gas station. The refined oil industry is a comprehensive industry involving multiple links such as crude oil processing, production, wholesale and retail. The main products of this industry include gasoline, diesel, kerosene, lubricants, etc. These products are widely used in the fields of automobiles, agricultural machinery, aviation, navigation, and electricity. In the refined oil wholesale and retail industry, the competition pattern is mainly manifested in competition in price, brand, technology and service. In addition, in order to regulate the refined oil circulation market, the state has also formulated relevant policies such as the "Refined Oil Circulation Management Measures" to strengthen the supervision and management of refined oil circulation and protect the legitimate rights and interests of operators and consumers. The refined oil industry is an industry closely related to the development of the national economy. With the adjustment of the energy structure and the promotion of environmental protection policies, the industry will face more opportunities and challenges. Among them, the transaction data of the refueling machine is an important basis for strengthening the supervision and management of refined oil circulation.

[0003] The current refined oil industry has many problems such as tax loss, missing operating data, chaotic market sales prices, substandard oil quality, and measurement shortages. The traditional on-site inspection method of tax, emergency, and measurement personnel has problems such as untimely data, high labor costs, and low data reliability. Therefore, it is necessary to propose a method and device for collecting transaction data of fuel dispensers to solve the problems in the existing technology. Summary of the invention

[0004] The purpose of the present invention is to make up for the deficiencies of the prior art and to provide a method and device for collecting transaction data of a gas station. The device is placed inside the gas station and connected to the gas station mainboard through a specific interface to obtain the transaction data of the gas station in real time, and upload the data to the server for analysis and processing through a communication module.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a fuel dispenser transaction data collection device, the device comprising:

[0006] The main microcontroller is used to control the data collection, processing and transmission process of the entire device;

[0007] External interface, used to connect with various devices of the fuel dispenser to obtain the fuel dispenser's tax control data, encoder pulse number and fuel gun lifting and hanging status in real time;

[0008] EEPROM storage chip, used to store the device serial number and bound fuel dispenser motherboard information, to ensure the unique correspondence between the device and the fuel dispenser;

[0009] nor flash memory, used to store programs and cache real-time data obtained from external interfaces;

[0010] Reserved slots for connecting decryption cards and communication modules to support decryption of encrypted data and remote transmission of data;

[0011] The power interface is used to provide a stable power supply to the device.

[0012] Furthermore, the main control microcontroller is selected from but not limited to STM32 or CD32 series, which has high performance, low power consumption and powerful data processing capabilities.

[0013] Furthermore, the external interface is specifically a group of interfaces including but not limited to S232, RS485, pulse signal pins and interrupt pins, which are respectively used to connect to the tax reporting port, encoder or encoder pulse signal, and lifting gun pin of the fuel dispenser mainboard.

[0014] Furthermore, the decryption card is used to decrypt the data encrypted by the tax declaration port to ensure the integrity and security of the data.

[0015] Furthermore, the communication module supports wireless or wired communication methods, including but not limited to 4G, 5G, Wi-Fi, and Ethernet, and is used to transmit the collected data to the server in real time for analysis and processing.

[0016] A method for collecting transaction data of a fuel dispenser using the above device, the method comprising:

[0017] Obtain tax control data, encoder pulse quantity and fuel gun lifting and hanging status of fuel dispenser in real time through external interface;

[0018] Cache the above acquired real-time data in the form of queue into the NOR flash memory;

[0019] The main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is any abnormality in the mainboard;

[0020] If the tax declaration port is encrypted, the decryption card is called to decrypt the data;

[0021] The main control microcontroller assembles the data and adds the connector device information data, and then uploads it to the server through the communication module;

[0022] The fuel dispenser connector periodically determines the connection and availability status of each external port and reports abnormal information to the server.

[0023] Furthermore, the method also includes:

[0024] After receiving the data, the server cross-checks the data to comprehensively extract the number of times the gas station sells oil, the time of each sale, the unit price, the amount of oil and the total price information for further data analysis and processing.

[0025] Furthermore, the main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is an abnormality in the mainboard. The checksum algorithm is required. The main control microcontroller compares the cached tax control data with the data in the EEPROM item by item. In addition to directly comparing the serial number, version information, and configuration parameters, it also calculates the checksum of the data in these two data sources to further confirm the integrity of the data. The checksum algorithm is a simple accumulation similar to this: Among them, data i Represents each byte of the data, and n represents the total number of bytes of the data. This algorithm adds all the bytes of the data (usually as unsigned bytes, and may require modulo 256 operations to prevent overflow), and then obtains an 8-bit checksum.

[0026] Furthermore, after receiving the data, the server extracts the number of times the gas station sells oil, the time of each oil sale, the unit price, the oil volume and the total price information by cross-checking various data. The specific algorithm is described as follows:

[0027] For each transaction record R i , where i is the index of the record, R i Contains the following fields: Timestamp T j 、Oil volume V i Unit Price i ;

[0028] The number of oil sales (N) can be obtained by simply counting R i To obtain: N = count (R i );

[0029] Time of each oil sale (Assuming you need to calculate the average time of each oil sale) You can get it by taking the difference and average of the timestamps (assuming the records are sorted by timestamp): where j∈[1,count(R i )-1];

[0030] The statistics of unit price and oil quantity can be obtained by i and V i Summing or averaging gives:

[0031] Furthermore, the above method not only saves labor costs, but also improves the timeliness and reliability of data, which helps to improve the efficiency of tax collection and management, standardize market sales behavior, and ensure oil quality and measurement accuracy.

[0032] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0033] The embodiment of the present application provides a method and device for collecting transaction data of a gas station, which collects the transaction data of the gas station in real time and uploads it to the server for processing, thereby realizing real-time updating and remote monitoring of the data, which not only saves labor costs, but also improves the timeliness and reliability of the data. At the same time, through the design of the encrypted tax declaration port and the decryption card, the difficulty of cheating and tampering with the data is increased, and the authenticity and accuracy of the data are further guaranteed, so that the present invention can be widely used in the field of data collection and monitoring in the finished oil sales industry, which helps to improve the efficiency of tax collection and management, standardize market sales behavior, and ensure the quality of oil products and measurement accuracy.

[0034] Other advantages, objectives and features of the present invention will be set forth in part in the following description and, in part, will be apparent to those skilled in the art based on an examination of the following or may be taught from the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 It is a system structure diagram of a fuel dispenser transaction data collection device;

[0037] Figure 2 The figure is a flowchart of a method for collecting transaction data of a gas station. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] Example 1

[0040] like Figure 1 As shown, the present application provides a fuel dispenser transaction data collection device, the device comprising:

[0041] A main control microcontroller, used to control the data collection, processing and transmission process of the entire device; the main control microcontroller is selected from but not limited to the STM32 or CD32 series, which has high performance, low power consumption and strong data processing capabilities;

[0042] The main control microcontroller adopts high-performance processor chips, such as the STM32 series or CD32 series, which have powerful data processing capabilities and low power consumption characteristics. It can handle multiple data acquisition, processing and transmission tasks at the same time to ensure the real-time and accuracy of the data. The main control microcontroller has a built-in self-diagnosis mechanism that can automatically detect the operating status of the device and try to automatically recover when an abnormality occurs, thereby improving the stability and reliability of the device.

[0043] The external interface is used to connect with various devices of the fuel dispenser to obtain the tax control data, encoder pulse number and fuel gun lifting and hanging status of the fuel dispenser in real time; the external interface is specifically a group of interfaces including but not limited to S232, RS485, pulse signal pins and interrupt pins, which are respectively used to connect with the tax reporting port, encoder or encoder pulse signal, and fuel gun lifting and hanging pin of the fuel dispenser mainboard;

[0044] S232 interface: used for data transmission with the tax reporting port of the fuel dispenser mainboard, supporting high-speed and stable data communication;

[0045] RS485 interface: provides multi-node communication capability, supports simultaneous connection to multiple fuel dispenser motherboards, and expands the application scope of the device;

[0046] Pulse signal pin: Receive encoder or encoder pulse signal, accurately measure the refueling amount, and ensure the accuracy of data;

[0047] Interrupt pin: connected to the lifting and hanging status of the fuel gun, real-time monitoring of the use of the fuel gun, providing an important basis for data analysis.

[0048] EEPROM storage chip, used to store the device serial number and bound fuel dispenser motherboard information, to ensure the unique correspondence between the device and the fuel dispenser;

[0049] The EEPROM storage chip is used to store the serial number of the device and important data of the bound fuel dispenser motherboard information, ensuring the unique correspondence between the device and the fuel dispenser. It adopts advanced storage technology to ensure the stability and reliability of data in extreme environments, supports remote updating of data in the storage chip, and facilitates equipment management and maintenance.

[0050] nor flash memory, used to store programs and cache real-time data obtained from external interfaces;

[0051] The NOR flash memory is used to store the device's operating program, ensuring that the device can collect and process data according to the predetermined logic. It provides a high-speed, large-capacity cache area for caching real-time data obtained from external interfaces to prevent data loss or conflict. It supports data backup functions to ensure that key data can be restored in unexpected situations.

[0052] The reserved slot is used to connect the decryption card and the communication module to support the decryption of encrypted data and the remote transmission of data; the decryption card is used to decrypt the data encrypted by the tax declaration port to ensure the integrity and security of the data; the communication module supports wireless or wired communication methods, including but not limited to 4G, 5G, Wi-Fi, Ethernet, and is used to transmit the collected data to the server in real time for analysis and processing;

[0053] The reserved slots include a decryption card slot and a communication module slot. The decryption card slot is used to connect the decryption card to decrypt the data encrypted at the tax declaration port to ensure data security. The communication module slot supports the connection of multiple communication modules, such as 4G, 5G, Wi-Fi, and Ethernet, to achieve remote transmission and real-time monitoring of data. The reserved slot design enables the device to have powerful expansion capabilities, and new functional modules can be added or existing modules can be upgraded according to actual needs.

[0054] The power interface is used to provide a stable power supply to the device.

[0055] The power interface supports a wide range of voltage input to adapt to the power environment of different gas stations. The power interface has a built-in power protection circuit to prevent overvoltage and overcurrent abnormal conditions from damaging the device. The power interface adopts low-power technology and energy-saving measures to reduce the power consumption of the device and extend its service life.

[0056] Example 2

[0057] Based on the same inventive concept as the gas station transaction data collection device in the above embodiment, Figure 2 As shown, the present application provides a method for collecting transaction data of a fuel dispenser using the above device, the method comprising:

[0058] Obtain tax control data, encoder pulse quantity and fuel gun lifting and hanging status of fuel dispenser in real time through external interface;

[0059] The specific execution steps of this method are as follows: after the device is started, the hardware and software resources related to the external interface are initialized first to ensure that the interface can work normally, and the parameters of S232, RS485, pulse signal pins and interrupt pins, such as baud rate, data bit, stop bit, are configured. The device establishes a communication connection with the tax reporting port of the fuel dispenser mainboard through the S232 or RS485 interface. After ensuring that the connection is stable, it starts to receive tax control data from the fuel dispenser mainboard. The device receives the pulse signal from the encoder through the pulse signal pin. According to the frequency and encoding rules of the pulse signal, the number of encoder pulses is calculated to know the amount of fuel. The device is connected to the lifting and hanging state of the fuel gun through the interrupt pin. The state change of the interrupt pin is monitored in real time to determine whether the fuel gun is lifted or hung back. When the state of the fuel gun changes, the corresponding state information is recorded. The tax control data, the number of encoder pulses and the lifting and hanging state of the fuel gun obtained from the external interface are verified to ensure the accuracy and integrity of the data. The verified data is stored in the internal memory of the device (nor flash memory) for subsequent processing and transmission. During the entire data collection process, the device needs to maintain real-time connection with the external interface to ensure that the latest data of the fuel dispenser can be obtained in real time. The processing and transmission mechanism within the device also needs to be efficient and real-time to ensure the timeliness and accuracy of the data.

[0060] Through the above detailed steps, the tax control data, encoder pulse number and fuel gun lifting and hanging status of the fuel dispenser can be obtained in real time and accurately, providing reliable data support for subsequent data processing and analysis.

[0061] Cache the above acquired real-time data in the form of queue into the NOR flash memory;

[0062] The specific execution steps of this method step are: define a queue data structure in the software program for storing real-time data. The queue needs to support the first-in-first-out (FIFO) principle. When the device obtains real-time data from the external interface (such as tax control data, encoder pulse number, and fuel gun lifting and hanging status), the data is first packaged according to the defined format. Then, the packaged data is added to the end of the queue. If the queue is full, it needs to be processed according to the queue management strategy (such as overwriting old data or discarding new data). Since the NOR flash memory has the characteristics of block erasure and page programming, it is necessary to determine the storage location and method of the data before writing the data to the memory. The device can choose to write the data to a free page of the memory, or when the memory space is insufficient, it can free up space by erasing a used block. When writing data, the device needs to operate according to the programming protocol of the NOR flash memory and correctly write the data to the specified address.

[0063] After data is written to the NOR flash memory, the device needs to perform data verification to ensure the integrity and accuracy of the data. The written data can be verified using a checksum algorithm, and the verification result can be stored in the memory or transmitted together with other data. Throughout the caching process, the device needs to maintain the state of the queue, including the length, head and tail position of the queue. When data needs to be read, the device can take the data from the head of the queue and update the state of the queue accordingly. If errors occur during the writing process to the NOR flash memory (such as memory failure, write failure), the device needs to be able to detect and handle these errors. Some recovery measures can be taken, such as retrying the write, switching to backup memory, or reporting errors and stopping data caching.

[0064] Through the above detailed steps, real-time data can be cached in the NOR flash memory in the form of queues, providing reliable data support for subsequent data processing and transmission. At the same time, through queue management and error handling mechanisms, the integrity and accuracy of data can be ensured, and the reliability and stability of the system can be improved.

[0065] The main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is any abnormality in the mainboard;

[0066] The specific execution steps of this method step are as follows: the main control microcontroller first reads the tax control data cached in the memory (nor flash memory). At the same time, the main control microcontroller also reads the data or reference values ​​related to the mainboard stored in the EEPROM (electrically erasable programmable read-only memory). Ensure that the data read from the memory and EEPROM are in the correct format and are ready for comparison. The data may need to be decoded, parsed or converted into a unified format for comparison. The main control microcontroller compares the cached tax control data with the data in the EEPROM item by item. The content of the comparison may include but is not limited to: serial number, version information, configuration parameters, and checksum value.

[0067] If any inconsistency or anomaly is found during the comparison process, such as data mismatch, missing or format error, the main control microcontroller will mark it as an abnormal state. The anomaly may indicate a problem with the motherboard, such as hardware failure, configuration error or data corruption. The main control microcontroller records the abnormal information and may trigger the corresponding processing mechanism. The processing method may include: displaying an error message to the user, sending an alarm signal, entering a safe mode, attempting automatic repair or starting a fault recovery program. Depending on the design and requirements of the system, the main control microcontroller may also need to report the abnormal information to the host computer, server or administrator. This can be achieved through serial communication, network communication or other interfaces so that relevant personnel can be notified in time and take appropriate measures. The main control microcontroller can try to automatically repair or recover data to ensure the normal operation of the system. If automatic repair is not possible, manual intervention or hardware replacement by the user or administrator may be required.

[0068] The main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is an abnormality in the mainboard. The checksum algorithm is required. The main control microcontroller compares the cached tax control data with the data in the EEPROM item by item. In addition to directly comparing the serial number, version information, and configuration parameters, it also calculates the checksum of the data in the two data sources to further confirm the integrity of the data. The checksum algorithm is a simple accumulation similar to this: Among them, data i Represents each byte of the data, and n represents the total number of bytes of the data. This algorithm adds all the bytes of the data (usually as unsigned bytes, and may require modulo 256 operations to prevent overflow), and then obtains an 8-bit checksum.

[0069] If the tax declaration port is encrypted, the decryption card is called to decrypt the data;

[0070] The specific execution steps of this method step are as follows: The master microcontroller first detects whether the data received from the tax declaration port is encrypted. This can usually be achieved by checking specific fields or flag bits of the data. If the data is detected to be encrypted, the master microcontroller initializes the communication interface with the decryption card. This usually involves setting communication parameters (such as baud rate, data bits, stop bits) and establishing a stable communication connection. The master microcontroller sends the encrypted data and any necessary decryption keys or parameters to the decryption card. The specific format and content of the decryption request may vary depending on the encryption algorithm and the requirements of the decryption card. The master microcontroller waits for the decryption response from the decryption card. The decryption card decrypts the received encrypted data and returns the decrypted data to the master microcontroller. After receiving the decryption result, the master microcontroller performs necessary verification to ensure that the decryption is successful and the data is correct. The verification method may include checking the integrity, format or value of specific fields of the decrypted data. Once the decryption result is verified, the master microcontroller can perform subsequent processing on the decrypted data. This may include storing the decrypted data in a memory, comparing it with other data, or performing other patent-related operations. If an error occurs during the decryption process (such as the decryption card cannot recognize the encrypted data, the decryption key is incorrect, or the decryption fails), the main microcontroller needs to perform corresponding error handling operations. This may include recording error information, sending an alarm signal, or taking other remedial measures.

[0071] It should be noted that the specific decryption steps and implementation methods may vary depending on the encryption algorithm, the type of decryption card, and the specific requirements of the patent. Therefore, in actual applications, corresponding adjustments and modifications need to be made according to the specific situation. In addition, since the decryption operation involves the processing of sensitive data, it is necessary to ensure the security and reliability of the decryption process.

[0072] The main control microcontroller assembles the data and adds the connector device information data, and then uploads it to the server through the communication module;

[0073] The specific execution steps of this method step are as follows: the main control microcontroller first collects the data to be uploaded, which includes real-time data obtained from the external interface (such as tax control data, encoder pulse number and fuel gun lifting and hanging status), decrypted data (if the tax reporting port is encrypted), and connector device information. According to the preset data format or protocol, the main control microcontroller assembles the collected data. This usually includes packaging the data into specific data frames or data packets, and adding necessary header information, tail information, and checksums. During the data assembly process, the main control microcontroller also adds the connector device information to the data packet. This device information may include a unique identifier of the device (such as a serial number, MAC address), the type, model, and version of the device. This information is very important for the server to identify and distinguish different connectors and devices. Before uploading the data, the main control microcontroller will check the assembled data packet to ensure the integrity and accuracy of the data. This usually includes calculating the checksum and checking the length and format of the data packet.

[0074] The master microcontroller sends the assembled and verified data packets to the communication module by calling the interface or function of the communication module. The communication module is responsible for sending the data to the server through a specific communication protocol (such as TCP / IP, MQTT, HTTP). If the connection between the server and the master microcontroller has not been established, the communication module will try to establish a connection with the server. This usually involves a handshake and identity authentication process with the server. Once the connection is successfully established, the communication module will send the data packet to the server. During the transmission process, it may be necessary to deal with network delays and packet loss to ensure reliable data transmission. If an error occurs during the data transmission process (such as connection failure, data transmission timeout), the master microcontroller will perform the corresponding error handling operations and record the error information for subsequent analysis and troubleshooting.

[0075] The fuel dispenser connector periodically determines the connection and availability status of each external port and reports abnormal information to the server.

[0076] The specific execution steps of this method step are as follows: a timer is set inside the fuel dispenser connector to trigger the port status check operation according to a preset time interval (such as every second, every minute). The connector traverses all external ports (such as tax control interface, encoder interface, fuel gun interface), checks the physical connection status of each port (such as whether a device is plugged in, whether it is loose), and in addition to the physical connection status, the connector also needs to check the logical status of the port (such as whether the communication is smooth, whether the device responds). This can be achieved by sending a test instruction or request and waiting for a response. The connector determines whether there is an abnormality in the port based on preset rules or thresholds. Exceptions may include physical disconnection, communication timeout, and no response from the device. If a port is judged to be abnormal, the connector will record the abnormal information of the port, including the port number, abnormality type, and abnormal time.

[0077] The connector assembles the collected exception information according to the preset format or protocol to generate an exception report. The exception report is sent to the server through the communication module (such as Ethernet module, Wi-Fi module, 4G / 5G module). During the sending process, it may be necessary to deal with network delays and packet loss issues to ensure reliable data transmission. If an error occurs during the reporting of exception information (such as network failure, no response from the server), the connector will perform the corresponding error handling operations and record the error information for subsequent analysis and troubleshooting. The connector also needs to record the results and exception information of all port status checks to form a log for subsequent analysis and query. After sending the exception report, the connector will continue to perform regular checks on the port status and continue to monitor the connection and availability status of each external port.

[0078] Furthermore, the method also includes: after the server receives the data, it cross-compares the data to comprehensively extract the number of times the gas station sells oil, the time of each oil sale, the unit price, the amount of oil and the total price information for further data analysis and processing.

[0079] The specific execution steps of this method are as follows: after receiving the abnormal report, the server can perform corresponding processing, such as sending an alarm notification, recording abnormal information, and starting remote fault diagnosis. The server can also remotely configure or control the fuel dispenser or connector based on the abnormal information to try to resolve the abnormality or restore the normal operation of the equipment.

[0080] After receiving the data, the server extracts the number of times the gas station sells oil, the time of each sale, the unit price, the amount of oil, and the total price information by cross-checking the data. The specific algorithm is described as follows:

[0081] For each transaction record R i , where i is the index of the record, R i Contains the following fields: Timestamp T j 、Oil volume V i Unit Price i ;

[0082] The number of oil sales (N) can be obtained by simply counting R i To obtain: N = count (R i );

[0083] Time of each oil sale (Assuming you need to calculate the average time of each oil sale) You can get it by taking the difference and average of the timestamps (assuming the records are sorted by timestamp): where j∈[1,count(R i )-1];

[0084] The statistics of unit price and oil quantity can be obtained by i and V i Summing or averaging gives:

[0085] The above method not only saves labor costs, but also improves the timeliness and reliability of data, which helps to improve the efficiency of tax collection and management, standardize market sales behavior, and ensure oil quality and measurement accuracy.

[0086] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the same elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A fuel dispenser transaction data collection device, characterized in that: The device includes: The main microcontroller is used to control the data collection, processing and transmission process of the entire device; External interface, used to connect with various devices of the fuel dispenser to obtain the fuel dispenser's tax control data, encoder pulse number and fuel gun lifting and hanging status in real time; EEPROM storage chip, used to store the device serial number and bound fuel dispenser motherboard information, to ensure the unique correspondence between the device and the fuel dispenser; nor flash memory, used to store programs and cache real-time data obtained from external interfaces; Reserved slots for connecting decryption cards and communication modules to support decryption of encrypted data and remote transmission of data; The power interface is used to provide a stable power supply to the device.

2. The device according to claim 1, characterized in that The main control microcontroller is selected from but not limited to STM32 or CD32 series, which has high performance, low power consumption and powerful data processing capability.

3. The device according to claim 1, characterized in that The external interface is specifically a group of interfaces including but not limited to S232, RS485, pulse signal pins and interrupt pins, which are respectively used to connect to the tax reporting port, encoder or encoder pulse signal, and lifting gun pin of the fuel dispenser mainboard.

4. The device according to claim 1, characterized in that The decryption card is used to decrypt the data encrypted by the tax declaration port to ensure the integrity and security of the data.

5. The device according to claim 1, characterized in that The communication module supports wireless or wired communication methods, including but not limited to 4G, 5G, Wi-Fi, and Ethernet, and is used to transmit the collected data to the server in real time for analysis and processing.

6. A method for collecting transaction data of a fuel dispenser using the above device, characterized in that: The method comprises: Obtain tax control data, encoder pulse quantity and fuel gun lifting and hanging status of fuel dispenser in real time through external interface; Cache the above acquired real-time data in the form of queue into the NOR flash memory; The main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is any abnormality in the mainboard; If the tax declaration port is encrypted, the decryption card is called to decrypt the data; The main control microcontroller assembles the data and adds the connector device information data, and then uploads it to the server through the communication module; The fuel dispenser connector periodically determines the connection and availability status of each external port and reports abnormal information to the server.

7. The method according to claim 6, characterized in that: The method further includes: After receiving the data, the server cross-checks the data to comprehensively extract the number of times the gas station sells oil, the time of each sale, the unit price, the amount of oil and the total price information for further data analysis and processing.

8. The method according to claim 6, characterized in that: The main control microcontroller compares the cached tax control data with the data in the EEPROM storage chip to determine whether there is an abnormality in the mainboard. The checksum algorithm is required. The main control microcontroller compares the cached tax control data with the data in the EEPROM item by item. In addition to directly comparing the serial number, version information, and configuration parameters, it also calculates the checksum of the data in the two data sources to further confirm the integrity of the data. The checksum algorithm is a simple accumulation similar to this: Among them, data i Represents each byte of the data, and n represents the total number of bytes of the data. This algorithm adds all the bytes of the data (usually as unsigned bytes, and may require modulo 256 operations to prevent overflow), and then obtains an 8-bit checksum.

9. The method according to claim 7, characterized in that: After receiving the data, the server extracts the number of times the gas station sells oil, the time of each oil sale, the unit price, the oil volume and the total price information by cross-checking various data. The specific algorithm is described as follows: For each transaction record R i , where i is the index of the record, R i Contains the following fields: Timestamp T j 、Oil volume V i Unit Price i ; The number of oil sales (N) can be obtained by simply counting R i To obtain: N = count (R i ); Time of each oil sale (Assuming you need to calculate the average time of each oil sale) You can get it by taking the difference and average of the timestamps (assuming the records are sorted by timestamp): where j∈[1,count(R i )-1]; The statistics of unit price and oil quantity can be obtained by i and V i Summing or averaging gives:

10. The method according to the above claims not only saves labor costs, but also improves the timeliness and reliability of data, which helps to improve the efficiency of tax collection and management, standardize market sales behavior, and ensure the quality of oil products and measurement accuracy.