Data processing method and device, storage medium and program product
By combining the cache server and the execution server, the time window cache area is used to manage coupon collection data, which solves the problem of inefficient query caused by data expansion, improves the efficiency and user experience of coupon collection, and reduces storage costs and system maintenance difficulties.
Patent Information
- Application Number
- CN202510473830.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the inflated data volume of coupon collection records leads to inefficient database query, affects service performance and user experience, and increases data storage cost and maintenance difficulty.
Through the combination of the cache server and the execution server, the application platform provides coupon data caching services, and uses the time window cache area to manage users' coupon data, reduce dependence on the database, and automatically clear the no longer needed data after the time window ends.
It improves the query efficiency and flexibility of coupon collection, reduces storage costs and system maintenance difficulties, optimizes the coupon collection process, and improves user experience and system performance.
Smart Images

Figure CN120410619A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a data processing method, device, storage medium, and program product. Background Art
[0002] With the development of Internet technology and the popularization of intelligent terminals, more and more merchants tend to conduct marketing promotion activities by issuing electronic coupons. Currently, the coupon redemption mechanism relies on a database to store users' redemption records. Each time a user attempts to redeem a coupon, the system queries the database to determine how many coupons the user has redeemed within a specified past time period, and based on this, determines whether to allow a new coupon redemption behavior.
[0003] As the usage time increases, the accumulation of coupon redemption records will cause the data volume in the database to expand rapidly. This not only reduces the data query efficiency, affects service performance and user experience, but also increases the data storage cost and maintenance difficulty. Summary of the Invention
[0004] Embodiments of this application provide a data processing method, device, storage medium, and program product, which are used to improve data query efficiency, improve service performance and user experience, and reduce data storage cost and maintenance difficulty.
[0005] An embodiment of the present application provides a processing method, which is applied to an execution server. The execution server is responsible for connecting at least one application platform to a cache server. The at least one application platform issues various coupons to users. The cache server is responsible for providing a coupon collection data caching service for the at least one application platform. The method includes: receiving a collection request sent by a terminal device. The collection request is sent by the terminal device in response to a trigger operation of a target user on a coupon collection entry provided by a target application platform. The coupon collection request includes an identifier of the target user and an identifier of a target coupon provided by the target application platform. The target application platform is any one of the at least one application platforms. According to the identifier of the target user and the identifier of the target coupon, it is determined whether there is a target time window cache area corresponding to the target user and the target coupon in the cache server. Wherein, the cache server is used to create a time window cache area corresponding to a certain type of coupon for a user when the user first collects any type of coupon for the first time. Different types of coupons collected by the same user correspond to different time window cache areas. The time window cache area refers to a cache area with a time window, and the time window represents the validity period of the time window cache area. If the target time window cache area exists, obtain the historical collection data of the target user for the target coupon from the target time window cache area. According to the historical collection data, it is determined whether the target user can continue to collect the target coupon. If the determination result is yes, issue the target coupon to the target user, and cache the current collection data of the target user for the target coupon into the target time window cache area. If the target time window cache area does not exist, create the target time window cache area on the cache server, issue the target coupon to the target user, and cache the current collection data of the target user for the target coupon into the target time window cache area.
[0006] An embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the above method for parsing the class inheritance relationship based on program operation or the code analysis method.
[0007] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to implement the steps in the above method for parsing the class inheritance relationship based on program operation or the code analysis method.
[0008] In the embodiments of the present application, by combining a cache server and an execution server, a secure and efficient coupon redemption service and a coupon redemption data caching service are provided for the application platform, significantly improving the query efficiency of redemption data, the efficiency and flexibility of coupon redemption, and saving the storage space of the execution server. First, the use of the cache server greatly reduces the dependence on the database, avoids the problem of low query efficiency caused by data volume expansion, thus significantly improving the response speed of users redeeming coupons and enhancing the user experience. Second, different time window buffers are corresponding to different types of coupons redeemed by the same user, enabling the redemption limit of each type of coupon to be set independently, enhancing the flexibility of the coupon issuance strategy and meeting diverse operation requirements. In addition, the cache server automatically clears the data that is no longer needed after the time window ends and reclaims the cache resources, not only improving the space utilization rate, but also reducing the storage cost and the maintenance difficulty of the system, and maintaining the efficient operation of the system. In summary, this solution optimizes the coupon redemption process, reduces the operation cost, and improves the overall performance of the system and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0010] Figure 1 is a schematic flowchart of a data processing method provided by an exemplary embodiment of the present application;
[0011] Figure 2 is a schematic flowchart of another data processing method provided by another exemplary embodiment of the present application;
[0012] Figure 3 is a schematic structural diagram of an electronic device provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0013] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0014] It should be noted that in the case where the embodiments of the present application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject. Additionally, various models (including but not limited to language models or large models) involved in the present application comply with relevant laws and standards.
[0015] In addition, it should be noted that in the case where the embodiments of the present application involve user interaction operations or trigger operations, the user interaction operations or trigger operations involved in the embodiments of the present application include but are not limited to: interaction operations in various ways such as touch operations, gesture operations, voice operations, head movement operations, eye movement operations, etc.; among them, touch operations include but are not limited to: click operations, double-click operations, long-press operations, swipe operations, pinch operations, or mouse hover operations, etc. Swipe operations include but are not limited to: straight-line swipes, curved swipes, etc.
[0016] Furthermore, it should be noted that in the case where the embodiments of the present application involve the jump between the first interface and the second interface, the jump methods involved in the embodiments of the present application include but are not limited to: directly jumping from the first interface to the second interface, first jumping from the first interface to the task interface and then jumping to the second interface when corresponding task operations are completed on the task interface; completing the corresponding task operations on the task interface includes but is not limited to: when the task interface is implemented as a game interface, completing game operations on the game interface; when the task interface is implemented as an identity authentication interface, completing identity authentication on the identity authentication interface; when the task interface is implemented as a recharge interface, completing recharge operations on the recharge interface; and so on.
[0017] Continuing from the background art, in view of the above-mentioned existing technical problems, in the embodiments of the present application, by combining a cache server and an execution server, a secure and efficient coupon redemption service and a coupon redemption data caching service are provided for the application platform, significantly improving the query efficiency of redemption data, the efficiency and flexibility of coupon redemption, and saving the storage space of the execution server. First, the use of the cache server greatly reduces the dependence on the database, avoiding the problem of low query efficiency caused by data volume expansion, thus significantly improving the response speed of users to redeem coupons and enhancing the user experience. Second, different time window buffer areas are corresponding to different types of coupons redeemed by the same user, enabling the redemption limit of each type of coupon to be set independently, enhancing the flexibility of the coupon issuance strategy and meeting diverse operation requirements. In addition, the cache server automatically clears the data that is no longer needed after the time window ends and reclaims the cache resources, not only improving the space utilization rate, but also reducing the storage cost and the maintenance difficulty of the system, and maintaining the efficient operation of the system. In summary, this solution optimizes the coupon redemption process, reduces the operation cost, and improves the overall performance of the system and the user experience.
[0018] The following will describe in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
[0019] Figure 1 It is a schematic flowchart of a data processing method provided by an exemplary embodiment of the present application. As Figure 2 It is a schematic flowchart of another data processing method provided by another exemplary embodiment of the present application. As Figure 1 and Figure 2 shown, this data processing method is applied to an execution server. The execution server is responsible for connecting at least one application platform to the cache server. At least one application platform issues multiple types of coupons to users. The cache server is responsible for providing a coupon redemption data caching service for at least one application platform. This data processing method includes:
[0020] 101. Receive a redemption request sent by a terminal device. The redemption request is sent by the terminal device in response to a trigger operation of a target user on a coupon redemption entry provided by a target application platform. The coupon redemption request includes an identifier of the target user and an identifier of a target coupon provided by the target application platform. The target application platform is any one of the at least one application platform;
[0021] 102. Determine whether there is a target time window buffer area corresponding to the target user and the target coupon in the cache server according to the identifier of the target user and the identifier of the target coupon. The cache server is used to create a time window buffer area corresponding to each coupon for a user when the user first receives any coupon. Different types of coupons received by the same user correspond to different time window buffer areas. The time window buffer area refers to a buffer area with a time window, and the time window represents the validity period of the time window buffer area.
[0022] 103. If there is a target time window buffer area, obtain the historical receipt data of the target user for the target coupon from the target time window buffer area.
[0023] 104. Determine whether the target user can continue to receive the target coupon according to the historical receipt data.
[0024] 105. If the judgment result is yes, issue the target coupon to the target user, and cache the current receipt data of the target user for the target coupon in the target time window buffer area.
[0025] 106. If there is no target time window buffer area, create a target time window buffer area on the cache server, issue the target coupon to the target user, and cache the current receipt data of the target user for the target coupon in the target time window buffer area.
[0026] This embodiment does not limit the implementation forms of the execution server and the cache server. The execution server and the cache server can be a single physical server or a cloud server, or can also be a server array. In addition, the execution server and the cache server can be servers with the same implementation form, or can also be servers with different implementation forms.
[0027] This embodiment does not limit the type of the terminal device. For example, the terminal device can be a smart handheld device, such as a smart phone, a tablet computer, a laptop computer or a desktop computer, etc.; or for another example, the terminal device can also be a smart wearable device, such as a smart watch, a smart bracelet, etc.; or for yet another example, the terminal device can also be various smart home appliances with a display screen, such as a smart TV, a smart large screen or a smart robot, etc.
[0028] In this embodiment, the terminal device is the device used by the user who receives the coupon. The terminal device can run at least one application platform, and at least one application platform can issue various coupons to the user. This embodiment does not limit the implementation form of at least one application platform. For example, at least one application platform can be an independently running APP, a mini-program that depends on the APP to run, or a web page. This embodiment also does not limit the type of at least one application platform. For example, at least one application platform can be an application platform in various fields such as a shopping application platform, a housekeeping service application platform, a network car-hailing application platform, or a public transportation application platform.
[0029] In the embodiment of the present application, the execution server can connect at least one application platform to the cache server, and the cache server is responsible for providing coupon receiving data caching services for at least one application platform. Specifically, the cache server is used to create a time window buffer area corresponding to the coupon for the user when each user receives any coupon for the first time. The time window buffer area is used to store the receiving data of the user receiving the coupon. The receiving data at least includes: the time when the user receives the coupon for the first time and the quantity received this time. Different types of coupons received by the same user correspond to different time window buffer areas. The time window buffer area refers to a buffer area with a time window, and the time window represents the validity period of the time window buffer area. The validity period can be determined according to actual needs and can be several minutes, several hours, several days, etc. That is to say, for any coupon received by the same user, there can be a corresponding time window buffer area in the cache server. In other words, each receiving request can correspond to a time window buffer area in the cache server, and the time window buffer area is at least used to store the receiving data of the user receiving the coupon.
[0030] In an alternative embodiment, the time window buffer area can be named jointly with the identifier of the user who receives the coupon and the identifier of the coupon, so as to facilitate subsequent search for the corresponding receiving data. Among them, the application platform where the user receives the coupon can be called the target application platform, and the target application platform is any one of at least one application platform. The use of the cache server greatly reduces the dependence on the database in the execution server, avoids the problem of low query efficiency caused by the expansion of the data volume in the database, thereby significantly improving the response speed of the user receiving the coupon and improving the user experience. Moreover, this data storage method is simple, convenient, and efficient to maintain, and can also save the storage space of the execution server.
[0031] In the embodiments of the present application, the target application platform can provide a coupon redemption entry for users. Users can redeem corresponding coupons through the coupon redemption entry, and such users can be referred to as target users. The implementation forms of the redemption entries for different coupons can be the same or different. For example, the coupon redemption entry can be a pop-up window, a fixed redemption entry on any page included in the target application platform, or a link, etc. This embodiment does not limit this.
[0032] Regardless of the implementation form of the coupon redemption entry, when the target application platform responds to the trigger operation of the target user on the coupon redemption entry, a redemption request can be generated. The redemption request includes the identifier of the target user and the identifier of the target coupon provided by the target application platform. Among them, the identifier of the target user can be an identifier with a unique reference function such as the name or number of the target user. The identifier of the target coupon can also be an identifier with a unique reference function such as the name or number of the target coupon.
[0033] In practical applications, different coupons correspond to different redemption entries. The redemption entry of a coupon can be bound with the identifier of the corresponding coupon. When the target user triggers the redemption entry of the target coupon, a redemption request can be generated based on the identifier of the target coupon carried by the target coupon entry.
[0034] In the embodiments of the present application, after the target application platform generates a redemption request, the terminal device can send the redemption request to the execution server. The execution server can determine whether there is a target time window cache area corresponding to the target user and the coupon in the cache server according to the identifier of the target user and the identifier of the target coupon included in the redemption request.
[0035] In an alternative embodiment, the execution server and the cache server can cooperate with each other to determine whether there is a target time window cache area corresponding to the target user and the coupon in the cache server. The execution server determines whether there is a target time window cache area corresponding to the target user and the coupon in the cache server according to the identifiers of the target user and the target coupon included in the redemption request, including: the execution server can send a data acquisition request to the cache server, and the data acquisition request includes the identifiers of the target user and the target coupon; in response to the data acquisition request, the cache server searches for the corresponding time window cache area according to the identifiers of the target user and the target coupon; if there is a time window cache area named with the identifiers of the target user and the target coupon, the cache server determines that there is a target time window cache area corresponding to the target user and the coupon locally, and sends the historical redemption data in the target time window cache area and the prompt information indicating the existence of the target time window cache area corresponding to the target user and the coupon to the execution server; if there is no time window cache area named with the identifiers of the target user and the target coupon, the cache server determines that there is no target time window cache area corresponding to the target user and the coupon locally, and sends the prompt information indicating that there is no target time window cache area corresponding to the target user and the coupon in the cache server to the execution server.
[0036] In another alternative embodiment, the execution server can directly determine whether there is a target time window cache area corresponding to the target user and the coupon in the cache server. The execution server determines whether there is a target time window cache area corresponding to the target user and the coupon in the cache server according to the identifiers of the target user and the target coupon included in the redemption request, including: the execution server can actively send a data acquisition instruction to the cache server, and the data acquisition instruction includes the identifiers of the target user and the target coupon; the data acquisition instruction searches for the corresponding time window cache area according to the identifiers of the target user and the target coupon; if a time window cache area named with the identifiers of the target user and the target coupon is found, it is determined that there is a target time window cache area corresponding to the target user and the coupon in the cache server, and the historical redemption data is obtained from the target time window cache area; if no time window cache area named with the identifiers of the target user and the target coupon is found, it is determined that there is no target time window cache area corresponding to the target user and the coupon in the cache server.
[0037] In the embodiment of the present application, if there is a target time window buffer in the cache server, the execution server obtains the historical redemption data of the target user for the target coupon from the target time window buffer or receives the historical data sent by the cache server. The historical redemption data includes, but is not limited to: redemption data in terms of user dimension, redemption data in terms of time dimension, or redemption data combining user dimension and time dimension. Among them, the redemption data in terms of user dimension includes, but is not limited to: the maximum number of target coupons that the target user can redeem. The redemption data in terms of time dimension includes, but is not limited to: the maximum number and frequency of target coupons that the same user or different users can redeem within a specified time. The redemption data combining user dimension and time dimension includes, but is not limited to: the number and frequency of the target user obtaining the target coupon during the time window corresponding to the target time window buffer. The number of the target user obtaining the target coupon during the time window corresponding to the target time window buffer includes, but is not limited to: the maximum number of target coupons that the target user can redeem. The frequency can be understood as the maximum number of redemptions of the target coupon that the target user can make within the target period. Usually, one coupon can be redeemed each time. Among them, the size of the target period is smaller than the size of the time window. The target period can be one minute, one hour, one day, etc. For example, if the size of the time window is three minutes, then the target period included in the time window can be one minute; if the size of the time window is three hours, then the target period included in the time window can be one hour; if the size of the time window is three days, then the target period included in the time window can be one day.
[0038] In the embodiment of the present application, after obtaining the historical redemption data, the execution server can also determine whether the target user can continue to redeem the target coupon according to the historical redemption data. If the judgment result is yes, the target coupon is issued to the target user, and the current redemption data of the target user for the target coupon is cached in the target time window buffer. If the judgment result is no, the issuance of the target coupon to the target user is stopped. Specifically, on the basis of the original redemption data, the redemption count of the current redemption of the target coupon is increased (such as "+1"), and the relevant data such as the increased redemption count and the time of the current redemption of the target coupon are cached in the target time window buffer.
[0039] As can be seen from the above embodiments, the historical redemption data at least includes: the historical redemption quantity and historical redemption frequency of the target user within the time window. Then, in an optional embodiment, determining whether the target user can continue to redeem the target coupon according to the historical redemption data includes: comparing the historical redemption data with the pre-configured redemption rules for the target coupon. The pre-configured redemption rules at least include: the maximum redemption quantity and maximum redemption frequency within the time window. If the historical redemption quantity is less than the maximum redemption quantity and the historical redemption frequency is less than the maximum redemption frequency, it is determined that the target user can continue to redeem the target coupon.
[0040] Optionally, the redemption rules pre-configured for the target coupon can be stored in the database of the execution server. When the target user redeems the target coupon for the first time, in addition to creating a target time window buffer area corresponding to this type of coupon for the target user in the cache server, a specified storage area can also be created in the cache server. The specific implementation method of creating the specified storage area in the cache server can refer to the relevant description of creating the target time window buffer area, which will not be elaborated here. The specified storage area is used to store the redemption rules pre-configured for the target coupon. The specified storage area and the target time window buffer area are different areas, and the redemption rules pre-configured for the target coupon stored in the specified storage area can be data shared by different users. Specifically, when the target user redeems the target coupon for the first time, the execution server can, in response to the redemption request, obtain the redemption rules pre-configured for the target coupon from the local database and store the redemption rules pre-configured for the target coupon in the specified storage area of the cache server, so that when comparing the historical redemption data with the redemption rules pre-configured for the target coupon, the redemption rules pre-configured for the target coupon can be quickly found in the specified storage area of the cache server, improving the efficiency of coupon redemption.
[0041] It should be noted that since there is usually a certain time span between different redemption requests, the time span can be long or short. If the time span is long, storing the redemption rules pre-configured for the target coupon in the specified storage area for a long time will cause waste of storage space. To save the storage space of the cache server, a monitor can be set for the specified storage area. After monitoring that the redemption rules pre-configured for the target coupon stored in the specified storage area exceed the preset storage duration, the redemption rules pre-configured for the target coupon stored in the specified storage area can be cleared to release the specified storage area. Or, when the monitor detects that the time span between different redemption requests for the target coupon exceeds the preset duration, and after the monitor detects that the redemption rules pre-configured for the target coupon stored in the specified storage area exceed the preset storage duration, the redemption rules pre-configured for the target coupon stored in the specified storage area can be cleared to release the specified storage area.
[0042] Further optionally, the configuration process of the redemption rule pre-configured for the target coupon is as follows: in response to the configuration operation of the maximum redemption quantity of the target user on the target application platform within the time window, obtain the maximum redemption quantity of the target user on the target application platform within the time window; in response to the configuration operation of the maximum redemption frequency of the target user on the target application platform within the time window, obtain the maximum redemption frequency of the target user on the target application platform within the time window; wherein, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the maximum redemption quantity and maximum redemption frequency of the coupons within the corresponding time window are different.
[0043] Based on this, optionally, compare the historical redemption data with the redemption rule pre-configured for the target coupon, including: the execution server attempts to obtain the redemption rule pre-configured for the target coupon from the specified storage area of the cache server; if successfully obtained, determine whether the target user can continue to redeem the target coupon according to the redemption rule pre-configured for the target coupon obtained from the specified storage area and the historical redemption data; if not successfully obtained, obtain the redemption rule pre-configured for the target coupon from the database of the execution server; determine whether the target user can continue to redeem the target coupon according to the redemption rule pre-configured for the target coupon and the historical redemption data.
[0044] Further optionally, in the case of stopping the issuance of the target coupon to the target user, a prompt message for stopping the redemption of the coupon can be sent to the terminal device, and the reason for stopping the redemption can also be included in the prompt message, so that the target user can understand the reason for stopping the redemption of the coupon. The reason for stopping the redemption includes, but is not limited to: the redemption times have exceeded the limit, the time window has expired, the current coupon redemption behavior is not within the allowable redemption time period, and so on.
[0045] In some alternative embodiments, in order to further save the storage space in the cache server and the target time window buffer, the historical redemption data can be compressed historical redemption data. Then, according to the historical redemption data, determine whether the target user can continue to redeem the target coupon, including: decompress the historical redemption data to obtain the decompressed historical redemption data; determine whether the target user can continue to redeem the target coupon according to the decompressed historical redemption data.
[0046] Correspondingly, caching the current redemption data of the target user for the target coupon into the target time window buffer includes: compressing the current redemption data of the target user for the target coupon, and caching the compressed current redemption data of the target user for the target coupon into the target time window buffer.
[0047] Optionally, when the target user compresses the current redemption data of the target coupon, a lossless compression method can be used. Lossless compression means that during the compression and decompression processes, the original data can be fully restored without any information loss or distortion. In other words, the decompressed data is exactly the same as the original data without any differences. Lossless compression has data integrity, which means that it can ensure that every byte and every bit of the data is exactly the same as the original data after decompression. Additionally, lossless compression is reversible, which means that the compressed data can be precisely restored to the original data without introducing any irrecoverable errors or changes due to compression. Lossless compression includes, but is not limited to, the following methods: dictionary coding compression, algorithm compression, Huffman coding compression, and run-length coding compression.
[0048] Among them, dictionary coding compression includes: by establishing a dictionary, representing recurring strings or data patterns with shorter codes. During the compression process, scan the data, and when a recurring string is encountered, replace it with the code in the dictionary. During decompression, restore the code to the original string according to the dictionary.
[0049] Among them, algorithm compression includes but is not limited to: LZ77 algorithm, LZ78 algorithm, and LZW algorithm (Lempel-Ziv-Welch). Among them, the LZ77 algorithm uses a sliding window technique. The window is divided into two parts. One part is the processed data (as the search range), and the other part is the data to be processed. The algorithm searches for the same substring in the processed data. After finding it, the substring is represented by a pointer (pointing to the position of the substring in the processed data) and a length. If not found, the single character is directly output. For example, for the string "abracadabra", when the window slides to "abracadab", the subsequent "ra" has appeared before and can be represented by a pointer and a length, thus achieving compression. The LZ78 algorithm decomposes the input data into a prefix and an additional character. The prefix is the encoded string, and the additional character is the newly appeared character. The algorithm encodes the new string by continuously updating the dictionary. For example, for the string "ababab", the first "a" is directly encoded as 1, "b" is encoded as 2, "ab" can be regarded as the prefix 1 plus the character "b" and is encoded as (1, 2), and so on, to achieve compression in this way. The LZW algorithm (Lempel-Ziv-Welch): It is a variant of the LZ78 algorithm that optimizes the update and management of the dictionary. It starts from an initial dictionary (usually containing all possible single characters). During the compression process, when encountering a new string, first check if it is in the dictionary. If it is, continue to read the next character; if not, add this new string to the dictionary and represent it with a unique code. For example, for the string "tooth", the initial dictionary contains the single characters "t", "o", "h". When reading "to", it is not in the dictionary, so "to" is added to the dictionary and assigned a new code, and then continue to process the next character, and finally achieve compression in this way.
[0050] Among them, Huffman coding compression constructs a Huffman tree based on the frequencies of symbols (such as characters) in the data. Symbols with high frequencies are represented by shorter codes, and symbols with low frequencies are represented by longer codes. The specific steps are as follows: First, count the frequencies of each symbol in the data, then merge the two symbols with the lowest frequencies into a new node. The frequency of the new node is the sum of the frequencies of the two child nodes. Repeat this process until all symbols are merged into a tree. The path from the root node to each symbol is the Huffman code of that symbol. For example, in a piece of text, the character "a" has the highest frequency and "z" has the lowest frequency. Then "a" may be encoded as "0", and "z" may be encoded as a longer code such as "111", thus achieving effective compression of the entire data. This method is a variable-length coding method with good compression effect and can accurately restore the original data during decompression.
[0051] Among them, run - length encoding compression is for continuously repeated data elements, representing this string of repeated data with a count and a data value. For example, for the string "aaaabbbcccd", it can be compressed to "4a3b3c1d", where the numbers represent the number of repetitions and the letters represent the repeated data elements. This method is simple to implement and has a significant compression effect on files containing a large amount of continuously repeated data.
[0052] In the embodiment of the present application, if the target time - window buffer does not exist in the cache server, then create the target time - window buffer on the cache server, issue the target coupon to the target user, and cache the current redemption data of the target user for the target coupon into the target time - window buffer, so as to facilitate the target user to access the redemption entry of the target coupon again.
[0053] In an optional embodiment, if the target time - window buffer does not exist in the cache server, then create the target time - window buffer on the cache server, issue the target coupon to the target user, and cache the current redemption data of the target user for the target coupon into the target time - window buffer, including: if the target time - window buffer does not exist in the cache server, the execution server can send a creation instruction for creating the target time - window buffer to the cache server, and the creation instruction contains the code corresponding to the target time - window buffer; after receiving the creation instruction, the cache server executes the code corresponding to the target time - window buffer included in the creation instruction to obtain the target time - window buffer.
[0054] In another optional embodiment, if the target time - window buffer does not exist in the cache server, then create the target time - window buffer on the cache server, issue the target coupon to the target user, and cache the current redemption data of the target user for the target coupon into the target time - window buffer, including: if the target time - window buffer does not exist in the cache server, the execution server can send a creation instruction for creating the target time - window buffer to the cache server; the cache server responds to the creation instruction and creates the target time - window buffer.
[0055] In yet another optional embodiment, if the target time - window buffer does not exist in the cache server, then create the target time - window buffer on the cache server, issue the target coupon to the target user, and cache the current redemption data of the target user for the target coupon into the target time - window buffer, including: if the target time - window buffer does not exist in the cache server, the execution server can send a creation instruction for creating the target time - window buffer to the cache server, and the creation instruction is used to create the target time - window buffer in the cache server.
[0056] Further optionally, when creating a target time window buffer on the cache server, a first monitor may also be created for the target time window buffer. The first monitor is used to monitor the existence duration of the target time window buffer since the creation of the target time window buffer. When the first monitor detects that the existence duration of the target time window buffer reaches the validity period of the target time window buffer, all the received data cached in the target time window buffer is cleared to release the target time window buffer. Additionally, after releasing the target time window buffer, the first monitor or the cache server may also recycle the target time window buffer to provide sufficient space for creating time window buffers corresponding to other received requests subsequently. Furthermore, the first monitor may also have an automatic deletion mechanism. After the first monitor clears and releases all the received data cached in the target time window buffer, the first monitor may be cleared according to its own automatic deletion mechanism to save more storage space of the cache server.
[0057] In some alternative embodiments, creating a target time window buffer on the cache server includes: determining the size of the buffer and the size of the time window according to the attribute information of the target user, the attribute information of the target coupon, and / or the attribute information of the target application platform to which the target coupon belongs; wherein, the size of the buffer is in a proportional relationship with the size of the time window; creating a target time window buffer on the cache server according to the size of the buffer and the size of the time window; wherein, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the corresponding buffer sizes and time window sizes are different. Among them, the attributes of the user include, but are not limited to: the membership level of the user on the target application platform, the credit level of the user on the target application platform, and the gender of the user. The attributes of the coupon include, but are not limited to: the type of the coupon, the level of the coupon, and the popularity of the coupon. The popularity of the coupon can be determined by the number of received and / or used coupons. The attributes of the application platform include, but are not limited to: the type of the application platform and the level of the application platform.
[0058] It should be noted that for high-quality platforms, popular coupons, users who like to receive coupons, and / or users with a high level (but not limited to this), a larger cache area may be allocated, and a longer validity period may be set for the corresponding time window buffer. The larger the buffer, the more data can be cached, and the longer the validity period can be.
[0059] Further optionally, after receiving the redemption request, a second monitor may be created for the redemption request. The second monitor is used to monitor whether the execution server receives the same redemption request during the process of redeeming the corresponding coupon according to the redemption request. If so, the second monitor clears the same redemption request. The second monitor can monitor whether the target user redeems the same coupon at the same time through different terminal devices, so as to prevent the abnormal situation of coupon redemption caused by exactly the same concurrent tasks.
[0060] It should be noted that for multiple redemption requests, regardless of whether these redemption requests are sent by the same user and regardless of whether these redemption requests are for redeeming the same coupon, after receiving each redemption request, the execution server may create a corresponding thread and execute the above steps (coupon redemption process) in the corresponding data processing method through the thread. Different requests correspond to different threads. If there are multiple redemption requests for different users to redeem coupons at the same time, corresponding multiple threads may be created simultaneously, and different threads process the above steps (coupon redemption process) in the data processing methods corresponding to different redemption requests.
[0061] The technical solutions provided in the above embodiments of the present application, by combining the cache server and the execution server, provide a secure and efficient coupon redemption service and a coupon redemption data caching service for the application platform, significantly improving the query efficiency of redemption data, the efficiency and flexibility of coupon redemption, and saving the storage space of the execution server. First, the use of the cache server greatly reduces the dependence on the database, avoiding the problem of low query efficiency caused by data volume expansion, thus significantly improving the response speed of users redeeming coupons and improving the user experience. Second, different time window buffers correspond to different types of coupons redeemed by the same user, so that the redemption limit for each type of coupon can be set independently, enhancing the flexibility of the coupon issuance strategy and meeting diverse operation requirements. In addition, the cache server automatically clears the data that is no longer needed after the time window ends and reclaims the cache resources, not only improving the space utilization rate, but also reducing the storage cost and the maintenance difficulty of the system, and maintaining the efficient operation of the system. In summary, this solution optimizes the coupon redemption process, reduces the operation cost, and improves the overall performance and user experience of the system.
[0062] Figure 3 It is a schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. As Figure 3 shown, the electronic device includes: a memory 30a and a processor 30b; the memory 30a is used to store a computer program; the processor 30b is coupled to the memory 30a and is used to execute the computer program to implement the following steps:
[0063] Receive the redemption request sent by the receiving terminal device. The redemption request is sent by the terminal device in response to the triggering operation of the target user on the coupon redemption entry provided by the target application platform. The coupon redemption request contains the identifier of the target user and the identifier of the target coupon provided by the target application platform. The target application platform is any one of at least one application platform. According to the identifier of the target user and the identifier of the target coupon, determine whether there is a target time window buffer area corresponding to the target user and the target coupon in the cache server. The cache server is used to create a time window buffer area corresponding to each coupon for a user when the user first redeems any coupon. Different time window buffer areas correspond to different types of coupons redeemed by the same user. The time window buffer area is a buffer area with a time window, and the time window represents the validity period of the time window buffer area. If there is a target time window buffer area, obtain the historical redemption data of the target user for the target coupon from the target time window buffer area. According to the historical redemption data, determine whether the target user can continue to redeem the target coupon. If the judgment result is yes, issue the target coupon to the target user and cache the current redemption data of the target user for the target coupon in the target time window buffer area. If there is no target time window buffer area, create a target time window buffer area on the cache server, issue the target coupon to the target user, and cache the current redemption data of the target user for the target coupon in the target time window buffer area.
[0064] In some alternative embodiments, if the historical redemption data is compressed historical redemption data, when the processor determines whether the target user can continue to redeem the target coupon according to the historical redemption data, it is specifically used for: decompressing the historical redemption data to obtain the decompressed historical redemption data; and determining whether the target user can continue to redeem the target coupon according to the decompressed historical redemption data.
[0065] Correspondingly, when the processor caches the current redemption data of the target user for the target coupon in the target time window buffer area, it is specifically used for: compressing the current redemption data of the target user for the target coupon and caching the compressed current redemption data of the target user for the target coupon in the target time window buffer area.
[0066] Further optionally, the processor is further used to create a first monitor for the target time window buffer area when creating the target time window buffer area on the cache server. The first monitor is used to monitor the existence duration of the target time window buffer area since the creation of the target time window buffer area. When the first monitor detects that the existence duration of the target time window buffer area reaches the validity period of the target time window buffer area, clear all the redemption data cached in the target time window buffer area to release the target time window buffer area.
[0067] In some alternative embodiments, when creating a target time window buffer on the cache server, the processor is specifically configured to: determine the buffer size and the size of the time window according to the attribute information of the target user, the attribute information of the target coupon, and / or the attribute information of the target application platform to which the target coupon belongs; wherein, the buffer size is in a proportional relationship with the size of the time window; create a target time window buffer on the cache server according to the buffer size and the size of the time window; wherein, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the corresponding buffer size and the size of the time window are different.
[0068] In some alternative embodiments, the historical redemption data at least includes: the historical redemption quantity and the historical redemption frequency of the target user within the time window; when determining whether the target user can continue to redeem the target coupon according to the historical redemption data, the processor is specifically configured to: compare the historical redemption data with the pre-configured redemption rules for the target coupon, and the pre-configured redemption rules at least include: the maximum redemption quantity and the maximum redemption frequency within the time window; if the historical redemption quantity is less than the maximum redemption quantity and the historical redemption frequency is less than the maximum redemption frequency, it is determined that the target user can continue to redeem the target coupon.
[0069] Further optionally, the processor is further configured to, in response to a configuration operation for the maximum redemption quantity of the target user of the target application platform within the time window, obtain the maximum redemption quantity of the target user of the target application platform within the time window; in response to a configuration operation for the maximum redemption frequency of the target user of the target application platform within the time window, obtain the maximum redemption frequency of the target user of the target application platform within the time window; wherein, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the corresponding maximum redemption quantity and the maximum redemption frequency of the coupons within the time window are different.
[0070] Further optionally, after receiving a redemption request, the processor may further create a second monitor for the redemption request, and the second monitor is used to monitor whether the execution server receives the same redemption request during the process of redeeming the corresponding coupon according to the redemption request; if so, the second monitor clears the same redemption request.
[0071] The detailed implementation manners and beneficial effects of the steps in the method of this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated herein.
[0072] Further, as Figure 3 shown, the electronic device further includes: other components such as a communication component 30c, a display 30d, a power supply component 30e, and an audio component 30f. Figure 3 Only some components are schematically shown, and it does not mean that the electronic device only includesFigure 3 The components shown
[0073] In addition Figure 3 The components within the dashed box are optional components, rather than essential components, and can be determined according to the product form of the electronic device. The electronic device in this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or can also be a server device such as a conventional server, a cloud server, or a server array. If the electronic device in this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it may include Figure 3 the components within the dashed box; if the electronic device in this embodiment is implemented as a server device such as a conventional server, a cloud server, or a server array, it may not include Figure 3 the components within the dashed box.
[0074] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disc.
[0075] The above-mentioned communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on communication standards, such as WiFi, 2G, 3G, 6G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0076] The above-mentioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from users. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations.
[0077] The above-mentioned power supply component provides power for various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
[0078] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.
[0079] Correspondingly, an exemplary embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the above method.
[0080] Correspondingly, an exemplary embodiment of the present application further provides a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, enables the processor to perform the steps in the above method.
[0081] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, Compact Disc Read-Only Memories (CD-ROMs), optical memories, etc.) that contain computer-usable program code.
[0082] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, as well as the combination of flows and / or blocks in the flowchart and / or block diagram. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0083] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0085] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), an input / output interface, a network interface, and a memory.
[0086] The memory may include non-permanent memory in the form of computer-readable media, random access memory (Random Access Memory, RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0087] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0088] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0089] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A data processing method, characterized in that, Applied to an execution server, the execution server is responsible for connecting at least one application platform to a cache server. The at least one application platform issues various coupons to users. The cache server is responsible for providing coupon redemption data caching services for the at least one application platform. The method includes: Receiving a redemption request sent by a terminal device. The redemption request is sent by the terminal device in response to a trigger operation by a target user on a coupon redemption entry provided by a target application platform. The coupon redemption request contains an identifier of the target user and an identifier of a target coupon provided by the target application platform. The target application platform is any one of the at least one application platforms; Based on the identifier of the target user and the identifier of the target coupon, determining whether there is a target time window cache area corresponding to the target user and the target coupon in the cache server. The cache server is used to create a time window cache area corresponding to a coupon for a user when the user first redeems any coupon. Different types of coupons redeemed by the same user correspond to different time window cache areas. The time window cache area is a cache area with a time window, and the time window represents the validity period of the time window cache area; If the target time window cache area exists, obtaining historical redemption data of the target user for the target coupon from the target time window cache area; Based on the historical redemption data, determining whether the target user can continue to redeem the target coupon; If the determination result is yes, issuing the target coupon to the target user and caching the current redemption data of the target user for the target coupon in the target time window cache area; If the target time window cache area does not exist, creating the target time window cache area on the cache server, issuing the target coupon to the target user, and caching the current redemption data of the target user for the target coupon in the target time window cache area.
2. The method according to claim 1, wherein If the historical redemption data is compressed historical redemption data, then based on the historical redemption data, determining whether the target user can continue to redeem the target coupon includes: Performing decompression processing on the historical redemption data to obtain decompressed historical redemption data. Based on the decompressed historical redemption data, determining whether the target user can continue to redeem the target coupon; Correspondingly, caching the current redemption data of the target user for the target coupon in the target time window cache area includes: Compressing the current redemption data of the target user for the target coupon and caching the compressed current redemption data of the target user for the target coupon in the target time window cache area.
3. The method according to claim 1, wherein It further includes: When creating the target time window buffer on the cache server, create a first monitor for the target time window buffer, where the first monitor is used to monitor the existence duration of the target time window buffer since the creation of the target time window buffer; When the first monitor detects that the existence duration of the target time window buffer reaches the validity period of the target time window buffer, clear all the redeemed data cached in the target time window buffer to release the target time window buffer.
4. The method according to claim 1, wherein Creating the target time window buffer on the cache server includes: Determine the buffer size and the size of the time window according to the attribute information of the target user, the attribute information of the target coupon, and / or the attribute information of the target application platform to which the target coupon belongs; wherein, the buffer size is in a proportional relationship with the size of the time window; Create the target time window buffer on the cache server according to the buffer size and the size of the time window; Among them, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the corresponding buffer size and the size of the time window are different.
5. The method according to any one of claims 4, characterized in that, The historical redemption data at least includes: the historical redemption quantity and historical redemption frequency of the target user within the time window; judging whether the target user can continue to redeem the target coupon according to the historical redemption data includes: Compare the historical redemption data with the pre-configured redemption rules for the target coupon, where the pre-configured redemption rules at least include: the maximum redemption quantity and maximum redemption frequency within the time window; If the historical redemption quantity is less than the maximum redemption quantity and the historical redemption frequency is less than the maximum redemption frequency, it is determined that the target user can continue to redeem the target coupon.
6. The method according to claim 5, characterized in that, It further includes: In response to a configuration operation of the maximum redemption quantity of the target user of the target application platform within the time window, obtain the maximum redemption quantity of the target user of the target application platform within the time window; In response to a configuration operation of the maximum redemption frequency of the target user of the target application platform within the time window, obtain the maximum redemption frequency of the target user of the target application platform within the time window; Among them, for users with different attributes, coupons with different attributes, and / or application platforms with different attributes, the corresponding maximum redemption quantity and maximum redemption frequency of the coupons within the time window are different.
7. The method according to any one of claims 1-6, characterized in that It further includes: After receiving the redemption request, create a second monitor for the redemption request, where the second monitor is used to monitor whether the execution server receives the same redemption request during the process of redeeming the corresponding coupon according to the redemption request; If so, the second monitor clears the same redemption request.
8. An electronic device, characterized in that, It includes: A memory and a processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the method described in any one of claims 1-7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to implement the steps in the method according to any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program / instructions which, when executed by a processor, cause the processor to be able to implement the steps in the method according to any one of claims 1-7.
