Sales terminal host updating method, sub-machine updating method and related device
By receiving and verifying data packets at the sales terminal sub-unit, the security deficiencies in the host update process are resolved, enabling efficient and secure update operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN XINGUODU TECH
- Filing Date
- 2023-06-12
- Publication Date
- 2026-07-24
AI Technical Summary
Existing point-of-sale (POS) terminal hosts lack sufficient security during the update process, cannot identify tampered update data, and embedding security chips increases device costs.
By receiving and performing security checks on data at the sales terminal sub-unit, and using its highly secure security chip to verify the signature of the host data packets before transmitting them to the host, combined with cache management, data integrity and security are ensured.
It improves the security of the sales terminal host update process, avoids the risk of data tampering, and improves update efficiency and reliability while reducing costs.
Smart Images

Figure CN116866005B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to, but are not limited to, the field of communication technology, and in particular to a method for updating a sales terminal host, a method for updating a sub-terminal, and related devices. Background Technology
[0002] With the continuous development of technology and society, customers' demand for intelligent applications in point-of-sale (POS) terminals is also increasing. This necessitates continuous updates and upgrades to the POS terminal software systems to meet these growing needs. Simultaneously, POS terminals need to process large amounts of sensitive information; therefore, ensuring the security of POS terminals during program updates is crucial.
[0003] For point-of-sale (POS) devices equipped with a main unit and sub-units, the update method for the POS main unit is typically achieved through a communication connection between the main unit and a downloader, where data is received and the update operation is executed. However, some POS main units suffer from insufficient security, failing to meet the high security requirements of financial transaction environments. Furthermore, during the update operation, there is a risk that the POS main unit may receive tampered update data after responding to the update request and be unable to identify this vulnerability. Adding an embedded security chip would excessively increase the cost of the POS device. Summary of the Invention
[0004] To improve the security of the sales terminal host during the update process, this application provides a sales terminal host update method, a sub-machine update method, and related apparatus.
[0005] In a first aspect, embodiments of this application provide a method for updating a sales terminal host, applied to a sales terminal sub-unit, including:
[0006] In response to the downloader's update request, execute the host data packet sending step;
[0007] The host data packet sending step includes:
[0008] Receive at least one host data packet sent by the downloader, wherein the at least one host data packet constitutes host update data of the sales terminal host based on its serial number;
[0009] The received host data packets are sequentially stored into a preset buffer, and the remaining space value of the preset buffer is calculated.
[0010] A host transmission identifier is generated based on the sequence number of the host data packet and the remaining space value, and the host data packets in the preset buffer are sequentially sent to the sales terminal host according to the host transmission identifier;
[0011] If the first sending instruction is received, the system continues to receive the host data packets sent by the downloader and executes the host data packet sending step until the sales terminal host receives all the host update data and performs an update operation based on the host update data.
[0012] According to some embodiments of the present invention, the step of sequentially storing the received host data packets into a preset buffer includes:
[0013] The host data packet is verified by host signature, and after the signature is verified, the host data packet is stored in a preset cache area;
[0014] A second sending instruction is generated and sent to the downloader, so that the downloader responds to the second sending instruction and continues to send the host data packet according to the host data packet sequence number.
[0015] According to some embodiments of the present invention, the step of generating a host transmission identifier based on the sequence number of the host data packet and the remaining space value, and sequentially sending the host data packets in the preset buffer to the sales terminal host according to the host transmission identifier, includes:
[0016] If the remaining space value is less than the size of the latest received host data packet, the latest received host data packet is discarded, and a host sending identifier and a stop receiving identifier are generated based on the sequence number of the host data packet.
[0017] The stop receiving flag and the sequence number of the most recently received host data packet are sent to the downloader to instruct the downloader to stop sending the host data packet;
[0018] Based on the host sending identifier and the sequence number of the host data packet, the host data packets in the preset buffer are sent one by one to the sales terminal host.
[0019] According to some embodiments of the present invention, if a first sending instruction is obtained, then continuing to receive the host data packet sent by the downloader and executing the host data packet sending step until the sales terminal host receives all the host update data includes:
[0020] Receive the first sending instruction generated by the sales terminal host, and clear the preset cache area according to the first sending instruction;
[0021] The first sending instruction is sent to the downloader so that the downloader continues to send the host data packet according to the sequence number of the host data packet.
[0022] According to some embodiments of the present invention, the step of performing host signature verification on the host data packet, and storing the host data packet in a preset buffer after successful signature verification, includes:
[0023] Verify the integrity of the host data packet to obtain the integrity verification parameters of the host data packet;
[0024] The sequence number of the host data packet is checked to determine if it is correct, and the sequence number check parameter of the host data packet is obtained.
[0025] Verify whether the signature of the host data packet is correct, and obtain the signature verification parameters of the host data packet;
[0026] The verification result of the host data packet is obtained based on the complete verification parameters of the host data packet, the sequence number verification parameters of the host data packet, and the signature verification parameters of the host data packet.
[0027] If the verification result of the host data packet indicates that the host data packet has passed the signature verification, the host data packet is stored in a preset cache area.
[0028] Secondly, embodiments of this application provide a method for updating a point-of-sale (POS) terminal sub-machine, applied to a POS terminal sub-machine, the method comprising:
[0029] In response to the update request from the downloader, the sub-machine data packet receiving step is executed;
[0030] The slave device data packet receiving steps include:
[0031] Receive at least one sub-machine data packet sent by the downloader, wherein the at least one sub-machine data packet constitutes the sub-machine update data of the sales terminal sub-machine based on its serial number;
[0032] The received data packets from the submachine are sequentially verified by the first submachine signature. Once the signature is verified, the data packets from the submachine are saved.
[0033] A sub-machine sending identifier is generated based on the sequence number of the sub-machine data packet, and the sub-machine sending identifier is sent to the sales terminal host so that the sales terminal host can display the update process in real time according to the sub-machine sending identifier, and send a third sending command based on the update process;
[0034] If a third sending instruction is received, the system continues to receive the data packets sent by the downloader and executes the data packet receiving steps until all the update data of the sub-machine is received, and then performs an update operation based on the update data of the sub-machine.
[0035] According to some embodiments of the present invention, when all the slave machine update data is received and an update operation is performed based on the slave machine update data, the following steps are executed:
[0036] A second submachine signature verification is performed based on the sequence number of the submachine data packet and all the received submachine data packets to obtain the second submachine signature verification result. The submachine update data is obtained based on the second submachine signature verification result and the submachine data packet.
[0037] The update operation is performed based on the update data of the submachine, and the result of the update operation is sent to the downloader.
[0038] According to some embodiments of the present invention, the step of sequentially performing first sub-machine signature verification on the received sub-machine data packets, and saving the sub-machine data packets after successful signature verification, includes:
[0039] The integrity of the data packet of the sub-machine is checked to obtain the integrity check parameters of the first sub-machine data packet;
[0040] The sequence number of the data packet of the submachine is checked to determine if it is correct, and the sequence number check parameter of the first submachine data packet is obtained.
[0041] Verify the signature of the data packet from the submachine to obtain the signature verification parameters of the first submachine data packet;
[0042] The verification result of the first submachine data packet is obtained based on the completeness verification parameters, the sequence number verification parameters, and the signature verification parameters of the first submachine data packet.
[0043] If the verification result of the first submachine data packet indicates that the submachine data packet has passed the signature verification, then the submachine data packet is saved.
[0044] According to some embodiments of the present invention, the step of performing a second submachine signature verification based on the sequence number of the submachine data packet and all received submachine data packets to obtain a second submachine signature verification result includes:
[0045] Check the integrity of each of the sub-machine data packets to obtain the integrity check parameters of the second sub-machine data packets;
[0046] The sequence number of each submachine data packet is checked for correctness based on the sequence number information of the submachine data packet to obtain the sequence number check parameter of the second submachine data packet;
[0047] Verify the signature of each data packet from the submachine to obtain the signature verification parameters for the second submachine data packet;
[0048] The signature verification result of the second submachine is obtained based on the complete verification parameters of the second submachine data packet, the verification parameters of the sequence number of the second submachine data packet, and the signature verification parameters of the second submachine data packet.
[0049] Thirdly, embodiments of this application provide a sales terminal host update device, the device comprising:
[0050] The host response request module is used to respond to update requests from the downloader;
[0051] The host receiving and sending module is used to execute the data packet sending steps;
[0052] The receiving and transmitting module includes:
[0053] The host receiving submodule is used to receive at least one host data packet sent by the downloader, wherein the at least one host data packet constitutes the host update data of the sales terminal host based on its serial number;
[0054] The host storage and calculation submodule is used to sequentially store the received host data packets into a preset buffer and calculate the remaining space value of the preset buffer.
[0055] The host sending submodule is used to generate a host sending identifier based on the sequence number of the host data packet and the remaining space value, and to send the host data packets in the preset buffer to the sales terminal host in sequence according to the host sending identifier;
[0056] The host determination submodule is used to continue receiving the host data packets sent by the downloader and execute the host data packet sending steps if the first sending instruction is obtained, until the sales terminal host receives all the host update data and performs an update operation based on the host update data.
[0057] Fourthly, embodiments of this application provide a sales terminal update system, the system comprising:
[0058] A downloader is used to download data packets, which may be host data packets or slave data packets;
[0059] The point-of-sale terminal is communicatively connected to the downloader and is used to receive the data packets;
[0060] The sales terminal host is communicatively connected to the sales terminal sub-unit;
[0061] When the data packet is the host data packet, the sales terminal host is updated with data by executing a sales terminal host update method as described in the first aspect;
[0062] When the data packet is the data packet of the sub-machine, the data of the sales terminal sub-machine is updated by executing a sales terminal sub-machine update method as described in the second aspect.
[0063] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program being used for:
[0064] Perform the sales terminal host update method described in the first aspect;
[0065] or,
[0066] Perform the sales terminal sub-machine update method described in the second aspect.
[0067] Sixthly, embodiments of this application provide an electronic device, including: a processor; and a memory for storing executable instructions of the processor;
[0068] The processor is configured to execute the executable instructions:
[0069] Perform the sales terminal host update method described in the first aspect;
[0070] or,
[0071] Perform the sales terminal sub-machine update method described in the second aspect.
[0072] This application provides a sales terminal host update method as described in the first aspect and a sales terminal sub-machine update method as described in the second aspect, both of which are applied to sales terminal sub-machines.
[0073] Unlike some point-of-sale (POS) mainframes which suffer from inherent security vulnerabilities, POS sub-units are equipped with highly secure security chips. Furthermore, these security chips incorporate security-related hardware and software algorithms. Therefore, in terms of security, POS sub-units are far more secure than POS mainframes.
[0074] When executing the sales terminal host update method as described in the first aspect, the sales terminal slave unit responds to the update request from the downloader and then executes the host data packet sending step. This enables the communication connection between the sales terminal slave unit and the downloader to receive and verify the host data packet before sending it to the sales terminal host. This effectively avoids situations where data is tampered with but cannot be identified, thereby improving the security of the sales terminal host update process. Furthermore, by establishing a buffer area at the sales terminal slave unit for temporary storage of host data packets, when the buffer is full, about to be full, or has no more subsequent host data packets, the stored host data packets are sent to the sales terminal host, the buffer is cleared, and then subsequent host data packets are received. This avoids the inefficient information forwarding situation where the sales terminal slave unit immediately forwards each received data packet; it also avoids situations where the total storage space of the sales terminal slave unit is too small, resulting in the inability to receive all host data packets, thereby effectively improving the update efficiency of the sales terminal host.
[0075] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing this application. Attached Figure Description
[0076] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0077] Figure 1 This is a schematic diagram of the sales terminal update system structure provided in an embodiment of the present invention;
[0078] Figure 2 This is a flowchart of a sales terminal host update method provided in another embodiment of the present invention;
[0079] Figure 3 yes Figure 2 Flowchart of step S22;
[0080] Figure 4 This is a flowchart of the host signature verification process in a sales terminal host update method provided in another embodiment of the present invention;
[0081] Figure 5 yes Figure 2 Flowchart of step S23;
[0082] Figure 6 yes Figure 2 Flowchart of step S24;
[0083] Figure 7This is a flowchart of a sales terminal host update provided in another embodiment of the present invention;
[0084] Figure 8 This is a flowchart of a sales terminal sub-machine update method provided in another embodiment of the present invention;
[0085] Figure 9 This is a flowchart of the first sub-machine signature verification process of the sales terminal sub-machine update method provided in another embodiment of the present invention;
[0086] Figure 10 This is a display diagram of the sales terminal host during the update of the sales terminal sub-machine according to another embodiment of the present invention;
[0087] Figure 11 yes Figure 8 Flowchart of step S44;
[0088] Figure 12 This is a flowchart of the second sub-machine signature verification process for updating a sales terminal sub-machine according to another embodiment of the present invention;
[0089] Figure 13 This is a flowchart of a sales terminal sub-machine update according to another embodiment of the present invention;
[0090] Figure 14 This is a structural block diagram of a sales terminal host update device provided in another embodiment of the present invention;
[0091] Figure 15 This is a structural block diagram of a sales terminal sub-machine update device provided in another embodiment of the present invention;
[0092] Figure 16 This is a schematic diagram of the hardware structure of an electronic device provided in another embodiment of the present invention. Detailed Implementation
[0093] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0094] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0095] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0096] First, let's clarify some of the terms used in this invention:
[0097] Point-of-Sale (POS) Mainframe: A point-of-sale (POS) mainframe is a computer device used in retail operations, typically installed at the store's checkout counter or counter. It is used to process transactions, manage inventory, and track sales data.
[0098] Point-of-sale (POS) terminal unit: A point-of-sale (POS) terminal unit refers to an auxiliary device connected below the main unit of a point-of-sale (POS) terminal, typically installed on a counter or shelf in a store. It can be used to handle tasks such as sales and inventory management, and is an important component of the main POS terminal unit.
[0099] Security Chips: Security chips are integrated circuit chips with high security performance and protective measures. They are primarily used to store and process sensitive information such as passwords, fingerprints, ID card numbers, and bank account details to protect personal privacy and financial security. Security chips typically employ encryption, physical isolation, and security authentication technologies to encrypt, isolate, and authenticate data, preventing data leaks and hacker attacks.
[0100] Downloader: A downloader is a computer program typically used to download files, applications, music, videos, and other content from the internet. Downloaders can download files via a network connection and then send the downloaded files to the corresponding device for storage.
[0101] For point-of-sale (POS) devices equipped with a main unit and sub-units, current update methods involve the main unit communicating with a downloader to receive data and perform the update operation. However, some POS main units lack sufficient security to meet the high security requirements of financial transaction environments. Furthermore, during the update operation, there is a risk that the POS main unit may receive tampered update data after responding to the update request and fail to recognize this vulnerability. Adding an embedded security chip would excessively increase the cost of the POS device.
[0102] Based on this, embodiments of the present invention provide a method for updating a sales terminal host, a method for updating a sales terminal sub-unit, and related systems, devices, storage media, and electronic devices, targeting sales terminal devices equipped with a sales terminal host and sales terminal sub-units. By utilizing the high security of the security chip equipped in the sales terminal sub-unit, the receiving end, which is directly connected to the downloader, is placed at the sales terminal sub-unit. The sales terminal sub-unit performs security checks on the received data packets. Only after the checks pass are the data packets transmitted to the sales terminal host for updating, or the data packets are stored within itself for updating, thereby improving the security during the update operation.
[0103] This invention provides a method for updating a sales terminal host, a method for updating a sales terminal sub-device, a sales terminal updating system, a sales terminal host updating device, a sales terminal sub-device updating device, a storage medium, and an electronic device. The sales terminal updating system of this invention is described below.
[0104] The embodiments of the present invention are based on, for example Figure 1 An update system for a point-of-sale (POS) terminal, as shown, includes: a downloader 100 for downloading data packets, which may be host data packets or slave data packets; a POS terminal slave unit 200, communicatively connected to the downloader 100 for receiving data packets; and a POS terminal host 300, communicatively connected to the POS terminal slave unit 200. When the data packet is a host data packet, a POS terminal host update method is executed to update the data on the POS terminal host 300; when the data packet is a slave data packet, a POS terminal slave update method is executed to update the data on the POS terminal slave unit 200. That is, as described above, the receiving end, directly connected to the downloader 100, is placed at the POS terminal slave unit 200, and the high security of the security chip carried by the POS terminal slave unit 200 is used to perform security checks on the received data packets. This improves the security of the POS terminal host 300 during the update operation.
[0105] In addition, the sales terminal sub-unit 200 is equipped with a sub-unit storage space 210 for storing the data required by the sales terminal sub-unit 200; the sales terminal host 300 is equipped with a host storage space 310 for storing the data required by the sales terminal host 300.
[0106] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Figures 2 to 7 This invention describes a method for updating a sales terminal host in an embodiment of the present invention.
[0107] Figure 2 This is an optional flowchart of the sales terminal host update method provided in the embodiment of the present invention, which is applied to the sales terminal sub-machine. It can be understood that "applied to the sales terminal sub-machine" means that the update method of the sales terminal host is executed by the sales terminal sub-machine. Figure 2 The method may include, but is not limited to, steps S1 to S2 and steps S21 to S24 corresponding to step S2. It is also understood that this embodiment... Figure 2 The order of steps S1 to S2 and steps S21 to S24 corresponding to step S2 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0108] Step S1: Respond to the update request from the downloader.
[0109] In some embodiments, the update request from the downloader can be sent by the downloader to the sales terminal host based on the updated version on the network, or it can be sent by the downloader in response to an update request from the sales terminal host or the sales terminal sub-machine. This embodiment does not specifically limit the original requesting subject of the update request. Furthermore, this embodiment does not specifically limit the subject of the update determination; that is, the downloader can determine at the downloader that the sales terminal host needs to be updated and send the host data packet; or the sales terminal sub-machine can determine, after receiving the data packet, that it is a host data packet for updating and upgrading the sales terminal host based on information such as the downloaded file name, storage location, and storage size of the data packet.
[0110] In some embodiments, in step S1, the sales terminal slave unit first responds to the update request from the downloader. After determining that the update request is from the sales terminal host, it sends a pre-update instruction to the sales terminal host so that the sales terminal host can prepare for the corresponding program update. Furthermore, after determining that the update request is from the sales terminal host, the sales terminal slave unit allocates a cache area in its own storage space, using this cache area as a preset cache area. This cache area is used to temporarily store the host data packets that will be received soon. This embodiment does not specifically limit the size of the cache area; that is, the size of the cache area can be allocated based on the remaining storage space of the sales terminal slave unit, or it can be allocated randomly, or it can be allocated based on the update data size of the sales terminal host obtained in advance.
[0111] Step S2: Perform the host data packet sending step.
[0112] In one embodiment, reference is made to Figure 2 The host data packet sending steps include:
[0113] Step S21: Receive at least one host data packet sent by the downloader. The at least one host data packet constitutes the host update data of the point-of-sale terminal host based on its serial number.
[0114] In one embodiment, the host update data of the point-of-sale (POS) terminal host consists of at least one host data packet based on its sequence number. When the POS terminal slave receives a host data packet, the host data packet carries parameters such as the total number of host data packets, the sequence number of the host data packet, the complete data of the host data packet, the data size of the host data packet, and the signature of the host data packet. The sequence number of the host data packet can be generated by an algorithm based on a clock counter, which ensures that the sequence number is monotonically increasing; or it can be generated by a hash function to associate the data packet sequence number with other parameters (such as source IP address, destination IP address, port number, etc.). This method ensures the uniqueness and randomness of the sequence number.
[0115] In one embodiment, the point-of-sale terminal (POS terminal) can determine the current progress of receiving host data packets based on the total number of host data packets and the sequence number of the host data packet, and thus determine approximately how much longer it will take to complete the update process of the POS terminal host. This embodiment only limits the size of the host data packets to be less than the size of the temporary buffer space allocated by the POS terminal; no other limitations are imposed. That is, when the number of host data packets exceeds one, the data size of each host data packet can be different and random, or the data size of each host data packet can be the same.
[0116] Step S22: Store the received host data packets into the preset buffer in sequence, and calculate the remaining space value of the preset buffer.
[0117] In one embodiment, reference is made to Figure 3 The received host data packets are sequentially stored into a preset buffer, and the remaining space in the preset buffer is calculated. This also includes:
[0118] Step S221: Perform host signature verification on the host data packet. After successful verification, store the host data packet in the preset buffer.
[0119] In one embodiment, in order to ensure data security during the update process of the point-of-sale (POS) host, it is necessary to perform host signature verification on each newly received host data packet at the POS terminal slave unit.
[0120] Reference Figure 4 The process of verifying signatures on the host computer includes:
[0121] Step S2211: Check whether the host data packet is complete and obtain the host data packet integrity check parameters.
[0122] In one embodiment, after receiving the host data packet, the sales terminal sub-unit performs an integrity judgment on the host data packet based on the complete data information, data size information, and functional information carried by the host data packet, and obtains a host data packet integrity judgment result. Then, the host data packet integrity judgment result is used as a host data packet integrity verification parameter, and the host data packet integrity verification parameter is used as one of the judgment bases when performing a comprehensive inspection of the data packet in the future.
[0123] Step S2212: Verify whether the sequence number of the host data packet is correct, and obtain the host data packet sequence number verification parameter.
[0124] In one embodiment, after receiving a host data packet, the sales terminal sub-unit determines whether the sequence number of the host data packet is correct based on the sequence number information carried in the host data packet, the sequence number information of the previous host data packet, and the total number of all host data packets. If the sequence number information carried in the host data packet is the next consecutive natural value after the sequence number information of the previous host data packet, and is less than or equal to the total number of all host data packets, then the sequence number of the host data packet is determined to be correct; otherwise, it is incorrect. Based on the aforementioned determination process, a host data packet sequence number correctness determination result is obtained. This result is then used as a host data packet sequence number verification parameter, and subsequently, this host data packet integrity verification parameter is used as one of the judgment bases for the subsequent overall verification of the data packet.
[0125] Step S2213: Verify whether the signature of the host data packet is correct, and obtain the host data packet signature verification parameters.
[0126] In one embodiment, after receiving a host data packet, the sales terminal slave unit verifies the signature information carried in the host data packet using its own signature algorithm. Based on the signature algorithm verification, a correctness judgment result for the host serial number signature is obtained. This correctness judgment result is then used as a host data packet signature verification parameter, and subsequently, this host data packet integrity verification parameter is used as one of the criteria for judging the overall integrity of the data packet in subsequent verifications.
[0127] Step S2214: Obtain the host data packet verification result based on the host data packet integrity verification parameter, the host data packet sequence number verification parameter, and the host data packet signature verification parameter.
[0128] In one embodiment, after receiving the host data packet and performing the three verification processes described in steps S2211 to S2213, the sales terminal performs a comprehensive verification of the host data packet based on the obtained host data packet integrity verification parameters, host data packet sequence number verification parameters, and host data packet signature verification parameters, thereby obtaining a host data packet verification result. This host data packet verification result is used to determine whether to save the host data packet or discard it and notify the downloader to resend the host data packet.
[0129] Step S2215: If the host data packet verification result indicates that the host data packet verification is successful, store the host data packet in the preset buffer.
[0130] In one embodiment, after receiving the host data packet and completing the host verification process according to steps S2211 to S2214, the sales terminal sub-unit determines whether the host data packet has passed verification based on the obtained host data packet verification result. If the host data packet verification result indicates that the host data packet has passed verification, the sales terminal sub-unit stores the host data packet in a preset buffer. If the host data packet verification result indicates that the host data packet has failed verification, the sales terminal sub-unit discards the host data packet and sends a retransmission request for the host data packet.
[0131] In one embodiment, if the host data packet verification result fails the standard host data packet signature verification, the point-of-sale terminal will also record which verification parameters are incorrect. If a host data packet signature verification parameter error occurs, the point-of-sale terminal will proactively initiate a stop-update request to avoid the possibility of being attacked by malicious software, thereby improving the security of the point-of-sale terminal.
[0132] Unlike some point-of-sale (POS) main units that have inherent security vulnerabilities, POS sub-units are specifically designed to work with their corresponding main units and are manufactured using security chips. This means that POS sub-units do not require an externally embedded security chip; they inherently possess a built-in security chip. Furthermore, this security chip is equipped with security-related hardware and software algorithms. Therefore, in terms of security, POS sub-units are far more secure than POS main units.
[0133] In one embodiment, by using a high-security security chip carried by the point-of-sale terminal sub-unit to inspect each received host data packet, the situation of data being tampered with but not identified can be effectively avoided, thereby improving the security of the point-of-sale terminal host update process.
[0134] Step S222: Generate a second sending command and send the second sending command to the downloader so that the downloader responds to the second sending command and continues to send host data packets according to the sequence number of the host data packets.
[0135] In one embodiment, after receiving a host data packet and storing it in its cache, the point-of-sale terminal (POS terminal) generates a second sending instruction based on the host data packet's sequence number. This second sending instruction carries information including the number of host data packets already received and the sequence number of the next host data packet to be received. The POS terminal then sends this second sending instruction to a downloader. This allows the downloader to accurately send the next host data packet to the POS terminal based on the received host data packet count and the next host data packet sequence number carried in the second sending instruction.
[0136] In one embodiment, the received host data packets are sequentially stored into a preset cache area, and the remaining space value of the preset cache area is calculated. The method further includes: saving the host data packets in the cache space of the preset cache area, accumulating the data size of each host data packet to obtain the occupied space value and obtain the cache update data; and obtaining the remaining space value based on the occupied space value and the preset space value of the preset cache area.
[0137] In one embodiment, after receiving a host data packet and storing it in a cache, the sales terminal sub-unit accumulates the occupied space value of all stored host data packets in the cache based on the data size of each cached host data packet. A cache update data is then generated based on the occupied space value of all stored host data packets in the cache. This cache update data is used to display changes in the data size within the cache in real time and is updated after each received host data packet.
[0138] In one embodiment, after receiving a host data packet and storing it in a buffer, the sales terminal slave device obtains the remaining space value of the buffer based on the difference between a preset space value of the buffer and the occupied space value of all stored host data packets in the buffer. The sales terminal slave device can then use this remaining space value to determine whether to receive the next host data packet or to send all host data packets already stored in the buffer to the sales terminal host.
[0139] Step S23: Generate a host transmission identifier based on the sequence number and remaining space value of the host data packet, and send the host data packets in the preset buffer to the sales terminal host in sequence according to the host transmission identifier.
[0140] In one embodiment, reference is made to Figure 5 Based on the sequence number and remaining space value of the host data packet, a host transmission identifier is generated, and the host data packets in the preset buffer are sequentially sent to the sales terminal host according to the host transmission identifier, including:
[0141] Step S231: If the remaining space value is less than the size of the latest received host data packet, discard the latest received host data packet and generate a host sending identifier and a stop receiving identifier based on the sequence number of the host data packet.
[0142] Step S232: Send the stop receiving flag and the sequence number of the latest received host data packet to the downloader to instruct the downloader to stop sending host data packets.
[0143] Step S233: Based on the host sending identifier and the sequence number of the host data packet, send the host data packets in the preset buffer to the sales terminal host one by one.
[0144] In one embodiment, when the sales terminal slave receives the latest host data packet, it determines the size based on the remaining space in the buffer: if the remaining space is greater than the size of the latest host data packet, it performs the signature verification operation as described in steps S2211 to S2215 on the latest received host data packet and stores the host data packet in the buffer according to the signature verification result; if the remaining space is less than the size of the latest host data packet, the sales terminal slave discards the latest received host data packet and generates a host transmission flag and a stop receiving flag. The information carried by the host transmission flag includes: the sequence number of each host data packet stored in the buffer and the transmission request, used to remind the sales terminal host to prepare for reception. The sales terminal slave sends the host data packets in the buffer to the sales terminal host one by one in sequence according to the sequence number of each host data packet stored in the buffer. In addition, the sales terminal slave sends the sequence number of the latest received host data packet with the stop receiving flag to the downloader, used to remind the downloader not to send the host data packet for the time being, and to retransmit the host data packet after responding to the transmission request.
[0145] Furthermore, in some embodiments, the sales terminal slave unit establishes a buffer. When the received host data packets are full, about to be full, or there are no more subsequent host data packets, the slave unit sends the stored host data packets to the sales terminal host and clears the buffer before receiving subsequent host data packets. This avoids the inefficient information forwarding situation where the sales terminal slave unit immediately forwards a data packet upon receiving it; it also avoids the situation where the total storage space of the sales terminal slave unit is too small, resulting in the inability to receive all host data packets. Therefore, when the host update data, consisting of multiple host data packets, is too large, it can ensure that all host data packets are received while increasing the rate of forwarding host data packets to the sales terminal host, thereby effectively improving the reliability and efficiency of the sales terminal host update.
[0146] Step S24: If the first sending instruction is received, continue to receive the host data packets sent by the downloader and execute the host data packet sending step until the sales terminal host receives all the host update data and performs the update operation based on the host update data.
[0147] In one embodiment, reference is made to Figure 6 If the first send command is received, the system continues to receive host data packets sent by the downloader and executes the host data packet sending step until the sales terminal host receives all host update data, including:
[0148] Step S241: Receive the first sending instruction generated by the sales terminal host, and clear the preset buffer according to the first sending instruction.
[0149] In one embodiment, after receiving host data packets from the sales terminal slave's buffer, the sales terminal host verifies the received host data packets. If the verification is successful, it generates a first sending command containing confirmation information and a receive request information and sends it to the sales terminal slave. The sales terminal slave clears its buffer based on the confirmation information in the first sending command to facilitate the storage of new host data packets.
[0150] Step S242: Send the first sending instruction to the downloader so that the downloader continues to send host data packets according to the sequence number of the host data packets.
[0151] In one embodiment, after clearing the cache, the sales terminal slave unit forwards the first sending instruction to the downloader. Based on the receive request information in the first sending instruction and the sequence number of the discarded data packets obtained in step S232, the downloader continues to send host data packets to ensure the integrity of the host update data composed of multiple host data packets, thereby improving the reliability of the sales terminal host update process.
[0152] In one embodiment, after the sales terminal slave device sends all the host data packets in the buffer to the sales terminal host, if it does not receive the first send instruction within a certain time threshold, the sales terminal slave device retransmits the host data packets in the buffer. This avoids the loss of host data packets sent by the sales terminal slave device, thereby improving the reliability of the sales terminal host in receiving updated host data.
[0153] In one embodiment, upon receiving the first sending instruction, the system continues to receive host data packets sent by the downloader and executes the host data packet sending step until the sales terminal host receives all host update data and performs an update operation based on the host update data. The system further includes:
[0154] After receiving all host data packets, the sales terminal host performs overall host verification based on the host data packet sequence number information and all received host data packets to obtain the overall host verification result. Based on the overall host verification result and host data packets, the host update data is obtained.
[0155] In one embodiment, overall host signature verification is performed based on the host data packet sequence number information and all received host data packets to obtain an overall host signature verification result, including:
[0156] The system checks the integrity of each host data packet to obtain overall host data packet integrity check parameters; it checks the sequence number of each host data packet to obtain overall host data packet sequence number check parameters; it checks the signature of each host data packet to obtain overall host data packet signature check parameters; and it obtains overall host signature verification result based on overall host data packet integrity check parameters, overall host data packet sequence number check parameters, and overall host data packet signature check parameters.
[0157] In one embodiment, after receiving all host data packets, the sales terminal host performs an integrity judgment on each host data packet based on the complete data information, data size information, and functional information carried by each host data packet, and obtains an overall host data packet integrity judgment result. Then, the overall host data packet integrity judgment result is used as an overall host data packet integrity verification parameter, and then the overall host data packet integrity verification parameter is used as one of the judgment bases when performing an overall verification of the entire host update data.
[0158] The sequence number of each host data packet is checked for correctness based on the host data packet sequence number information to obtain the overall host data packet sequence number check parameters.
[0159] In one embodiment, after receiving all host data packets, the sales terminal host determines the correctness of the sequence number of each host data packet based on the sequence number information carried by each host data packet, the sequence number information of the previous host data packet, and the total number of all host data packets. If the sequence number information carried by each host data packet is the next consecutive natural value of the sequence number information of the previous host data packet, and is less than or equal to the total number of all host data packets, then the sequence number of the host data packet is determined to be correct; otherwise, it is incorrect. Based on the aforementioned determination process, an overall host data packet sequence number correctness determination result is obtained. This overall host data packet sequence number correctness determination result is then used as an overall host data packet sequence number verification parameter, and subsequently, this overall host data packet integrity verification parameter is used as one of the judgment bases when performing an overall verification of the entire host update data.
[0160] In one embodiment, after receiving all host data packets, the sales terminal host verifies the signature information carried in each host data packet using the signature algorithm carried by the sales terminal host. Based on the signature algorithm verification, a correctness judgment result for the overall host serial number signature is obtained. This correctness judgment result is then used as a signature verification parameter for the overall host data packet, and subsequently, this overall host data packet integrity verification parameter is used as one of the judgment bases when performing a comprehensive verification of the entire host update data.
[0161] In one embodiment, after receiving all host data packets and performing the aforementioned verification process, the sales terminal host performs a comprehensive verification of the entire host update data based on the obtained overall host data packet integrity verification parameters, overall host data packet sequence number verification parameters, and overall host data packet signature verification parameters, thereby obtaining an overall host data packet verification result and an overall host signature verification result. This overall host signature verification result is used to determine whether to save the host update data and perform an update operation, or to discard it and notify the downloader to resend the entire host update data.
[0162] In one embodiment, after each host data packet is verified using a new high-security chip carried by the point-of-sale terminal (POS terminal) slave unit, the purpose of the overall host verification process on the POS terminal host is primarily to verify the integrity of the host update data, which consists of multiple host data packets, thereby avoiding missing data packets and improving the reliability of the POS terminal host update process.
[0163] like Figure 7 The diagram shown illustrates the update process of a sales terminal host in one embodiment. The specific steps are described below.
[0164] 1) The downloader sends an upgrade request to the sales terminal slave unit; the sales terminal slave unit forwards the upgrade request to the sales terminal host unit;
[0165] 2) The sales terminal host responds to the upgrade request by sending a confirmation message to the sales terminal slave unit; after receiving the confirmation message from the sales terminal host, the sales terminal slave unit responds to the upgrade request and sends a confirmation message to the downloader;
[0166] 3) The downloader sends the host data packet to the point-of-sale terminal;
[0167] 4) The point-of-sale terminal performs host signature verification on the received host data packets;
[0168] 5) The point-of-sale terminal stores the verified host data packets into a temporarily allocated buffer area;
[0169] 6) If the buffer is full, the sales terminal sends a second sending instruction to the downloader so that the downloader can send the host data packet according to the second sending instruction;
[0170] 7) If the buffer is full, the point-of-sale terminal will send the host data packets in the buffer to the point-of-sale terminal host one by one.
[0171] 8) After receiving the host data packet from the sales terminal slave's buffer, the sales terminal host sends the first send command to the sales terminal slave;
[0172] 9) The point-of-sale terminal (POS terminal) sends a first sending instruction to the downloader based on the first sending instruction received from the POS terminal host, so that the downloader can continue to send host data packets according to the first sending instruction;
[0173] 10) Repeat steps 3) through 9) until the point terminal host has received all the host data packets;
[0174] 11) The sales terminal host performs overall host signature verification on all received host data packets;
[0175] 12) The sales terminal host performs an update operation based on the overall host signature verification result and sends the overall host signature verification result confirmation information to the sales terminal slave unit;
[0176] 13) The sales terminal sub-unit sends the overall host signature verification result confirmation information to the downloader based on the overall host signature verification result confirmation information received from the sales terminal host.
[0177] 14) The sales terminal host displays the update and upgrade results.
[0178] In one embodiment, if the sales terminal loses its host data packet due to some unforeseen reason, the sales terminal will not send a second transmission command to the downloader. When the downloader determines that two consecutive received second transmission commands exceed a first preset time threshold, it will retransmit the host data packet several times. If the downloader receives a second transmission command from the sales terminal during the retransmission process, it will continue to send the next host data packet according to the host data packet sequence number in the second transmission command. In this embodiment, the length of the first preset time threshold is not specifically limited. It can be determined based on experience or experimental results; or it can be predicted using machine learning algorithms based on historical and real-time data to estimate the time required for network operation, and the time threshold can be dynamically adjusted based on the prediction results.
[0179] The sales terminal host update method proposed in this invention utilizes a highly secure security chip carried by the sales terminal sub-unit. The sales terminal sub-unit responds to the update request from the downloader and directly receives host data packets or sub-unit data packets from the downloader. Then, it performs an initial verification on the received data packets. After the initial verification is passed, the host data packets are sent to the sales terminal host for update, or the sub-unit data packets that have passed the initial verification are saved and updated. This effectively avoids the situation where data is tampered with but cannot be identified, thereby improving the security of the sales terminal during updates.
[0180] Furthermore, regarding the update process of the point-of-sale (POS) mainframe, a buffer is established at the POS terminal sub-unit to temporarily store POS data packets. When the buffer is full, nearly full, or has no more subsequent POS data packets, the stored POS data packets are sent to the POS mainframe, the buffer is cleared, and then subsequent POS data packets are received. This avoids the inefficient information forwarding situation where the POS sub-unit immediately forwards a data packet upon receiving it; it also avoids the situation where the total storage space of the POS sub-unit is too small to receive all POS data packets. Therefore, when the POS update data consists of a large number of POS data packets, it can ensure that all POS data packets are received while increasing the rate of forwarding POS data packets to the POS mainframe, thereby effectively improving the reliability and efficiency of POS mainframe updates.
[0181] Next, we will combine the appendix Figures 8 to 13 The present invention further elaborates on the sales terminal sub-machine update method in the embodiments of the present invention.
[0182] Figure 8 This is an optional flowchart of the sales terminal sub-machine update method provided in the embodiments of the present invention, applied to the sales terminal sub-machine. Figure 8 The method may include, but is not limited to, steps S3 to S4 and steps S41 to S44 corresponding to step S4. It is also understood that this embodiment... Figure 8 The order of steps S3 to S4 and steps S41 to S44 corresponding to step S4 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0183] Step S3: Respond to the update request from the downloader.
[0184] In some embodiments, the update request from the downloader can be sent by the downloader to the sales terminal sub-device based on the updated version on the network, or it can be sent by the downloader in response to an update request from the sales terminal host or the sales terminal sub-device. This embodiment does not specifically limit the original requesting subject of the update request. Furthermore, this embodiment does not specifically limit the subject of the update determination; that is, the downloader can determine at the downloader that the sales terminal sub-device needs to be updated and send the host data packet; or the sales terminal sub-device can determine that it is a sub-device data packet for updating and upgrading the sales terminal sub-device based on information such as the downloaded file name, storage location, and storage size after receiving the data packet.
[0185] In some embodiments, in step S3, the sales terminal sub-unit first responds to the update request from the downloader. After determining that the update request is an update request from the sales terminal sub-unit, the sales terminal sub-unit makes corresponding program update preparations and sends a pre-update instruction to the sales terminal host, so that the sales terminal host can prepare to display the update progress of the sales terminal sub-unit.
[0186] Step S4: Perform the submachine data packet receiving step.
[0187] In one embodiment, reference is made to Figure 8 The steps for receiving data packets on the slave device include:
[0188] Step S41: Receive at least one sub-machine data packet sent by the downloader, wherein the at least one sub-machine data packet constitutes the sub-machine update data of the sales terminal sub-machine based on its serial number.
[0189] In one embodiment, the slave update data of the point-of-sale terminal slave unit consists of at least one slave data packet based on its sequence number. When the point-of-sale terminal slave unit receives a slave data packet, the slave data packet carries parameters such as the total number of slave data packets, the sequence number of the slave data packet, the complete data of the slave data packet, the data size of the slave data packet, and the signature of the slave data packet. The sequence number of the host data packet can be generated by an algorithm based on a clock counter, which ensures that the sequence number is monotonically increasing; or it can be generated by a hash function to associate the data packet sequence number with other parameters (such as source IP address, destination IP address, port number, etc.). This method ensures the uniqueness and randomness of the sequence number.
[0190] In one embodiment, the point-of-sale terminal (POS terminal) can determine the current data packet reception progress based on the total number of POS terminal data packets and the sequence number of the POS terminal data packet, and thus determine approximately how much longer it will take to complete the POS terminal's update process. This embodiment only limits the size of the POS terminal data packets to be less than the storage space of the POS terminal; no other limitations are imposed. That is, when the number of POS terminal data packets exceeds one, the data size of each POS terminal data packet can be different and random, or the data size of each POS terminal data packet can be the same.
[0191] Step S42: The received data packets from the sub-machine are sequentially verified by the first sub-machine signature. After the signature is verified, the sub-machine data packets are saved.
[0192] In one embodiment, reference is made to Figure 9 To ensure data security during the update process of the point-of-sale (POS) terminal sub-machines, it is essential to perform initial sub-machine signature verification on each newly received sub-machine data packet at the POS terminal sub-machine. The initial sub-machine signature verification process includes:
[0193] Step S421: Check whether the data packet of the submachine is complete, and obtain the data packet integrity check parameters of the first submachine.
[0194] In one embodiment, after receiving a data packet, the sales terminal sub-unit performs an integrity judgment on the data packet based on the complete data information, data size information, and functional information carried by the data packet, and obtains a first data packet integrity judgment result. Then, the first data packet integrity judgment result is used as a first data packet integrity verification parameter, and the first data packet integrity verification parameter is used as one of the judgment bases for subsequent overall verification of the data packet.
[0195] Step S422: Verify whether the sequence number of the data packet of the submachine is correct, and obtain the sequence number verification parameter of the first submachine data packet.
[0196] In one embodiment, after receiving a data packet, the sales terminal sub-unit determines whether the sequence number of the data packet is correct based on the sequence number information carried in the data packet, the sequence number information of the previous data packet, and the total number of all data packets. If the sequence number information carried in the data packet is the next consecutive natural value of the sequence number information of the previous data packet, and is less than or equal to the total number of all data packets, then the sequence number of the data packet is determined to be correct; otherwise, it is incorrect. Based on the aforementioned determination process, a first sub-unit data packet sequence number correctness determination result is obtained. This first sub-unit data packet sequence number correctness determination result is then used as a first sub-unit data packet sequence number verification parameter, and subsequently, this first sub-unit data packet integrity verification parameter is used as one of the judgment bases for subsequent overall verification of the data packet.
[0197] Step S423: Verify whether the signature of the submachine data packet is correct, and obtain the signature verification parameters of the first submachine data packet.
[0198] In one embodiment, after receiving a data packet, the sales terminal slave unit verifies the signature information carried in the data packet using its signature algorithm. Based on the signature algorithm verification, a correctness judgment result for a first slave unit serial number signature is obtained. This first slave unit serial number signature correctness judgment result is then used as a signature verification parameter for the first slave unit data packet, and subsequently, this first slave unit data packet integrity verification parameter is used as one of the judgment bases for subsequent overall verification of the data packet.
[0199] Step S424: Obtain the first submachine data packet verification result based on the first submachine data packet integrity verification parameter, the first submachine data packet sequence number verification parameter, and the first submachine data packet signature verification parameter.
[0200] In one embodiment, after receiving a data packet and performing the three verification processes described in steps S2211 to S2213, the sales terminal performs a comprehensive verification of the data packet based on the obtained first data packet integrity verification parameters, first data packet sequence number verification parameters, and first data packet signature verification parameters, resulting in a first data packet verification result. This first data packet verification result is used to determine whether to save the data packet or discard it and notify the downloader to resend it.
[0201] Step S425: If the first submachine data packet verification result indicates that the submachine data packet verification is successful, then the submachine data packet is saved.
[0202] In one embodiment, after receiving a data packet and completing the first signature verification process based on steps S421 to S424, the sales terminal sub-unit determines whether the data packet has passed signature verification based on the obtained first data packet verification result. If the first data packet verification result indicates that the data packet has passed signature verification, the sales terminal sub-unit saves the data packet. If the first data packet verification result indicates that the data packet has failed signature verification, the sales terminal sub-unit discards the data packet and sends a retransmission request for the data packet.
[0203] In one embodiment, if the first slave device data packet verification result shows that the standard slave device data packet signature verification fails, the sales terminal slave device will also record which verification parameters are incorrect. If the first slave device data packet signature verification parameters are incorrect, the sales terminal slave device will automatically initiate a stop update request to avoid the possibility of being attacked by malicious software, thereby improving the security of the sales terminal.
[0204] Unlike some point-of-sale (POS) main units that have inherent security vulnerabilities, POS sub-units are specifically designed to work with their corresponding main units and are manufactured using security chips. This means that POS sub-units do not require an externally embedded security chip; they inherently possess a built-in security chip. Furthermore, this security chip is equipped with security-related hardware and software algorithms. Therefore, in terms of security, POS sub-units are far more secure than POS main units.
[0205] In one embodiment, by using a high-security security chip carried by the sales terminal sub-unit to inspect each received data packet, the situation of data being tampered with but not identified can be effectively avoided, thereby improving the security of the sales terminal sub-unit update process.
[0206] Step S43: Generate a sub-machine sending identifier based on the sequence number of the sub-machine data packet, and send the sub-machine sending identifier to the sales terminal host so that the sales terminal host can display the update process in real time according to the sub-machine sending identifier, and send a third sending command based on the update process.
[0207] In one embodiment, after receiving a data packet and passing the verification process in steps S421 to S425, the sales terminal slave device generates a slave device transmission identifier based on the sequence number of the data packet and sends this identifier to the sales terminal host. This allows the sales terminal host to display the update process in real time based on the sequence number in the slave device transmission identifier and the total number of all slave device data packets constituting the slave device update data. After confirming that the update process is correct, the sales terminal host sends a third transmission command carrying confirmation information to the sales terminal slave device. This allows the sales terminal slave device to send a slave device data packet reception request to the downloader based on the confirmation information in the third transmission command.
[0208] In one embodiment, the update process displayed in real time on the point-of-sale terminal host can be as follows: Figure 10 The update process screen shown allows viewers to understand and monitor the real-time update status of the terminal's sub-units from the main unit's perspective. This update process screen includes: the filename of the sub-unit's update data, displaying the current update file information; a download progress percentage bar, displaying the download progress status in real-time from a percentage perspective; and the sequence number of the currently downloaded data packet (current) / the total number of data packets to be downloaded (total), displaying the download progress status in real-time from a numerical perspective.
[0209] Step S44: If a third sending instruction is received, continue to receive the sub-machine data packets sent by the downloader and execute the sub-machine data packet receiving steps until all sub-machine update data is received, and perform update operations based on the sub-machine update data.
[0210] In one embodiment, reference is made to Figure 11 When all the slave machine update data is received, and an update operation is performed based on the slave machine update data, the following steps are executed:
[0211] Step S441: Perform second submachine signature verification based on the submachine data packet sequence number information and all received submachine data packets to obtain the second submachine signature verification result. Obtain submachine update data based on the second submachine signature verification result and submachine data packets.
[0212] In one embodiment, reference is made to Figure 12 The second submachine signature is verified based on the submachine data packet sequence number information and all received submachine data packets to obtain the second submachine signature verification result, including:
[0213] Step S4411: Check whether the data packets of each submachine are complete, and obtain the data packet integrity check parameters of the second submachine.
[0214] In one embodiment, after receiving all the data packets from the sales terminal, the terminal performs an integrity judgment on the data packets based on the complete data information, data size information, and functional information carried by each data packet, and obtains a second data packet integrity judgment result. The second data packet integrity judgment result is then used as a second data packet integrity verification parameter, and the second data packet integrity verification parameter is used as one of the judgment bases when performing an overall verification of the updated data of the entire terminal.
[0215] Step S4412: Verify the sequence number of each submachine data packet based on the submachine data packet sequence number information to obtain the second submachine data packet sequence number verification parameter.
[0216] In one embodiment, after receiving all the data packets from the sales terminal, the terminal determines the correctness of the sequence number of each data packet based on the sequence number information carried by each data packet, the sequence number information of the preceding data packet, and the total number of data packets. If the sequence number information carried by each data packet is the next consecutive natural value of the sequence number information of the preceding data packet, and is less than or equal to the total number of data packets, then the sequence number of the data packet is determined to be correct; otherwise, it is incorrect. Based on the aforementioned determination process, a second data packet sequence number correctness determination result is obtained. This second data packet sequence number correctness determination result is then used as a second data packet sequence number verification parameter, and subsequently, this second data packet integrity verification parameter is used as one of the judgment bases when performing a comprehensive verification of the entire updated data of the terminal.
[0217] Step S4413: Verify the signature of each submachine data packet to obtain the signature verification parameters of the second submachine data packet.
[0218] In one embodiment, after receiving all the data packets from each sub-terminal, the sales terminal sub-terminal verifies the signature information carried in each data packet using the signature algorithm carried by the sales terminal sub-terminal. Based on the signature algorithm verification, a correctness judgment result for a second sub-terminal serial number signature is obtained. This correctness judgment result is then used as a signature verification parameter for the second sub-terminal data packet, and subsequently, this second sub-terminal data packet integrity verification parameter is used as one of the judgment bases when performing a comprehensive verification of the entire sub-terminal update data.
[0219] Step S4414: Obtain the signature verification result of the second submachine based on the second submachine data packet integrity verification parameter, the second submachine data packet sequence number verification parameter, and the second submachine data packet signature verification parameter.
[0220] In one embodiment, after receiving all sub-machine data packets and performing the three verification processes described in steps S4411 to S4413, the sales terminal sub-machine performs a comprehensive verification of the entire sub-machine update data based on the obtained second sub-machine data packet integrity verification parameters, second sub-machine data packet sequence number verification parameters, and second sub-machine data packet signature verification parameters. This results in a second sub-machine data packet verification result, and subsequently, a second sub-machine signature verification result. This second sub-machine signature verification result is used to determine whether to save the sub-machine update data and perform an update operation, or to discard it and notify the downloader to resend the entire sub-machine update data.
[0221] In one embodiment, after each data packet of the sales terminal is verified using a new high-security chip carried by the terminal, the purpose of the second terminal verification process is to verify the integrity of the terminal update data composed of multiple data packets, thereby avoiding missing data packets and improving the reliability of the sales terminal update process.
[0222] Step S442: Perform an update operation based on the slave machine's update data, and send the result of the update operation to the downloader.
[0223] like Figure 13 The diagram shown illustrates the update process of a point-of-sale terminal in one embodiment. The specific steps are described below.
[0224] 1) The downloader sends an upgrade request to the sales terminal slave unit; the sales terminal slave unit responds to the upgrade request and forwards the upgrade request to the sales terminal host unit;
[0225] 2) The sales terminal host sends a confirmation message to the sales terminal slave unit; after receiving the confirmation message from the sales terminal host, the sales terminal slave unit sends a confirmation message to the downloader;
[0226] 3) The downloader sends data packets from the sub-machine to the point-of-sale terminal sub-machine;
[0227] 4) The sales terminal sub-unit performs first sub-unit signature verification on the received sub-unit data packets;
[0228] 5) The point-of-sale terminal (POS) sub-unit stores the verified POS data packet into the storage medium and sends the serial number of the POS data packet to the POS host.
[0229] 6) The sales terminal host confirms the serial number of the received data packet from the sub-machine. After confirming that there is no error, it sends a confirmation message to the sales terminal sub-machine.
[0230] 7) The point-of-sale terminal (POS terminal) sends a third sending instruction to the downloader based on the third sending instruction received from the POS terminal host, so that the downloader can continue to send POS terminal data packets according to the third sending instruction;
[0231] 8) Repeat steps 3) to 7) until the point terminal receives all the data packets from the point terminal;
[0232] 9) The sales terminal sub-unit performs second sub-unit signature verification on all received sub-unit data packets;
[0233] 10) The sales terminal sub-machine performs an update operation based on the signature verification result of the second sub-machine, and sends the signature verification result of the second sub-machine to the sales terminal host machine;
[0234] 11) The sales terminal host returns a confirmation message of the second sub-machine's signature verification result to the sales terminal sub-machine based on the received signature verification result from the second sub-machine;
[0235] 12) The sales terminal sub-machine forwards the signature verification result confirmation information from the second sub-machine to the downloader;
[0236] 13) After the sales terminal sub-unit update is completed, the update and upgrade results will be displayed. At the same time, the sales terminal main unit will display the update and upgrade results of the sales terminal sub-unit.
[0237] In one embodiment, if the sales terminal loses its data packet due to some unforeseen reason, the sales terminal will not send a third transmission command to the downloader. When the downloader determines that two consecutive third transmission commands received exceed a second preset time threshold, it will retransmit the data packet several times. If the downloader receives a third transmission command from the sales terminal during the retransmission process, it will continue to send the next data packet based on the data packet sequence number in the third transmission command. In this embodiment, the length of the second preset time threshold is not specifically limited. It can be determined based on experience or experimental results; or it can be predicted using machine learning algorithms based on historical and real-time data, and the time threshold can be dynamically adjusted based on the prediction results.
[0238] In one embodiment, the download code operations of the point-of-sale terminal are integrated into a single download project. All download and update actions are handled within this project, aiming to decouple the download function from other code. Subsequently, any upgrades or updates performed on the point-of-sale terminal that require code modifications can be made only within this download project. Data compression using the LZMA data compression algorithm is then applied for storage, reducing storage space usage, avoiding code duplication, centralizing functionality, facilitating debugging, and ultimately improving system efficiency.
[0239] In one embodiment, when the storage space of the sales terminal needs to be adjusted, it can be updated directly through the above-mentioned download process without the need to download a separate transition package, thereby providing a convenient program maintenance environment and improving the efficiency of system operation.
[0240] In one embodiment, the sales terminal slave unit loads the received slave unit update data into RAM for execution, thereby improving the update efficiency of the sales terminal slave unit. Furthermore, loading the received slave unit update data into RAM for execution can also achieve the effect of directly updating the program space corresponding to the slave unit update data within the sales terminal's internal storage space.
[0241] The point-of-sale terminal (POS) slave unit update method proposed in this invention utilizes a highly secure security chip carried by the POS slave unit. The POS slave unit responds to the update request from the downloader and directly receives host data packets or slave data packets from the downloader. Then, it performs an initial verification on the received data packets. After the initial verification passes, the host data packets are sent to the POS host for update, or the slave data packets that have passed the initial verification are saved and then updated. This effectively avoids the situation where data is tampered with but cannot be identified, thereby improving the security of the POS terminal during updates.
[0242] Furthermore, regarding the update process of the sales terminal sub-units, after the sub-unit receives and verifies a data packet, it sends the serial number of the data packet to the sales terminal host for confirmation. Once confirmed, the sub-unit receives the next data packet. This allows the sales terminal host to display the update process of the sub-units in real time without needing to receive data packets from the sub-units. This enables staff to monitor the update status of the sub-units in real time at the sales terminal host, thereby improving the reliability of the sub-unit updates.
[0243] This invention also provides a point-of-sale (POS) terminal host update device, which can implement the above-described POS terminal host update method, as described above. Figure 14 The device includes:
[0244] The host response request module 1410 is used to respond to update requests from the downloader.
[0245] The host receiving and sending module 1420 is used to perform the host data packet sending steps.
[0246] The host receiving and transmitting module includes:
[0247] The host receiving submodule 1421 is used to receive at least one host data packet sent by the downloader, wherein the at least one host data packet constitutes host update data of the sales terminal host based on its serial number.
[0248] The host storage calculation submodule 1422 is used to sequentially store the received host data packets into a preset buffer and calculate the remaining space value of the preset buffer.
[0249] The host sending submodule 1423 is used to generate a host sending identifier based on the sequence number and remaining space value of the host data packet, and to send the host data packets in the preset buffer to the sales terminal host in sequence according to the host sending identifier.
[0250] The host judgment submodule 1424 is used to continue receiving host data packets sent by the downloader and execute host data packet sending steps if the first sending instruction is obtained, until the sales terminal host receives all host update data and performs update operations based on the host update data.
[0251] The specific implementation of the sales terminal host update device in this embodiment is basically the same as the specific implementation of the sales terminal host update method described above, and will not be repeated here.
[0252] This invention also provides a point-of-sale terminal (POS) sub-machine update device, which can implement the above-described POS terminal sub-machine update method, as described above. Figure 15 The device includes:
[0253] The slave machine response request module 1510 is used to respond to the update request from the downloader.
[0254] The slave receiver / transmitter module 1520 is used to perform the slave data packet receiving steps.
[0255] The slave receiver / transmitter module includes:
[0256] The sub-machine receiving sub-module 1521 is used to receive at least one sub-machine data packet sent by the downloader, and the at least one sub-machine data packet constitutes the sub-machine update data of the sales terminal sub-machine based on its serial number.
[0257] The sub-machine verification and storage sub-module 1522 is used to sequentially perform first sub-machine signature verification on the received sub-machine data packets, and save the sub-machine data packets after the signature verification is successful.
[0258] The slave device sending submodule 1523 is used to generate a slave device sending identifier based on the sequence number of the slave device data packet, and send the slave device sending identifier to the sales terminal host so that the sales terminal host can display the update process in real time according to the slave device sending identifier, and send a third sending command based on the update process.
[0259] The slave device judgment submodule 1524 is used to continue receiving slave device data packets sent by the downloader and execute slave device data packet receiving steps if a third sending instruction is received, until all slave device update data is received, and to perform update operations based on the slave device update data.
[0260] The specific implementation of the sales terminal sub-machine update device in this embodiment is basically the same as the specific implementation of the sales terminal sub-machine update method described above, and will not be repeated here.
[0261] This application embodiment also provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-described sales terminal host update method and the above-described sales terminal slave update method.
[0262] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0263] This invention also provides an electronic device, comprising:
[0264] At least one memory;
[0265] At least one processor;
[0266] At least one program;
[0267] The program is stored in a memory, and the processor executes the at least one program to implement the text translation method described above. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0268] Please see Figure 16 , Figure 16The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0269] The processor 1601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0270] The memory 1602 can be implemented in the form of ROM (Read-Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory 1602 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1602 and is called and executed by the processor 1601 using the text translation method of the embodiments of this invention.
[0271] The input / output interface 1603 is used to implement information input and output;
[0272] The communication interface 1604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0273] Bus 1605 transmits information between various components of the device (e.g., processor 1601, memory 1602, input / output interface 1603, and communication interface 1604);
[0274] The processor 1601, memory 1602, input / output interface 1603 and communication interface 1604 are connected to each other within the device via bus 1605.
[0275] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0276] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0277] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0278] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0279] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0280] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0281] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0282] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0283] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0284] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0285] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for updating a point-of-sale (POS) terminal host, characterized in that, Applied to a point-of-sale terminal, the method includes: In response to the downloader's update request, execute the host data packet sending step; The host data packet sending step includes: Receive at least one host data packet sent by the downloader, wherein the at least one host data packet constitutes host update data of the sales terminal host based on its serial number; The received host data packets are sequentially stored into a preset buffer, and the remaining space value of the preset buffer is calculated. A host transmission identifier is generated based on the sequence number of the host data packet and the remaining space value, and the host data packets in the preset buffer are sequentially sent to the sales terminal host according to the host transmission identifier; If the first sending instruction is received, the system continues to receive the host data packets sent by the downloader and executes the host data packet sending step until the sales terminal host receives all the host update data and performs an update operation based on the host update data. The step of generating a host transmission identifier based on the sequence number of the host data packet and the remaining space value, and sequentially sending the host data packets in the preset buffer to the sales terminal host according to the host transmission identifier, includes: If the remaining space value is less than the size of the latest received host data packet, the latest received host data packet is discarded, and a host sending identifier and a stop receiving identifier are generated based on the sequence number of the host data packet. The stop receiving flag and the sequence number of the most recently received host data packet are sent to the downloader to instruct the downloader to stop sending the host data packet; Based on the host sending identifier and the sequence number of the host data packet, the host data packets in the preset buffer are sent one by one to the sales terminal host.
2. The method for updating a sales terminal host according to claim 1, characterized in that, The step of sequentially storing the received host data packets into a preset buffer includes: The host data packet is verified by host signature, and after the signature is verified, the host data packet is stored in a preset cache area; A second sending instruction is generated and sent to the downloader, so that the downloader responds to the second sending instruction and continues to send the host data packet according to the sequence number of the host data packet.
3. The method for updating a sales terminal host according to claim 1, characterized in that, If the first sending instruction is received, the system continues to receive the host data packets sent by the downloader and executes the host data packet sending step until the sales terminal host receives all the host update data, including: Receive the first sending instruction generated by the sales terminal host, and clear the preset cache area according to the first sending instruction; The first sending instruction is sent to the downloader so that the downloader continues to send the host data packet according to the sequence number of the host data packet.
4. The method for updating a sales terminal host according to claim 2, characterized in that, The step of performing host signature verification on the host data packet, and storing the host data packet in a preset cache after successful signature verification, includes: Verify the integrity of the host data packet to obtain the integrity verification parameters of the host data packet; The sequence number of the host data packet is checked to determine if it is correct, and the sequence number check parameter of the host data packet is obtained. Verify whether the signature of the host data packet is correct, and obtain the signature verification parameters of the host data packet; The verification result of the host data packet is obtained based on the complete verification parameters of the host data packet, the sequence number verification parameters of the host data packet, and the signature verification parameters of the host data packet. If the verification result of the host data packet indicates that the host data packet has passed the signature verification, the host data packet is stored in a preset cache area.
5. A method for updating a point-of-sale (POS) terminal, characterized in that, Applied to a point-of-sale (POS) terminal host, the method includes: In response to the update request from the downloader, the sub-machine data packet receiving step is executed; The slave device data packet receiving steps include: Receive at least one sub-machine data packet sent by the downloader, wherein the at least one sub-machine data packet constitutes the sub-machine update data of the sales terminal sub-machine based on its serial number; The received data packets from the submachine are sequentially verified by the first submachine signature. Once the signature is verified, the data packets from the submachine are saved. A sub-machine sending identifier is generated based on the sequence number of the sub-machine data packet, and the sub-machine sending identifier is sent to the sales terminal host so that the sales terminal host can display the update process in real time according to the sub-machine sending identifier, and send a third sending command based on the update process; If a third sending instruction is received, the system continues to receive the data packets sent by the downloader and executes the data packet receiving steps until all the update data of the sub-machine is received, and then performs an update operation based on the update data of the sub-machine. When all the slave machine update data is received, and an update operation is performed based on the slave machine update data, the following steps are executed: A second submachine signature verification is performed based on the sequence number of the submachine data packet and all the received submachine data packets to obtain the second submachine signature verification result. The submachine update data is obtained based on the second submachine signature verification result and the submachine data packet. The update operation is performed based on the update data of the submachine, and the result of the update operation is sent to the downloader.
6. The method for updating a point-of-sale terminal (POS) sub-machine according to claim 5, characterized in that, The step of sequentially performing first sub-machine signature verification on the received sub-machine data packets, and saving the sub-machine data packets after successful signature verification, includes: The integrity of the data packet of the sub-machine is checked to obtain the integrity check parameters of the first sub-machine data packet; The sequence number of the data packet of the submachine is checked to determine if it is correct, and the sequence number check parameter of the first submachine data packet is obtained. Verify the signature of the data packet from the submachine to obtain the signature verification parameters of the first submachine data packet; Based on the completeness verification parameters of the first submachine data packet, the sequence number verification parameters of the first submachine data packet, and the signature verification parameters of the first submachine data packet, the verification result of the first submachine data packet is obtained. If the verification result of the first submachine data packet indicates that the submachine data packet has passed the signature verification, then the submachine data packet is saved.
7. A method for updating a point-of-sale terminal (POS) sub-machine according to claim 5, characterized in that, The step of performing a second submachine signature verification based on the sequence number of the submachine data packet and all received submachine data packets to obtain the second submachine signature verification result includes: Check the integrity of each of the sub-machine data packets to obtain the integrity check parameters of the second sub-machine data packets; The sequence number of each submachine data packet is checked for correctness based on the sequence number information of the submachine data packet to obtain the sequence number check parameter of the second submachine data packet; Verify the signature of each data packet from the submachine to obtain the signature verification parameters for the second submachine data packet; The signature verification result of the second submachine is obtained based on the complete verification parameters of the second submachine data packet, the verification parameters of the sequence number of the second submachine data packet, and the signature verification parameters of the second submachine data packet.
8. A point-of-sale (POS) terminal host update device, characterized in that, The device includes: The host response request module is used to respond to update requests from the downloader; The host receiving and sending module is used to execute the host data packet sending steps; The host receiving and transmitting module includes: The host receiving submodule is used to receive at least one host data packet sent by the downloader, wherein the at least one host data packet constitutes the host update data of the sales terminal host based on its serial number; The host storage and calculation submodule is used to sequentially store the received host data packets into a preset buffer and calculate the remaining space value of the preset buffer. The host sending submodule is used to generate a host sending identifier based on the sequence number of the host data packet and the remaining space value, and to send the host data packets in the preset buffer to the sales terminal host in sequence according to the host sending identifier; The host determination submodule is used to continue receiving the host data packet sent by the downloader and execute the host data packet sending step if the first sending instruction is obtained, until the sales terminal host receives all the host update data and performs the update operation according to the host update data; The step of generating a host transmission identifier based on the sequence number of the host data packet and the remaining space value, and sequentially sending the host data packets in the preset buffer to the sales terminal host according to the host transmission identifier, includes: If the remaining space value is less than the size of the latest received host data packet, the latest received host data packet is discarded, and a host sending identifier and a stop receiving identifier are generated based on the sequence number of the host data packet. The stop receiving flag and the sequence number of the most recently received host data packet are sent to the downloader to instruct the downloader to stop sending the host data packet; Based on the host sending identifier and the sequence number of the host data packet, the host data packets in the preset buffer are sent one by one to the sales terminal host.
9. A sales terminal update system, characterized in that, The system includes: A downloader is used to download data packets, which may be host data packets or slave data packets; The point-of-sale terminal is communicatively connected to the downloader and is used to receive the data packets; The sales terminal host is communicatively connected to the sales terminal sub-unit; When the data packet is the host data packet, the sales terminal host is updated using the sales terminal host method as described in any one of claims 1-4; when the data packet is the sub-machine data packet, the sales terminal sub-machine is updated using the sales terminal sub-machine method as described in any one of claims 5-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a sales terminal host update method according to any one of claims 1-4, or a sales terminal sub-machine update method according to any one of claims 5-7.
11. An electronic device, characterized in that, include: processor; and memory for storing the executable instructions of the processor; The processor is configured to execute the sales terminal host update method according to any one of claims 1-4, or the sales terminal slave update method according to any one of claims 5-7, by executing the executable instructions.