Data processing method, device, electronic terminal and storage medium

The coupon identification is generated by parsing the coupon code redemption request and matching the coupon template, which solves the problem of wasting database resources and enables only the coupon template to be saved during coupon redemption, reducing resource usage.

CN110362719BActive Publication Date: 2024-09-24PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910422811.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-21
Publication Date
2024-09-24
Estimated Expiration
2039-05-21

AI Technical Summary

Technical Problem

In the existing technology, a large number of discount codes and their corresponding coupons are pre-generated and stored in the database, resulting in a waste of database resources, and the discount codes and coupons that are not used by users occupy resources.

Method used

By obtaining the coupon code redemption request, parsing the target coupon code information, finding and matching the coupon template, generating the coupon identification, and saving the coupon template in the database instead of a large number of discount codes and coupons, which will be regenerated after the coupon code is successfully redeemed. Create and save coupons.

Benefits of technology

It reduces the occupation of database resources, avoids unused discount codes and coupons from occupying resources, and solves the problem of wasting database resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110362719B
    Figure CN110362719B
Patent Text Reader

Abstract

The embodiment of the present invention provides a data processing method, device, electronic terminal and storage medium, which relates to the field of data processing technology. The embodiment of the present invention obtains a discount code redemption request, which includes a target discount code; obtains target discount code information by parsing the target discount code, wherein the target discount code information includes a target coupon template identifier and a serial number of the target discount code; searches for a target coupon template matching the target coupon template identifier from a database; generates a target coupon identifier according to the target coupon template identifier and the serial number; and, generates a coupon corresponding to the target coupon identifier according to the target coupon template; and saves the coupon identifier in a database, and sends the coupon. Therefore, the technical solution provided by the embodiment of the present invention can solve the problem of a large number of unused discount codes occupying database resources in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, electronic terminal and storage medium. [Background technology]

[0002] A discount code is a combination of specific characters or numbers that can give users discounts and the right to enter certain places. Discount codes can be issued in many ways, for example, a specific character can be issued directly to users, or discount codes can be issued in some large shopping malls or on the Internet, and users can collect discount codes by themselves after entering the corresponding shopping malls or visiting the corresponding websites. When using a discount code, it needs to be converted into a coupon first.

[0003] The issuance of discount codes is the main means of promotion for merchants. In order to ensure that the promotion scope of discount codes is relatively wide and the use is safe, the discount code server will pre-generate a large number of discount codes, and save these discount codes and the coupons corresponding to each discount code in the database. Therefore, when a user uses a discount code in his hand, the discount code in the user's hand is matched with the discount code in the database. If the discount code in the user's hand matches the discount code in the database, the code verification is successful, and then the corresponding coupon is retrieved for the user. In actual use, the inventor found that only a small part of the generated discount codes is received and used by users, and most of the discount codes are useless. Pre-generating a large number of discount codes and corresponding coupons and storing all of these discount codes and coupons in the database causes a waste of database resources. [Summary of the invention]

[0004] In view of this, an embodiment of the present invention provides a data processing method, device, electronic terminal and storage medium to solve the problem of waste of database resources in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a data processing method, the method comprising:

[0006] Obtaining a discount code redemption request, wherein the discount code redemption request includes a target discount code to be redeemed;

[0007] Parsing the target discount code to obtain target discount code information, wherein the target discount code information at least includes a target coupon template identifier of a coupon template corresponding to the target discount code and a serial number of the target discount code;

[0008] Searching a database for a target coupon template that matches the target coupon template identifier;

[0009] If a target coupon template matching the target coupon template identifier is found, a target coupon identifier is generated according to the target coupon template identifier and the serial number of the target discount code; and,

[0010] generating a coupon corresponding to the target coupon identifier according to the target coupon template;

[0011] The target coupon identifier is saved in a database, and the coupon is sent.

[0012] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the method further includes:

[0013] Obtain a discount code download request, wherein the discount code download request carries the quantity of discount codes required and a coupon template identifier;

[0014] Generate a specified number of serial numbers according to the number of discount codes required and a preset numbering rule, wherein the specified number is equal to the number of discount codes required;

[0015] Combining the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes;

[0016] Encrypting the initial discount code to obtain an encrypted target discount code;

[0017] The target discount code is output.

[0018] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the method further includes:

[0019] The target discount code is parsed to obtain the target discount code information, including:

[0020] Decrypting the target discount code to obtain an initial discount code corresponding to the target discount code;

[0021] By parsing the initial discount code, the corresponding target discount code information is obtained.

[0022] According to the above aspects and any possible implementation manner, an implementation manner is further provided, where if a target coupon template matching the target coupon template identifier is found, before generating a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the method further includes:

[0023] Determining whether there is a coupon identifier corresponding to the serial number of the target discount code in the database;

[0024] If it is determined that the target discount code exists, it is determined that the target discount code has been exchanged for a coupon, and a prompt message indicating that the target discount code is invalid is output;

[0025] If it is determined that the target discount code does not exist, it is determined that the target discount code has not been redeemed for a coupon.

[0026] According to the above aspects and any possible implementation manner, there is further provided an implementation manner, after determining that the discount code has not been redeemed for a coupon and before generating a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the method further includes:

[0027] Obtaining the redemption time range corresponding to the target coupon template;

[0028] Determine whether the current time is within the exchange time range;

[0029] If it is determined that the current time is within the redemption time range, the target discount code is determined to be valid;

[0030] If it is determined that the current time is beyond the redemption time range, a prompt message indicating that the discount code is invalid is output.

[0031] and / or,

[0032] Get the number of coupons generated within a specified time and / or specified area;

[0033] Determining whether the number of generated coupons reaches a specified threshold;

[0034] If it is determined that the number of generated coupons does not reach the specified threshold, determining that the target discount code is valid;

[0035] If it is determined that the number of generated coupons exceeds the specified threshold, a prompt message indicating that all coupons have been redeemed is output.

[0036] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the method further includes: the coupon code redemption request also includes an identifier of a sender, and before sending the coupon, the method further includes:

[0037] Based on the sender's identifier as a secret key, encrypt the coupon to obtain an encrypted coupon;

[0038] The encrypted coupon is sent.

[0039] In a second aspect, an embodiment of the present invention provides a data processing device, the data processing device comprising:

[0040] An acquisition unit, configured to acquire a discount code redemption request, wherein the discount code redemption request includes a target discount code to be redeemed;

[0041] A parsing unit, configured to parse the target discount code to obtain target discount code information, wherein the target discount code information at least includes a target coupon template identifier of a coupon template corresponding to the target discount code and a serial number of the target discount code;

[0042] A search unit, configured to search a database for a target coupon template that matches the target coupon template identifier;

[0043] a generating unit, configured to generate a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code if a target coupon template matching the target coupon template identifier is found; and to generate a coupon corresponding to the target coupon identifier according to the target coupon template;

[0044] The processing unit is used to save the coupon identifier into a database and send the coupon.

[0045] According to the above aspects and any possible implementation, an implementation is further provided.

[0046] The acquisition unit is further used to acquire a discount code download request, wherein the discount code download request carries the quantity of discount codes required and a coupon template identifier;

[0047] The generating unit is further configured to generate a specified number of serial numbers according to the number of the required discount codes and a preset numbering rule, wherein the specified number is equal to the number of the required discount codes;

[0048] The processing unit is further used to combine the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes;

[0049] The processing unit is further used to encrypt the initial discount code to obtain an encrypted target discount code;

[0050] The processing unit is further configured to output the target discount code.

[0051] In a third aspect, an embodiment of the present invention provides an electronic terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements a data processing method as described in any one of the first aspects.

[0052] In a fourth aspect, an embodiment of the present invention provides a non-volatile computer-readable storage medium having computer-readable instructions stored thereon, and when a computer reads and executes the computer-readable instructions, the computer implements the data processing method described in any one of the first aspects. The above technical solution of template identification has the following beneficial effects:

[0053] The technical solution provided by the present invention generates a coupon based on the coupon template after the user sends a coupon code redemption request and searches for the corresponding coupon template according to the target coupon template identifier in the target coupon code, generates an identifier for the coupon according to the target coupon template identifier and the serial number of the target coupon code, and saves the coupon identifier. When the technical solution provided by the present invention implements coupon redemption, the database only needs to save the coupon template, and there is no need to pre-store a large number of coupon codes and coupons corresponding thereto in the database, thereby reducing the occupation of database resources to a certain extent, and the technical solution of the present invention saves the coupon identifier after the coupon code is successfully exchanged for the coupon, further avoiding the occupation of database resources by the coupon codes and coupons that are not used by the user, thereby solving the problem of waste of database resources caused by a large number of unused coupon codes and coupons in the prior art.

Brief Description of the Drawings

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 It is a flowchart of a data processing method provided by an embodiment of the present invention;

[0056] Figure 2 is a flow chart of another data processing method provided by an embodiment of the present invention;

[0057] Figure 3 is a structural schematic diagram of a data processing device provided by an embodiment of the present invention;

[0058] Figure 4 It is a structural schematic diagram of an electronic terminal provided by an embodiment of the present invention. [Specific implementation method]

[0059] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0060] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0062] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0063] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0064] The embodiment of the present invention provides a data processing method.

[0065] For details, please refer to Figure 1 , which is a flow chart of a method provided by an embodiment of the present invention. As shown in the figure, the method includes the following steps:

[0066] 102. Obtain a discount code redemption request, where the discount code redemption request includes a target discount code to be redeemed.

[0067] In an embodiment of the present invention, the execution subject in the above-mentioned discount code processing may be a server. For example, a user may input a discount code redemption request by operating an operation control in a display interface of a user terminal, so that the user terminal sends the discount code redemption request to a server. After obtaining the discount code redemption request, the server redeems the discount code into a coupon, configures and saves a coupon identifier, and sends the redeemed coupon to the user terminal for use by the user. Alternatively, the execution subject in the above-mentioned discount code processing may also be a user terminal. For example, a display interface of the user terminal displays a discount code redemption interface. The user inputs a discount code redemption request by operating some operation controls in the discount code redemption interface. The user terminal obtains the discount code redemption request, triggering the user terminal to redeem the discount code into a coupon, configure and save the coupon identifier, and display the coupon to the user.

[0068] Specifically, assuming that the execution device executing the above data processing method is a server, when a user wants to use a discount code to enjoy a discount activity, the user enters the discount code in the coupon redemption interface displayed on the user terminal, so that the user terminal sends a discount code redemption request to the server, so that the server obtains the target discount code;

[0069] Specifically, when a user wants to use a discount code to participate in an activity, he or she may also input a picture containing the discount code. After acquiring the picture, the user terminal uses OCR (Optical Character Recognition) technology to recognize digital information in the picture to obtain the target discount code.

[0070] Among them, the use of OCR technology to extract text from images mainly includes two processes: image processing and text pattern recognition. Image processing includes: first, grayscale processing, noise reduction, binarization and other pre-processing of the image to reduce useless information in the image; second, character segmentation processing is performed on the pre-processed image to divide the characters in the pre-processed image into single character images; then, the single character image is normalized to integrate the single character image into an image of the same format, so that the same text recognition algorithm can be used to perform text pattern recognition on these images.

[0071] Text pattern recognition is achieved by detecting dark and light patterns, magnifying the image to determine its shape features and extracting and judging them, and finally matching the image black and white binary with the character encoding, and converting the text image features into text based on the closest match.

[0072] 104. Parse the target discount code to obtain target discount code information, wherein the target discount code information at least includes a target coupon template identifier corresponding to the target discount code and a serial number of the target discount code.

[0073] In the embodiment of the present invention, the target discount code is a code composed of a combination of specific characters or numbers. The target discount code represents what discounts can be brought to the user and the right to access which place. In order to obtain the specific discount information represented by the discount code input by the user, after obtaining the target discount code, it is necessary to parse the target discount code to parse out the target discount code information such as the target coupon template identifier carried by the target discount code and the serial number of the target discount code, so as to determine the corresponding specific discount information based on the target discount code information.

[0074] The parsing process involved in the present invention is mainly to extract the target coupon template identifier, serial number and other target discount code information from the target discount code. The parsing process is the reverse process of the process of obtaining the target discount code by subjecting the target coupon template identifier, serial number and other target discount code information to a series of processes. For example, the process of encapsulating the target discount code information such as the target coupon template identifier and serial number in the discount code redemption request includes: writing the target coupon template identifier and serial number of the discount code into a data body (the data body is an intermediate carrier in the process of generating the discount code request), then encapsulating the data body into a discount code data packet based on a specified communication protocol, and finally, encrypting the discount code data packet to obtain the target discount code after a series of processes. Based on this process, the parsing process of the target discount code is: first, decrypting the target discount code to obtain a discount code data packet; second, unpacking the discount code data packet to obtain a data body carrying the target discount information; finally, reading the target discount code information such as the target coupon template identifier and serial number from the data body.

[0075] It should be noted that the target discount code parsing process given in the above embodiment is only an example provided in the embodiment of the present invention and is not intended to be a specific limitation of the present invention.

[0076] 106. Search a database for a target coupon template that matches the target coupon template identifier.

[0077] 108. If a target coupon template matching the target coupon template identifier is found, a coupon identifier corresponding to the coupon is generated according to the target coupon template identifier and the serial number of the target discount code.

[0078] 110. Generate a coupon corresponding to the target coupon identifier according to the target coupon template.

[0079] 112, save the coupon identifier in a database and send the coupon.

[0080] In the embodiment of the present invention, when implementing coupon exchange, a coupon template is used to generate a coupon. Because the specific discount method corresponding to each discount code is displayed to the user through a coupon, and different discount codes corresponding to the same discount method have the same specific form of coupons (that is, the specific discount method carried by the coupon is the same), therefore, when implementing the coupon exchange process, the coupon template can be used to exchange different discount codes that enjoy the same discount method into coupons with the same format and specific discount method.

[0081] Specifically, the preferential method is configured by each merchant according to the business promotion needs, that is, the merchant will configure the coupon template according to its own business promotion needs. In other words, different coupon templates will be configured for different merchants at the same time, and different coupon templates will be configured for the same merchant at different times according to business promotion needs. Therefore, a large number of coupon templates will be stored in the database of the server that executes the above-mentioned preferential code processing. In order to be able to relatively quickly confirm the coupon templates configured by different merchants or salesmen each time, a unique coupon template identifier can be assigned to each configured coupon template. In this way, after parsing the target coupon template identifier from the acquired target preferential code, the target coupon template identifier is used to search for a coupon template matching the target coupon template identifier from the database. If a coupon template matching the target coupon template identifier can be searched, the coupon template is determined as the target coupon template, and the target coupon template is called from the database, and the coupon is generated using the target coupon template.

[0082] In the embodiment of the present invention, considering that the coupon template identifiers included in the discount codes corresponding to the same coupon template are the same, in the process of configuring the corresponding identifier for each generated coupon, the serial number of the discount code is referenced, and the target coupon template identifier in the target discount code and the serial number of the target discount code are used to generate a unique identifier. The serial number is the number of the discount code, which can distinguish multiple discount codes of the same coupon template from each other.

[0083] In an embodiment of the present invention, the generated coupon carries relevant discount information such as coupon validity period, discount amount, discount location, and the corresponding target coupon identifier. Among them, the target coupon identifier mainly plays an anti-counterfeiting role. Specifically, when using a coupon, the user clicks the "Use" control in the client operation interface to trigger the client to send the coupon to the server. The server extracts the target coupon identifier in the coupon and matches the target coupon identifier with the coupon identifier in the database. If the target coupon identifier matches the coupon identifier in the database, it is determined that the coupon is a system-generated coupon; otherwise, it is determined that the coupon is a non-system-generated coupon.

[0084] The technical solution provided by the present invention generates a coupon based on the coupon template after the user sends a coupon code redemption request and searches for the corresponding coupon template according to the target coupon template identifier in the target coupon code, generates an identifier for the coupon according to the target coupon template identifier and the serial number of the target coupon code, and saves the coupon identifier. When the technical solution provided by the present invention implements coupon redemption, the database only needs to save the coupon template, and there is no need to pre-store a large number of coupon codes and coupons corresponding thereto in the database, thereby reducing the occupation of database resources to a certain extent, and the technical solution of the present invention saves the coupon identifier after the coupon code is successfully exchanged for the coupon, further avoiding the occupation of database resources by the coupon codes and coupons that are not used by the user, thereby solving the problem of waste of database resources caused by a large number of unused coupon codes and coupons in the prior art.

[0085] Optionally, in order to ensure the safety and reliability of the issued discount codes and avoid economic losses to merchants due to malicious imitation of discount codes by some unscrupulous users, the discount codes issued to users can be encrypted based on certain rules, which can avoid the phenomenon of discount code imitation to a certain extent and improve the safety and reliability of discount codes. Based on this, the present invention provides another data processing method, such as Figure 2 As shown, the method also includes:

[0086] 202, obtaining a discount code download request, wherein the download request carries the quantity of discount codes required and a coupon template identifier.

[0087] 204 , generating a specified number of serial numbers according to the number of required discount codes and a preset numbering rule, wherein the specified number is equal to the number of required discount codes.

[0088] In an embodiment of the present invention, the preset numbering rule may be a rule preset by a merchant or salesperson, or may be an inherent coding rule set by a server that executes the data processing method. The present invention does not specifically limit the preset numbering rule.

[0089] The preset numbering rules include the starting number, the number of bytes of the serial number, etc. For example, the preset numbering rules include: the byte length of the serial number is a 32-bit binary number, the starting number is 0; or, the preset numbering rules include: the byte length of the serial number is a 32-bit binary number, the starting number is 0, and the number is an even number; or, the preset numbering rules include: the byte length of the serial number is a 32-bit binary number, the starting number is 2 32 -1.

[0090] 206 , combining the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes.

[0091] In a specific embodiment, the coupon template is identified as A, and the generated serial numbers are B1, B2, B3, B4, B i , i is an integer greater than 1, the combination of coupon template identifier A and serial number can be AB i ,Based on this combination method, the initial discount codes obtained by combining the coupon template identifier A with each serial number are A B1, A B2, A B3, and A B4.

[0092] In another specific embodiment, the coupon template is identified as A, and the generated serial numbers are B1, B2, B3, B4, B i , i is an integer greater than 1, and the combination of coupon template identifier A and serial number is B i A, based on this combination method, the initial discount code obtained by combining the coupon template identifier A with each serial number is B1A, B2A, B3A, B4A.

[0093] It should be noted that the above-mentioned combination of the coupon template identifier and the serial number is only two feasible methods listed in the embodiment of the present invention, and the present invention does not specifically limit the combination of the coupon template identifier and the serial number. For example, when at least one of the coupon template identifier and the serial number is a multi-digit number, the combination of the two can also be a cross-combination of the numbers of the two according to a specified rule. For example, the coupon template identifier is a, and the serial number is 123456. The cross-combination of the numbers of the two according to the specified rule is 12a3456.

[0094] 208, encrypt the initial discount code to obtain an encrypted target discount code.

[0095] 210, output the target discount code.

[0096] It should be noted that, in the embodiment of the present invention, after the target discount code is generated, the target discount code is directly issued, and there is no need to store the generated target discount code in the database.

[0097] The coupon template identifier is carried in the discount code download request. The device executing the method obtains and parses the discount code download request, thereby extracting the coupon template identifier from the discount code download request, and using the coupon template identifier to generate a discount code, so as to facilitate the subsequent conversion of the discount code into a coupon, and quickly and accurately locate the target coupon template from the multiple coupon templates stored in the database, thereby shortening the time for redeeming the coupon.

[0098] Each obtained initial discount code may be encrypted using a specified encryption algorithm, wherein the specified encryption algorithm may include but is not limited to a symmetric encryption algorithm, an AES (Advanced Encryption Standard) or the like.

[0099] In combination with the above embodiment, optionally, if the discount code obtained by the user is an encrypted discount code, the above-mentioned parsing process of the target discount code to obtain the target discount code information includes: decrypting the obtained target discount code to obtain an initial discount code corresponding to the target discount code; and then, obtaining the corresponding target discount code information by parsing the initial discount code.

[0100] The following uses the Tripple DES symmetric encryption algorithm as an example to specifically explain the encryption and decryption process. In order to ensure the security of the discount code, the device performing the encryption process will automatically generate a random number during the encryption process. The random number can only be used once in the encryption process. Based on this, the random number is used as a component of the discount code to verify the uniqueness of the discount code. In a specific scenario, assuming that the coupon template identifier of the coupon template is a 2-byte binary number, the serial number of the discount code is a 32-bit (4-byte) binary number, and the random number is 1 byte, the 2-byte coupon template identifier, the 4-byte serial number, and the 1-byte random number constitute plain text (i.e., the initial discount code), and then the Tripple DES symmetric encryption algorithm is used to encrypt the plain text to obtain the encrypted target discount code. Among them, TrippleDES is encrypted in data blocks, one data block is 8 bytes, and the plain text composed of the above coupon template identifier, serial number and random number is 7 bytes. Therefore, before encryption, it is necessary to add a 1-byte supplementary value of "0" to fill it up to 8 bytes, and then encrypt it to obtain the ciphertext, and perform 32-bit encoding on the ciphertext to obtain a 13-bit discount code. In addition, the Tripple DES algorithm uses the same secret key for encryption and decryption operations. In this embodiment, the encryption and decryption processes are performed by the same server. If the target discount code obtained is the discount code issued by the server, then the server can successfully implement the decryption process of the target discount code to obtain the coupon template identifier and serial number.

[0101] In the embodiment of the present invention, it is optional that the coupon template identifier of a coupon template is unique, that is, the data of the coupon template identifier of the coupon template in different discount codes corresponding to the same coupon template is the same, and the user can easily crack the coupon template identifier of the coupon template by analyzing multiple different discount codes. In the process of realizing the exchange of discount codes into coupons in the present invention, the security and reliability of the exchange process of finding the coupon template using the coupon template identifier and directly generating the coupon are low. In order to solve this problem, before using the coupon template to generate the coupon, it is possible to first check whether the target discount code is a discount code issued by the system executing the data processing method. Specifically, the target discount code is mainly composed of a coupon template identifier and a serial number of the target discount code. The serial number of the target discount code is a unique identifier of the discount code generated according to a preset numbering rule. Therefore, after obtaining the serial number of the target discount code, before generating the coupon, the following steps need to be performed: verify whether the serial number of the target discount code meets the preset numbering rule; if it is determined that the serial number of the target discount code meets the preset numbering rule, it is determined that the target discount code is issued by the system, and the discount code is exchanged for a coupon; if it is determined that the serial number of the target discount code does not meet the preset coding rule, it is determined that the target discount code is not issued by the system, and it is not allowed to be exchanged for a coupon, and the discount code redemption fails.

[0102] In an embodiment of the present invention, it is optional that in order to reduce the occurrence of multiple redemptions of a discount code, the present invention proposes that before executing the step of generating a coupon and a coupon identifier according to the target coupon template identifier and the serial number of the target discount code, it is also necessary to check whether the target discount code is valid. After determining that the target discount code is valid, the device is triggered to execute the step of generating the target coupon identifier. In a specific embodiment, checking whether the target discount code is valid includes: first, determining whether there is a coupon identifier corresponding to the serial number of the target discount code in the database; if it is determined that it exists, determining that the discount code has been exchanged for a coupon, and outputting a prompt message that the target discount code is invalid; if it is determined that it does not exist, determining that the discount code has not been exchanged for a coupon, thereby executing the step of generating a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code.

[0103] In an embodiment of the present invention, it is optional that the preferential promotion activity will set some limiting rules for participation in the activity, such as the validity period of the preferential promotion activity, the areas where the preferential activity is allowed to participate, the upper limit of the number of users allowed to participate in the preferential activity within a unit time, and the like. Before finally realizing the exchange of the preferential code for the coupon, it is necessary to first check whether the preferential code meets these limiting rules. Only after it is determined that these limiting rules are met and the target preferential code is valid, can the coupon be successfully exchanged.

[0104] In a specific embodiment, for example, the limiting rules include a redemption time range. After determining that the discount code has not been redeemed, the following steps need to be performed, including: obtaining the redemption time range corresponding to the target coupon template; determining whether the current time is within the redemption time range; if it is determined that the current time is within the redemption time range, determining that the target discount code is valid; if it is determined that the current time is beyond the redemption time range, outputting a prompt message that the discount code is invalid.

[0105] In another specific embodiment, the limiting rules include an upper limit on the number of users allowed to participate in the promotion within a unit time and / or an upper limit on the number of users allowed to participate in a specified area. Before generating a coupon, the following operations need to be performed: obtaining the number of coupons generated within the specified time and / or specified area; determining whether the number of generated coupons reaches a specified threshold; if it is determined that the number of generated coupons does not reach the specified threshold, determining that the target discount code is valid; if it is determined that the number of generated coupons exceeds the specified threshold, outputting a prompt message that the coupons have been collected.

[0106] It should be noted that the above-listed limiting rules are only specific examples given in the embodiment of the present invention, and the embodiment of the present invention does not specifically limit the specific limiting rules.

[0107] Optionally, after the target discount code entered by the user is exchanged for a coupon, in order to ensure that when the coupon is sent to the corresponding user, the coupon will not be maliciously intercepted and used by others during the sending process. Specifically: the sender ID number of the target discount code is used as the secret key to encrypt the coupon to obtain the encrypted coupon; then, the encrypted coupon is sent. In this way, before the device displays the coupon to the user, the identity needs to be verified first. When the identity verification is passed, the coupon is displayed; otherwise, a prompt message indicating that the verification failed is output.

[0108] Based on the data processing method provided in the above embodiment, the embodiment of the present invention further provides an embodiment of a device for implementing each step and method in the above method embodiment.

[0109] Please refer to Figure 3, which is a functional block diagram of the device provided by an embodiment of the present invention. As shown in the figure, the device includes: an acquisition unit 31, a parsing unit 32, a search unit 33, a generation unit 34 and a processing unit 35. Among them, the acquisition unit 31 is used to obtain a discount code redemption request, and the discount code redemption request includes a target discount code to be redeemed; the parsing unit 32 is used to parse the target discount code to obtain the target discount code information, wherein the target discount code information at least includes a target coupon template identifier of a coupon template corresponding to the target discount code and a serial number of the target discount code; the search unit 33 is used to search for a target coupon template matching the target coupon template identifier from a database; the generation unit 34 is used to generate a coupon identifier corresponding to the coupon according to the target coupon template identifier and the serial number of the target discount code if a target coupon template matching the target coupon template identifier is found; and, according to the target coupon template, generate a coupon corresponding to the target coupon identifier; the processing unit 35 is used to save the coupon identifier in a database and send the coupon.

[0110] Optionally, in order to ensure the security and reliability of the issued discount codes and avoid economic losses to merchants due to malicious imitation of discount codes by some unscrupulous users, the discount codes issued to users can be encrypted based on certain rules. In this way, the phenomenon of discount code imitation can be avoided to a certain extent, and the security and reliability of discount codes can be improved. Based on this, in the data processing device, the acquisition unit 31 is also used to obtain a discount code download request, wherein the discount code download request carries the number of discount codes required and the coupon template identifier. The generation unit 34 is also used to generate a specified number of serial numbers according to the number of discount codes required and the preset numbering rules, wherein the specified number is equal to the number of discount codes required. The processing unit 35 is also used to combine the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes; and, encrypt the initial discount code to obtain the encrypted target discount code; and, output the target discount code.

[0111] In the embodiment of the present invention, optionally, if the discount code obtained by the user is an encrypted discount code, the parsing unit 32 needs to perform the following operations when parsing the target discount code to obtain the target discount code information: decrypting the target discount code to obtain an initial discount code corresponding to the target discount code; and obtaining the corresponding target discount code information by parsing the initial discount code.

[0112] In the embodiment of the present invention, optionally, before the generation unit 34 generates the target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, if a target coupon template matching the target coupon template identifier is found, it is also necessary to verify the validity of the discount code, that is, to verify whether the discount code meets the redemption requirements. Based on this, the processing unit 35 is further used to execute: determine whether there is a coupon identifier corresponding to the serial number of the target discount code in the database; if it is determined that it exists, determine that the target discount code has been redeemed for a coupon, and output a prompt message that the target discount code is invalid; if it is determined that it does not exist, determine that the target discount code has not been redeemed for a coupon.

[0113] In the embodiment of the present invention, optionally, after determining that the discount code has not been exchanged for a coupon, if a target coupon template matching the target coupon template identifier is found, before generating a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the processing unit 35 may also be used to further check whether the target discount code meets other requirements, which may be:

[0114] First, obtain the redemption time range corresponding to the target coupon template; then, determine whether the current time is within the redemption time range; if it is determined that the current time is within the redemption time range, determine that the target discount code is valid; if it is determined that the current time is beyond the redemption time range, output a prompt message that the discount code is invalid.

[0115] and / or,

[0116] First, the number of coupons generated within the specified time and / or specified area is obtained; then, it is determined whether the number of generated coupons reaches a specified threshold; if it is determined that the number of generated coupons does not reach the specified threshold, it is determined that the target discount code is valid; if it is determined that the number of generated coupons exceeds the specified threshold, a prompt message is output indicating that the coupons have been collected.

[0117] In the embodiment of the present invention, after the target discount code is successfully exchanged for a coupon, in order to ensure that when the coupon is sent to the corresponding user, the coupon will not be maliciously intercepted and used by others during the sending process, the coupon can be encrypted. Specifically, the discount code redemption request also includes the sender's identifier. Before the processing unit 35 sends the coupon, the processing unit 35 can also be used to encrypt the coupon based on the sent identifier as a secret key to obtain an encrypted coupon; thereby, the encrypted coupon is sent.

[0118] Since each unit in this embodiment can execute Figure 1-Figure 2 For the method shown in the embodiment, the part not described in detail in this embodiment can be referred to Figure 1-Figure 2 Related instructions.

[0119] Based on the data processing method provided in the above embodiment, the embodiment of the present invention further provides an electronic terminal for implementing each step and method in the above method embodiment. Figure 4 , which is a functional block diagram of an electronic terminal provided by an embodiment of the present invention. Figure 4 As shown, the electronic terminal includes a memory 41, a processor 42, and a computer program stored in the memory 41 and executable on the processor 42. When the processor 42 executes the computer program, the processor 42 implements any one of the above-mentioned data processing methods.

[0120] An embodiment of the present invention further provides a non-volatile computer-readable storage medium on which computer-readable instructions are stored. When a computer reads and executes the computer-readable instructions, the computer implements any of the above-mentioned data processing methods.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0122] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0125] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0126] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining a discount code redemption request, wherein the discount code redemption request includes a target discount code to be redeemed; Parsing the target discount code to obtain target discount code information, wherein the target discount code information at least includes a target coupon template identifier corresponding to the target discount code and a serial number of the target discount code; Searching a database for a target coupon template that matches the target coupon template identifier; If the target discount code has not been exchanged for a coupon, and a target coupon template matching the target coupon template identifier is found, a target coupon identifier is generated according to the target coupon template identifier and the serial number of the target discount code; and, Generate a coupon corresponding to the target coupon identifier according to the target coupon template; save the target coupon identifier in a database, and send the coupon; Before generating the target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the method further includes: Determining whether there is a coupon identifier corresponding to the serial number of the target discount code in the database; If it is determined that the target discount code exists, it is determined that the target discount code has been exchanged for a coupon, and a prompt message indicating that the target discount code is invalid is output; If it is determined that the target discount code does not exist, it is determined that the target discount code has not been redeemed for a coupon; After obtaining the serial number of the target discount code and before generating the coupon, the method further includes: Verify whether the serial number of the target discount code meets the preset numbering rules; if the serial number of the target discount code meets the preset numbering rules, exchange the target discount code for a coupon; if the serial number of the target discount code does not meet the preset coding rules, the discount code exchange fails.

2. The method according to claim 1, characterized in that The method further comprises: Obtain a discount code download request, wherein the discount code download request carries the quantity of discount codes required and a coupon template identifier; Generate a specified number of serial numbers according to the number of discount codes required and a preset numbering rule, wherein the specified number is equal to the number of discount codes required; Combining the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes; Encrypting the initial discount code to obtain an encrypted target discount code; The target discount code is output.

3. The method according to claim 2, characterized in that The target discount code is parsed to obtain the target discount code information, including: Decrypting the target discount code to obtain an initial discount code corresponding to the target discount code; By parsing the initial discount code, the corresponding target discount code information is obtained.

4. The method according to claim 1, characterized in that: After determining that the target discount code has not been exchanged for a coupon, and before generating a target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the method further includes: Obtaining the redemption time range corresponding to the target coupon template; Determine whether the current time is within the exchange time range; If it is determined that the current time is within the redemption time range, the target discount code is determined to be valid; If it is determined that the current time is beyond the redemption time range, a prompt message indicating that the discount code is invalid is output; and / or, Get the number of coupons generated within a specified time and / or specified area; Determining whether the number of generated coupons reaches a specified threshold; If it is determined that the number of generated coupons does not reach the specified threshold, determining that the target discount code is valid; If it is determined that the number of generated coupons exceeds the specified threshold, a prompt message indicating that the coupons have been redeemed is output.

5. The method according to any one of claims 1 to 4, characterized in that: The coupon code redemption request also includes an identifier of the sender. Before sending the coupon, the method further includes: Using the sender's identifier as a secret key, encrypting the coupon to obtain an encrypted coupon; The encrypted coupon is sent.

6. A data processing device, characterized in that: The data processing device comprises: An acquisition unit, configured to acquire a discount code redemption request, wherein the discount code redemption request includes a target discount code to be redeemed; A parsing unit, configured to parse the target discount code to obtain target discount code information, wherein the target discount code information at least includes a target coupon template identifier of a coupon template corresponding to the target discount code and a serial number of the target discount code; A search unit, configured to search a database for a target coupon template that matches the target coupon template identifier; a generating unit, configured to generate a target coupon identifier according to the target coupon template identifier and the serial number of the target coupon code if the target coupon code has not been exchanged for a coupon and a target coupon template matching the target coupon template identifier is found; and to generate a coupon corresponding to the target coupon identifier according to the target coupon template; A processing unit, configured to save the target coupon identifier into a database and send the coupon; Before generating the target coupon identifier according to the target coupon template identifier and the serial number of the target discount code, the method further includes: Determining whether there is a coupon identifier corresponding to the serial number of the target discount code in the database; If it is determined that the target discount code exists, it is determined that the target discount code has been exchanged for a coupon, and a prompt message indicating that the target discount code is invalid is output; If it is determined that the target discount code does not exist, it is determined that the target discount code has not been redeemed for a coupon; After obtaining the serial number of the target discount code and before generating the coupon, the process further includes: Verify whether the serial number of the target discount code meets the preset numbering rules; if the serial number of the target discount code meets the preset numbering rules, exchange the target discount code for a coupon; if the serial number of the target discount code does not meet the preset coding rules, the discount code exchange fails.

7. The device according to claim 6, characterized in that The acquisition unit is further used to acquire a discount code download request, wherein the discount code download request carries the quantity of discount codes required and a coupon template identifier; The generating unit is further configured to generate a specified number of serial numbers according to the number of the required discount codes and a preset numbering rule, wherein the specified number is equal to the number of the required discount codes; The processing unit is further used to combine the coupon template identifier with each obtained serial number to obtain a specified number of initial discount codes; The processing unit is further used to encrypt the initial discount code to obtain an encrypted target discount code; The processing unit is further configured to output the target discount code.

8. An electronic terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the data processing method according to any one of claims 1 to 5.

9. A non-volatile computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When a computer reads and executes the computer-readable instructions, the computer implements the data processing method according to any one of claims 1 to 5.