Software upgrading method and device for card machine linkage oiling machine and storage medium

By automatically obtaining and verifying program file information and data packets, and using image files to achieve breakpoint resuming, it solves the difficulties and high failure rate in the upgrade process of the serial port communication equipment of the tanker, and improves the efficiency and reliability of the upgrade.

CN118550562APending Publication Date: 2024-08-27SHANDONG ENERGY CHAIN HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410503121.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

After the existing oil dispenser without card function was transformed into card-machine linkage, the software program upgrade process of the serial communication equipment was difficult, slow and had a high failure rate, resulting in low upgrade efficiency and poor reliability.

Method used

By detecting that the device is in a state to be upgraded, it automatically obtains program file information and data packages, uses image files to resume breakpoints, verifies the data packages before upgrading, and ensures that the device is restarted to complete the upgrade.

Benefits of technology

It improves the upgrade efficiency and success rate of serial communication equipment, improves the reliability of program upgrades, and reduces manual intervention and travel costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550562A
    Figure CN118550562A
Patent Text Reader

Abstract

The invention discloses a software upgrading method and device for a card machine linkage oiling machine and a storage medium. The method comprises the steps of sending a program upgrading request to target communication equipment which is in serial communication with the communication equipment in response to detection that current equipment is in a to-be-upgraded state, so as to obtain program file information; querying an image file corresponding to the program file information according to the program file information, and if the image file is not queried, creating the image file corresponding to the program file information; determining a to-be-acquired program file data packet according to the mapping file, and sending the data packet acquisition request to the target communication equipment to acquire the program file data packet; and verifying the program file data packet, upgrading the program through the program file data packet after the verification of the program file data packet is passed, and controlling the current equipment to be restarted. According to the method, the program upgrading efficiency, the success rate and the reliability of the serial port communication equipment in the card machine linkage refueling machine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic control of fuel dispensers, and in particular to a software upgrading method, device, storage medium and computer equipment of a fuel dispenser linked to a card machine. Background Art

[0002] The card machine linkage fuel dispenser refers to a fuel dispenser that connects the card machine at the gas station with the fuel dispenser to realize data exchange between the payment terminal and the fuel dispenser. Through the card machine linkage fuel dispenser, customers at the gas station can use the card to pay, and the gas station manager can monitor the working status and payment data of the fuel dispenser in real time.

[0003] At present, many gas pumps in gas stations have not yet realized the card-machine linkage function. In order to achieve the goal of reducing costs and increasing efficiency, gas stations usually transform gas pumps without card insertion function so that the gas pumps in gas stations can realize the card-machine linkage function.

[0004] In the prior art, the card-machine linkage transformation of gas pumps without card insertion function requires replacing or adding multiple serial communication devices. However, serial communication devices often encounter problems such as slow communication speed and communication interruption when communicating, making the program upgrade process very difficult and slow, and the program upgrade failure rate is high. Summary of the invention

[0005] In view of this, the present application provides a software upgrade method, device, storage medium and computer equipment for a card machine linked to a gas station. The main purpose is to solve the technical problems that the software program upgrade process of the serial communication device inside the modified card machine linked to the gas station is difficult, slow and has a high failure rate.

[0006] According to a first aspect of the present invention, a method for software upgrading of a card machine linked to a fuel dispenser is provided, wherein the card machine linked to a fuel dispenser comprises a plurality of communication devices, wherein the plurality of communication devices communicate with each other via a serial port, and the method is applied to any one of the communication devices, and the method comprises:

[0007] In response to detecting that the current device is in a state to be upgraded, sending a program upgrade request to a target communication device in serial communication with the communication device to obtain program file information;

[0008] According to the program file information, query the image file corresponding to the program file information, and if the image file is not found, create the image file corresponding to the program file information;

[0009] Determine the program file data packet to be acquired according to the image file, and send a data packet acquisition request to the target communication device to acquire the program file data packet;

[0010] The program file data package is verified, and after the program file data package passes the verification, the program is upgraded through the program file data package, and the current device is controlled to restart.

[0011] According to a second aspect of the present invention, a software upgrade device for a card machine linkage fuel dispenser is provided, wherein the card machine linkage fuel dispenser includes a plurality of communication devices, wherein the plurality of communication devices communicate with each other through a serial port, and the method is applied to any one of the communication devices, and the device includes:

[0012] A file information acquisition module, for sending a program upgrade request to a target communication device in serial communication with the communication device in response to detecting that the current device is in a state to be upgraded, so as to acquire program file information;

[0013] An image file creation module, used to query the image file corresponding to the program file information according to the program file information, and if the image file is not found, create the image file corresponding to the program file information;

[0014] A data packet acquisition module, used to determine the program file data packet to be acquired according to the image file, and send a data packet acquisition request to the target communication device to acquire the program file data packet;

[0015] The data packet verification module is used to verify the program file data packet, and after the program file data packet is verified, perform a program upgrade through the program file data packet and control the current device to restart.

[0016] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the software upgrade method of the card machine linked fuel dispenser.

[0017] According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the software upgrade method for the card machine linked fuel dispenser when executing the program.

[0018] The present invention provides a software upgrade method, device, storage medium and computer equipment for a card machine linked to a gas station. By automatically acquiring program file information and program file data packets when detecting that the current device is in a state to be upgraded, the automatic upgrade of the serial communication device can be realized, thereby improving the upgrade efficiency of the serial communication device. In addition, the above method queries or creates an image file corresponding to the program file information through the program file information, and determines the program file data packet to be acquired through the image file. The breakpoint resume function of the program file data packet can be realized through the data packet transmission progress recorded in the image file, thereby effectively improving the transmission efficiency and transmission success rate of the program upgrade file. In addition, by verifying the program file data packet, and after the program file data packet is verified, the program is upgraded through the program file data packet, and the current device is controlled to restart, the reliability of the program upgrade file transmission can be effectively improved, which is of great help to the automatic software upgrade of the serial port device.

[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 A schematic diagram of the structure of the interior of a fuel dispenser before modification provided by an embodiment of the present invention is shown;

[0022] Figure 2 A schematic diagram of the structure inside a fuel dispenser linked to a card machine provided by an embodiment of the present invention is shown;

[0023] Figure 3 A schematic flow chart of a method for upgrading software of a card machine linked to a fuel dispenser provided by an embodiment of the present invention is shown;

[0024] Figure 4 The schematic diagram of the overall structure of a fuel dispenser linked to a card machine provided by an embodiment of the present invention is shown;

[0025] Figure 5 A schematic diagram showing the communication relationship between various communication devices inside a card machine linkage fuel dispenser provided by an embodiment of the present invention is shown;

[0026] Figure 6 A schematic structural diagram of a software upgrade device for a card machine linked to a fuel dispenser provided by an embodiment of the present invention is shown;

[0027] Figure 7 A schematic diagram of the structure of a computer device of a multi-serial port cascade communication device for a card machine linked to a fuel dispenser provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0028] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0029] Specifically, before describing the method of this embodiment, a brief introduction to the modification of the fuel dispenser is first given. The schematic diagram of the internal structure of the fuel dispenser before modification is shown in FIG. Figure 1 As shown. Before the transformation, the oil engine mainboard can be connected to the keyboard of the fuel dispenser through the keyboard cable and the keyboard board. Among them, the keyboard of the fuel dispenser can be used to receive the key value input by the user, and the keyboard board can be used to convert the key value input by the user into an electrical signal that can be recognized by the oil engine mainboard, and send the recognized electrical signal to the oil engine mainboard. After receiving the electrical signal corresponding to the key value, the oil engine mainboard can realize the function corresponding to the key value, such as realizing the transaction data query function, the fixed amount and quantity refueling function, etc. In addition, the oil engine mainboard is also connected to the oil gun switch through the oil gun interface, and can be used to identify the state of the oil gun, including the lifting state and the hanging gun state, and perform the refueling operation or stop the refueling operation according to the state of the oil gun.

[0030] The schematic diagram of the internal structure of the modified card machine linkage fuel dispenser is as follows Figure 2 As shown. Among them, the modified card machine linkage fuel dispenser includes a fuel dispenser mainboard, a fuel gun switch, a fuel gun, a keyboard board, a keyboard, a card reader, a keyboard central control board and a data transfer module. Among them, the keyboard central control board is respectively connected to the card reader, the data transfer module, the keyboard, the fuel gun switch and the fuel gun interface of the fuel dispenser mainboard, and is connected to the keyboard interface of the fuel dispenser mainboard through the keyboard board, and the data transfer module is connected to the communication interface of the fuel dispenser mainboard. In this embodiment, the fuel dispenser mainboard, the fuel gun switch, the fuel gun, the keyboard board and the keyboard are the original functional modules of the fuel dispenser, and the card reader, the keyboard central control board and the data transfer module are the newly added functional modules of the modified card machine linkage fuel dispenser.

[0031] After the transformation, the original fuel dispenser main board, fuel gun switch, fuel gun, keyboard board and keyboard are not changed, but the keyboard central control board, card reader and data transfer module are directly added on the basis of the original fuel dispenser, and the connection method of the fuel gun switch, fuel dispenser main board, keyboard board and keyboard is transformed. In this embodiment, the modified keyboard board and keyboard can be separated by the keyboard central control board, and the keyboard key value is forwarded through the keyboard central control board, so as to retain the original function of the fuel dispenser main board, so that the fuel dispenser modification can be applied to various types of fuel dispensers and reduce the difficulty of program debugging. In addition, the modified fuel gun switch includes an input circuit and an output circuit, wherein the input end of the input circuit of the fuel gun switch is connected to the fuel gun switch, and the output end of the input circuit of the fuel gun switch is connected to the keyboard central control board. The circuit can be used to monitor the state of the fuel gun, including the lifting state and the hanging state of the fuel gun, and send the state of the fuel gun to the keyboard central control board. The input end of the output circuit of the oil gun switch is connected to the keyboard central control board, and the output end of the output circuit of the oil gun switch is connected to the oil gun interface of the oil machine main board. This circuit can be used to send the state of the oil gun to the oil machine main board after the card information of the fuel card is verified, so that the oil machine main board can perform the refueling operation. Through the above connection method, not only can a series of card-machine linkage functions such as fuel card identification, fuel card verification, and authorized refueling be realized, but also key value forwarding, fuel gun status monitoring, fuel gun status forwarding and other related functions can be realized, so as to realize all-round control of the refueling process of the fuel dispenser.

[0032] At present, due to the consideration of various factors such as the internal circuit structure of the tanker, the environment in which the tanker is located, and the cost of tanker transformation, the various modules inside the tanker can often only communicate through the serial port. However, multiple modules communicate through the serial port, which will lead to very low communication efficiency. Especially when upgrading and iterating the software of the newly added serial communication module inside the modified card machine linkage tanker, the transmission process of the upgrade program is very time-consuming, and communication interruptions and other problems often occur, which makes the program upgrade process very difficult and slow, and the program upgrade failure rate is high. In addition, when the serial port device has unforeseen BUG problems in the early development, it cannot be automatically upgraded. Even a very small problem requires manual work to go on business trips to deal with it on site, which has high travel costs and time costs. At the same time, if the problem is not responded to in time, it may cause customer complaints and losses. In this scenario, the keyboard center control board and the energy chain box in the modified tanker are the core components of the equipment, and their program upgrade and maintenance are very important. The efficiency and success rate of program upgrades directly determine the application value of the equipment.

[0033] In view of the above problems, in order to improve the technical problems that the software program upgrade process of the communication device is difficult, slow, and has a high failure rate, in one embodiment, Figure 3As shown, a method for software upgrade of a card machine linked to a fuel dispenser is provided. The card machine linked to a fuel dispenser includes multiple communication devices, and the multiple communication devices communicate with each other through a serial port. Taking the method applied to any communication device as an example, the method may include the following steps:

[0034] 101. In response to detecting that the current device is in a waiting-for-upgrade state, a program upgrade request is sent to a target communication device in serial communication with the communication device to obtain program file information.

[0035] The communication device where the execution subject is located refers to the newly added electronic device in the modified card machine linkage fuel dispenser. For example, the communication device can be a serial communication device such as a keyboard central control board and a data transfer module. Furthermore, the target communication device that communicates serially with the communication device refers to an electronic device that is connected to the communication device through a serial port and can provide data to the current device. For example, when the communication device is a keyboard central control board, the target communication device can be a data transfer module; when the communication device is a data transfer module, the target communication device can be a hub.

[0036] Furthermore, a program upgrade request refers to an instruction for obtaining program file information sent in accordance with the communication protocol between the current device and the target communication device. The program upgrade request may be an instruction in a fixed format or an instruction carrying specific information. For example, a program upgrade request may be an instruction carrying the program version number and the device ID number to be upgraded. It is understandable that the specific format and content of the program upgrade request are not specifically limited in this embodiment. Program file information refers to relevant information of a program file data packet for program upgrade of the current device. In this embodiment, the program file information may include a variety of information such as the file identifier of the program file data packet, the number of file bytes, the number of data packets, the number of data packet bytes, and the file key, which are not specifically limited in this embodiment.

[0037] Specifically, when the current communication device (hereinafter referred to as the current device) is detected to be in a state to be upgraded, a program upgrade request can be sent to a target communication device in serial communication with the communication device to obtain program file information. In this embodiment, the communication device can detect whether the current device is in a state to be upgraded in a variety of ways. For example, the communication device can actively request to obtain the latest version number of the current device, and then determine whether the latest version number is consistent with the version number of the current device. If not, the current device is determined to be in a state to be upgraded. Alternatively, the communication device can also passively receive the latest version number of the current device, and when the latest version number is inconsistent with the version number of the current device, the current device is determined to be in a state to be upgraded. In addition, the timing of the detection can be when the current device is powered on and started, or it can be a real-time detection during the operation of the current device. This embodiment does not make specific limitations here.

[0038] 102. According to the program file information, query the image file corresponding to the program file information. If the image file is not found, create the image file corresponding to the program file information.

[0039] The image file includes information related to the transmission progress of the program file data packet. In this embodiment, the image file may include the data packet sequence number of the program file data packet and the file receiving identifier corresponding to each data packet sequence number, wherein the data packet sequence number is consistent with the number of program file data packets in the program file information, and can be used to indicate the location and order of the program file data packet, and the file receiving identifier can be used to indicate whether the file corresponding to the data packet sequence number is received successfully.

[0040] Specifically, for each program file information, a unique image file is created, and the image file can be used to indicate the receiving progress of the program file data package for program upgrade of the current device. If a successfully created image file is found according to the program file information, the image file is obtained, so that the receiving progress of the program file data package can be known, and then the program file data package is resumed; if a successfully created image file is not found according to the program file information, an image file corresponding to the program file information can be created, and then the program file data package is received from the beginning.

[0041] 103. Determine the program file data package to be acquired according to the image file, and send a data package acquisition request to the target communication device to acquire the program file data package.

[0042] Among them, the data packet acquisition request refers to an instruction for acquiring a program file data packet sent in accordance with the communication protocol between the current device and the target communication device. The program upgrade request can be an instruction in a fixed format or an instruction carrying specific information. For example, the data packet acquisition request can be an instruction carrying the sequence number of the program file data packet and the device ID number. It can be understood that the specific format and specific content of the data packet acquisition request are not specifically limited in this embodiment. The program file data packet refers to a program upgrade file that has been processed in blocks according to a preset data volume. Generally speaking, the file size for program upgrades of electronic devices is large and inconvenient to transmit. By dividing the program upgrade file into data packets with a preset data volume, the success rate of file transmission can be effectively improved.

[0043] Specifically, after the current device has queried the image file or created the image file, the transmission progress of the program file data packet can be determined according to the image file, so that the program file data packet to be obtained can be determined according to the transmission progress of the program file data packet, and then a data packet acquisition request can be sent to the target communication device to obtain the above-mentioned program file data packet to be obtained. For example, assuming that the program upgrade file is a 10,000-byte file, and the size of each program file data packet is 100 bytes, then the number of program file data packets is 100, and the sequence number of the program file data packets is 0 to 99. If the program file data packets with sequence numbers 0 to 60 are successfully transmitted through the image file query, then it can be determined that the sequence number of the program file data packet to be obtained is 61 to 99. At this time, a data packet acquisition request for obtaining the program file data packets with sequence numbers 61 to 99 can be sent to the target communication device to obtain the program file data packets with sequence numbers 61 to 99.

[0044] 104. Verify the program file data package, and after the program file data package is verified, upgrade the program through the program file data package, and control the current device to restart.

[0045] Specifically, after the current device receives the program file data packet, each program file data packet can be verified through the file key, and / or all the obtained program file data packets can be integrated and then verified to determine the legitimacy and reliability of the program file data packet. Among them, the file key can be pre-stored in the current device, or it can be obtained through the target communication device. For example, the file key can be carried in the program file information. Furthermore, after all program file data packets have passed the verification, the program file data packets can be integrated into a program upgrade file, and then the current device can be upgraded through the integrated program upgrade file, and the current device can be controlled to restart. After the current device restarts, the program in the current device is the upgraded program.

[0046] The software upgrade method for the card machine linkage gas station provided in this embodiment can realize the automatic upgrade of the serial communication device by automatically acquiring the program file information and the program file data packet when detecting that the current device is in a state to be upgraded, thereby improving the upgrade efficiency of the serial communication device. In addition, the above method queries or creates an image file corresponding to the program file information through the program file information, and determines the program file data packet to be acquired through the image file, and can realize the breakpoint resume function of the program file data packet through the data packet transmission progress recorded in the image file, thereby effectively improving the transmission efficiency and transmission success rate of the program upgrade file. In addition, by verifying the program file data packet, and after the program file data packet is verified, the program is upgraded through the program file data packet, and the current device is controlled to restart, the reliability of the program upgrade file transmission can be effectively improved, which is of great help to the automatic software upgrade of the serial port device.

[0047] In one embodiment, the communication device may be a keyboard central control board and / or a data transfer module of a modified card machine linkage fuel dispenser. In this scenario, the communication device may be a data transfer module, and the target communication device for serial communication with the communication device may be a hub, based on which the data transfer module may obtain program file information and program file data packets of the data transfer module and the keyboard central control board through the hub. In addition, the communication device may also be a keyboard central control board, and the target communication device for serial communication with the communication device may be a data transfer module, based on which the keyboard central control board may obtain program file information and program file data packets of the keyboard central control board through the data transfer module.

[0048] In the above embodiment, if Figure 4 As shown, the communication equipment in the modified card machine linkage fuel dispenser can include a keyboard central control board, a data transfer module, a hub and other equipment. In this embodiment, by setting up a keyboard central control board, a data transfer module, a hub and other communication equipment in the fuel dispenser, a variety of card machine linkage functions such as key value forwarding, data query, data configuration, and data upload can be realized. Figure 5 As shown in the figure, in the modified card machine linkage fuel dispenser, each communication device can use the data transfer module as a bridge to provide data instructions for other communication devices. Among them, each communication device has its own different functions and roles. They may need to request information from the upstream PC or cloud platform, and at the same time, they may need to deliver information or issue control instructions to the downstream fuel dispenser equipment.

[0049] In this embodiment, for the newly added serial communication devices in the modified card machine linkage fuel dispenser, the functions of the card reader and the hub are relatively stable. Among them, the card reader can be used to read the card information and transmit the card information to the keyboard central control panel for processing, and the hub can be used to send the request or data of at least one serial port device to the PC and the cloud platform, and distribute the instructions issued by the cloud platform to each serial port device. Based on this, the program upgrade requirements of the card reader and the hub are usually not high. Relatively speaking, the keyboard central control panel and the data transfer module, as the core modules of the modified card machine linkage fuel dispenser, often need to exchange instructions and data with the original fuel dispenser, so the upgrade requirements will be more frequent.

[0050] In this scenario, this embodiment sets the hub as the target communication device of the data transfer module, and provides the data transfer module with program file information and program file data packets of the data transfer module and the keyboard central control board through the hub, and sets the data transfer module as the target communication device of the keyboard central control board, and provides the keyboard central control board with program file information and program file data packets through the data transfer module. This can achieve multi-level transmission of program file information and program file data packets, thereby enabling program upgrades of the two serial port devices to be achieved through serial communication, thereby improving the overall performance of the card-machine-linked fuel dispenser.

[0051] In one embodiment, the method of detecting whether the current device is in a state to be upgraded in step 101 can be implemented by the following method: in response to the current device being powered on successfully, obtaining the target program version number corresponding to the communication device in the current device or the target communication device, and then determining whether the program version number of the current device is the same as the target program version number; if the program version number of the current device is different from the target program version number, determining that the current device is in a state to be upgraded.

[0052] In the above embodiment, after the power-on startup is successful, the communication device can actively request to obtain the latest version number of the current device, that is, obtain the target program version number corresponding to the communication device, and then determine whether the target program version number is the same as the version number of the current device. If not, the current device is determined to be in a state to be upgraded, or the communication device can also passively receive the target program version number, and when the target program version number is different from the version number of the current device, the current device is determined to be in a state to be upgraded. For example, after the keyboard control board is successfully powered on, the data transfer module can be requested to verify the version number. When the keyboard control board receives the latest version number, the version number will be verified. When the version number is verified to be different, the program file information will be requested, and then the program upgrade will be performed. For another example, when the data transfer module finds that there is a new program version number (for example, the hub notifies that there is an upgrade program), the data transfer module will first download the file from the hub, and then notify the keyboard control board of the latest version number. At this time, the keyboard control board can also determine whether a program upgrade is required.

[0053] The above embodiment can make the current device run under the latest program version after each power-on, thereby improving the timeliness of program upgrade and overall performance of the communication device. In addition, it can also reduce the interference of the program upgrade process on the normal communication function and other functions of the communication device.

[0054] In one embodiment, the program file information may include a variety of information such as file identification, file byte count, data packet number, data packet byte count, and file key. On this basis, the method of creating an image file corresponding to the program file information in step 102 may be implemented by the following method: judging whether the received data is the program file information of the current device according to the file identification, and if so, determining the program file storage space according to the file byte count, and generating a data packet sequence number and a file receiving identification corresponding to each data packet sequence number according to the data packet number, and finally, obtaining the image file corresponding to the program file information according to the data packet sequence number and the file receiving identification corresponding to each data packet sequence number.

[0055] In the above embodiment, through the file identifier, the current device can clearly know whether the received program file information is the program file information of the current device. If it is, the relevant process of program upgrade can be executed. In this embodiment, the image file can apply for file storage space according to the size of the program upgrade file, and can generate a data packet sequence number and a file receiving identifier corresponding to each data packet sequence number. For example, each file receiving identifier can occupy one byte, 0 means that the data packet has not been successfully transmitted, and 1 means that the data packet has been successfully transmitted and stored. In this way, until all blocks are transmitted and the file is verified to be correct, these transmission process auxiliary information are removed, and the real file itself can be stored. In this embodiment, the size of the program file data packet can be set according to the hardware resource situation. The larger the program file data packet, the more data is transmitted each time, but the possibility of error is greater, and the program file data packet needs to be retransmitted, so it is necessary to weigh the appropriate size of the program file data packet. After the size of the program upgrade file is determined, the size of the program file data packet can also be determined, and the number of program file data packets can also be determined. The sequence number of the program file data packet can be numbered from 0 to the last packet. For example, the program file data packet can be transmitted in a size of 256 bytes, 384 bytes, or 512 bytes. For example, if a 600K file is transmitted in a data packet of 512 bytes, the image file needs a file size of 600K, and also needs to store program file information such as file identifier, file byte count, number of data packets, number of data packet bytes and file key. In addition, it is also necessary to store file receiving identifiers corresponding to 1200 data packet numbers to obtain an image file that uniquely corresponds to the program file information.

[0056] The above embodiment determines whether to execute the program upgrade process through the file identifier, which can improve the efficiency of the communication device program upgrade. In addition, the data packet sequence number and the file receiving identifier corresponding to each data packet sequence number are generated through the information in the program file information, and then the image file corresponding to the program file information is generated through the sequence number and the identifier. The transmission status of each program file data packet can be recorded through the image file, so that the breakpoint resume function of the program file can be realized, thereby improving the success rate of the device program upgrade.

[0057] In one embodiment, step 103 can be implemented by the following method: determine the target sequence number of the program file data packet to be acquired based on the data packet sequence number in the image file and the file receiving identifier corresponding to each data packet sequence number, then generate a data packet acquisition request based on the target sequence number, and send the data packet acquisition request to the target communication device to acquire the program file data packet corresponding to the target sequence number, and finally, store the received program file data packet in the program file storage space.

[0058] In the above embodiment, the communication device can request the target communication device to transmit any program file data packet. For example, the communication device can first process data packets with odd numbers such as 1, 3, 5, and then process data packets with even numbers such as 2, 4, 6, etc. Since the target communication device transmits data packets according to the data packet acquisition request sent by the communication device, and the program file information includes information such as the number of file bytes, the number of data packets, and the number of data packet bytes, the communication device performing the program upgrade can fully determine where each program file data packet should be stored in the file, so that each program file data packet can be processed separately, thereby improving the flexibility of program file processing.

[0059] The above-mentioned embodiment determines the target sequence number of the program file data packet to be obtained through the data packet sequence number in the image file and the file receiving identifier corresponding to each data packet sequence number, and sends a data packet acquisition request in a targeted manner to obtain the data packets that have not been successfully transmitted. This can effectively improve the efficiency and success rate of communication device program upgrades, avoid time loss and communication congestion caused by repeated transmission of program upgrade files, and thus improve the overall performance of the communication device.

[0060] In one embodiment, the method for verifying the program file data packet in step 104 can be implemented by the following method: verifying each program file data packet in turn according to the number of data packet bytes and the file key in the program file information to obtain a verification result for each program file data packet; after all program file data are verified, the program file data packets are spliced ​​into a program upgrade file, and the program upgrade file is verified according to the file key; after the program upgrade file is verified, it is determined that the program file data packet has passed the verification.

[0061] The above embodiment can ensure the legitimacy and reliability of each data packet by verifying each program file data packet one by one, thereby preventing data errors in the data packet, thereby improving the reliability of file transmission. In addition, by verifying the spliced ​​program upgrade file as a whole, it can be ensured that all data packets are transmitted correctly, thereby improving the success rate of device program upgrades.

[0062] In one embodiment, the software upgrade method of the card machine linkage fuel dispenser further includes the following steps:

[0063] 201. Determine whether all program file data packets are successfully received and verified.

[0064] Specifically, during the transmission of the program file data packets, the communication device can verify the transmission status of each program file data packet in real time to verify whether each program file data packet is successfully received and whether each program file data packet has passed verification.

[0065] 202. If any program file data packet is not received successfully, re-execute the step of sending a data packet acquisition request to the target communication device to obtain the program file data packet. If all program file data packets are not obtained after executing the preset number of times, exit the upgrade process.

[0066] Specifically, if the communication device cannot receive a data packet, it means that the communication is disconnected. If the communication device still cannot receive data after multiple attempts, it can exit the upgrade process by itself. For example, if the communication device still cannot receive a data packet after more than three attempts, it can exit the upgrade process and execute other data processing processes to avoid blocking other data processing processes. Generally speaking, once the serial port is opened, it will always be valid. If the two serial communication devices are reconnected and can communicate through commands, they can also return to the correct download process; if the communication device is disconnected, because the program has not been upgraded, it can still try to execute the program download process multiple times to continue to complete the transmission of subsequent data packets.

[0067] 203. If there is any program file data package that fails to pass the verification, the program file information and the image file are deleted, and the step of sending the program upgrade request to the target communication device in serial communication with the communication device to obtain the program file information is re-executed.

[0068] Specifically, if any program file data package fails to pass the verification, it indicates that the program file information and the image file itself may be wrong. At this time, continuing to execute the program upgrade process will waste a lot of time and ultimately fail to achieve the program upgrade. Therefore, at this time, the program file information and the image file can be deleted and the program upgrade process can be re-executed to improve the success rate of the program upgrade.

[0069] 204. If all program file data packets are received successfully and verified, the program file information and the image file are deleted, and the program is upgraded through the program file data packets, and the current device is controlled to restart.

[0070] Specifically, if all program file data packets are received successfully and verified, the program file information and image file can be deleted to reduce memory usage. At this time, the communication device can upgrade the program through the program file data packet and control the current device to restart. Since the communication device has verified the correctness of the program upgrade file before restarting, it can restart normally. After restarting normally, the version number in the communication device is already the latest version. At this time, the communication device will still request the target communication device to verify the version number. If they are the same, it means that there is no need to upgrade and the upgrade has been successful. If they are different, it means that the last upgrade was not completed. In this case, the image file should be able to be queried, and the transfer can be resumed at this time.

[0071] The above embodiment verifies the transmission status of each program file data packet in real time during the transmission of the program file data packet, and executes different processing flows when it is verified that the data packet transmission fails or the verification fails, thereby ensuring the reliability and success rate of the program upgrade to the greatest extent.

[0072] In one example, the software upgrade method of the card machine linkage fuel dispenser can be implemented by the following steps:

[0073] Step 1: The communication device first determines the file version number. If the version number is different, it determines that a program upgrade is required and executes the next step, otherwise the process ends.

[0074] Step 2: The communication device requests program file information. After receiving the program file information, it checks whether there is an image file of the program file information. If not, it creates an image file. If it exists, it opens the image file and reads the relevant information to determine the progress of receiving the data packet.

[0075] Step 3: Determine the data packets that need to be transmitted later according to the image file information, apply for the corresponding data packets from the target communication device, and store them in the corresponding position of the file after verification, change the block identifier to 1, and repeat this process until the last block of data is received.

[0076] Step 4: Verify the file MD5 code to ensure that the entire file reception result is correct. If correct, go to Step 5. If incorrect, clear the image file and go to Step 2.

[0077] Step 5: Clean up auxiliary information, save files and end, and finally restart the program to make the new program take effect.

[0078] The above software upgrade method can effectively improve the program upgrade efficiency, success rate and reliability of the serial communication device inside the card machine linkage fuel dispenser.

[0079] It should be noted that the information and data involved in this application (including but not limited to data for analysis, data for storage, data for display, etc.) are all information and data authorized by the user or fully authorized by all parties. In addition, the numbers corresponding to the various steps in the above embodiments only serve as identification and are not used as a limitation on the order in which the steps are executed. The order in which the steps are executed in each embodiment can be set according to actual conditions.

[0080] Further, as Figures 3 to 5 The specific implementation of the method shown in the embodiment provides a software upgrade device for a card machine linked to a fuel dispenser, such as Figure 6As shown, the device includes a file information acquisition module 31, an image file creation module 32, a data packet acquisition module 33, and a data packet verification module 34, wherein:

[0081] The file information acquisition module 31 can be used to send a program upgrade request to a target communication device in serial communication with the communication device in response to detecting that the current device is in a state to be upgraded, so as to obtain program file information;

[0082] An image file creation module 32, which can be used to query the image file corresponding to the program file information according to the program file information, and if the image file is not found, create the image file corresponding to the program file information;

[0083] The data packet acquisition module 33 may be used to determine the program file data packet to be acquired according to the image file, and send a data packet acquisition request to the target communication device to acquire the program file data packet;

[0084] The data packet verification module 34 can be used to verify the program file data packet, and after the program file data packet is verified, perform a program upgrade through the program file data packet and control the current device to restart.

[0085] In a specific application scenario, the file information acquisition module 31 can be specifically used to obtain the target program version number corresponding to the communication device in the current device or the target communication device in response to the current device being powered on successfully; determine whether the program version number of the current device is the same as the target program version number; if the program version number of the current device is different from the target program version number, determine that the current device is in a state to be upgraded.

[0086] In a specific application scenario, the program file information includes a file identifier, a file byte count, a data packet count, a data packet byte count and a file key; the image file creation module 32 can be specifically used to determine whether the received data is the program file information of the current device based on the file identifier; if so, the program file storage space is determined based on the file byte count, and a data packet sequence number and a file receiving identifier corresponding to each data packet sequence number are generated based on the data packet number; and an image file corresponding to the program file information is obtained based on the data packet sequence number and the file receiving identifier corresponding to each data packet sequence number.

[0087] In a specific application scenario, the data packet acquisition module 33 can be specifically used to determine the target serial number of the program file data packet to be acquired based on the data packet serial number in the image file and the file receiving identifier corresponding to each of the data packet serial numbers; generate a data packet acquisition request based on the target serial number, and send the data packet acquisition request to the target communication device to acquire the program file data packet corresponding to the target serial number; and store the received program file data packet in the program file storage space.

[0088] In a specific application scenario, the data packet verification module 34 can be specifically used to verify each of the program file data packets in turn according to the number of data packet bytes and the file key in the program file information to obtain a verification result of each program file data packet; after all the program file data are verified, the program file data packets are spliced ​​into a program upgrade file, and the program upgrade file is verified according to the file key; after the program upgrade file is verified, it is determined that the program file data packet verification has passed.

[0089] In a specific application scenario, the data packet verification module 34 can also be used to determine whether all program file data packets are successfully received and verified; if there is any program file data packet that is not successfully received, the step of sending the data packet acquisition request to the target communication device to obtain the program file data packet is re-executed, and if all the program file data packets are not obtained after executing the preset number of times, the upgrade process is exited; if there is any program file data packet that is not verified, the program file information and the image file are deleted, and the step of sending the program upgrade request to the target communication device that communicates serially with the communication device to obtain the program file information is re-executed; if all program file data packets are successfully received and verified, the program file information and the image file are deleted, and the program is upgraded through the program file data packet, and the current device is controlled to restart.

[0090] In a specific application scenario, the communication device is the keyboard central control board and / or the data transfer module in the card machine-linked gas station; when the communication device is the data transfer module, the target communication device for serial communication with the communication device is the hub, and the data transfer module obtains the program file information and program file data packets of the data transfer module and the keyboard central control board through the hub; when the communication device is the keyboard central control board, the target communication device for serial communication with the communication device is the data transfer module, and the keyboard central control board obtains the program file information and program file data packets of the keyboard central control board through the data transfer module.

[0091] It should be noted that for other corresponding descriptions of the functional units involved in the software upgrade device for a card machine linkage fuel dispenser provided in this embodiment, please refer to Figures 3 to 5 The corresponding description in will not be repeated here.

[0092] Based on the above Figures 3 to 5 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figures 3 to 5 The software upgrade method of the card machine linked fuel dispenser is shown.

[0093] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product. The software product to be identified can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0094] Based on the above Figures 3 to 5 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the software upgrade device embodiment of the card machine linkage fuel dispenser shown in the figure is as follows: Figure 7 As shown, this embodiment also provides a computer device for upgrading the software of the card machine linkage fuel dispenser, which can be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, etc. The computer device includes a storage medium and a processor; the storage medium is used to store computer programs and operating systems; the processor is used to execute computer programs to implement the above-mentioned Figures 3 to 5 The method shown.

[0095] Optionally, the computer device may further include an internal memory, a communication interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, a display, an input device such as a keyboard, etc. Optionally, the communication interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0096] Those skilled in the art will appreciate that the computer device structure for identifying an operation action provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0097] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the above-mentioned computer device hardware and the software resources to be identified, and supports the operation of the information processing program and other software and / or programs to be identified. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing computer device.

[0098] Through the description of the above implementation methods, the technicians in this field can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of the present application, first in response to detecting that the current device is in a state to be upgraded, a program upgrade request is sent to the target communication device that communicates serially with the communication device to obtain the program file information, and then according to the program file information, the image file corresponding to the program file information is queried. If the image file is not found, the image file corresponding to the program file information is created, and then according to the image file, the program file data packet to be obtained is determined, and the data packet acquisition request is sent to the target communication device to obtain the program file data packet, and finally the program file data packet is verified, and after the program file data packet is verified, the program is upgraded through the program file data packet, and the current device is controlled to restart. Compared with the prior art, the above method can effectively improve the program upgrade efficiency, success rate and reliability of the serial communication device inside the card machine linkage fuel dispenser.

[0099] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0100] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A software upgrade method for a card machine linked to a fuel dispenser, characterized in that: The card machine linkage fuel dispenser includes a plurality of communication devices, and the plurality of communication devices communicate with each other through a serial port. The method is applied to any one of the communication devices, and the method includes: In response to detecting that the current device is in a state to be upgraded, sending a program upgrade request to a target communication device in serial communication with the communication device to obtain program file information; According to the program file information, query the image file corresponding to the program file information, and if the image file is not found, create the image file corresponding to the program file information; Determine the program file data packet to be acquired according to the image file, and send a data packet acquisition request to the target communication device to acquire the program file data packet; The program file data package is verified, and after the program file data package passes the verification, the program is upgraded through the program file data package, and the current device is controlled to restart.

2. The method according to claim 1, characterized in that The detecting that the current device is in a state to be upgraded includes: In response to the current device being powered on and started successfully, obtaining a target program version number corresponding to the communication device in the current device or the target communication device; Determine whether the program version number of the current device is the same as the target program version number; If the program version number of the current device is different from the target program version number, it is determined that the current device is in a waiting-for-upgrade state.

3. The method according to claim 1, characterized in that The program file information includes a file identifier, a file byte count, a data packet count, a data packet byte count, and a file key; then the step of creating an image file corresponding to the program file information includes: According to the file identifier, determining whether the received data is program file information of the current device; If yes, then determine the program file storage space according to the number of file bytes, and generate a data packet sequence number and a file receiving identifier corresponding to each data packet sequence number according to the number of data packets; According to the data packet sequence number and the file receiving identifier corresponding to each data packet sequence number, an image file corresponding to the program file information is obtained.

4. The method according to claim 3, characterized in that The step of determining a program file data packet to be acquired according to the image file, and sending a data packet acquisition request to the target communication device to acquire the program file data packet includes: Determine the target serial number of the program file data packet to be acquired according to the data packet serial number in the image file and the file receiving identifier corresponding to each data packet serial number; Generate a data packet acquisition request according to the target sequence number, and send the data packet acquisition request to the target communication device to acquire the program file data packet corresponding to the target sequence number; The received program file data packet is stored in the program file storage space.

5. The method according to claim 3, characterized in that: The verifying of the program file data package includes: According to the number of bytes of the data packet and the file secret key in the program file information, each of the program file data packets is verified in turn to obtain a verification result of each of the program file data packets; After all the program file data are verified, the program file data packets are spliced ​​into a program upgrade file, and the program upgrade file is verified according to the file secret key; After the program upgrade file passes verification, it is determined that the program file data package passes verification.

6. The method according to claim 5, characterized in that The method further comprises: Determine whether all program file data packets are received successfully and verified; If any program file data packet is not received successfully, the step of sending the data packet acquisition request to the target communication device to acquire the program file data packet is executed again, and if all the program file data packets are not acquired after executing the preset number of times, the upgrade process is exited; If there is any program file data package that fails to pass the verification, the program file information and the image file are deleted, and the step of sending the program upgrade request to the target communication device in serial communication with the communication device to obtain the program file information is re-executed; If all the program file data packets are successfully received and verified, the program file information and the image file are deleted, and the program is upgraded through the program file data packets, and the current device is controlled to restart.

7. The method according to any one of claims 1 to 6, characterized in that: The communication device is a keyboard central control panel and / or a data transfer module in the card machine linkage fuel dispenser; the method further includes: When the communication device is the data transfer module, the target communication device that serially communicates with the communication device is the hub, and the data transfer module obtains the program file information and program file data packet of the data transfer module and the keyboard central control board through the hub; When the communication device is the keyboard central control board, the target communication device that communicates serially with the communication device is the data transfer module, and the keyboard central control board obtains the program file information and program file data package of the keyboard central control board through the data transfer module.

8. A software upgrade device for a card machine linked to a fuel dispenser, characterized in that: The device comprises: A file information acquisition module, for sending a program upgrade request to a target communication device in serial communication with the communication device in response to detecting that the current device is in a state to be upgraded, so as to acquire program file information; An image file creation module, used to query the image file corresponding to the program file information according to the program file information, and if the image file is not found, create the image file corresponding to the program file information; A data packet acquisition module, used to determine the program file data packet to be acquired according to the image file, and send a data packet acquisition request to the target communication device to acquire the program file data packet; The data packet verification module is used to verify the program file data packet, and after the program file data packet is verified, perform a program upgrade through the program file data packet and control the current device to restart.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.