Two-dimensional code generation method and device for secure transaction, equipment and storage medium
By generating encrypted and dynamic QR codes in e-commerce and online payment systems, the security vulnerabilities and user experience problems of traditional passwords and SMS verification codes are solved, and transaction security and dynamic and effective QR codes are improved.
Patent Information
- Application Number
- CN202411210645.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-03
AI Technical Summary
The existing e-commerce and online payment systems rely on traditional passwords and SMS verification codes, which have problems such as leakage risks, security vulnerabilities and poor user experience. At the same time, the QR code generation method is insufficient dynamic, lacks multiple encryption protection and flexibility in effective time control. , affect transaction security.
Receive user requests through the service platform, generate preset project information and send it to the account management system, combine it into the real number of user card coupons for encryption, generate random IDs and combine them into original strings, perform AES algorithm encryption and BASE64 encoding, and generate dynamic two Rating code and set the preset valid duration to send it to the service platform to improve transaction security.
It improves transaction security in e-commerce and online payment, enhances the dynamicity and encryption protection of QR codes, realizes flexible and effective duration control, and improves user experience.
Smart Images

Figure CN119067665A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic commerce secure transaction, and in particular to a two-dimensional code generation method, device, equipment and storage medium for secure transaction. Background Art
[0002] In the rapid development of e-commerce and online payment, transaction security and user identity verification have become a crucial issue. With the popularity of mobile payment, cashless transactions and online shopping, how to ensure the authenticity and validity of each transaction, prevent fraud and protect the property safety of users has become one of the main challenges faced by major platforms and payment systems.
[0003] Currently, many e-commerce platforms and online payment systems mainly rely on traditional passwords and SMS verification codes for user identity authentication and transaction confirmation. However, these traditional methods have the following problems:
[0004] Passwords are easily compromised: Users often use simple and easy-to-remember passwords, which can be easily cracked or obtained through social engineering.
[0005] SMS verification codes have security vulnerabilities: SMS verification codes are vulnerable to man-in-the-middle attacks (MITM) and SIM card swap attacks (SIM swap), which can lead to the interception of verification codes and thus account theft.
[0006] Poor user experience: Frequent password input and verification code verification process is not only cumbersome, but also easily makes users feel bored, affecting the user experience.
[0007] In order to improve transaction security, QR code technology has gradually been applied to payment and transaction verification. QR code technology is easy to generate and difficult to forge, which can effectively improve transaction security and user experience. However, the existing QR code generation and verification methods still have certain shortcomings:
[0008] Lack of dynamism: Many QR codes are static and cannot change with time and transaction environment once generated, making them easy to be copied and abused.
[0009] Lack of multiple encryption protection: Some QR code generation methods lack sufficient encryption measures, making the QR code information easy to crack and tamper with.
[0010] Limited effective time control: The effective time control of the QR code is not flexible enough and cannot be dynamically adjusted according to specific transaction scenarios, affecting the security of transactions. Summary of the invention
[0011] The main purpose of the present invention is to provide a method, device, equipment and storage medium for generating a two-dimensional code for secure transactions, aiming to solve the technical problem of how to generate secure dynamic two-dimensional codes in e-commerce and online payments to improve the security of transactions.
[0012] To achieve the above object, the present invention provides a method for generating a two-dimensional code for secure transactions, the method comprising the following steps:
[0013] The service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user's login mobile phone number and the service source number;
[0014] The account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code;
[0015] The account management system generates a random ID, inserts a random obfuscation bit into the random ID, generates a target ID, and combines the target ID with the user account-bound voucher code into an original string according to a second preset combination rule;
[0016] The account management system encrypts and encodes the original character string to generate a dynamic QR code, wherein the dynamic QR code is set with a preset validity period, and the account management system sends the account-bound coupon code and the dynamic QR code to the service platform.
[0017] Optionally, after the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it also includes:
[0018] The service platform sends the dynamic QR code to a user interface, which is used to display the dynamic QR code for subsequent verification.
[0019] Optionally, after the service platform sends the dynamic QR code to the user interface, the method further includes:
[0020] When the service outlet verifies the dynamic QR code on the user interface, the service platform verifies the validity of the dynamic QR code and the voucher code bound to the account;
[0021] If the dynamic QR code and the account-bound coupon code are both valid, the cancellation is successful;
[0022] If the dynamic QR code and / or the account-bound coupon code are verified to be invalid, the verification fails.
[0023] Optionally, before the write-off is successful, it also includes:
[0024] The service platform requests the account management system to re-verify the validity of the dynamic QR code and the account-bound coupon code;
[0025] When it is verified again that both the dynamic QR code and the account-bound coupon code are valid, the cancellation is successful.
[0026] Optionally, the account management system encrypts and encodes the original string to generate a dynamic QR code, including:
[0027] The account management system performs AES algorithm encryption and BASE64 encoding on the original character string to generate the dynamic QR code.
[0028] Optionally, after the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it further includes:
[0029] When the service platform receives the user's request to regenerate the QR code, it notifies the account management system to regenerate a new dynamic QR code and returns it to the service platform.
[0030] Optionally, the account management system generates a random ID, including:
[0031] The account management system generates a random ID through a snowflake algorithm, a UUID algorithm or a timestamp algorithm.
[0032] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a two-dimensional code generation device for secure transactions, the two-dimensional code generation device for secure transactions comprising:
[0033] User request processing module: the service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user login mobile phone number and the service source number;
[0034] An account-bound voucher code generation module, wherein the account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account-bound voucher code;
[0035] A random ID generation module, wherein the account management system generates a random ID, inserts a random confusion bit into the random ID, generates a target ID, and combines the target ID with the user account binding voucher code into an original string according to a second preset combination rule;
[0036] The dynamic QR code generation module, the account management system encrypts and encodes the original string to generate a dynamic QR code, the dynamic QR code is set with a preset validity period, and the account management system sends the account binding coupon code and the dynamic QR code to the service platform.
[0037] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a QR code generation device for secure transactions, the QR code generation device for secure transactions comprising a memory, a processor, and a QR code generation program for secure transactions stored in the memory and executable on the processor, the QR code generation program for secure transactions implementing the steps of the QR code generation method for secure transactions as described above when executed by the processor.
[0038] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a QR code generation program for secure transactions is stored, and when the QR code generation program for secure transactions is executed by a processor, the steps of the QR code generation method for secure transactions as described above are implemented.
[0039] The present invention receives a user's service purchase request through a service platform, generates preset project information and sends it to an account management system, wherein the preset project information includes a card voucher code, a user login mobile phone number and a service source number; the account management system combines the preset project information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code; the account management system generates a random ID, inserts a random confusion bit into the random ID, generates a target ID, and combines the target ID and the user account binding voucher code into an original string according to a second preset combination rule; the account management system encrypts and encodes the original string, generates a dynamic QR code, and the dynamic QR code is set with a preset effective time; the account management system sends the account binding voucher code and the dynamic QR code to the service platform. The present invention improves the transaction security in e-commerce and online payment. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the structure of the device hardware operating environment involved in the embodiment of the two-dimensional code generating device for secure transactions of the present invention;
[0041] Figure 2 It is a flowchart of a first embodiment of a method for generating a two-dimensional code for secure transactions according to the present invention;
[0042] Figure 3 It is a functional module diagram of a preferred embodiment of a two-dimensional code generating device for secure transactions of the present invention.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] It should be noted that in the rapid development of e-commerce and online payments, transaction security and user identity verification have become a crucial issue. With the popularity of mobile payments, cashless transactions and online shopping, how to ensure the authenticity and validity of each transaction, prevent fraud and protect the property safety of users has become one of the main challenges faced by major platforms and payment systems.
[0046] Currently, many e-commerce platforms and online payment systems mainly rely on traditional passwords and SMS verification codes for user identity authentication and transaction confirmation. However, these traditional methods have the following problems:
[0047] Passwords are easily compromised: Users often use simple and easy-to-remember passwords, which can be easily cracked or obtained through social engineering.
[0048] SMS verification codes have security vulnerabilities: SMS verification codes are vulnerable to man-in-the-middle attacks (MITM) and SIM card swap attacks (SIM swap), which can lead to the interception of verification codes and thus account theft.
[0049] Poor user experience: Frequent password input and verification code verification process is not only cumbersome, but also easily makes users feel bored, affecting the user experience.
[0050] In order to improve transaction security, QR code technology has gradually been applied to payment and transaction verification. QR code technology is easy to generate and difficult to forge, which can effectively improve transaction security and user experience. However, the existing QR code generation and verification methods still have certain shortcomings:
[0051] Lack of dynamism: Many QR codes are static and cannot change with time and transaction environment once generated, making them easy to be copied and abused.
[0052] Lack of multiple encryption protection: Some QR code generation methods lack sufficient encryption measures, making the QR code information easy to crack and tamper with.
[0053] Limited effective time control: The effective time control of the QR code is not flexible enough and cannot be dynamically adjusted according to specific transaction scenarios, affecting the security of transactions.
[0054] Based on the above defects, the present invention provides a two-dimensional code generation device for secure transactions, referring to Figure 1 , Figure 1 It is a schematic diagram of the structure of the device hardware operating environment involved in the embodiment of the two-dimensional code generation device for secure transactions of the present invention.
[0055] like Figure 1 As shown, the two-dimensional code generating device for secure transactions may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0056] Those skilled in the art will understand that Figure 1 The hardware structure of the two-dimensional code generating device for secure transactions shown in the figure does not constitute a limitation of the two-dimensional code generating device for secure transactions, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0057] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a two-dimensional code generation program for secure transactions. The operating system is a program for managing and controlling the two-dimensional code generation device and software resources for secure transactions, and supports the operation of the network communication module, the user interface module, the two-dimensional code generation program for secure transactions, and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.
[0058] exist Figure 1 In the hardware structure of the QR code generating device for secure transactions shown in the figure, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client and perform data communication with the client; the processor 1001 can call the QR code generating program for secure transactions stored in the memory 1005 and perform the following operations:
[0059] The service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user's login mobile phone number and the service source number;
[0060] The account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code;
[0061] The account management system generates a random ID, inserts a random obfuscation bit into the random ID, generates a target ID, and combines the target ID with the user account-bound voucher code into an original string according to a second preset combination rule;
[0062] The account management system encrypts and encodes the original character string to generate a dynamic QR code, wherein the dynamic QR code is set with a preset validity period, and the account management system sends the account-bound coupon code and the dynamic QR code to the service platform.
[0063] Furthermore, after the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it also includes:
[0064] The service platform sends the dynamic QR code to a user interface, which is used to display the dynamic QR code for subsequent verification.
[0065] Furthermore, after the service platform sends the dynamic QR code to the user interface, it also includes:
[0066] When the service outlet verifies the dynamic QR code on the user interface, the service platform verifies the validity of the dynamic QR code and the voucher code bound to the account;
[0067] If the dynamic QR code and the account-bound coupon code are both valid, the cancellation is successful;
[0068] If the dynamic QR code and / or the account-bound coupon code are verified to be invalid, the verification fails.
[0069] Furthermore, before the write-off is successful, it also includes:
[0070] The service platform requests the account management system to re-verify the validity of the dynamic QR code and the account-bound coupon code;
[0071] When it is verified again that both the dynamic QR code and the account-bound coupon code are valid, the cancellation is successful.
[0072] Furthermore, the account management system encrypts and encodes the original string to generate a dynamic QR code, including:
[0073] The account management system performs AES algorithm encryption and BASE64 encoding on the original character string to generate the dynamic QR code.
[0074] Furthermore, after the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it also includes:
[0075] When the service platform receives the user's request to regenerate the QR code, it notifies the account management system to regenerate a new dynamic QR code and returns it to the service platform.
[0076] Furthermore, the account management system generates a random ID, including:
[0077] The account management system generates a random ID through a snowflake algorithm, a UUID algorithm or a timestamp algorithm.
[0078] The specific implementation of the two-dimensional code generation device for secure transactions of the present invention is basically the same as the various embodiments of the two-dimensional code generation method for secure transactions described below, and will not be repeated here.
[0079] The present invention also provides a two-dimensional code generation method for secure transactions based on the two-dimensional code generation device for secure transactions.
[0080] Reference Figure 2 , Figure 2 It is a flowchart of the first embodiment of the method for generating a two-dimensional code for secure transactions according to the present invention.
[0081] The embodiments of the present invention provide an embodiment of a method for generating a QR code for secure transactions. It should be noted that, although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown here.
[0082] The two-dimensional code generation method for secure transactions includes:
[0083] Step S10, the service platform receives the user's service purchase request, generates preset item information and sends it to the account management system, wherein the preset item information includes the card code, the user login mobile phone number and the service source number;
[0084] In the rapid development of e-commerce and online payment, transaction security and user identity verification have become a crucial issue. With the popularity of mobile payment, cashless transactions and online shopping, how to ensure the authenticity and validity of each transaction, prevent fraud and protect the property safety of users has become one of the main challenges faced by major platforms and payment systems.
[0085] Currently, many e-commerce platforms and online payment systems mainly rely on traditional passwords and SMS verification codes for user identity authentication and transaction confirmation. However, these traditional methods have the following problems:
[0086] Passwords are easily compromised: Users often use simple and easy-to-remember passwords, which can be easily cracked or obtained through social engineering.
[0087] SMS verification codes have security vulnerabilities: SMS verification codes are vulnerable to man-in-the-middle attacks (MITM) and SIM card swap attacks (SIM swap), which can lead to the interception of verification codes and thus account theft.
[0088] Poor user experience: Frequent password input and verification code verification process is not only cumbersome, but also easily makes users feel bored, affecting the user experience.
[0089] In order to improve transaction security, QR code technology has gradually been applied to payment and transaction verification. QR code technology is easy to generate and difficult to forge, which can effectively improve transaction security and user experience. However, the existing QR code generation and verification methods still have certain shortcomings:
[0090] Lack of dynamism: Many QR codes are static and cannot change with time and transaction environment once generated, making them easy to be copied and abused.
[0091] Lack of multiple encryption protection: Some QR code generation methods lack sufficient encryption measures, making the QR code information easy to crack and tamper with.
[0092] Limited effective time control: The effective time control of the QR code is not flexible enough and cannot be dynamically adjusted according to specific transaction scenarios, affecting the security of transactions.
[0093] In this embodiment, the explanation of relevant technical features is as follows:
[0094] The service platform receives the user's service purchase request: refers to the service platform receiving the purchase request submitted by the user through its interface or API. The user request may include detailed information on the purchased goods or services.
[0095] Generate preset item information and send it to the account management system: After the service platform processes the user's purchase request, it generates preset item information containing transaction-related information and sends this information to the account management system for further processing.
[0096] Preset item information includes card voucher code, user login mobile phone number and service source number: Preset item information refers to a set of information used to identify and process transactions, including: Card voucher code: a unique number used to identify the card voucher purchased by the user. User login mobile phone number: the mobile phone number used by the user to log in to the platform, which is used for user identity verification and contact. Service source number: information that identifies the specific service source or provider purchased by the user.
[0097] A specific implementation method may be: a user submits a purchase request through a service platform (such as a mobile application or a web page). This request may include the selected service or product, quantity, and other relevant information.
[0098] After receiving the user's purchase request, the service platform generates a set of preset item information, which may include the card code, the user's login mobile phone number and the service source number.
[0099] Card code: The system generates a unique card code for each purchase request to identify the card in the transaction.
[0100] User login mobile phone number: The system records the mobile phone number used by the user when submitting a purchase request for subsequent verification and notification.
[0101] Service source number: identifies the source that provides the service, such as a specific merchant or service provider.
[0102] In addition, the specific content of the preset project information may vary according to different transaction types and application scenarios. In addition to the card code, user login mobile phone number and service source number, the preset project information may also include the following:
[0103] Transaction amount: records the amount of this transaction, which is used for subsequent settlement and accounting processing. Example: If the transaction amount is 100 yuan, the preset item information includes the transaction amount: 100 yuan.
[0104] Transaction time: Record the specific time when the transaction occurs, which is convenient for tracking and verification of the transaction. Example: If the transaction time is 10:30 on August 12, 2023, the preset project information includes the transaction time: 2023-08-12 10:30.
[0105] User ID: An ID that uniquely identifies a user, used for user identity authentication and transaction records. Example: If the user ID is 12345, the preset project information contains user ID: 12345.
[0106] Product or service ID: Identifies the specific product or service purchased by the user, and is used for subsequent order processing and service provision. Example: If the product ID is A001, the preset project information contains product ID: A001.
[0107] Transaction status: records the current status of the transaction (such as processing, completed, canceled, etc.) to facilitate transaction management and query. Example: If the transaction status is processing, the preset project information includes transaction status: processing.
[0108] Discount information: records the discount information enjoyed by the user (such as discounts, coupons, etc.), which is used for discount calculation during settlement. Example: If the user enjoys a 10% discount, the preset item information contains the discount information: 10% discount.
[0109] Payment method: Record the payment method selected by the user (such as credit card, Alipay, WeChat Pay, etc.) to facilitate payment processing. Example: If the payment method is Alipay, the preset project information includes payment method: Alipay.
[0110] After generating the preset project information, the service platform sends the information to the account management system via API or other data transmission methods.
[0111] Example description:
[0112] User A purchased a gas card worth 100 yuan through a mobile application. The specific implementation steps are as follows:
[0113] User request submission: User A chooses to purchase a 100 yuan gas card in the application and submits a purchase request.
[0114] Generate preset item information: After receiving the purchase request from user A, the application generates the following preset item information:
[0115] Card code: for example, C100A20230812 (indicates a 100 yuan gas card generated on August 12, 2023)
[0116] User login mobile phone number: for example, 13800138000
[0117] Service source number: for example, S001 (indicates a gas station)
[0118] Send the preset project information to the account management system: The application sends the above preset project information to the account management system through the API:
[0119] {
[0120] "Card Code":"C100A20230812",
[0121] "User login phone number":"13800138000",
[0122] "Service Source Number":"S001"
[0123] }.
[0124] Through the above steps, the service platform can effectively receive users' purchase requests, generate preset item information including card code, user login mobile phone number and service source number, and send this information to the account management system to provide basic data for subsequent transaction processing and QR code generation.
[0125] Step S20, the account management system combines the preset item information into the user card voucher real number according to the first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code;
[0126] In this embodiment, the account management system combines the preset item information (such as the card coupon code, the user login mobile phone number and the service source number) according to the first preset combination rule to generate the user card coupon real number.
[0127] The first preset combination rule can be a simple string connection, such as user card coupon real number = card coupon code + user login mobile phone number + service source number. For example, the card coupon code is C100A20230812, the user login mobile phone number is 13800138000, and the service source number is S001, then the user card coupon real number is C100A2023081213800138000S001.
[0128] The first preset combination rule may also be a hash function rule, which combines the preset item information and generates a hash value of fixed length through a hash function. For example, the real number of the user's card coupon = hash (card coupon code + user login mobile phone number + service source number).
[0129] Encrypt the generated real number of the user card voucher to ensure the security of the information. The encryption method can be encrypted using encryption algorithms such as RSA encryption algorithm, ChaCha20 encryption algorithm, AES algorithm, etc. Various encryption methods can be selected according to specific needs and security requirements. For example, encryption algorithm: AES-256; key: system preset or dynamically generated key; encryption steps: use AES-256 encryption algorithm and preset key to encrypt the real number of the user card voucher. The encrypted data may be unreadable binary data. Example: Encryption input: C100A2023081213800138000S001; key: MySecretKey123456; encryption output: [unreadable binary data].
[0130] Encode the encrypted binary data to make it a readable string for easy transmission and storage. You can use various encoding methods such as BASE64 encoding, HEX encoding (hexadecimal encoding), URL encoding, ASCII encoding, etc. For example, use the BASE64 encoding algorithm to encode the encrypted binary data to generate a readable BASE64 string. Example: Encrypted output (unreadable binary data): [unreadable binary data]; BASE64 encoding output: U2FsdGVkX19++NKSYIVsAQ==.
[0131] The encoded string is used as the voucher code for the user account, and is associated with the user account for subsequent transaction verification and cancellation. For example, the voucher code for the user account is:
[0132] U2FsdGVkX19++NKSYIVsAQ==.
[0133] Example description:
[0134] User A purchased a gas card worth 100 yuan through a mobile app. The specific implementation steps are as follows:
[0135] Combined preset item information: The preset item information is: card code: C100A20230812; user login mobile phone number: 13800138000; service source number: S001.
[0136] The real number of the user's card is: C100A2023081213800138000S001.
[0137] Encrypt the real ID number of the user's card or voucher: Use the AES-256 encryption algorithm and the preset key MySecretKey123456 to encrypt C100A2023081213800138000S001 to generate ciphertext.
[0138] Encode the encrypted number: Use BASE64 encoding to encode the encrypted ciphertext and generate the encoded string U2FsdGVkX19++NKSYIVsAQ==.
[0139] Generate a user account binding voucher code: User account binding voucher code: U2FsdGVkX19++NKSYIVsAQ==.
[0140] The account management system combines the preset item information into the real number of the user's card voucher according to the preset combination rules, encrypts and encodes it, and generates a unique and secure user account binding voucher code. This voucher code is used to identify the specific card voucher or service purchased by the user and is associated with the user's account to ensure the security and traceability of the transaction.
[0141] Step S30, the account management system generates a random ID, inserts a random obfuscation bit into the random ID, generates a target ID, and combines the target ID with the user account binding voucher code into an original string according to a second preset combination rule;
[0142] In this embodiment, random ID refers to a unique identifier generated in the system to identify each transaction, operation or record. Random ID ensures that the ID generated at different times, places or devices is unique to avoid conflicts and duplications. The account management system generates a random ID to identify the unique identifier in the transaction process. The generation algorithm can be: snowflake algorithm, UUID algorithm or timestamp algorithm, etc. Example: Random ID generated using snowflake algorithm. Random ID: 1288834974657.
[0143] In order to increase the complexity and unpredictability of random IDs, random obfuscation bits are inserted into the generated random IDs. Random obfuscation bits are a technique used to increase the complexity and unpredictability of data by inserting randomly generated characters or numbers at specific locations to increase the randomness and security of data. This method can effectively prevent the ID from being easily predicted or reversed when generating a unique identifier (such as an ID generated by a snowflake algorithm).
[0144] You can randomly select positions to insert specific characters or numbers, or insert random confusion bits into the generated random ID at certain intervals to increase the unpredictability of the ID. For example, the original random ID (binary): 10010101110111101101000001001000011001;
[0146] After inserting the confusion bit every 4 bits (binary):
[0147] 1001X0101Y1101Z1110110A1000001B01000011001C;
[0148] The inserted obfuscation bits are X, Y, Z, A, B, C. The ID after the obfuscation bits are inserted is the target ID, which is used for subsequent combinations.
[0149] Combine the target ID and the user account binding voucher code into an original string according to the second preset combination rule. The second preset combination rule can be the same as the first preset combination rule, or a combination method different from the first preset combination rule. For example, the original string = target ID + "-" + user account binding voucher code. Example: target ID: 1288X834Y974Z657A; user account binding voucher code: U2FsdGVkX19++NKSYIVsAQ==; original string:
[0150] 1288X834Y974Z657A-U2FsdGVkX19++NKSYIVsAQ==.
[0151] Example description:
[0152] User A purchased a gas card worth 100 yuan through a mobile app. The specific implementation steps are as follows:
[0153] Generate random ID: Use the snowflake algorithm to generate a random ID: 1288834974657.
[0154] Insert random confusion bits at regular intervals:
[0155] Original random ID (binary): 10010101110111101101000001001000011001;
[0156] After inserting the obfuscation bits (binary):
[0157] 1001X0101Y1101Z1110110A1000001B01000011001C;
[0158] After inserting the obfuscation bits (hex): 1288X834Y974Z657A.
[0159] Generate a target ID:
[0160] Target ID: 1288X834Y974Z657A
[0161] Combine the target ID and the user account binding coupon code to generate the original string:
[0162] User account binding coupon code: U2FsdGVkX19++NKSYIVsAQ==;
[0163] Original string: 1288X834Y974Z657A-U2FsdGVkX19++NKSYIVsAQ==.
[0164] The account management system generates a random ID, inserts random confusion bits to form a target ID, and combines it with the coupon code bound to the user account into an original string according to preset rules. This enhances the uniqueness and unpredictability of the data, prevents forgery and tampering, improves security and system flexibility, and adapts to the high concurrency requirements of distributed environments.
[0165] In step S40, the account management system encrypts and encodes the original string to generate a dynamic QR code, wherein the dynamic QR code is set with a preset validity period, and the account management system sends the account-bound coupon code and the dynamic QR code to the service platform.
[0166] In this embodiment, setting a preset validity period refers to setting a preset validity period for the generated dynamic QR code to ensure that the QR code is valid within a specific time and automatically becomes invalid after expiration to prevent malicious use.
[0167] The original string is encrypted and encoded. The encryption and encoding method can be the same as the encryption and encoding method of the user's card and voucher real number, or a different encryption or encoding method can be used. For example, the original string is encrypted using the AES-256 encryption algorithm. The encrypted data is encoded using the BASE64 encoding algorithm to generate a readable string. For example, the original string: 1288A834B974C657D-U2FsdGVkX19++NKSYIVsAQ==; after encryption (AES-256): [unreadable binary data]; after encoding (BASE64): QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0168] You can use a QR code generation library (such as Python's qrcode library) to generate a dynamic QR code from the encoded string and store the dynamic QR code in the REDIS cache. For example, the dynamic QR code content: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0169] Set a preset validity period for the generated dynamic QR code, such as 2 minutes. The QR code will automatically become invalid after the validity period expires.
[0170] The account management system will send the account-bound coupon code and dynamic QR code to the service platform through API or other means. The service platform receives and stores this data in the database for subsequent transaction verification and processing. For example, {
[0171] "Account binding coupon code":"U2FsdGVkX19++NKSYIVsAQ==",
[0172] "Dynamic QR code":"QmFzZTY0RW5jb2RlZFN0cmluZw=="
[0173] }.
[0174] Example description:
[0175] User A purchased a gas card worth 100 yuan through a mobile app. The specific implementation steps are as follows:
[0176] Encrypt and encode the original string:
[0177] Original string: 1288A834B974C657D-U2FsdGVkX19++NKSYIVsAQ==;
[0178] After encryption (AES-256): [unreadable binary data];
[0179] After encoding (BASE64): QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0180] Generate dynamic QR code:
[0181] Dynamic QR code content: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0182] Set the preset effective time: Preset effective time: 2 minutes
[0183] Send account binding coupon code and dynamic QR code:
[0184] Account binding coupon code: U2FsdGVkX19++NKSYIVsAQ==;
[0185] Dynamic QR code:QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0186] JSON data sent to the service platform:
[0187] {
[0188] "Account binding coupon code":"U2FsdGVkX19++NKSYIVsAQ==",
[0189] "Dynamic QR code":"QmFzZTY0RW5jb2RlZFN0cmluZw=="
[0190] }.
[0191] The account management system can encrypt and encode the original string, generate a dynamic QR code, set a preset validity period, and send the account-bound coupon code and the dynamic QR code to the service platform. This not only improves the security and uniqueness of the transaction, but also ensures the validity of the QR code within a specific time to prevent malicious use.
[0192] The present invention receives a user's service purchase request through a service platform, generates preset project information and sends it to an account management system, wherein the preset project information includes a card voucher code, a user login mobile phone number and a service source number; the account management system combines the preset project information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code; the account management system generates a random ID, inserts a random confusion bit into the random ID, generates a target ID, and combines the target ID and the user account binding voucher code into an original string according to a second preset combination rule; the account management system encrypts and encodes the original string, generates a dynamic QR code, and the dynamic QR code is set with a preset effective time; the account management system sends the account binding voucher code and the dynamic QR code to the service platform. The present invention improves the transaction security in e-commerce and online payment.
[0193] Furthermore, a second embodiment of the method for generating a two-dimensional code for secure transactions according to the present invention is proposed. After the above step S40, the method further includes:
[0194] In step a1, the service platform sends the dynamic QR code to a user interface, and the user interface is used to display the dynamic QR code for subsequent verification.
[0195] In this embodiment, the account management system generates an account-bound coupon code and a dynamic QR code, and sends the account-bound coupon code and the dynamic QR code to the service platform via an API or other data transmission method.
[0196] The service platform receives the data sent by the account management system. It parses and processes the data and prepares to send the dynamic QR code to the user interface. The dynamic QR code can be converted into a QR code image using a QR code generation library (such as Python's qrcode library), which is more convenient for display in the user interface.
[0197] The service platform sends the dynamic QR code to the user interface (such as a mobile application or web page) through an API or other data transmission method. The user interface receives the dynamic QR code data. After receiving the dynamic QR code data, the user interface displays it. The user can see the dynamic QR code on the mobile application or web page for subsequent transaction verification or write-off.
[0198] Example description:
[0199] User B purchased a 50-yuan restaurant coupon on an e-commerce website. The specific implementation steps are as follows:
[0200] The account management system sends the account binding coupon code and dynamic QR code:
[0201] Account binding coupon code: QmFzZTY0RW5jb2RlZFN0cmluZw==;
[0202] Dynamic QR code: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0203] JSON data sent to the service platform:
[0204] {
[0205] "Account binding coupon code":"QmFzZTY0RW5jb2RlZFN0cmluZw==",
[0206] "Dynamic QR code":"QmFzZTY0RW5jb2RlZFN0cmluZw=="
[0207] }.
[0208] The service platform receives and processes the data: After receiving the data, the service platform parses and processes it, and prepares to send the dynamic QR code to the user interface.
[0209] The service platform sends the dynamic QR code to the web page through the API:
[0210] {
[0211] "Dynamic QR code":"QmFzZTY0RW5jb2RlZFN0cmluZw=="
[0212] }.
[0213] The user interface displays a dynamic QR code: Users see a dynamic QR code on the web page for subsequent transaction verification or settlement.
[0214] The displayed dynamic QR code content: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0215] In addition, the user interface may also display a QR code image generated by a dynamic QR code, which is more convenient for verification.
[0216] Through the above steps, this embodiment can send the generated account binding coupon code and dynamic QR code to the service platform. After receiving and processing these data, the service platform sends the dynamic QR code to the user interface so that the user can use it during the transaction verification or cancellation process, thereby ensuring the security and convenience of the transaction.
[0217] Furthermore, a third embodiment of the method for generating a two-dimensional code for secure transactions of the present invention is proposed. In the above step a1, after the service platform sends the dynamic two-dimensional code to the user interface, the method further includes:
[0218] Step b1, when the service outlet verifies the dynamic QR code of the user interface, the service platform verifies the validity of the dynamic QR code and the voucher code bound to the account;
[0219] Step b2: If both the dynamic QR code and the account-bound coupon code are verified to be valid, the cancellation is successful;
[0220] Step b3: If the dynamic QR code and / or the account-bound coupon code are verified to be invalid, the verification fails.
[0221] In this embodiment, when the service outlet scans or reads the dynamic QR code displayed on the user interface, the cancellation operation is performed. After receiving the cancellation request from the service outlet, the service platform verifies the validity of the dynamic QR code and the account-bound voucher code. If both the dynamic QR code and the account-bound voucher code are verified to be valid, the cancellation is successful. If the dynamic QR code and / or the account-bound voucher code are verified to be invalid, the cancellation fails.
[0222] A specific implementation method may be: a user arrives at a service point and displays a dynamic QR code displayed on a mobile application or web page. The service point uses a code scanning device or application to scan the dynamic QR code on the user interface to obtain the QR code content. For example, the service point scans the dynamic QR code and obtains the content: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0223] The service outlet sends the scanned dynamic QR code content to the service platform for verification. After receiving the request, the service platform parses the dynamic QR code content and compares it with the account-bound coupon code in the database for verification.
[0224] The service platform determines whether the write-off is successful or failed based on the verification results:
[0225] Successful cancellation: If both the dynamic QR code and the voucher code bound to the account are valid and within the validity period, a successful cancellation message will be returned to complete the transaction.
[0226] Verification failure: If the verification dynamic QR code and / or account-bound coupon code is invalid, the verification failure message will be returned and the transaction will not be completed.
[0227] Example description:
[0228] Example 1: User A arrives at a gas station and displays a dynamic QR code in a mobile app. The gas station staff uses a code scanning device to scan the dynamic QR code and obtain the QR code content.
[0229] The gas station system sends the scanned QR code content to the service platform. After receiving the request, the service platform parses the QR code content and verifies the match with the voucher code bound to the account.
[0230] Verify that the dynamic QR code and the account-bound coupon code are both valid and within the validity period, and the service platform returns a successful cancellation message. The gas station staff confirms the successful cancellation and completes the transaction.
[0231] Example 2: User B arrives at a restaurant and displays a dynamic QR code on the web page. The restaurant staff uses a code scanning device to scan the dynamic QR code and obtain the QR code content.
[0232] The restaurant system sends the scanned QR code content to the service platform. After receiving the request, the service platform parses the QR code content and verifies the match with the voucher code bound to the account.
[0233] The dynamic QR code or account-bound coupon code is invalid, and the service platform returns a verification failure message. The restaurant staff notifies user B that the verification has failed and that a new QR code needs to be generated.
[0234] Through the above steps, this embodiment can effectively verify the validity of the dynamic QR code and the account-bound coupon code, and determine the success or failure of the cancellation based on the verification result. This not only ensures the security and reliability of the transaction, but also improves the user experience.
[0235] Furthermore, a fourth embodiment of the method for generating a two-dimensional code for secure transactions according to the present invention is proposed. In the above step b2, before the verification is successful, the following steps are further included:
[0236] Step c1, the service platform requests the account management system to re-verify the validity of the dynamic QR code and the account-bound coupon code;
[0237] Step c2: When it is verified again that both the dynamic QR code and the account-bound coupon code are valid, the cancellation is successful.
[0238] In this embodiment, after the user arrives at the service point, the dynamic QR code displayed on the mobile application or web page is displayed. The service point uses a code scanning device or application to scan the dynamic QR code on the user interface to obtain the QR code content.
[0239] The service outlet sends the scanned dynamic QR code content to the service platform. The service platform first performs a preliminary verification to check whether the dynamic QR code and the account-bound coupon code are valid.
[0240] After the initial verification is successful, the service platform sends a request to the account management system, requesting re-verification of the validity of the dynamic QR code and the account-bound coupon code.
[0241] After receiving the request from the service platform, the account management system parses the dynamic QR code and account-bound coupon code, and compares them with the information in the database to verify their validity.
[0242] The service platform determines whether the write-off is successful or unsuccessful based on the verification results of the account management system:
[0243] Successful cancellation: When both the service platform and the account management system verify that the dynamic QR code and the account-bound coupon code are valid, the service platform returns a successful cancellation message to complete the transaction.
[0244] Verification failure: If the verification dynamic QR code and / or account-bound coupon code is invalid, the service platform returns a verification failure message and the transaction is not completed.
[0245] Example description:
[0246] User A arrives at a gas station and displays the dynamic QR code in the mobile app. The gas station staff uses a code scanning device to scan the dynamic QR code and obtain the QR code content.
[0247] The gas station system sends the scanned QR code content to the service platform. After receiving the request, the service platform first performs a preliminary verification to check whether the dynamic QR code and the account-bound coupon code are valid.
[0248] After the initial verification is successful, the service platform sends a request to the account management system, requesting re-verification of the validity of the dynamic QR code and the account-bound coupon code.
[0249] After receiving the request, the account management system parses the QR code content and verifies the match with the account-bound coupon code in the database.
[0250] Verify that the dynamic QR code and the account-bound coupon code are both valid, and the service platform returns a successful cancellation message. The gas station staff confirms the successful cancellation and completes the transaction.
[0251] Through the above steps, this embodiment adds a layer of verification mechanism, thereby improving the anti-counterfeiting and anti-tampering capabilities of the system.
[0252] Furthermore, a fifth embodiment of the method for generating a QR code for secure transactions of the present invention is proposed. In the above step S40, the account management system encrypts and encodes the original string to generate a dynamic QR code, including:
[0253] In step d1, the account management system performs AES algorithm encryption and BASE64 encoding on the original string to generate the dynamic QR code.
[0254] In this embodiment, the account management system generates an original string, for example: original string: 1288A834B974C657D-U2FsdGVkX19++NKSYIVsAQ==.
[0255] The original string is encrypted using the AES-256 encryption algorithm. The encryption key can be a system preset or dynamically generated key.
[0256] Example: Raw string:
[0257] 1288A834B974C657D-U2FsdGVkX19++NKSYIVsAQ==;
[0258] After encryption (AES-256): [Unreadable binary data].
[0259] Perform BASE64 encoding on the AES encrypted binary data to generate a readable BASE64 string. This encoded string will be used to generate a dynamic QR code.
[0260] Example: After encryption (AES-256): [unreadable binary data];
[0261] After BASE64 encoding: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0262] Use a QR code generation tool or library (such as Python's qrcode library) to generate a QR code image from the BASE64-encoded string. The generated QR code image is a dynamic QR code.
[0263] Example description:
[0264] Original string: 1288A834B974C657D-U2FsdGVkX19++NKSYIVsAQ==.
[0265] AES algorithm encryption: Use the AES-256 algorithm to encrypt the original string and generate unreadable binary data.
[0266] BASE64 encoding: Perform BASE64 encoding on the AES encrypted binary data to generate the string: QmFzZTY0RW5jb2RlZFN0cmluZw==.
[0267] Generate dynamic QR code: Use the QR code generation library to generate a QR code image from the BASE64-encoded string as a dynamic QR code.
[0268] Through the above steps, this embodiment can perform AES algorithm encryption and BASE64 encoding on the original string to generate a dynamic QR code. This process ensures that the generated QR code has a high degree of security and uniqueness, and is suitable for various transaction verification and write-off scenarios.
[0269] Furthermore, a sixth embodiment of the method for generating a two-dimensional code for secure transactions according to the present invention is proposed. After the above step S40, the method further includes:
[0270] Step e1, when the service platform receives a request from the user to regenerate a QR code, it notifies the account management system to regenerate a new dynamic QR code and returns it to the service platform.
[0271] In this embodiment, the user sends a request to regenerate the QR code through a mobile application or a web page, for example, because the QR code has expired or the QR code information is incorrect.
[0272] The service platform receives the user's request to regenerate the QR code. The service platform sends a notification to the account management system, requesting to regenerate a new dynamic QR code.
[0273] After receiving the notification from the service platform, the account management system parses the request information. Generates a new dynamic QR code based on the account-bound coupon code. Returns the newly generated dynamic QR code to the service platform. For example, the new dynamic QR code content: QmFzZTY0RW5jb2RlZFN0cmluZw==(new QR code after BASE64 encoding).
[0274] The service platform receives the new dynamic QR code returned by the account management system. The service platform sends the new dynamic QR code to the user interface (such as a mobile application or a web page). The user interface displays the new dynamic QR code for the user to use.
[0275] Example description:
[0276] User A finds that the dynamic QR code has expired and sends a request to regenerate the QR code through the mobile application. After receiving the request from user A, the service platform parses the request information and sends a notification to the account management system to regenerate the QR code. The account management system generates a new dynamic QR code based on the account-bound coupon code and other information. The account management system returns the newly generated dynamic QR code to the service platform. After receiving the new dynamic QR code, the service platform sends it to the mobile application. The mobile application displays the new dynamic QR code and user A can continue to use it.
[0277] Through the above steps, this embodiment can timely notify the account management system to regenerate a new dynamic QR code, return it to the service platform, and finally display it on the user interface. This process not only improves the flexibility of the system and user experience, but also ensures the continuity and security of transactions.
[0278] Furthermore, a seventh embodiment of the method for generating a QR code for secure transactions of the present invention is proposed. In the above step S30, the account management system generates a random ID, including:
[0279] Step f1, the account management system generates a random ID through a snowflake algorithm, a UUID algorithm or a timestamp algorithm.
[0280] In this embodiment, the account management system may generate a random ID using a snowflake algorithm, a UUID algorithm, or a timestamp algorithm.
[0281] Snowflake is a distributed ID generation algorithm that generates a unique 64-bit ID through a timestamp, machine ID, and serial number. The ID generated by the Snowflake algorithm has time sequence and global uniqueness, and is suitable for highly concurrent distributed systems. For example, the generated random ID is: 1288834974657.
[0282] UUID (Universally Unique Identifier) is a 128-bit identifier generated by timestamp, node ID and random number. UUID is highly unique and suitable for a wide range of application scenarios. It is not dependent on a specific machine or data center. For example, the generated random ID is: 550e8400-e29b-41d4-a716-446655440000.
[0283] The timestamp algorithm generates a unique ID using the current timestamp. The account management system obtains the current precise time (for example, millisecond timestamp) as a random ID. The timestamp algorithm is simple and efficient, and is suitable for generating time-related unique identifiers. For example, the generated random ID is: 1627549200123.
[0284] Through the above steps, this embodiment can generate a random ID through a snowflake algorithm, a UUID algorithm or a timestamp algorithm. These algorithms have their own advantages and are suitable for different application scenarios, ensuring that the generated ID is unique and secure, and meeting the requirements of high concurrency and distributed environments of the system.
[0285] The invention also provides a two-dimensional code generating device for secure transactions.
[0286] Reference Figure 3 , Figure 3 This is a functional module diagram of a first embodiment of a two-dimensional code generation device for secure transactions of the present invention. The two-dimensional code generation device for secure transactions comprises:
[0287] User request processing module: the service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user login mobile phone number and the service source number;
[0288] An account-bound voucher code generation module, wherein the account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account-bound voucher code;
[0289] A random ID generation module, wherein the account management system generates a random ID, inserts a random confusion bit into the random ID, generates a target ID, and combines the target ID with the user account binding voucher code into an original string according to a second preset combination rule;
[0290] The dynamic QR code generation module, the account management system encrypts and encodes the original string to generate a dynamic QR code, the dynamic QR code is set with a preset validity period, and the account management system sends the account binding coupon code and the dynamic QR code to the service platform.
[0291] In addition, an embodiment of the present invention further provides a computer storage medium.
[0292] The storage medium stores a two-dimensional code generation program for secure transactions, and when the two-dimensional code generation program for secure transactions is executed by the processor, the steps of the two-dimensional code generation method for secure transactions as described above are implemented.
[0293] The specific implementation of the storage medium of the present invention is basically the same as the above-mentioned embodiments of the QR code generation method for secure transactions, and will not be repeated here.
[0294] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims. All equivalent structures or equivalent process changes made using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are protected by the present invention.
[0295] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0296] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), a disk or an optical disk.
[0297] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0298] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating a QR code for secure transactions, characterized in that: The following steps are involved: The service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user's login mobile phone number and the service source number; The account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account binding voucher code; The account management system generates a random ID, inserts a random obfuscation bit into the random ID, generates a target ID, and combines the target ID with the user account-bound voucher code into an original string according to a second preset combination rule; The account management system encrypts and encodes the original character string to generate a dynamic QR code, wherein the dynamic QR code is set with a preset validity period, and the account management system sends the account-bound coupon code and the dynamic QR code to the service platform.
2. The method for generating a two-dimensional code for secure transactions according to claim 1, characterized in that: After the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it also includes: The service platform sends the dynamic QR code to a user interface, which is used to display the dynamic QR code for subsequent verification.
3. The method for generating a two-dimensional code for secure transactions according to claim 2, characterized in that: After the service platform sends the dynamic QR code to the user interface, the method further includes: When the service outlet verifies the dynamic QR code on the user interface, the service platform verifies the validity of the dynamic QR code and the voucher code bound to the account; If the dynamic QR code and the account-bound coupon code are both valid, the cancellation is successful; If the dynamic QR code and / or the account-bound coupon code are verified to be invalid, the verification fails.
4. The method for generating a two-dimensional code for secure transactions according to claim 3, characterized in that: Before the write-off is successful, it also includes: The service platform requests the account management system to re-verify the validity of the dynamic QR code and the account-bound coupon code; When it is verified again that both the dynamic QR code and the account-bound coupon code are valid, the cancellation is successful.
5. The method for generating a two-dimensional code for secure transactions according to claim 1, characterized in that: The account management system encrypts and encodes the original string to generate a dynamic QR code, including: The account management system performs AES algorithm encryption and BASE64 encoding on the original character string to generate the dynamic QR code.
6. The method for generating a two-dimensional code for secure transactions according to claim 1, characterized in that: After the account management system sends the account-bound coupon code and the dynamic QR code to the service platform, it also includes: When the service platform receives the user's request to regenerate the QR code, it notifies the account management system to regenerate a new dynamic QR code and returns it to the service platform.
7. The method for generating a two-dimensional code for secure transactions as claimed in claim 1, characterized in that: The account management system generates a random ID, including: The account management system generates a random ID through a snowflake algorithm, a UUID algorithm or a timestamp algorithm.
8. A two-dimensional code generating device for secure transactions, characterized in that: The two-dimensional code generating device for secure transaction comprises: User request processing module: the service platform receives the user's service purchase request, generates preset item information and sends it to the account management system. The preset item information includes the card code, the user login mobile phone number and the service source number; An account-bound voucher code generation module, wherein the account management system combines the preset item information into a user card voucher real number according to a first preset combination rule, encrypts and encodes the user card voucher real number, and generates a user account-bound voucher code; A random ID generation module, wherein the account management system generates a random ID, inserts a random confusion bit into the random ID, generates a target ID, and combines the target ID with the user account binding voucher code into an original string according to a second preset combination rule; The dynamic QR code generation module, the account management system encrypts and encodes the original string to generate a dynamic QR code, the dynamic QR code is set with a preset validity period, and the account management system sends the account binding coupon code and the dynamic QR code to the service platform.
9. A QR code generating device for secure transactions, characterized in that: The two-dimensional code generation device for secure transactions includes a memory, a processor, and a two-dimensional code generation program for secure transactions stored in the memory and executable on the processor. When the two-dimensional code generation program for secure transactions is executed by the processor, the steps of the two-dimensional code generation method for secure transactions as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium, characterized in that: The storage medium stores a two-dimensional code generation program for secure transactions, and when the two-dimensional code generation program for secure transactions is executed by a processor, the steps of the two-dimensional code generation method for secure transactions as described in any one of claims 1-7 are implemented.
Citation Information
Cited By
Electronic shopping coupon system based on mobile phone terminal and cash register and application method
CN119648219A
An electronic shopping card system and application method based on mobile phone and cash register.
CN119648219B
