CN109933997B - Vending machine data interaction method, device, equipment and storage medium - Google Patents

Vending machine data interaction method, device, equipment and storage medium Download PDF

Info

Publication number
CN109933997B
CN109933997B CN201910121717.4A CN201910121717A CN109933997B CN 109933997 B CN109933997 B CN 109933997B CN 201910121717 A CN201910121717 A CN 201910121717A CN 109933997 B CN109933997 B CN 109933997B
Authority
CN
China
Prior art keywords
instruction
command
vending machine
content information
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910121717.4A
Other languages
Chinese (zh)
Other versions
CN109933997A (en
Inventor
韩儒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Yunshu Information Technology Co ltd
Original Assignee
Hunan Yunshu Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Yunshu Information Technology Co ltd filed Critical Hunan Yunshu Information Technology Co ltd
Priority to CN201910121717.4A priority Critical patent/CN109933997B/en
Publication of CN109933997A publication Critical patent/CN109933997A/en
Application granted granted Critical
Publication of CN109933997B publication Critical patent/CN109933997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a vending machine data interaction method, a vending machine data interaction device, vending machine data interaction equipment and a storage medium, wherein the vending machine data interaction device comprises a server, a server and a server, wherein the server sends a command instruction, and the command instruction comprises a first interface number, first command content information and first signature information for verifying the command instruction; and receiving a response instruction corresponding to the command instruction from the server, wherein the response instruction comprises a second interface number, second command content information and second signature information for verifying the response instruction, the second interface number is the same as the first interface number, and the second command content information corresponds to the first command content information. A sending and responding mechanism is formed by the command instruction and the responding instruction, and the command content information in the command instruction and the responding instruction is reconstructed to generate a safe signature, so that the accuracy, the stability and the safety of transmission are improved, and the consumption experience and the property safety of consumers are improved.

Description

Vending machine data interaction method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a vending machine data interaction method, a vending machine data interaction device, vending machine data interaction equipment and a storage medium.
Background
The vending machine is an automatic device which can automatically spit out corresponding goods after a consumer pays, works for 24 hours, is not limited by business hours and business places, can be used for paying by putting paper money or scanning code and paying on the internet, and can meet the demand of the consumer on purchasing snacks, beverages, wines, cigarettes, lottery tickets and other articles at any time.
The conventional vending machine uses a cash-in payment mode, but the pure paper money payment mode faces some inconvenient processes such as identifying the authenticity of paper money and handling the change, and the internet payment mode becomes the market mainstream along with the rapid development of the internet, so the vending machine using the cash payment type is eliminated by the market. The current automatic vending machine supports an internet payment mode, a consumer can pay fees by using a mobile phone or other equipment with an internet payment function, and therefore can obtain articles to be bought, the convenience degree of buying the articles by the consumer is increased, the premise that the consumer buys the articles on the vending machine through the internet is that the vending machine and a server can perform stable data interaction, a large amount of message data can be transmitted between the vending machine and the server every day for interaction, the current communication network is very complex, the stability and the safety of message data transmission between the vending machine and the server are improved, the consumption feeling and the property safety of the consumer are ensured, and the novel problem is solved.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a vending machine data interaction method, a vending machine data interaction device, vending machine data interaction equipment and a storage medium. A sending and responding mechanism is formed by the command instruction and the responding instruction, the transmission stability is improved, the communication data is protected by generating a signature for the command content information in the command instruction and the responding instruction, and the accuracy, the stability and the safety of the communication data transmission are ensured.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, the present invention provides a vending machine data interaction method, including the following steps:
receiving a command instruction sent by a server, wherein the command instruction comprises a first interface number, first command content information and first signature information used for verifying the command instruction;
and sending a response instruction corresponding to the command instruction to the server, wherein the response instruction comprises a second interface number, second command content information and second signature information used for verifying the response instruction, the second interface number is the same as the first interface number, and the second command content information corresponds to the first command content information.
Further, the first signature information is generated based on first command content information, and the second signature information is generated based on second command content information.
Further, the first command content information includes a first machine number, a first timestamp, and a first information parameter; the second command content information comprises a second machine number, a second timestamp and a second information parameter; the second machine number is the same as the first machine number and the second timestamp is the same as the first timestamp.
Further, the first signature information is generated after being encrypted based on a first BCD code group converted by the first command content information; and the second signature information is generated after the second BCD code group converted based on the second command content information is encrypted. The first BCD code group and the second BCD code group are 16 bytes each. After the first BCD code group is encrypted, taking the first 4 bytes as the first signature information; and after the second BCD code group is encrypted, taking the first 4 bytes as the second signature information. The first signature information and the second signature information are generated by encryption by using an AES algorithm. The first signature information and the second signature information are verified by using an AES algorithm.
Further, the first BCD code group is generated by converting the first machine number, the first timestamp and the first command content information into BCD codes respectively; and the second BCD code group is generated by converting the second machine number, the second time stamp and the second command content information into BCD codes respectively. The first BCD code group is formed by converting the first machine number into a BCD code with 5 bytes, adding the BCD code with 5 bytes converted by the first timestamp, adding the checksum of the first command content information into a BCD code with 5 bytes and adding a fixed BCD code with 1 byte; the second BCD code group is formed by converting the second machine number into a BCD code with 5 bytes, adding the BCD code with 5 bytes converted from the second timestamp, adding the checksum of the second command content information into a BCD code with 5 bytes and adding a fixed BCD code with 1 byte.
Further, the method also comprises the following steps:
the vending machine receives a goods delivery command instruction which is sent by the server and used for controlling the goods delivery of the vending machine, wherein the command instruction comprises the goods delivery command instruction;
and the vending machine sends a shipment response instruction corresponding to the shipment command instruction to the server, wherein the response instruction comprises the shipment response instruction.
Further, before the step that the vending machine receives a goods outlet command instruction sent by the server and used for controlling goods outlet of the vending machine, the method further comprises the following steps:
the method comprises the steps that the vending machine receives an online detection command instruction which is sent by a server and used for detecting whether the vending machine is online or not, wherein the command instruction comprises an online detection command instruction;
the vending machine sends an online detection response instruction corresponding to the online detection command instruction to the server, and when the server receives the online detection response instruction, the vending machine is judged to be online; and when the server does not receive the online detection response instruction, judging that the vending machine is offline, and executing automatic refund operation, wherein the response instruction comprises an online detection response instruction.
Further, after the step that the vending machine sends the shipment response instruction corresponding to the shipment command instruction to the server, the method further comprises the following steps:
the vending machine executes the goods delivery operation and circularly sends a goods delivery result command instruction for reporting the goods delivery condition to the server;
the server receives the shipment result command instruction, judges a shipment result and sends a shipment result response instruction corresponding to the shipment result command instruction to the vending machine; or the server does not receive the shipment result command instruction and judges that the vending machine is off-line.
In a second aspect, the present invention provides a data interaction device for a vending machine, which is characterized in that: the system comprises an instruction receiving circuit module, an instruction sending circuit module and an instruction processing module, wherein the instruction processing module is respectively electrically connected with the instruction receiving circuit module and the instruction sending circuit module, and the instruction receiving circuit module is used for receiving a command instruction sent by a server; and the instruction sending circuit module is used for sending a response instruction corresponding to the command instruction to the server.
In a third aspect, the present invention provides a vending machine application system, which includes an instruction receiving circuit module, an instruction sending circuit module, an instruction processing module, and a server. In this embodiment, the server may perform data interaction with the vending machine, and the server may send a response instruction to the instruction receiving circuit module, or may receive a response instruction sent by the instruction sending circuit module.
In a fourth aspect, the present invention provides a vending machine data interaction device comprising at least one control processor and a memory for communicative connection with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform the vending system data interaction method as described above.
In a fifth aspect, the present invention provides a vending machine data interaction readable storage medium, which stores computer-executable instructions for causing a computer to perform the vending machine data interaction method as described above.
One or more technical schemes provided in the embodiment of the invention have at least the following beneficial effects:
the invention adopts a vending machine data interaction method, which comprises the following steps: sending a command instruction to a server, wherein the command instruction comprises a first interface number, first command content information and first signature information for verifying the command instruction; and receiving a response instruction corresponding to the command instruction from the server, wherein the response instruction comprises a second interface number, second command content information and second signature information for verifying the response instruction, the second interface number is the same as the first interface number, and the second command content information corresponds to the first command content information. The sending and responding mechanism is formed by the command instruction and the responding instruction, the transmission stability is improved, the communication data is protected by reconstructing the command content information in the command instruction and the responding instruction and generating a signature, the accuracy, the stability and the safety of the communication data transmission are ensured, and the consumption experience and the property safety of consumers are improved.
Drawings
The invention is further illustrated with reference to the following figures and examples.
FIG. 1 is a flow chart of a vending machine data interaction method provided by an embodiment of the invention;
FIG. 2 is a diagram illustrating the overall steps of a vending machine data interaction method, according to one embodiment of the present invention;
fig. 3 is a schematic structural diagram of a vending machine data interaction device according to an embodiment of the present invention.
Detailed Description
The vending machine is an automatic device which can automatically spit out corresponding goods after a consumer pays, works for 24 hours, is not limited by business hours and business places, can be used for paying by the consumer through paper money or by scanning codes and paying on a network, and can meet the demand of the consumer on buying goods such as snacks, beverages, wines, cigarettes, lottery tickets and the like at any time.
The conventional automatic vending machine uses a cash-in payment mode, the pure paper money payment mode faces some inconvenient processes of identifying the authenticity of paper money, processing the change and the like, and the internet payment mode becomes the market mainstream along with the rapid development of the internet, so the automatic vending machine using the cash payment type is eliminated by the market. The current automatic vending supports an internet payment mode, a consumer can pay fees by using a mobile phone or other equipment with an internet payment function, and therefore the consumer can obtain articles to be bought, the convenience degree of buying the articles by the consumer is increased, the consumer purchases the articles on the automatic vending machine through the internet on the premise that the automatic vending machine and a server can perform stable data interaction, although the current communication network is developed rapidly, the communication network is extremely complex, a large amount of communication data can be transmitted between the automatic vending machine and the server every day, a reasonable sending and answering mechanism is lacked when the communication data is transmitted between the automatic vending machine and the server, the signature protection of the communication data is unreasonable, when the network fluctuates, the condition of communication data transmission errors can occur, and therefore wrong operation is executed, and the consumption experience and property safety of the consumer are influenced.
The invention adopts a vending machine data interaction method, which comprises the following steps: sending a command instruction to a server, wherein the command instruction comprises a first interface number, first command content information and first signature information for verifying the command instruction; receiving a response instruction corresponding to the command instruction from the server, wherein the response instruction comprises a second interface number, second command content information and second signature information used for verifying the response instruction, the second interface number is the same as the first interface number, and the second command content information corresponds to the first command content information. The sending and responding mechanism is formed by the command instruction and the responding instruction, the transmission stability is improved, the communication data is protected by reconstructing the command content information in the command instruction and the responding instruction and generating a signature, the accuracy, the stability and the safety of the communication data transmission are ensured, and the consumption experience and the property safety of consumers are improved.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is 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 of the invention and are not intended to limit the invention.
It should be noted that, if not conflicting, various features of the embodiments of the present invention may be combined with each other within the scope of the present invention. Additionally, while a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different division than the blocks in the apparatus, or in an order within the flowcharts.
Referring to fig. 1, an embodiment of the present invention provides a vending machine data interaction method, including the following steps:
step S1, receiving a command instruction sent by a server, wherein the command instruction comprises a first interface number, first command content information and first signature information used for verifying the command instruction.
And S2, sending a response instruction corresponding to the command instruction to the server, wherein the response instruction comprises a second interface number, second command content information and second signature information used for verifying the response instruction, the second interface number is the same as the first interface number, and the second command content information corresponds to the first command content information.
In this embodiment, the command instruction further includes a command header disposed at a front end of the command instruction and a command trailer disposed at a rear end of the command instruction, and the command header and the command trailer are used to provide format constraints for the command instruction. The response instruction, like the command instruction, also includes a command header and a command trailer. The first interface number represents the type of the instruction, and the second interface number is the same as the first interface number, for example, when the first interface number is "3000", the instruction type is represented as "remote shipment", and the second interface number is also "3000", which facilitates the response instruction matching the command instruction. The signature is used for ensuring the integrity of communication data transmission, identity authentication of a sender and preventing repudiation in transaction, the first signature information is used for verifying the command instruction, and the second signature information has similar action with the first signature information and is used for verifying the response instruction. The data of the command and the response command are transmitted in the UTF8 format, and compared with the traditional ASCLL format, the UTF8 format can be used for widening the use range and the service range of the vending machine. In step S2 of this embodiment, the second command content information corresponds to the first command content information because the same machine number and time stamp are included in the second command content information as in the first command content information.
Further, in another embodiment of the present invention, the first command content information includes a first machine number, a first time stamp, and a first information parameter; the second command content information comprises a second machine number, a second timestamp and a second information parameter; the second machine number is the same as the first machine number, and the second timestamp is the same as the first timestamp. According to the type of the command instruction, the first command content information must include two parameters, namely a first machine number, a first time stamp and the like, and a first information parameter can be zero; according to the type of the response instruction, the second command content information must include two parameters, i.e., a second machine number, a second time stamp, and the like, and the second information parameter may be zero.
In this embodiment, the machine number is represented as a network number of the vending machine, and the network number of the vending machine is used to facilitate the server to distinguish each vending machine, so as to avoid mistakes caused by mistaking the vending machine. The time stamp is expressed as the system time of the transmission of the command instruction, and the second time stamp in the second command content information is the same as the first time stamp of the first command content information in order to ensure that the response instruction is consistent with the command instruction at the system time of the transmission, thereby facilitating the matching of the command instruction and the response instruction. In this embodiment, when the command instruction and the response instruction do not need to provide necessary information parameters, the first information parameter and the second information parameter may be zero, and the command instruction and the response instruction only need to include two parameters, namely a machine number and a timestamp. For example, when the server needs to detect whether the vending machine is online, the first command content information of the online detection command instruction is { "Mid": "1808130043", "TimeSp": "1534173031" only contains the machine number and the timestamp, and the second command content information of the on-line detection response instruction is { "Mid": "1808130043", "TimeSp": "1534173031" contains only the machine number and the time stamp.
Further, in another embodiment of the present invention, the first signature information is generated based on the first command content information, and the second signature information is generated based on the second command content information.
Further, in another embodiment of the present invention, the first signature information is generated after encrypting the first BCD code group based on the first command content information conversion; and the second signature information is generated after the second BCD code group converted based on the second command content information is encrypted. The first signature information and the second signature information are generated by encryption by using an AES algorithm. The first signature information and the second signature information are both verified using an AES algorithm.
The signature is used for ensuring the integrity of communication data transmission, authenticating the identity of a sender and preventing repudiation in the transaction.
In this embodiment, after the first signature information is converted from a character string in the first command content information, the first signature information is generated by encrypting with a private key; the second signature information is generated by encrypting with a private key after being converted by the character string in the second command content information. Information parameters in the first command content information and the second command content information need to be analyzed into corresponding formats before calculation, for example, when the information parameters have a Price ": "2.50", need to resolve "2.50" into "2.50" of the floating point type first and then calculate, as the information parameter has public key "PubKey": "E9AA8BF8" is calculated by resolving "E9AA8BF8" into "0xE90xA0 x8B 0xF8". The first signature information and the second signature information can be decrypted by using a public key and then verified. In this embodiment, the first BCD code group and the second BCD code group are preferably character strings of 16 bytes, respectively, and it is very convenient to use BCD codes, which can reduce the computational workload of the computer, and preferably 16 bytes, which can reduce the computational workload of the computer and improve the efficiency. After the first BCD code group is encrypted, taking the first 4 bytes of an encryption result as the first signature information; after the second BCD code group is encrypted, the first 4 bytes of the encrypted result are taken as the second signature information, so that the encryption reliability is ensured, the workload of computer encryption and decryption is reduced, and the efficiency is greatly improved. The first signature information and the second signature information are encrypted, generated and verified by using an AES algorithm, the AES algorithm can be an AES128 algorithm, an AES192 algorithm and an AES256 algorithm, and the AES256 is preferably used in the embodiment because the AES256 key has the longest length, the encryption effect is good, the cracking difficulty is extremely high, and the data security can be well protected. The key is divided into a private key and a public key, the public key is used for encryption only when the command instruction is for applying for the private key, and the general private key is used for encryption when the command instruction is not for applying for the private key.
Further, in another embodiment of the present invention, the first BCD code group is generated by converting BCD codes respectively by the first machine number, the first timestamp and the first command content information; and the second BCD code group is generated by converting the second machine number, the second time stamp and the second command content information into BCD codes respectively.
In this embodiment, the first BCD code group is formed by converting the first machine number into a BCD code of 5 bytes, adding the first timestamp into the BCD code of 5 bytes, adding the checksum of the first command content information into a BCD code of 5 bytes, and adding a fixed BCD code of 1 byte; the second BCD code group is formed by converting a second machine number into a BCD code with 5 bytes, adding a second timestamp into a BCD code with 5 bytes, adding a checksum of second command content information into a BCD code with 5 bytes and adding a fixed BCD code with 1 byte, and thus, the safety of the signature can be ensured. For example, when the machine number is: "1802020002", timestamp is: "1511936017", the checksum is: "0000044751", the contents to be encrypted are "0x18,0x02, 0x00,0x02,0x15,0x11,0x93,0x60,0x17,0x00, 0x04,0x47,0x51, and 0x00".
Referring to fig. 2, in another embodiment of the present invention, the following steps are further included:
in step S300, the vending machine receives a shipment command instruction sent by the server for controlling the vending machine to shipment.
And step S400, the vending machine sends a shipment response instruction corresponding to the shipment command instruction to the server.
In step S300 of this embodiment, the server receives information that the user paid before sending a shipping command instruction, where the shipping command instruction is used to control the vending machine to perform a shipping operation, the instruction includes parameter information such as a timestamp, a machine number, product information, a payment method, a payment amount, and an order number, the machine number represents a unique identification number of the vending machine in a communication system, the timestamp represents system time transmitted by the instruction, the product information represents detailed information of a product purchased by a consumer on a client, the payment method represents a payment method selected by the consumer on the client, the payment method may be a payroll, a WeChat, and software with a payment function, and when the consumer purchases and pays, an order number is generated. The server sends a delivery command instruction to the vending machine in a wireless transmission mode such as 3G, 4G or Wifi, and the sent instruction is received by an instruction receiving circuit module of the vending machine. The structure of the shipment command instruction is # # #3000$ { "Slot": "2", "SKU": "4710088422064", "Price": "0.01", "PayType": "A", "OrderNo": "180813151030197", "Mid": "1808130043", "TimeSp": "1534173031" } $1CB780B6& & & & &, interface number data can be customized according to actual needs, in this embodiment, it is preferable to set the interface number "3000" to indicate that the instruction type is "shipment", command content information in the shipment command instruction includes parameter information such as a machine number, a time stamp, commodity information, a payment method, a payment amount, and an order number, and a signature "1CB780B6" is obtained by checking the machine number, the time stamp, and the command content information and converting BCD codes respectively, and taking the first 4 bytes after encryption.
In step S400 of this embodiment, after the vending machine receives the shipment command instruction, the instruction sending circuit module selects to send a shipment response instruction to the server through a wireless transmission mode such as 3G, 4G, or Wifi, so as to prompt the server that the sent instruction has been received by the vending machine, and the command content information of the shipment response instruction only includes two parameter information, namely a machine number and a timestamp.
Referring to fig. 2, in another embodiment of the present invention, the following steps are further included:
and S100, if the payment is successful, the vending machine receives an online detection command instruction which is sent by the server and used for detecting whether the vending machine is online.
Step S200, the vending machine sends an online detection response instruction corresponding to the online detection command instruction to the server, and when the server receives the online detection response instruction, the vending machine is judged to be online; and when the server does not receive the online detection response instruction, judging that the vending machine is offline, and executing automatic refund operation.
In step S100 of this embodiment, the consumer successfully pays through the client, and the client may be a mobile phone App or a computer website. The vending machine needs to be determined to be online before the vending machine performs a shipment. The server may transmit the online detection command instruction in a wireless transmission manner such as 3G, 4G, or Wifi, and the embodiment preferably selects 4G to transmit the instruction. The structure of the on-line detection command instruction is # # #2002 { "Mid": "1808130043", "TimeSp": "1534173031" } $01B86EF1& & & & & & & & & & & & & & & & & & & ", the interface number data may be customized according to actual needs, and this embodiment preferably sets the interface number" 2002 "to indicate that the instruction type is" online detection ", the command content information of the online detection command instruction only contains two parameters of a machine number and a time stamp, which is convenient for server judgment, the machine number is first converted to generate a BCD code of 5 bytes, such as" 0x18,0x08,0x13,0x00,0x43", and then the time stamp is converted to generate a BCD code of 5 bytes with the validity and precedence of the command content information, and is added to a fixed BCD code 0x00 to form a BCD code group, the BCD code group is encrypted using AES256 algorithm, the first four bytes" 01B86EF1 "of the encryption result are taken as a signature of this piece of online detection command instruction, and this embodiment preferably selects" # # "and" # & & "as a command header and a command tail, as constraint formats. The server sends an online detection command instruction to the vending machine at least once every 100 seconds, and the automatic vending machine or the network can be judged whether to be disconnected at any time.
In step S200 of this embodiment, the online detection response instruction corresponds to the online detection command instruction, the interface number is the same as the interface number in step S100, the command content information of the online detection response instruction only includes two parameter information, i.e., the machine number and the timestamp, and the machine number and the timestamp in the synchronization step S100 are the same, so that the signatures generated in the synchronization step S100 are the same. After receiving the online detection response instruction, the server verifies the correctness of the instruction, judges that the vending machine is online and can execute the goods delivery operation. When the server does not receive the online detection response instruction within a fixed time, that is, it is determined that the vending machine is offline, an automatic refund operation is performed, and payment security of consumption is protected.
Referring to fig. 2, in another embodiment of the present invention, the following steps are further included:
and step S500, the vending machine executes the goods delivery operation and circularly sends a goods delivery result command instruction for reporting the goods delivery condition to the server.
Step S600, the server receives the shipment result command instruction, judges a shipment result and sends a shipment result response instruction corresponding to the shipment result command instruction to the vending machine; or the server does not receive the goods output result command instruction and judges that the vending machine is off-line.
In step S500 and step S600 of this embodiment, after the vending machine performs the shipping operation, the shipping result command is continuously sent to the server, and the machine number and the timestamp in the N shipping result commands continuously sent remain unchanged. When the server receives the delivery result command instruction, the delivery result is judged, meanwhile, a delivery result response instruction is sent to the vending machine, and when the delivery result is successful, the consumer is fed back; and when the delivery result is delivery failure, executing automatic refund operation. In this embodiment, when the shipping result command is sent continuously for more than 10 items and is not received by the server, it is determined that the vending machine is offline.
Referring to fig. 2, in another embodiment of the present invention, the following steps are included:
and S100, if the payment is successful, the vending machine receives an online detection command instruction which is sent by the server and used for detecting whether the vending machine is online.
Step S200, the vending machine sends an online detection response instruction corresponding to the online detection command instruction to the server, and when the server receives the online detection response instruction, the vending machine is judged to be online; and when the server does not receive the online detection response instruction, judging that the vending machine is offline, and executing automatic refund operation.
And step S300, the vending machine receives a goods outlet command instruction which is sent by the server and used for controlling goods outlet of the vending machine.
And step S400, the vending machine sends a shipment response instruction corresponding to the shipment command instruction to the server.
And step S500, the vending machine executes the goods delivery operation and circularly sends a goods delivery result command instruction for reporting the goods delivery condition to the server.
Step S600, the server receives the shipment result command instruction, judges a shipment result and sends a shipment result response instruction corresponding to the shipment result command instruction to the vending machine; or the server does not receive the goods output result command instruction and judges that the vending machine is off-line.
Referring to fig. 3, in another embodiment of the present invention, there is also provided a vending machine data interaction device, comprising at least one control processor and a memory for communicative connection with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform a vending system data interaction method of the above-described embodiments, for example, performing method steps S1-S2 of fig. 1, and method steps S100-S600 of fig. 2, as described above.
Further, in another embodiment of the present invention, there is also provided a vending machine, including an instruction receiving circuit module, an instruction sending circuit module, and an instruction processing module, where the instruction processing module is electrically connected to the instruction receiving circuit module and the instruction sending circuit module, respectively, and the instruction receiving circuit module is configured to receive a command instruction sent from a server; and the instruction sending circuit module is used for sending a response instruction corresponding to the command instruction to the server. The instruction processing module is used for executing the information in the command instruction and selecting the response instruction carrying the corresponding information.
Further, in another embodiment of the present invention, there is provided a vending machine application system, including an instruction receiving circuit module, an instruction sending circuit module, an instruction processing module, and a server. In this embodiment, the server may perform data interaction with the vending machine, and the server may send a response instruction to the instruction receiving circuit module, or may receive a response instruction sent by the instruction sending circuit module.
Further, in another embodiment of the present invention, a computer-readable storage medium is provided, which stores computer-executable instructions for causing a computer to perform the vending machine data interaction method of the above-described embodiment, for example, to perform the method steps S1 to S2 in fig. 1 and the method steps S100 to S600 in fig. 2 described above.
Further, in another embodiment of the present invention, there is also provided a computer program product, including a computer program stored on a computer-readable storage medium, the computer program including program instructions, which when executed by a computer, for example, by one of the processors in fig. 3, can cause the one or more processors to perform the vending machine data interaction method of the above-described embodiment, for example, to perform the above-described method steps S1 to S2 in fig. 1, and the method steps S100 to S600 in fig. 2.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a general hardware platform. Those skilled in the art will appreciate that all or part of the processes of the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, and the computer program may be stored in a computer readable storage medium, and when executed, may include the processes of the embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the preferred embodiments of the present invention have been described, the present invention is not limited to the above embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and such equivalent modifications or substitutions are to be included within the scope of the present invention defined by the claims.

Claims (7)

1. A vending machine data interaction method is characterized by comprising the following steps:
receiving a command instruction sent by a server, wherein the command instruction comprises a first interface number, first command content information and first signature information used for verifying the command instruction;
sending a response instruction corresponding to the command instruction to a server, wherein the response instruction comprises a second interface number, second command content information and second signature information used for verifying the response instruction, the second interface number is the same as the first interface number, the second command content information corresponds to the first command content information, and the first signature information is generated after being encrypted based on a first BCD code group converted from the first command content information; the second signature information is generated after being encrypted based on a second BCD code group converted from second command content information; the first BCD code group is generated by converting a first machine number, a first timestamp and first command content information into BCD codes respectively; the second BCD code group is generated by converting a second machine number, a second timestamp and second command content information into BCD codes respectively;
the first command content information comprises a first machine number, a first timestamp and a first information parameter; the second command content information comprises a second machine number, a second timestamp and a second information parameter; the second machine number is the same as the first machine number, and the second timestamp is the same as the first timestamp;
after the first BCD code group is encrypted, taking the first 4 bytes of an encryption result as the first signature information; and after the second BCD code group is encrypted, taking the first 4 bytes of the encrypted result as the second signature information.
2. The vending machine data interaction method as recited in claim 1, further comprising the steps of:
the vending machine receives a goods delivery command instruction which is sent by the server and used for controlling the goods delivery of the vending machine, wherein the command instruction comprises the goods delivery command instruction;
and the vending machine sends a shipment response instruction corresponding to the shipment command instruction to the server, wherein the response instruction comprises the shipment response instruction.
3. The vending machine data interaction method as claimed in claim 2, further comprising the following steps before the vending machine receives the delivery command instruction sent by the server for controlling the delivery of the vending machine:
the method comprises the steps that the vending machine receives an online detection command instruction which is sent by a server and used for detecting whether the vending machine is online or not, wherein the command instruction comprises an online detection command instruction;
the vending machine sends an online detection response instruction corresponding to the online detection command instruction to the server, and when the server receives the online detection response instruction, the vending machine is judged to be online; and when the server does not receive the online detection response instruction, judging that the vending machine is offline, and executing automatic refund operation, wherein the response instruction comprises an online detection response instruction.
4. The vending machine data interaction method according to claim 2, further comprising the following steps after the vending machine sends the shipment response instruction corresponding to the shipment command instruction to the server:
the vending machine executes the goods delivery operation and circularly sends a goods delivery result command instruction for reporting the goods delivery condition to the server;
the server receives the shipment result command instruction, judges a shipment result and sends a shipment result response instruction corresponding to the shipment result command instruction to the vending machine; or the server does not receive the shipment result command instruction and judges that the vending machine is off-line.
5. A vending machine data interaction device is characterized in that: the system comprises an instruction receiving circuit module, an instruction sending circuit module and an instruction processing module, wherein the instruction processing module is respectively electrically connected with the instruction receiving circuit module and the instruction sending circuit module, the instruction receiving circuit module is used for receiving an instruction sent by a server, and the instruction comprises a first interface number, first instruction content information and first signature information used for verifying the instruction; the instruction sending circuit module is used for sending a response instruction corresponding to the command instruction to the server, wherein the response instruction comprises a second interface number, second command content information and second signature information used for verifying the response instruction, the second interface number is the same as the first interface number, the second command content information corresponds to the first command content information, and the first signature information is generated after being encrypted based on a first BCD code group converted from the first command content information; the second signature information is generated after being encrypted based on a second BCD code group converted from second command content information; the first BCD code group is generated by converting a first machine number, a first timestamp and first command content information into BCD codes respectively; the second BCD code group is generated by converting a second machine number, a second timestamp and second command content information into BCD codes respectively;
the first command content information comprises a first machine number, a first time stamp and a first information parameter; the second command content information comprises a second machine number, a second timestamp and a second information parameter; the second machine number is the same as the first machine number, and the second timestamp is the same as the first timestamp;
after the first BCD code group is encrypted, taking the first 4 bytes of an encrypted result as the first signature information; and after the second BCD code group is encrypted, taking the first 4 bytes of the encrypted result as the second signature information.
6. A vending machine data interaction device, characterized in that: comprising at least one control processor and a memory for communicative connection with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform a vending machine data interaction method as claimed in any one of claims 1 to 4.
7. A computer-readable storage medium characterized by: the computer-readable storage medium stores computer-executable instructions for causing a computer to perform a vending machine data interaction method as recited in any of claims 1-4.
CN201910121717.4A 2019-02-19 2019-02-19 Vending machine data interaction method, device, equipment and storage medium Active CN109933997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910121717.4A CN109933997B (en) 2019-02-19 2019-02-19 Vending machine data interaction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910121717.4A CN109933997B (en) 2019-02-19 2019-02-19 Vending machine data interaction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109933997A CN109933997A (en) 2019-06-25
CN109933997B true CN109933997B (en) 2022-10-28

Family

ID=66985628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910121717.4A Active CN109933997B (en) 2019-02-19 2019-02-19 Vending machine data interaction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109933997B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1162156A (en) * 1997-02-03 1997-10-15 张跃明 Digital automatic vending-machine controlling system
JP2001338327A (en) * 2000-05-30 2001-12-07 Dokomo Eng Kk Automatic vending system and automatic vending machine, and method for vending commodities
CN1722049A (en) * 1995-02-13 2006-01-18 英特特拉斯特技术公司 Systems and methods for secure transaction management and electronic rights protection
CN1756150A (en) * 2004-09-30 2006-04-05 飞力凯网路股份有限公司 Information management apparatus, information management method, and program
TW200713132A (en) * 2005-07-13 2007-04-01 Mastercard International Inc Apparatus and method for integrated payment and electronic merchandise transfer
CN101454794A (en) * 2006-03-30 2009-06-10 奥博佩公司 Mobile person-to-person payment system
JP2013117845A (en) * 2011-12-02 2013-06-13 Nippon Telegr & Teleph Corp <Ntt> Service provision method, system server, and program
CN103942685A (en) * 2014-04-25 2014-07-23 天地融科技股份有限公司 Data security interactive system
CN104106270A (en) * 2011-12-06 2014-10-15 高通股份有限公司 Systems and methods for machine to machine device control and triggering
CN104335237A (en) * 2012-05-24 2015-02-04 Jvl风险投资有限责任公司 Systems, methods, and computer program products for providing a contactless protocol
CN104348792A (en) * 2013-07-30 2015-02-11 阿里巴巴集团控股有限公司 Data processing method, device and system
CN105282148A (en) * 2015-09-17 2016-01-27 褚维戈 Data remote authentication system and method
CN107395340A (en) * 2017-06-14 2017-11-24 云丁网络技术(北京)有限公司 Data transmission method, apparatus and system
CN107679962A (en) * 2017-10-17 2018-02-09 黄山市昌臣食品有限公司 A kind of intelligent automatic good selling method and vending system
CN107743633A (en) * 2015-04-10 2018-02-27 万事达卡国际股份有限公司 Automatic vending machine is merchandised
CN108830615A (en) * 2018-06-06 2018-11-16 富士电机(中国)有限公司 Automatic vending machine trade managing system and intelligence sharing method
CN109104283A (en) * 2018-06-26 2018-12-28 北京云迹科技有限公司 intelligent distribution system communication encryption method and device
CN109284996A (en) * 2018-09-25 2019-01-29 江小平 Self-service system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150235202A1 (en) * 2014-02-20 2015-08-20 Eazy Coin Corp. Method and system for cashless transactions at vending machines

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722049A (en) * 1995-02-13 2006-01-18 英特特拉斯特技术公司 Systems and methods for secure transaction management and electronic rights protection
CN1162156A (en) * 1997-02-03 1997-10-15 张跃明 Digital automatic vending-machine controlling system
JP2001338327A (en) * 2000-05-30 2001-12-07 Dokomo Eng Kk Automatic vending system and automatic vending machine, and method for vending commodities
CN1756150A (en) * 2004-09-30 2006-04-05 飞力凯网路股份有限公司 Information management apparatus, information management method, and program
TW200713132A (en) * 2005-07-13 2007-04-01 Mastercard International Inc Apparatus and method for integrated payment and electronic merchandise transfer
CN101454794A (en) * 2006-03-30 2009-06-10 奥博佩公司 Mobile person-to-person payment system
JP2013117845A (en) * 2011-12-02 2013-06-13 Nippon Telegr & Teleph Corp <Ntt> Service provision method, system server, and program
CN104106270A (en) * 2011-12-06 2014-10-15 高通股份有限公司 Systems and methods for machine to machine device control and triggering
CN104335237A (en) * 2012-05-24 2015-02-04 Jvl风险投资有限责任公司 Systems, methods, and computer program products for providing a contactless protocol
CN104348792A (en) * 2013-07-30 2015-02-11 阿里巴巴集团控股有限公司 Data processing method, device and system
CN103942685A (en) * 2014-04-25 2014-07-23 天地融科技股份有限公司 Data security interactive system
CN107743633A (en) * 2015-04-10 2018-02-27 万事达卡国际股份有限公司 Automatic vending machine is merchandised
CN105282148A (en) * 2015-09-17 2016-01-27 褚维戈 Data remote authentication system and method
CN107395340A (en) * 2017-06-14 2017-11-24 云丁网络技术(北京)有限公司 Data transmission method, apparatus and system
CN107679962A (en) * 2017-10-17 2018-02-09 黄山市昌臣食品有限公司 A kind of intelligent automatic good selling method and vending system
CN108830615A (en) * 2018-06-06 2018-11-16 富士电机(中国)有限公司 Automatic vending machine trade managing system and intelligence sharing method
CN109104283A (en) * 2018-06-26 2018-12-28 北京云迹科技有限公司 intelligent distribution system communication encryption method and device
CN109284996A (en) * 2018-09-25 2019-01-29 江小平 Self-service system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于ARM+GPRS的IC卡自动售货机的设计与应用;李战明等;《科学技术与工程》;20080401(第07期);全文 *

Also Published As

Publication number Publication date
CN109933997A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
US20220253825A1 (en) Peer-to-peer payment processing
US11593790B2 (en) Fault tolerant token based transaction systems
US9530126B2 (en) Secure mobile payment processing
AU2009296822B2 (en) Intelligent alert system and method
CA2764558C (en) Payment systems and methods using mobile computing devices
WO1997049070A2 (en) System and method for transmitting messages
CA2947514C (en) Payment confirmation system and method
JPWO2018047982A1 (en) Payment method and payment system using code information
CN111695887A (en) Block chain-based secure payment interaction system
CN101388096A (en) Multi-platform data standardization processing method and system
CN107730243A (en) A kind of card user and POS interactive system and method
CN111091430B (en) Billing two-dimensional code processing method and system
WO2012079145A1 (en) Method and system for product or service source authentication
CN109933997B (en) Vending machine data interaction method, device, equipment and storage medium
US20220051244A1 (en) Systems and methods for validating transmissions over communication channels
US11580530B1 (en) Direct payment authorization path
US8355969B2 (en) Credit and/or debit card security
US11907918B2 (en) Method for carrying out a transaction, corresponding terminal and computer program
JP7171289B2 (en) Electronic receipt system and program
KR101172872B1 (en) Method and system of secure payment using authentication number
Dulai et al. IOTP and Payments Protocols
CN114463027A (en) Information processing system and method thereof
CN115809874A (en) Transaction processing method, device and system and electronic equipment
KR101359396B1 (en) Product selling method, product selling server, product buying method, terminal, recording medium, and system
CN116596544A (en) Payment method and device based on magnetic stripe payment code, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant