Coupon issuing method and device and storage medium
By receiving coupons on the user side and generating a random QR code to update the QR code on the data screen, combining blockchain and smart contract verification, the problem of merchant QR codes being easily scanned is solved, and the discount is achieved security of coupons and protection of merchant interests.
Patent Information
- Application Number
- CN202411153333.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-31
AI Technical Summary
The QR code provided by merchants is prone to being stolen and scanned, resulting in loss of profits. The existing technology cannot effectively prevent the reuse and theft of QR codes.
By receiving coupon acquisition requests from the user side, reading the QR code identification and determining its status, sending the coupon only when the status is activated, and generating a random QR code to update the QR code on the data screen, utilizing blockchain and intelligence Contract verification and update the QR code status to ensure that the QR code scanned is new every time.
It effectively prevents the reuse and stolen QR codes, ensures the security of merchant information, avoids unreasonable acquisition of coupons, and protects the interests of merchants.
Smart Images

Figure CN119228435A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a coupon distribution method, device and storage medium. Background Art
[0002] In order to attract users to make purchases, some merchants will provide parking coupons to users who have already made purchases. In the process of providing QR codes to users, merchants usually print fixed QR codes on paper or display them on data screens to allow users to scan and obtain parking coupons.
[0003] In actual scenarios, merchants usually need to pay a certain amount of money to obtain parking coupons from parking lot management. However, if the QR code provided by the merchant is fixed, usually just scanning the QR code can get the parking coupon. This makes the QR code provided by the merchant vulnerable to theft.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a coupon distribution method, device and storage medium, aiming to solve the technical problem that the QR codes provided by merchants are easily scanned.
[0006] To achieve the above purpose, the present application provides a coupon distribution method, which comprises the following steps:
[0007] Receiving a coupon acquisition request from a user terminal based on the first QR code, and reading a QR code identifier in the coupon acquisition request;
[0008] Acquire the QR code status corresponding to the QR code identifier, and send the coupon to the user terminal when the QR code status is activated;
[0009] A random two-dimensional code is generated, and the first two-dimensional code displayed on the data screen is updated based on the random two-dimensional code.
[0010] In one embodiment, the step of generating a random two-dimensional code and updating the first two-dimensional code displayed on the data screen based on the random two-dimensional code includes:
[0011] Generate a target QR code identifier;
[0012] Encoding the target two-dimensional code identifier to generate the random two-dimensional code;
[0013] The random QR code is sent to the data screen, wherein the data screen updates the displayed first QR code based on the received random QR code, so that the user terminal scans the updated first QR code to obtain the coupon.
[0014] In one embodiment, the step of obtaining the QR code status corresponding to the QR code identifier and sending the coupon to the user terminal when the QR code status is activated includes:
[0015] In the blockchain, obtaining the QR code status corresponding to the QR code identifier;
[0016] When the QR code status is activated, sending the coupon to the user terminal;
[0017] In the blockchain, the QR code status of the first QR code is updated.
[0018] In one embodiment, before the step of sending the coupon to the user terminal when the QR code status is activated, the step further includes:
[0019] Determine the coupon smart contract corresponding to the QR code identifier in the blockchain;
[0020] Verifying the coupon acquisition request through the coupon smart contract;
[0021] According to the verification result, the coupon is determined and generated.
[0022] In one embodiment, the step of determining and generating the coupon according to the verification result includes:
[0023] Determine, in the verification result, the discount amount corresponding to the consumption record of the user terminal in the coupon acquisition request;
[0024] Determine the target parking lot to which the coupon is applicable according to the target positioning information of the QR code identification;
[0025] The coupon is generated according to the discount amount and the target parking lot.
[0026] In one embodiment, the step of verifying the coupon acquisition request through the coupon smart contract includes:
[0027] Determine the location information of the user terminal according to the coupon acquisition request, and obtain preset target location information according to the QR code identifier;
[0028] Determine a positioning distance between the positioning information and the target positioning information;
[0029] According to the positioning smart contract of the coupon smart contract, the positioning distance is verified, and when the positioning distance is greater than a preset distance threshold, an abnormal prompt information indicating that the user terminal location is abnormal is output.
[0030] In one embodiment, the step of verifying the coupon acquisition request through the coupon smart contract includes:
[0031] Determine the merchant information corresponding to the QR code identifier, and determine the coupon amount of the merchant information;
[0032] Verifying the coupon amount according to the amount smart contract in the coupon smart contract;
[0033] When the coupon amount is not zero, the coupon amount is updated according to the generated quantity of the coupon.
[0034] In one embodiment, after the step of generating a random two-dimensional code and updating the first two-dimensional code displayed on the data screen based on the random two-dimensional code, the method further includes:
[0035] In the blockchain, obtaining the display time of the first QR code;
[0036] Determine the display duration of the first two-dimensional code according to the display time and the current system time;
[0037] When the display time is greater than the display time threshold, the random two-dimensional code is generated, and the first two-dimensional code displayed on the data screen is updated based on the random two-dimensional code.
[0038] In addition, to achieve the above objectives, the present application also provides a coupon issuance device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the coupon issuance method described above.
[0039] In addition, to achieve the above purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, the steps of the coupon issuance method described above are implemented.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] After receiving the coupon acquisition request sent by the user end, the present application reads the QR code identifier in the coupon acquisition request and determines the QR code state corresponding to the QR code identifier. When the QR code state is activated, the coupon is sent to the user end, and a random QR code is generated at the same time. Based on the random QR code, the first QR code displayed on the data screen is updated. Each time the QR code on the data screen is used, it will become invalid and automatically updated, thereby ensuring the information security of the merchant's QR code, so that the QR code scanned by the user each time is a new QR code, avoiding the situation where the QR code is stolen by repeatedly scanning the QR code or saving the QR code image, thereby stealing the coupon. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 This is a flow chart of the first embodiment of the coupon distribution method of the present application;
[0045] Figure 2 This is a flow chart of the second embodiment of the coupon distribution method of the present application;
[0046] Figure 3 This is a flow chart of the third embodiment of the coupon distribution method of the present application;
[0047] Figure 4 It is a structural diagram of a coupon issuing device in a hardware operating environment involved in an embodiment of the present application.
[0048] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: receiving a coupon acquisition request sent by a user terminal, and reading the QR code identifier in the coupon acquisition request; if the QR code status corresponding to the QR code identifier is an activated state, sending the coupon to the user terminal; generating a random QR code according to the random QR code identifier, and updating the QR code display interface of the merchant terminal based on the random QR code.
[0052] Merchants usually need to pay a certain amount of compensation to obtain parking coupons from parking lot management to attract users to consume. In the related art, when merchants provide users with QR codes, they usually print the QR codes on paper or display them on a data screen to display fixed QR codes to users for them to scan and obtain parking coupons. When the QR codes provided by merchants are fixed, there are hidden dangers in the information security of the merchant's QR codes. Usually, parking coupons can be obtained by scanning the QR codes. This makes the QR codes provided by merchants vulnerable to theft, which affects the interests of merchants.
[0053] After receiving a coupon acquisition request based on a first QR code from a user terminal, the present application reads the QR code identifier in the coupon acquisition request, determines the QR code state corresponding to the QR code identifier, sends the coupon to the user terminal when the QR code state is activated, generates a random QR code at the same time, and updates the first QR code displayed on the data screen based on the random QR code. Each time the QR code on the data screen is used, it will become invalid and automatically updated, thereby ensuring the information security of the merchant's QR code, so that each QR code scanned by the user is a new QR code, avoiding the situation where the coupon is obtained unreasonably by scanning the QR code repeatedly or saving the QR code image, thereby protecting the interests of the merchant.
[0054] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0055] It should be noted that the execution subject of this embodiment can be a coupon distribution system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can achieve the above functions, a coupon distribution device, etc., which is not specifically limited in this embodiment. The following takes the coupon distribution system as an example to illustrate this embodiment and the following embodiments.
[0056] Based on this, the present application embodiment provides a coupon distribution method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the coupon distribution method of the present application.
[0057] In this embodiment, the coupon distribution method includes steps S10 to S30:
[0058] Step S10: receiving a coupon acquisition request sent by a user terminal, and reading a QR code identifier in the coupon acquisition request;
[0059] Step S20: If the QR code status corresponding to the QR code identifier is an activated status, the coupon is sent to the user terminal;
[0060] In this embodiment, the coupon issuance system includes a server, which is connected to the blockchain network and can perform data transmission and information exchange with the user end and the merchant end to complete the coupon issuance and other services. The user end is a terminal device such as a mobile phone or a tablet computer that can scan the QR code through a camera. After scanning the QR code displayed on the QR code display interface of the merchant end and decoding to obtain the QR code identifier of the QR code, a coupon acquisition request can be constructed based on the QR code identifier through an application (APP, Application), a public account or a web page, and the coupon acquisition request is sent to the server of the coupon issuance system. Among them, the coupon is a parking coupon, and the user can reduce the parking fee based on the coupon in the parking lot used.
[0061] Specifically, when the server receives the coupon acquisition request sent by the user terminal, it can read the QR code identifier in the coupon acquisition request. Each QR code identifier corresponds to a unique QR code, and the coupon issuance system can determine the QR code status of the target QR code and the QR code identifier based on the target QR code corresponding to the QR code identifier. The QR code status includes an activated state and an expired state. Among them, when the QR code status is an activated state, it means that the QR code has not yet issued a coupon, and when the QR code status is an expired state, it means that the QR code can no longer be used to obtain a coupon. When the coupon issuance system determines that the QR code status corresponding to the QR code identifier is an activated state, it will obtain or generate a coupon and send the coupon to the user terminal. Alternatively, if the QR code status corresponding to the QR code identifier is expired, the coupon issuance system will refuse to provide the coupon to the user terminal and send a prompt message to the user terminal that the QR code has expired.
[0062] Optionally, the method as described in step S20 includes steps S21 to S23:
[0063] Step S21: in the blockchain, obtaining the target QR code corresponding to the QR code identifier, and determining the QR code status of the target QR code;
[0064] Step S22: When the QR code is in an activated state, sending the coupon to the user terminal;
[0065] Step S23: updating the QR code status of the target QR code in the blockchain through the QR code status smart contract.
[0066] It should be noted that the blockchain network is a distributed system composed of multiple nodes, which stores data in multiple nodes in a decentralized manner and ensures the security and credibility of data through encryption algorithms and consensus mechanisms. The node can be a server, computer or other device connected to the blockchain network. The nodes in the blockchain network can perform data processing actions such as storage, forwarding and execution of smart contracts, and package the data processing actions into blocks, and broadcast the blocks to all nodes in the blockchain network, where each block contains the hash value of the previous block. At the same time, after receiving the block, all nodes in the blockchain network will determine the order and validity of adding new blocks based on the consensus mechanism of the blockchain network, so as to add the new blocks that have been agreed upon to the blockchain and update the ledger in the blockchain. Among them, the consensus mechanism can be selected from consensus mechanisms such as Proof of Work (PoW) and Proof of Stake (PoS). Based on multi-node storage, the blockchain network can achieve the immutability, reliability and transparency of data processing.
[0067] In the specific implementation, the blockchain network saves the QR code record and coupon generation information in the form of blockchain. At the same time, based on the QR code status smart contract, the QR code status is determined and updated. The coupon issuance system connects to the blockchain network, determines the target QR code corresponding to the QR code identifier in the blockchain, and obtains the QR code status. After the blockchain determines the QR code status corresponding to the QR code identifier based on the QR code status smart contract, the QR code status is fed back to the coupon issuance system. When the QR code status is activated, the coupon issuance system sends the coupon to the user terminal, which is saved in the electronic wallet by the user terminal. The coupon issuance system will also send the information on the completion of coupon issuance to the blockchain network, and the nodes in the blockchain network will simultaneously execute the QR code status smart contract, update the QR code status of the first QR code, and modify information such as the merchant coupon amount.
[0068] Exemplarily, based on the unmodifiable nature of blockchain, the QR code state is stored in the blockchain in the form of a state variable. The blockchain network can read and modify the state variable through the function in the QR code state smart contract. When the coupon issuance information based on the target QR code is received from the coupon issuance system, the function in the QR code state smart contract will be triggered, the state modification logic will be executed, the state variable will be updated from the activated state to the expired state, and the update will be broadcast to the blockchain network so that all nodes can verify and update their local state. The consensus mechanism of the blockchain ensures that all nodes agree on the changes in the data. When the state variable in the smart contract is modified, the modification will be packaged into a new block and propagated in the blockchain network through the consensus mechanism.
[0069] In an optional implementation, the coupon distribution system can also be directly deployed in the blockchain network in the form of a smart contract. In the blockchain network, all nodes receive coupon acquisition requests in the form of node servers, read the QR code identifier in the coupon acquisition request, and obtain the QR code status in the blockchain by executing the corresponding smart contract, and send the coupon to the user end when the QR code status is activated.
[0070] In another optional implementation, when the coupon issuing system is deployed in a server, the QR code and related information can also be saved in a database. After generating the QR code, the coupon issuing system will associate the QR code state, the QR code, and the QR code identifier with each other and save them in the database. The coupon issuing system determines the QR code state according to the QR code identifier through the database, and modifies the QR code state in the database.
[0071] Step S30: Generate a random QR code according to the random QR code identifier, and update the QR code display interface of the merchant terminal based on the random QR code.
[0072] In this embodiment, the coupon issuing system is also connected to the merchant terminal. The merchant terminal can be a data screen, or a terminal device equipped with a display screen such as a computer or a tablet computer. The merchant terminal can output the QR code display interface on the display screen or the data screen based on the preset rendering data, and receive the random QR code to be displayed generated by the server of the coupon issuing system for display. The random QR code is generated by the coupon issuing system and is used to update the QR code displayed on the data screen.
[0073] Specifically, the coupon distribution system generates a random QR code identifier through a random number generation algorithm. The random QR code identifier is binarized and encoded based on a preset QR code arrangement to generate the random QR code. The random QR code is sent to the merchant end, where the merchant end replaces the QR code currently displayed on the QR code display interface based on the received random QR code, so that the user end scans the updated QR code to obtain the coupon.
[0074] Exemplarily, the coupon distribution system generates a seed based on the current system time through a random number generation algorithm, and generates a target QR code identifier based on the seed. The target QR code identifier is binarized, arranged based on the layout of the QR code, and the arranged binary image is converted into a black and white image based on the method of black representing 1 and white representing 0, thereby generating a random QR code.
[0075] The embodiment of the present application reads the QR code identifier in the coupon acquisition request after receiving the coupon acquisition request based on the first QR code from the user end, and determines the QR code state corresponding to the QR code identifier. When the QR code state is activated, the coupon is sent to the user end, and a random QR code is generated at the same time. Based on the random QR code, the first QR code displayed on the data screen is updated. After each use, the QR code on the data screen will become invalid and automatically updated, thereby ensuring the information security of the merchant's QR code, so that the QR code scanned by the user each time is a new QR code, avoiding the situation where the coupon is obtained unreasonably by repeatedly scanning the QR code or saving the QR code image, and at the same time protecting the interests of the merchant.
[0076] Based on the same inventive concept, the present application also provides a second embodiment, referring to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the coupon distribution method of the present application.
[0077] In this embodiment, as described in step S22, when the state of the QR code is in the activated state, after sending the coupon to the user terminal, steps S221 to S223 are also included:
[0078] Step S221: Determine the coupon smart contract corresponding to the target QR code in the blockchain;
[0079] Step S222: verifying the coupon acquisition request through the coupon smart contract;
[0080] In this embodiment, a coupon smart contract is stored in the blockchain, which includes but is not limited to the coupon acquisition rules of each merchant, and is used to verify the coupon acquisition request, determine whether the coupon acquisition request meets the coupon issuance conditions in the coupon acquisition rules, and the target amount, scope of use and other information of the issued coupon. The coupon acquisition request can optionally include consumption records and / or user terminal location information. The coupon issuance system can determine the corresponding merchant and the coupon smart contract corresponding to the merchant based on the QR code identifier and / or the target QR code and / or the coupon acquisition request, thereby verifying the coupon acquisition request based on the coupon smart contract through dimensions such as user location information and consumption records.
[0081] Optionally, the coupon smart contract includes a consumption smart contract and / or a positioning smart contract and / or an amount smart contract. Among them, the consumption smart contract identifies the merchant's coupon acquisition rules for the user's consumption record, which is used to determine whether the user's consumption meets the coupon issuance conditions. The positioning smart contract is used to verify whether the user's terminal location is within a reasonable range for obtaining coupons, rather than remotely scanning the QR code through photos or other methods to obtain coupons. The amount smart contract is used to verify whether the merchant's remaining coupon amount meets the coupon issuance conditions.
[0082] In the first implementation, the consumption smart contract is determined according to the merchant's coupon acquisition rules, and the user's consumption record can be verified, and the discount amount of the coupon can be determined based on the verification results. For example, when the coupon acquisition rule of the consumption smart contract is "a parking coupon worth 10 yuan will be given for consumption of 100 yuan or more", the consumption smart contract will automatically scan and analyze the user's dining consumption records. Once it is confirmed that the user's single consumption amount reaches or exceeds 100 yuan, the smart contract will immediately trigger the discount mechanism, automatically calculate and determine that the user should receive a parking coupon discount of 10 yuan. Subsequently, the coupon will be directly issued to the user's electronic wallet in digital form.
[0083] Optionally, the blockchain network can adjust the coupon smart contract based on upgrading the smart contract to adapt to the different smart contract requirements of merchants.
[0084] Optionally, the consumption smart contract can also be verified in the form of points. Merchants can assign corresponding points to users based on their consumption behavior. For example, when a user spends 100 yuan, 10 points are assigned. After obtaining the user's consumption record, the consumption smart contract can verify based on the points in the consumption record and determine the discount amount. For example, when the consumption smart contract automatically detects that the points in the consumption record are 10, a 10-yuan parking coupon will be assigned to the user. Among them, merchants can adjust the way users obtain points based on their own adjustments to the coupon acquisition rules, thereby avoiding frequent upgrades and updates of smart contracts that cause the blockchain network to be too redundant.
[0085] In the second implementation, the positioning smart contract needs to determine whether the user terminal is located within the reasonable position range for scanning the QR code to obtain the coupon. According to the positioning information of the user terminal in the coupon acquisition request, and according to the QR code identifier, the preset target positioning information is obtained. The target positioning information can be the positioning information of the merchant. By determining the positioning distance between the positioning information and the target positioning information, the positioning smart contract can verify the positioning distance. When the positioning distance is greater than the preset distance threshold, the abnormal prompt information of the abnormal position of the user terminal is output, or, when the positioning distance is less than the preset distance threshold, the coupon issuance action is performed normally.
[0086] In the third implementation, the amount smart contract will verify the remaining coupon amount of the merchant. After determining the merchant information corresponding to the QR code logo, the coupon amount of the merchant information is determined, and the coupon amount is verified according to the amount smart contract in the coupon smart contract. Among them, when the coupon amount is not zero, the coupon issuance system executes the coupon issuance action and updates the coupon amount according to the number of coupons generated. Optionally, the amount smart contract can also record the number of coupons issued by the merchant, and each time the coupon issuance system issues a coupon, the number of coupons issued by the merchant is added by one.
[0087] Step S223: Determine and generate the coupon according to the verification result.
[0088] In this embodiment, the coupon issuing system can determine the discount amount corresponding to the consumption record of the user terminal in the coupon acquisition request according to the verification result. At the same time, according to the target positioning information of the QR code, the target parking lot to which the coupon is applicable can be determined. The coupon issuing system generates a coupon according to the discount amount and the target parking lot.
[0089] Furthermore, after the coupon is generated, the blockchain network will package the coupon and coupon information and save them in the blockchain. At the same time, when the parking lot management system settles parking fees based on the user's identity information, it can also verify the coupon of the user's identity information through the coupon information saved in the blockchain.
[0090] The embodiment of the present application verifies the received coupon acquisition request through the coupon smart contract to determine whether the coupon issuance conditions are met, as well as the discount amount and discount amount of the issued coupon, thereby verifying the QR code issuance conditions and further reducing the risk of coupon theft.
[0091] Since the system introduced in the second embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.
[0092] Based on the same inventive concept, the present application also provides a third embodiment, referring to Figure 3 , Figure 3 This is a flow chart of the third embodiment of the coupon distribution method of the present application.
[0093] In this embodiment, after generating a random QR code according to the random QR code identifier as described in step S30, and updating the QR code display interface of the merchant terminal based on the random QR code, steps S31 to S32 are also included:
[0094] Step S31: in the blockchain, obtaining the display time of the target QR code on the QR code display interface;
[0095] Step S32: Determine the display duration of the target QR code according to the display time and the current system time;
[0096] Step S33: When the display time is greater than the display time threshold, the random QR code is generated, and the QR code display interface of the merchant terminal is updated based on the random QR code.
[0097] In this embodiment, the blockchain records the display time of the target QR code currently displayed on the merchant's QR code display interface when it is put on the data screen, that is, the initial time when the target QR code is displayed. The coupon issuance system can determine the display time of the target QR code based on the display time and the current system time, and regularly update the QR code displayed on the data screen based on the display time threshold, that is, when the display time is greater than the display time threshold, generate a random QR code, and replace the target QR code displayed on the merchant's QR code display interface based on the random QR code, and use the random QR code as the new target QR code.
[0098] Optionally, the blockchain network can automatically trigger a smart contract through a smart contract when the display time of the QR code reaches a display time threshold, generate a random QR code, and update the target QR code displayed on the data screen.
[0099] The embodiment of the present application determines the display duration according to the display time of the QR code on the data screen, and updates the QR code displayed on the data screen when the display duration reaches a display duration threshold, thereby improving the security of the QR code.
[0100] Since the system introduced in the third embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.
[0101] The present application provides a coupon issuance device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the coupon issuance method in the above-mentioned embodiment 1.
[0102] Reference below Figure 4 , which shows a schematic diagram of the structure of a coupon issuing device suitable for implementing the embodiment of the present application. The coupon issuing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4The coupon issuing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0103] like Figure 4 As shown, the coupon issuing device may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. In the RAM 1004, various programs and data required for the operation of the coupon issuing device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the coupon issuing device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a coupon issuing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0104] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0105] The coupon issuing device provided by the present application adopts the coupon issuing method in the above embodiment, which can solve the technical problem that the QR code provided by the merchant is easily stolen and scanned. Compared with the prior art, the beneficial effects of the coupon issuing device provided by the present application are the same as the beneficial effects of the coupon issuing method provided by the above embodiment, and the other technical features in the coupon issuing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0106] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0107] The above is only a specific implementation 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.
[0108] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the coupon issuing method in the above-mentioned embodiment.
[0109] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0110] The computer-readable storage medium may be included in the coupon issuing device; or may exist independently without being assembled into the coupon issuing device.
[0111] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the coupon issuing device, the coupon issuing device: receives a coupon acquisition request sent by a user terminal, and reads a QR code identifier in the coupon acquisition request; if the QR code state corresponding to the QR code identifier is an activated state, sends the coupon to the user terminal; generates a random QR code according to the random QR code identifier, and updates the QR code display interface of the merchant terminal based on the random QR code.
[0112] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0115] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned coupon issuance method, and can solve the technical problem that the QR code provided by the merchant is easily scanned. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the coupon issuance method provided in the above-mentioned embodiment, and will not be repeated here.
[0116] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A coupon distribution method, characterized in that: The method comprises the following steps: Receive a coupon acquisition request sent by a user terminal, and read the QR code identifier in the coupon acquisition request; If the QR code status corresponding to the QR code identifier is in an activated state, the coupon is sent to the user terminal; A random QR code is generated according to the random QR code identifier, and a QR code display interface of the merchant terminal is updated based on the random QR code.
2. The method according to claim 1, characterized in that The step of generating a random QR code according to the random QR code identifier and updating the QR code display interface of the merchant terminal based on the random QR code includes: Generate the random QR code identifier through a random number generation algorithm; The random two-dimensional code identifier is binarized and encoded based on a preset two-dimensional code arrangement to generate the random two-dimensional code; The random QR code is sent to the merchant end, wherein the merchant end updates the QR code displayed on the QR code display interface based on the received random QR code, so that the user end scans the updated QR code to obtain the coupon.
3. The method according to claim 1, characterized in that If the state of the QR code corresponding to the QR code identifier is an activated state, the step of sending the coupon to the user terminal includes: In the blockchain, obtaining a target QR code corresponding to the QR code identifier, and determining the QR code status of the target QR code; When the QR code is in an activated state, sending the coupon to the user terminal; The QR code status of the target QR code in the blockchain is updated through the QR code status smart contract.
4. The method according to claim 3, characterized in that Before the step of sending the coupon to the user terminal when the QR code is in the activated state, the step further includes: Determine a coupon smart contract corresponding to the target QR code in the blockchain; Verifying the coupon acquisition request through the coupon smart contract; According to the verification result, the coupon is determined and generated.
5. The method according to claim 4, characterized in that The step of determining and generating the coupon according to the verification result includes: Determine the discount amount corresponding to the consumption record of the coupon acquisition request in the verification result; Determine the target parking lot to which the coupon is applicable according to the target positioning information of the QR code identification; The coupon is generated according to the discount amount and the target parking lot.
6. The method according to claim 4, characterized in that The step of verifying the coupon acquisition request through the coupon smart contract includes: Determine the location information of the user terminal according to the coupon acquisition request, and obtain preset target location information according to the QR code identifier; Determine a positioning distance between the positioning information and the target positioning information; According to the positioning smart contract of the coupon smart contract, the positioning distance is verified, and when the positioning distance is greater than a preset distance threshold, an abnormal prompt information indicating that the user terminal location is abnormal is output.
7. The method according to claim 4, characterized in that The step of verifying the coupon acquisition request through the coupon smart contract includes: Determining the coupon amount of the merchant terminal according to the merchant terminal information of the merchant terminal; Verifying the coupon amount according to the amount smart contract in the coupon smart contract; When the coupon amount is not zero, the coupon amount at the merchant end is updated according to the generated quantity of the coupon.
8. The method according to claim 1, characterized in that After the step of generating a random QR code according to the random QR code identifier and updating the QR code display interface of the merchant terminal based on the random QR code, the method further includes: In the blockchain, obtaining the display time of the target QR code on the QR code display interface; Determine the display duration of the target QR code according to the display time and the current system time; When the display time is greater than the display time threshold, the random QR code is generated, and the QR code display interface of the merchant terminal is updated based on the random QR code.
9. A coupon distribution device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the coupon issuing method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the coupon issuance method according to any one of claims 1 to 8 are implemented.
