Product purchasing methods, devices, electronic devices and computer storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-21
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]现有的自助终端商品购买方法依赖网络服务,自助终端不仅收到网络的限制,还要求所连接的网络能够稳定传输数据,对自助终端的使用范围具有一定限制
[0072] This application discloses a method, apparatus, electronic device, and computer storage medium for purchasing goods. Upon receiving a first operation, a self-service terminal outputs first output information associated with a target product. Then, it acquires second output information, including a first signature, generated by a user terminal based on the first output information. The self-service terminal verifies the first signature in the second output information using its public key, obtaining a first verification result. If the first verification result indicates that the first signature verification is successful, the self-service terminal controls the shipment of the target product.
Smart Images

Figure CN117315841B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of payment processing, and in particular relates to a method, apparatus, electronic device and computer storage medium for purchasing goods. Background Technology
[0002] Currently, self-service terminals generally use a user-initiated scanning method to sell goods. This requires network access to provide users with goods purchase services. After the user selects the desired goods on the self-service terminal, the backend service of the self-service terminal calls the corresponding payment channel to generate a payment QR code and displays it to the user, so that the user can scan the payment QR code to pay for the purchased goods through the smart terminal. Before the user completes the payment, the self-service terminal will use a polling method to query the final execution result of the transaction.
[0003] Existing self-service terminal purchasing methods rely on network services. Self-service terminals are not only limited by the network, but also require the network to be able to transmit data stably, which limits the scope of use of self-service terminals. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and computer storage medium for purchasing goods, enabling self-service terminals to provide goods purchasing services to users without relying on network services.
[0005] In a first aspect, embodiments of this application provide a method for purchasing goods, applied to a self-service terminal, which may include:
[0006] Upon receiving the first operation, first output information associated with the target product is output, wherein the first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product, wherein the identification information of the self-service terminal includes the public key of the self-service terminal.
[0007] The user terminal outputs second output information including a first signature. The first signature is a signature generated by the user terminal based on the first output information when it obtains the first output information and receives a payment operation. The payment operation is used to pay for the target product. The second output information is generated based on the first signature and the first output information.
[0008] The first signature in the second output information is verified using the public key of the self-service terminal to obtain the first verification result, wherein the public key of the self-service terminal is associated with the self-service terminal.
[0009] If the first verification result indicates that the first signature verification is successful, control the shipment of the target goods.
[0010] In one embodiment, the aforementioned step of outputting first output information associated with the target product upon receiving the first operation includes:
[0011] Upon receiving the first operation, a first key is generated;
[0012] The first output information is obtained by encrypting the identification information of the self-service terminal and the purchase information of the target product using the first key;
[0013] Output the first output information associated with the target product.
[0014] In one embodiment, the first key mentioned above includes a first random key and a payment channel public key;
[0015] Based on the identification information of the self-service terminal and the purchase information of the target product encrypted with the first key, the first output information is obtained, including:
[0016] The first random key is encrypted using the public key of the payment channel to obtain the first ciphertext, and the identification information of the self-service terminal and the purchase information of the target product are encrypted using the first random key to obtain the second ciphertext.
[0017] Based on the first ciphertext and the second ciphertext, the first output information is obtained.
[0018] Secondly, embodiments of this application provide a method for purchasing goods, applied to a user terminal, which may include:
[0019] Obtain first output information, which includes the identification information of the self-service terminal and the purchase information of the target product. The identification information of the self-service terminal includes the public key of the self-service terminal.
[0020] Upon receiving a payment operation, a first signature is generated based on the first output information. The first signature is a signature used by the user terminal to encrypt the first output information. The payment operation is used to pay for the target goods.
[0021] Based on the first signature and the first output information, generate the second output information;
[0022] The self-service terminal outputs second output information to itself, so that after the self-service terminal verifies the first signature in the second output information using its public key, it controls the shipment of the target product.
[0023] In one embodiment, after obtaining the first output information as described above, the process further includes:
[0024] The first output information is decrypted using the second key to obtain the identification information of the self-service terminal and the purchase information of the target product.
[0025] In one embodiment, the second key mentioned above includes a payment channel private key, and the first output information includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by encrypting the first random key with the payment channel public key, and the second ciphertext is obtained by encrypting the identification information of the self-service terminal and the purchase information of the target product with the first random key.
[0026] The first output information is decrypted using the second key to obtain the self-service terminal's identification information and the purchase information of the target product, including:
[0027] The first ciphertext is decrypted using the payment channel's private key to obtain the first random key;
[0028] The second ciphertext is decrypted using the first random key to obtain the self-service terminal's identification information and the purchase information of the target product.
[0029] In one embodiment, the above-mentioned step of generating a first signature based on the first output information upon receiving a payment operation includes:
[0030] Upon receiving a payment transaction, a delivery instruction is generated based on the identification information of the self-service terminal and the purchase information of the target product. The delivery instruction is used to control the delivery of the target product.
[0031] The shipping instruction is signed using the private key of the self-service terminal to obtain the first signature. The private key of the self-service terminal corresponds to the public key of the self-service terminal.
[0032] Based on the first signature and the first output information, generate the second output information, including:
[0033] Based on the first signature and shipping instructions, generate the second output information.
[0034] In one embodiment, the above-mentioned step of generating a first signature based on the first output information upon receiving a payment operation includes:
[0035] Upon receiving a payment request, a second random key is generated;
[0036] The second random key is encrypted using the public key of the self-service terminal to generate the third ciphertext, and the payment order is encrypted using the second random key to generate the fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0037] The second signature is obtained by signing the third and fourth ciphertexts using the payment channel's private key.
[0038] The second signature, third ciphertext, and fourth ciphertext are sent to the self-service terminal server so that the server can verify the second signature using the payment channel public key and obtain a second verification result. If the second verification result indicates that the second signature has been verified, the server decrypts the third ciphertext using the self-service terminal private key to obtain a second random key, and decrypts the fourth ciphertext using the second random key to obtain a payment order. A shipping instruction is generated based on the payment order, and the shipping instruction is signed using the self-service terminal private key to obtain a first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
[0039] Thirdly, embodiments of this application provide a method for purchasing goods, applied to a self-service terminal server, which may include:
[0040] Receive the second signature, third ciphertext, and fourth ciphertext sent by the user terminal;
[0041] The second signature is verified using the public key of the payment channel to obtain a second verification result, which indicates whether the second signature has been successfully verified.
[0042] If the second verification result indicates that the second signature verification is successful, the third ciphertext is decrypted using the private key of the self-service terminal to obtain the second random key;
[0043] The payment order is obtained by decrypting the fourth ciphertext using the second random key. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0044] Generate a shipping instruction based on the payment order;
[0045] The shipping instruction is signed using the private key of the self-service terminal to obtain the first signature;
[0046] Send the first signature to the user's terminal.
[0047] Fourthly, embodiments of this application provide a product purchasing device applied to a self-service terminal, which may include:
[0048] The output module is used to output first output information associated with the target product upon receiving the first operation. The first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product. The identification information of the self-service terminal includes the public key of the self-service terminal.
[0049] The acquisition module is used to acquire second output information including a first signature from the user terminal. The first signature is a signature generated by the user terminal based on the first output information when it acquires the first output information and receives a payment operation. The payment operation is used to pay for the target product. The second output information is generated based on the first signature and the first output information.
[0050] The verification module is used to verify the first signature in the second output information using the public key of the self-service terminal, and obtain the first verification result, wherein the public key of the self-service terminal is associated with the self-service terminal;
[0051] The shipping module is used to control the shipping of the target goods when the first verification result indicates that the first signature verification has passed.
[0052] Fifthly, embodiments of this application provide a product purchasing device applied to a user terminal, which may include:
[0053] The information acquisition module is used to acquire the first output information;
[0054] The signature generation module is used to generate a first signature based on the first output information when a payment operation is received. The payment operation is used to pay for the target goods.
[0055] The information generation module is used to generate second output information based on the first signature and the first output information;
[0056] The information output module is used to output the second output information.
[0057] Sixthly, embodiments of this application provide a product purchasing device applied to a self-service terminal server, the device including:
[0058] The information receiving module is used to receive the second signature, third ciphertext, and fourth ciphertext sent by the user terminal;
[0059] The signature verification module is used to verify the second signature based on the payment channel public key and obtain the second verification result, which indicates whether the second signature has been verified successfully.
[0060] The first decryption module is used to decrypt the third ciphertext to obtain the second random key based on the private key of the self-service terminal when the second verification result indicates that the second signature verification is successful.
[0061] The second decryption module is used to decrypt the fourth ciphertext according to the second random key to obtain the payment order. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0062] The instruction generation module is used to generate shipping instructions based on payment orders;
[0063] The instruction signing module is used to sign the delivery instruction based on the private key of the self-service terminal to obtain the first signature;
[0064] The signature sending module is used to send the first signature to the user terminal.
[0065] Seventhly, embodiments of this application provide an electronic device, the device comprising:
[0066] processor;
[0067] Memory used to store processor-executable instructions;
[0068] The processor is configured to execute instructions to implement the product purchasing method as shown in any of the embodiments of the first, second, and third aspects.
[0069] Eighthly, embodiments of this application provide a computer storage medium storing a computer program that, when executed by a processor, implements the product purchasing method as shown in any one of the embodiments of the first, second, and third aspects.
[0070] In a ninth aspect, embodiments of this application also provide a computer program product comprising a computer program stored in a readable storage medium, wherein at least one processor of the device reads from the storage medium and executes the computer program, causing the device to perform a goods purchasing method as shown in any one of the embodiments of the first, second, and third aspects.
[0071] This application provides a method, apparatus, electronic device, and computer storage medium for purchasing goods. Compared with the prior art, this application has the following advantages:
[0072] This application discloses a method, apparatus, electronic device, and computer storage medium for purchasing goods. Upon receiving a first operation, a self-service terminal outputs first output information associated with a target product. Then, it acquires second output information, including a first signature, generated by a user terminal based on the first output information. The self-service terminal verifies the first signature in the second output information using its public key, obtaining a first verification result. If the first verification result indicates that the first signature verification is successful, the self-service terminal controls the shipment of the target product.
[0073] In this way, by having the user terminal generate second output information based on the received first output information, and then having the self-service terminal verify the first signature in the second output information generated by the user terminal, the self-service terminal can determine whether the user has completed the payment order and the goods the user needs to purchase simply by verifying the first signature, without relying on network services, and thus complete the shipment of goods. Attached Figure Description
[0074] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a flowchart illustrating a method for purchasing goods provided in an embodiment of this application;
[0076] Figure 2 This is a flowchart illustrating another method for purchasing goods provided in an embodiment of this application;
[0077] Figure 3 This is a schematic diagram of the architecture of a product purchasing method provided in an embodiment of this application;
[0078] Figure 4 This is a schematic diagram of information transmission for a product purchasing method provided in an embodiment of this application;
[0079] Figure 5 This is a schematic diagram of the structure of a commodity purchasing device provided in an embodiment of this application;
[0080] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0081] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0082] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0083] As discussed in the background section, existing self-service machines rely on network services, which not only limits their operation but also requires a stable network connection. Furthermore, using a polling method would increase resource waste.
[0084] To address the problems existing in the prior art, embodiments of this application provide a method, apparatus, electronic device, and computer storage medium for purchasing goods. Upon receiving a first operation, a self-service terminal outputs first output information associated with a target product. Then, it acquires second output information, including a first signature, generated by a user terminal based on the first output information. The self-service terminal verifies the first signature in the second output information using its public key, obtaining a first verification result. If the first verification result indicates that the first signature verification is successful, the self-service terminal controls the shipment of the target product.
[0085] In this way, by having the user terminal generate second output information based on the received first output information, and then having the self-service terminal verify the first signature in the second output information generated by the user terminal, the self-service terminal can determine whether the user has completed the payment order and the goods the user needs to purchase simply by verifying the first signature, without relying on network services, and thus complete the shipment of goods.
[0086] This application provides a method, apparatus, electronic device, and computer storage medium for purchasing goods. The method for purchasing goods provided in this application will be described first. Figure 1 As shown in the embodiments of this application, the method for purchasing goods includes the following steps:
[0087] S101: Upon receiving the first operation, the self-service terminal outputs first output information associated with the target product, wherein the first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product, and the identification information of the self-service terminal includes the public key of the self-service terminal.
[0088] S102: The user terminal obtains the first output information;
[0089] S103: When the user terminal receives a payment operation, it generates a first signature based on the first output information. The payment operation is used to pay for the target goods.
[0090] S104: Generate second output information based on the first signature and the first output information;
[0091] S105: The user terminal outputs second output information including a first signature to the self-service terminal. The first signature is a signature generated by the user terminal based on the first output information when it obtains the first output information and receives a payment operation. The payment operation is used to pay for the target goods. The second output information is generated based on the first signature and the first output information.
[0092] S106: The self-service terminal verifies the first signature in the second output information using the self-service terminal public key to obtain the first verification result, wherein the self-service terminal public key is associated with the self-service terminal;
[0093] S107: If the first verification result indicates that the first signature verification is successful, the self-service terminal controls the shipment of the target goods.
[0094] This application provides a method, apparatus, electronic device, and computer storage medium for purchasing goods. Upon receiving a first operation, a self-service terminal outputs first output information associated with a target product. Then, it acquires second output information, including a first signature, generated by a user terminal based on the first output information. The self-service terminal verifies the first signature in the second output information using its public key, obtaining a first verification result. If the first verification result indicates that the first signature verification is successful, the self-service terminal controls the shipment of the target product.
[0095] In this way, by having the user terminal generate second output information based on the received first output information, and then having the self-service terminal verify the first signature in the second output information generated by the user terminal, the self-service terminal can determine whether the user has completed the payment order and the goods the user needs to purchase simply by verifying the first signature, without relying on network services, and thus complete the shipment of goods.
[0096] In S101, the first operation can be that the user selects the product to be purchased on the display screen of the self-service terminal. The first output information includes, but is not limited to, output in the form of a QR code, such as a barcode, audio information, wireless transmission information, etc., which are data transmission methods that do not rely on a network, and are not limited here.
[0097] In one example, to improve the security of information transmission, upon receiving a first operation, first output information associated with the target product is output, including: upon receiving the first operation, generating a first key; encrypting the identification information of the self-service terminal and the purchase information of the target product according to the first key to obtain the first output information; and outputting the first output information associated with the target product.
[0098] In one specific embodiment, the first key includes a first random key and a payment channel public key; the identification information of the self-service terminal and the purchase information of the target product are encrypted according to the first key to obtain the first output information, including: encrypting the first random key according to the payment channel public key to obtain the first ciphertext, and encrypting the identification information of the self-service terminal and the purchase information of the target product according to the first random key to obtain the second ciphertext; and obtaining the first output information according to the first ciphertext and the second ciphertext.
[0099] The target product can be any one of multiple products offered for sale by the self-service terminal. The purchase information for the target product may include product identification information and product price, and the identification information for the self-service terminal may include the self-service terminal identifier and the self-service terminal public key. The step of obtaining the first output information based on the first ciphertext and the second ciphertext can specifically include merging the first ciphertext and the second ciphertext to generate the first output information.
[0100] In S102, in one example, the user terminal can obtain the first input information by scanning. For example, the user scans a QR code with their smartphone and transmits the obtained first output information to the backend service of the payment application.
[0101] In one example, to improve the security of information transmission, after obtaining the first output information, the method further includes: decrypting the first output information using a second key to obtain the identification information of the self-service terminal and the purchase information of the target product.
[0102] In one example, the second key includes the payment channel private key, and the first output information includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by encrypting the first random key with the payment channel public key, and the second ciphertext is obtained by encrypting the identification information of the self-service terminal and the purchase information of the target product with the first random key.
[0103] The first output information is decrypted using the second key to obtain the identification information of the self-service terminal and the purchase information of the target product, including: decrypting the first ciphertext using the payment channel private key to obtain the first random key; and decrypting the second ciphertext using the first random key to obtain the identification information of the self-service terminal and the purchase information of the target product.
[0104] In S103, the payment operation can be the operation of the user confirming a payment order and completing the order payment.
[0105] In one example, upon receiving a payment operation, a first signature is generated based on the first output information, including:
[0106] Upon receiving a payment request, a second random key is generated;
[0107] The second random key is encrypted using the public key of the self-service terminal to generate the third ciphertext, and the payment order is encrypted using the second random key to generate the fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0108] The second signature is obtained by signing the third and fourth ciphertexts using the payment channel's private key.
[0109] The second signature, third ciphertext, and fourth ciphertext are sent to the self-service terminal server so that the server can verify the second signature using the payment channel public key and obtain a second verification result. If the second verification result indicates that the second signature has been verified, the server decrypts the third ciphertext using the self-service terminal private key to obtain a second random key, and decrypts the fourth ciphertext using the second random key to obtain a payment order. A shipping instruction is generated based on the payment order, and the shipping instruction is signed using the self-service terminal private key to obtain a first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
[0110] In S104, in one example, a payment voucher QR code is generated based on the shipping instruction generated from the first signature and the first output information.
[0111] In S105, in one example, the user terminal outputs second output information to the self-service terminal, for example, the user presents a payment voucher QR code to the self-service terminal.
[0112] In S106, the self-service terminal verifies the first signature using its public key to obtain a first verification result, which can be used to indicate whether the first signature has been verified.
[0113] In S107, if the verification result indicates that the first signature verification is successful, the self-service terminal completes the shipment of the goods according to the target goods corresponding to the shipment instruction.
[0114] To improve the accuracy and security of payment vouchers, such as Figure 2 As shown in the figure, this application embodiment improves a product purchase method, applied to a self-service terminal server, the method including:
[0115] S201: Receive the second signature, third ciphertext, and fourth ciphertext sent by the user terminal;
[0116] S202: Verify the second signature based on the payment channel public key to obtain a second verification result, which is used to indicate whether the second signature has been verified successfully;
[0117] S203: If the second verification result indicates that the second signature verification is successful, the third ciphertext is decrypted using the private key of the self-service terminal to obtain the second random key;
[0118] S204: Decrypt the fourth ciphertext using the second random key to obtain the payment order, which is generated based on the identification information of the self-service terminal and the purchase information of the target product;
[0119] S205: Generate a shipping instruction based on the payment order;
[0120] S206: Sign the shipping instruction using the private key of the self-service terminal to obtain the first signature;
[0121] S207: Send the first signature to the user terminal.
[0122] By sending the second signature, third ciphertext, and fourth ciphertext to the automated terminal server and verifying the second signature, and generating a shipping instruction based on the payment order and signing the shipping instruction if the verification is successful, the accuracy and security of the second output information used as a payment voucher can be improved.
[0123] In S201, the self-service terminal server receives the second signature, third ciphertext, and fourth ciphertext sent by the user terminal via the network.
[0124] In S202, the self-service terminal server verifies the second signature based on the payment channel public key and obtains the second verification result.
[0125] In S203, if the second signature is verified, the self-service terminal server decrypts the third ciphertext using the self-service terminal's private key to obtain the second random key.
[0126] In S204, the self-service terminal server decrypts the fourth ciphertext using the second random key to obtain the payment order.
[0127] In S205, the self-service terminal server generates a shipping instruction corresponding to the target product based on the payment order.
[0128] In S206, the self-service terminal server signs the delivery instruction based on the self-service terminal's private key to obtain the first signature.
[0129] In S207, the self-service terminal server sends the first signature to the user terminal via the network.
[0130] To better illustrate this application, a specific embodiment is provided below:
[0131] like Figure 3 and Figure 4 As shown, Figure 3 This is a schematic diagram of the architecture of the product purchasing method provided in the embodiments of this application. Figure 4 This is a schematic diagram illustrating the information transmission of a product purchase method provided in an embodiment of this application.
[0132] The solution provided in this application will now be described according to several core processes in the scenario of a user purchasing goods at a self-service terminal.
[0133] 1. The user clicks on the screen to select the product they want to buy, and the self-service terminal displays a payment QR code.
[0134] In this process, when the user clicks the screen to select the product to purchase, the internal program of the self-service terminal will generate a random key M1. The random key M1 is encrypted with the payment channel public key P1 to obtain ciphertext C1. The product information (product identifier, price) and self-service terminal information (self-service terminal identifier, self-service terminal public key P2) are encrypted using the random key M1 to obtain ciphertext C2. The ciphertext C1 and ciphertext C2 are combined to generate a payment QR code.
[0135] 2. Users scan the payment QR code using the payment app and complete the payment.
[0136] After a user scans a payment QR code using the payment app, the QR code information is transmitted to the payment app's backend service. The payment app's backend service uses the payment channel private key K1 to decrypt ciphertext C1 to obtain a random key M1. It then uses the random key M1 to decrypt ciphertext C2 to obtain product information and self-service terminal information. Based on this information, a payment order is generated and returned to the user. After the user confirms the payment order and completes the payment, the payment app's backend service generates a random key M2 and encrypts it using the self-service terminal's public key P2 to generate ciphertext C3. It then encrypts the order information using the random key M2 to generate ciphertext C4. Finally, it signs ciphertext C3 and ciphertext C4 using the payment channel private key K1 to obtain signature S1. The signature S1, ciphertext C3, and ciphertext C4 are then sent to the self-service terminal's backend service. The self-service terminal's backend service verifies the signature S1 using the payment channel's public key P1. After successful verification, it decrypts the ciphertext C3 using the self-service terminal's private key K2 to obtain the random key M2. Then, it decrypts the ciphertext C4 using the random key M2 to obtain the order information. Finally, the self-service terminal's backend service signs the shipping instruction using its private key K2 to obtain signature S2, and sends it to the payment app's backend service. The payment app's backend service then generates a payment voucher QR code and returns it to the user.
[0137] 3. Self-service terminal scans user's payment voucher QR code
[0138] At this point, the user can present the payment voucher QR code to the self-service terminal. The internal program of the self-service terminal uses the self-service terminal's public key P2 to verify the signature S2. After the verification is successful, the goods are shipped according to the delivery instruction.
[0139] Based on the product purchasing method provided in the above embodiments, correspondingly, such as Figure 5 As shown in the figure, this application embodiment provides a product purchasing device 500, applied to a self-service terminal, which may include:
[0140] The output module 501 is used to output first output information associated with the target product when a first operation is received. The first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product. The identification information of the self-service terminal includes the public key of the self-service terminal.
[0141] The acquisition module 502 is used to acquire second output information including a first signature from the user terminal. The first signature is a signature generated by the user terminal based on the first output information when it acquires the first output information and receives a payment operation. The payment operation is used to pay for the target product. The second output information is generated based on the first signature and the first output information.
[0142] The verification module 503 is used to verify the first signature in the second output information using the public key of the self-service terminal to obtain the first verification result, wherein the public key of the self-service terminal is associated with the self-service terminal.
[0143] The shipping module 504 is used to control the shipping of the target goods when the first verification result indicates that the first signature verification is successful.
[0144] In one embodiment, the output module may include:
[0145] A generation unit is used to generate a first key upon receiving a first operation;
[0146] An encryption unit is used to encrypt the identification information of the self-service terminal and the purchase information of the target product according to the first key to obtain the first output information;
[0147] The output unit is used to output the first output information associated with the target product.
[0148] In one embodiment, the encryption unit may specifically be used for:
[0149] Based on the identification information of the self-service terminal and the purchase information of the target product encrypted with the first key, the first output information is obtained, including:
[0150] The first random key is encrypted using the public key of the payment channel to obtain the first ciphertext, and the identification information of the self-service terminal and the purchase information of the target product are encrypted using the first random key to obtain the second ciphertext.
[0151] Based on the first ciphertext and the second ciphertext, the first output information is obtained.
[0152] Based on the product purchasing method provided in the above embodiments, correspondingly, this application provides a product purchasing device for a user terminal, which may include:
[0153] An information acquisition module is used to acquire first output information, which includes the identification information of the self-service terminal and the purchase information of the target product. The identification information of the self-service terminal includes the public key of the self-service terminal.
[0154] The signature generation module is used to generate a first signature based on the first output information when a payment operation is received. The first signature is a signature used by the user terminal to encrypt the first output information. The payment operation is used to pay for the target goods.
[0155] The information generation module is used to generate second output information based on the first signature and the first output information;
[0156] The information output module is used to output second output information to the self-service terminal, so that after the self-service terminal verifies the first signature in the second output information through the self-service terminal public key, it controls the shipment of the target product.
[0157] In one embodiment, the product purchasing device may further include:
[0158] The information decryption module is used to decrypt the first output information using the second key to obtain the identification information of the self-service terminal and the purchase information of the target product.
[0159] In one embodiment, the information decryption module can be specifically used for:
[0160] The first ciphertext is decrypted using the payment channel's private key to obtain the first random key;
[0161] The second ciphertext is decrypted using the first random key to obtain the self-service terminal's identification information and the purchase information of the target product.
[0162] In one embodiment, the signature generation module may include:
[0163] The first generation unit is used to generate a delivery instruction based on the identification information of the self-service terminal and the purchase information of the target product when a payment operation is received. The delivery instruction is used to control the delivery of the target product.
[0164] The signature unit is used to sign the delivery instruction based on the private key of the self-service terminal to obtain the first signature. The private key of the self-service terminal corresponds to the public key of the self-service terminal.
[0165] The second generation unit is configured to generate second output information based on the first signature and the first output information, including:
[0166] The third generation unit is used to generate the second output information based on the first signature and the shipping instruction.
[0167] In one embodiment, the signature generation module can be specifically used for:
[0168] Upon receiving a payment request, a second random key is generated;
[0169] The second random key is encrypted using the public key of the self-service terminal to generate the third ciphertext, and the payment order is encrypted using the second random key to generate the fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0170] The second signature is obtained by signing the third and fourth ciphertexts using the payment channel's private key.
[0171] The second signature, third ciphertext, and fourth ciphertext are sent to the self-service terminal server so that the server can verify the second signature using the payment channel public key and obtain a second verification result. If the second verification result indicates that the second signature has been verified, the server decrypts the third ciphertext using the self-service terminal private key to obtain a second random key, and decrypts the fourth ciphertext using the second random key to obtain a payment order. A shipping instruction is generated based on the payment order, and the shipping instruction is signed using the self-service terminal private key to obtain a first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
[0172] Based on the product purchase method provided in the above embodiments, correspondingly, this application provides a product purchase device applied to a self-service terminal server, which may include:
[0173] The information receiving module is used to receive the second signature, third ciphertext, and fourth ciphertext sent by the user terminal;
[0174] The signature verification module is used to verify the second signature based on the payment channel public key and obtain the second verification result, which indicates whether the second signature has been verified successfully.
[0175] The first decryption module is used to decrypt the third ciphertext to obtain the second random key based on the private key of the self-service terminal when the second verification result indicates that the second signature verification is successful.
[0176] The second decryption module is used to decrypt the fourth ciphertext according to the second random key to obtain the payment order. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product.
[0177] The instruction generation module is used to generate shipping instructions based on payment orders;
[0178] The instruction signing module is used to sign the delivery instruction based on the private key of the self-service terminal to obtain the first signature;
[0179] The signature sending module is used to send the first signature to the user terminal.
[0180] Based on the product purchasing method and apparatus provided in the above embodiments, this application also provides an electronic device 600, such as... Figure 6 As shown:
[0181] It includes a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the computer program is executed by the processor 601, it implements the various processes of the above-described product purchasing method embodiments and achieves the same technical effect.
[0182] Specifically, the processor 601 may include a central processing unit, or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0183] Memory 602 may include mass storage for data or instructions. For example, and not limitingly, memory 602 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 602 may include removable or non-removable (or fixed) media. Where appropriate, memory 602 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 602 is non-volatile solid-state memory.
[0184] In certain embodiments, the memory may include read-only memory, random access memory, disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0185] The processor 601 reads and executes computer program instructions stored in the memory 602 to implement any of the commodity purchasing methods in the above embodiments.
[0186] In one example, the electronic device may also include a communication interface 603 and a bus 610. As an example, such as... Figure 6 As shown, the processor 601, memory 602, and communication interface 603 are connected through bus 610 and complete communication with each other.
[0187] The communication interface 603 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0188] Bus 610 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an accelerated graphics port or other graphics bus, an enhanced industry standard architecture bus, a front-side bus, HyperTransport interconnect, an industry standard architecture bus, an unlimited bandwidth interconnect, a low pin count bus, a memory bus, a WeChat architecture bus, a peripheral component interconnect bus, a PCI-Express bus, a serial advanced technology accessory bus, a Video Electronics Standards Association local bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 610 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0189] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described product purchasing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0190] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0191] The functional blocks shown in the above structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory, flash memory, erasable read-only memory, floppy disks, read-only optical disk storage, optical disks, hard disks, fiber optic media, radio frequency links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0192] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0193] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0194] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for purchasing goods, characterized in that, Applied to self-service terminals, the methods include: Upon receiving a first operation, first output information associated with the target product is output, wherein the first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product, wherein the identification information of the self-service terminal includes the public key of the self-service terminal; The user terminal outputs second output information including a first signature. The first signature is a signature generated by the user terminal based on the first output information when the user terminal obtains the first output information and receives a payment operation. The payment operation is used to pay for the target product. The second output information is generated based on the first signature and the first output information. The first signature in the second output information is verified using the public key of the self-service terminal to obtain a first verification result, wherein the public key of the self-service terminal is associated with the self-service terminal; If the first verification result indicates that the first signature verification is successful, control the shipment of the target goods; Wherein, upon receiving the first operation, outputting first output information associated with the target product includes: Upon receiving the first operation, a first key is generated, which includes a first random key and a payment channel public key, wherein the payment channel public key is the public key corresponding to the payment application. The first random key is encrypted using the public key of the payment channel to obtain the first ciphertext, and the identification information of the self-service terminal and the purchase information of the target product are encrypted using the first random key to obtain the second ciphertext. The first output information is obtained based on the first ciphertext and the second ciphertext; Output the first output information associated with the target product; The process of generating the first signature is as follows: Upon receiving a payment request, the user terminal generates a second random key; The user terminal encrypts the second random key using the public key of the self-service terminal to generate a third ciphertext, and encrypts the payment order using the second random key to generate a fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product. The user terminal signs the third ciphertext and the fourth ciphertext using the payment channel private key to obtain the second signature; The user terminal sends the second signature, the third ciphertext, and the fourth ciphertext to the self-service terminal server, so that the self-service terminal server verifies the second signature based on the payment channel public key and obtains a second verification result. If the second verification result indicates that the second signature has been verified, the third ciphertext is decrypted based on the self-service terminal private key to obtain a second random key. The fourth ciphertext is then decrypted based on the second random key to obtain the payment order. A shipping instruction is generated based on the payment order. The shipping instruction is signed based on the self-service terminal private key to obtain the first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
2. A method for purchasing goods, characterized in that, Applied to user terminals, the methods include: Obtain first output information, the first output information including the identification information of the self-service terminal and the purchase information of the target product, the identification information of the self-service terminal including the public key of the self-service terminal, and the first output information being the output information generated by the self-service terminal in the process of executing the product purchase method according to claim 1; Upon receiving a payment operation, a first signature is generated based on the first output information. The first signature is a signature used by the user terminal to encrypt the first output information. The payment operation is used to pay for the target goods. Generate second output information based on the first signature and the first output information; The second output information is output to the self-service terminal so that the self-service terminal can control the shipment of the target product after verifying the first signature in the second output information through the self-service terminal public key. The first output information includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by encrypting a first random key with the public key of the payment channel, and the second ciphertext is obtained by encrypting the identification information of the self-service terminal and the purchase information of the target product with the first random key. After obtaining the first output information, the process further includes: The first ciphertext is decrypted using the payment channel private key to obtain the first random key, wherein the payment channel private key is the private key corresponding to the payment application. The second ciphertext is decrypted using the first random key to obtain the identification information of the self-service terminal and the purchase information of the target product; Upon receiving a payment operation, generating a first signature based on the first output information includes: Upon receiving a payment request, a second random key is generated; The second random key is encrypted using the public key of the self-service terminal to generate a third ciphertext, and the payment order is encrypted using the second random key to generate a fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product. The third ciphertext and the fourth ciphertext are signed using the payment channel private key to obtain the second signature; The second signature, the third ciphertext, and the fourth ciphertext are sent to the self-service terminal server, so that the self-service terminal server verifies the second signature based on the payment channel public key and obtains a second verification result. If the second verification result indicates that the second signature has been verified, the third ciphertext is decrypted based on the self-service terminal private key to obtain a second random key. The fourth ciphertext is then decrypted based on the second random key to obtain the payment order. A shipping instruction is generated based on the payment order. The shipping instruction is signed based on the self-service terminal private key to obtain the first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
3. A method for purchasing goods, characterized in that, Applied to the self-service terminal server, the methods include: Receive the second signature, third ciphertext, and fourth ciphertext sent by the user terminal; The second signature is verified using the payment channel public key to obtain a second verification result. The second verification result is used to indicate whether the second signature has been verified successfully. The payment channel public key is the public key corresponding to the payment application. If the second verification result indicates that the second signature verification is successful, the third ciphertext is decrypted using the private key of the self-service terminal to obtain the second random key; The payment order is obtained by decrypting the fourth ciphertext using the second random key. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product. A shipping instruction is generated based on the payment order; The shipping instruction is signed using the private key of the self-service terminal to obtain a first signature; The first signature is sent to the user terminal, so that the user terminal generates second output information based on the first signature and the first output information, and outputs the second output information to the self-service terminal, so that the self-service terminal controls the shipment of the target product after verifying the first signature in the second output information through the self-service terminal public key. The first output information includes the identification information of the self-service terminal and the purchase information of the target product. The identification information of the self-service terminal includes the self-service terminal public key. The first output information is the output information generated by the self-service terminal in the process of executing the product purchase method according to claim 1. The generation process of the second signature, the third ciphertext, and the fourth ciphertext is as follows: When the user terminal obtains the first output information and receives the payment operation, it generates a second random key; The user terminal encrypts the second random key using the public key of the self-service terminal to generate a third ciphertext, and encrypts the payment order using the second random key to generate a fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product. The user terminal signs the third ciphertext and the fourth ciphertext using the payment channel private key to obtain the second signature; The user terminal sends the second signature, the third ciphertext, and the fourth ciphertext to the self-service terminal server.
4. A commodity trading device, characterized in that, The device, applied to a self-service terminal, includes: An output module is configured to output first output information associated with a target product upon receiving a first operation, wherein the first operation is used to select the target product, and the first output information includes the identification information of the self-service terminal and the purchase information of the target product, wherein the identification information of the self-service terminal includes the public key of the self-service terminal. The acquisition module is used to acquire second output information including a first signature from the user terminal. The first signature is a signature generated by the user terminal based on the first output information when the user terminal acquires the first output information and receives a payment operation. The payment operation is used to pay for the target product. The second output information is generated based on the first signature and the first output information. The verification module is used to verify the first signature in the second output information using the public key of the self-service terminal to obtain a first verification result, wherein the public key of the self-service terminal is associated with the self-service terminal; The shipping module is used to control the shipping of the target goods when the first verification result indicates that the first signature verification is successful; The output module includes: The generation unit is configured to generate a first key upon receiving a first operation. The first key includes a first random key and a payment channel public key, wherein the payment channel public key is the public key corresponding to the payment application. The encryption unit is used to encrypt the first random key according to the public key of the payment channel to obtain the first ciphertext, and to encrypt the identification information of the self-service terminal and the purchase information of the target product according to the first random key to obtain the second ciphertext; and to obtain the first output information according to the first ciphertext and the second ciphertext. The output unit is used to output first output information associated with the target product; The process of generating the first signature is as follows: Upon receiving a payment request, the user terminal generates a second random key; The user terminal encrypts the second random key using the public key of the self-service terminal to generate a third ciphertext, and encrypts the payment order using the second random key to generate a fourth ciphertext. The payment order is generated based on the identification information of the self-service terminal and the purchase information of the target product. The user terminal signs the third ciphertext and the fourth ciphertext using the payment channel private key to obtain the second signature; The user terminal sends the second signature, the third ciphertext, and the fourth ciphertext to the self-service terminal server, so that the self-service terminal server verifies the second signature based on the payment channel public key and obtains a second verification result. If the second verification result indicates that the second signature has been verified, the third ciphertext is decrypted based on the self-service terminal private key to obtain a second random key. The fourth ciphertext is then decrypted based on the second random key to obtain the payment order. A shipping instruction is generated based on the payment order. The shipping instruction is signed based on the self-service terminal private key to obtain the first signature. The first signature is then sent to the user terminal. The second verification result is used to indicate whether the second signature has been verified.
Citation Information
Patent Citations
Method and system for transmitting data between terminal and server and sign-in and payment method
CN101964793A
Offline transaction method and device, storage medium and electronic equipment
CN114119000A