Low-latency asynchronous notification processing method, apparatus, device, medium, and program
By routing notification events based on user value characteristics and event popularity in high-concurrency business scenarios, the notification delay problem is solved, and the user experience and the timeliness of notifications are improved.
Patent Information
- Application Number
- CN202611480337.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-24
AI Technical Summary
In high-concurrency business scenarios, the notification sending latency of existing technologies increases significantly, affecting the user experience.
By responding to pending notification events, user information and event information are determined. Routing is performed using user value characteristics and event popularity. The pending notification events are allocated to at least two queues that are processed in parallel. Each queue is configured with different hardware resources to generate and send notification information.
It enables low-latency processing of asynchronous notifications, improving user experience and the timeliness of notifications, and avoiding delays caused by resource contention for high-priority events.
Smart Images

Figure CN123157482A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a low-latency asynchronous notification processing method, apparatus, device, medium and program. Background Technology
[0002] In high-concurrency business scenarios, when a user experiences a specific event (such as claiming benefits, completing a transaction, etc.), the system needs to send a notification to the user in a timely manner.
[0003] In related technologies, after detecting the need to send a notification to the user, the corresponding notification messages are typically placed into a queue, and the consumer retrieves and sends them sequentially according to the order they were enqueued. This method, in scenarios with massive concurrent notifications, causes a significant increase in notification sending latency, impacting the user experience.
[0004] Therefore, there is an urgent need for a low-latency asynchronous notification processing method. Summary of the Invention
[0005] This application provides a low-latency asynchronous notification processing method, apparatus, device, medium, and program to significantly reduce overall notification latency and improve user experience.
[0006] In a first aspect, embodiments of this application provide a low-latency asynchronous notification processing method, the method being applied to a server, the method comprising:
[0007] In response to the detection of a pending notification event; based on the pending notification event, determine user information and event information; wherein, the user information represents user identity and user value characteristic data; the event information represents rights batch identifier and event popularity related attributes;
[0008] Based on the user information and the event information, the event to be notified is routed to be allocated to a notification queue; wherein, the notification queue includes at least two queues that are processed in parallel; each queue is configured with different hardware resources.
[0009] For each event to be notified in the notification queue, a notification message corresponding to the event is generated; and the notification message is sent to the user terminal so that the user terminal can process the notification message and display it on the user terminal; wherein, the notification message represents the benefit claim result to be displayed to the user terminal.
[0010] In one possible implementation, the event to be notified is routed according to the user information and the event information to allocate the event to a notification queue, including:
[0011] Based on the user information and the event information, a user score and an event score are determined; wherein, the user score represents the value of the user; and the event score represents the popularity of the event's rights and benefits batch.
[0012] Based on the user rating and the event rating, the events to be notified are routed to be assigned to a notification queue; the notification queue includes a first queue, a second queue, and a third queue; the hardware resources configured for the first queue, the second queue, and the third queue decrease sequentially.
[0013] In one possible implementation, determining the user rating and the event rating based on the user information and the event information includes:
[0014] The user information is processed based on a preset LTV model to obtain the user rating output by the preset LTV model;
[0015] Based on the rights batch identifier in the event information, the number of rights batch claim requests is determined within a preset sliding window; and based on the number of claim requests, the event score is determined.
[0016] In one possible implementation, the event to be notified is routed based on the user rating and the event rating to allocate the event to a notification queue, including:
[0017] If it is determined that the user rating is greater than or equal to a first preset threshold, then it is determined that the event to be notified will be assigned to the first queue;
[0018] If it is determined that the user score is less than a first preset threshold and the event score is greater than or equal to a second preset threshold, then it is determined that the event to be notified will be assigned to the second queue.
[0019] If it is determined that the user score is less than a first preset threshold and the event score is less than a second preset threshold, then it is determined that the event to be notified will be assigned to the third queue.
[0020] In one possible implementation, for each event to be notified in the notification queue, generating notification information corresponding to the event to be notified includes:
[0021] Based on the events to be notified in the queue, the target template corresponding to the event to be notified is matched from the preset template database.
[0022] A notification summary is generated based on the target template and the event to be notified; wherein, the notification summary includes the target template identifier and dynamic parameters; the dynamic parameters are used to populate the fields to be populated in the target template;
[0023] The notification digest is compressed to obtain the notification information.
[0024] In one possible implementation, the user terminal is used to process the notification information and display it on the user terminal, including:
[0025] The user terminal decompresses the notification information to obtain a notification digest;
[0026] Based on the target template identifier in the notification summary, the corresponding target template is matched from the preset template database; the dynamic field identifier to be filled in the notification summary is filled into the target template to obtain the information to be displayed;
[0027] The information to be displayed is rendered and then displayed on the user's device.
[0028] Secondly, embodiments of this application provide a low-latency asynchronous notification processing apparatus, which is applied to a server and includes:
[0029] The response module is used to respond to the detection of a pending notification event; and to determine user information and event information based on the pending notification event; wherein the user information represents user identity and user value characteristic data; and the event information represents rights batch identifier and event popularity-related attributes.
[0030] The processing module is used to perform routing processing on the event to be notified based on the user information and the event information, so as to allocate the event to the notification queue; wherein, the notification queue includes at least two queues for parallel processing; each queue is configured with different hardware resources;
[0031] The generation module is used to generate notification information corresponding to each notification event in the notification queue; and send the notification information to the user terminal so that the user terminal can process the notification information and display it on the user terminal; wherein, the notification information represents the benefit claim result to be displayed to the user terminal.
[0032] In one possible implementation, the processing module is specifically used for:
[0033] Based on the user information and the event information, a user score and an event score are determined; wherein, the user score represents the value of the user; and the event score represents the popularity of the event's rights and benefits batch.
[0034] Based on the user rating and the event rating, the events to be notified are routed to be assigned to a notification queue; the notification queue includes a first queue, a second queue, and a third queue; the hardware resources configured for the first queue, the second queue, and the third queue decrease sequentially.
[0035] In one possible implementation, the processing module is further configured to:
[0036] The user information is processed based on a preset LTV model to obtain the user rating output by the preset LTV model;
[0037] Based on the rights batch identifier in the event information, the number of rights batch claim requests is determined within a preset sliding window; and based on the number of claim requests, the event score is determined.
[0038] In one possible implementation, the processing module is further configured to:
[0039] If it is determined that the user rating is greater than or equal to a first preset threshold, then it is determined that the event to be notified will be assigned to the first queue;
[0040] If it is determined that the user score is less than a first preset threshold and the event score is greater than or equal to a second preset threshold, then it is determined that the event to be notified will be assigned to the second queue.
[0041] If it is determined that the user score is less than a first preset threshold and the event score is less than a second preset threshold, then it is determined that the event to be notified will be assigned to the third queue.
[0042] In one possible implementation, the generation module is specifically used for:
[0043] Based on the events to be notified in the queue, the target template corresponding to the event to be notified is matched from the preset template database.
[0044] A notification summary is generated based on the target template and the event to be notified; wherein, the notification summary includes the target template identifier and dynamic parameters; the dynamic parameters are used to populate the fields to be populated in the target template;
[0045] The notification digest is compressed to obtain the notification information.
[0046] In one possible implementation, the user terminal is used to process the notification information and display it on the user terminal, including:
[0047] The user terminal decompresses the notification information to obtain a notification digest;
[0048] Based on the target template identifier in the notification summary, the corresponding target template is matched from the preset template database; the dynamic field identifier to be filled in the notification summary is filled into the target template to obtain the information to be displayed;
[0049] The information to be displayed is rendered and then displayed on the user's device.
[0050] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0051] The memory stores computer-executed instructions;
[0052] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0053] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0054] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0055] This application provides a low-latency asynchronous notification processing method, apparatus, device, medium, and program. In response to the detection of a pending notification event, it determines user information representing user identity and user value characteristics, and event information representing rights batch identifiers and event popularity-related attributes. Based on the user information and event information, it routes the pending notification event to at least two parallel processing queues configured with different hardware resources. Then, it generates corresponding notification information for each pending notification event in the queues and sends it to the user terminal for processing and display. This achieves an asynchronous notification effect based on differentiated resource scheduling according to user value characteristics and event popularity. Specifically, by introducing user value characteristic data and event popularity attributes as routing criteria, high-value users or high-popularity events can be preferentially allocated to queues with more abundant hardware resources, enabling notification events of different priorities to obtain matching processing capabilities and avoiding delays caused by resource contention for high-priority events. At the same time, the asynchronous processing architecture of at least two parallel queues allows the generation and sending of notification events to be executed concurrently without synchronously waiting for the processing of preceding events, thereby significantly reducing overall notification latency and improving the timeliness of the reach of rights and benefits claims and the user experience. Attached Figure Description
[0056] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0057] Figure 1 A flowchart illustrating a low-latency asynchronous notification processing method provided in this application embodiment. Figure 1 ;
[0058] Figure 2 A flowchart illustrating a low-latency asynchronous notification processing method provided in this application embodiment. Figure 2 ;
[0059] Figure 3 This is a schematic diagram of the structure of a low-latency asynchronous notification processing device provided in an embodiment of this application;
[0060] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0061] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0063] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0064] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0065] This application relates to the fields of high-concurrency transaction processing and user notification technology, and is applicable to the notification processing of benefit redemption results in e-commerce promotions, bank benefit distribution, and points redemption. Related systems typically include a transaction processing module, an event recognition module, a notification queue, and a user-end display module, used to output notification results to the user's end after the user completes benefit redemption.
[0066] In existing methods, notification tasks after rights are claimed are mostly triggered synchronously by the transaction process, or first written to the database and then asynchronously retrieved by the processing nodes. The processing nodes retrieve the notification tasks in a preset order, then generate the notification content and send it to the user's terminal for display. Although this method can complete the notification distribution, the notification task is closely linked to the transaction result processing, and the notification chain is susceptible to impacts from high-concurrency requests.
[0067] When a large number of users claim benefits within a short period, the processing method based on database records and polling is prone to task backlog. Tasks in the queue compete for processing resources in order of priority, making it difficult to deliver notifications for high-value users and those for popular benefits in a timely manner. Continuous polling of processing nodes also consumes computing and storage resources, and repeated retries of abnormal tasks further lengthen the waiting time for subsequent tasks, leading to increased notification latency fluctuations and affecting overall throughput and user experience.
[0068] To address the aforementioned issues, an event-driven asynchronous notification processing path is adopted. Upon detecting a notification event, user and event information are extracted, and routing is performed based on user identity, user value characteristics, rights batch identifiers, and event popularity-related attributes. This allows different notification events to enter multiple parallel notification queues. Each queue is configured with different hardware resources, with notification tasks for high-value users or high-popularity events receiving more suitable processing capabilities. Ordinary tasks continue processing according to their respective queues, ensuring that notification generation and user-side display processes proceed independently.
[0069] By combining the database layer, message scheduling module, parallel queue, and client processing module in a high-concurrency transaction system, a notification distribution method that matches the business load can be formed without changing the core transaction processing path. This alleviates the problems of sequence contention and resource idleness, and improves the real-time performance of notification processing, priority guarantee capability, and overall resource utilization.
[0070] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0071] Figure 1A flowchart illustrating a low-latency asynchronous notification processing method provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the method includes:
[0072] S101, In response to detecting a pending notification event; determine user information and event information based on the pending notification event.
[0073] Among them, user information represents user identity and user value characteristics; event information represents rights batch identifiers and event popularity-related attributes.
[0074] For example, a pending notification event refers to a specific event captured by the system during business operations that needs to trigger a notification to the user, such as a new batch of benefits being launched, benefits about to expire, the release of quotas for popular activities, or a user obtaining exclusive benefits. This pending notification event is usually generated by a rules engine, monitoring module, or message middleware, and at least carries the event type, the time of occurrence, and identification information used to associate the user and the benefit.
[0075] User information refers to a set of data used to describe the recipient of notifications, representing user identity and user value characteristics. User identity includes information that can uniquely identify a user, such as user ID, mobile phone number, device identifier, and account system identifier; user value characteristics include features that can reflect a user's contribution to the platform or notification priority, such as membership level, historical spending amount, spending frequency, activity level, points balance, lifetime value score, and churn risk level.
[0076] Event information refers to a data set describing the batches of benefits associated with the event to be notified and their popularity. It represents the benefit batch identifier and event popularity-related attributes. Among them, the benefit batch identifier is used to distinguish benefits issued in different batches, such as coupon batch number, activity code, benefit package ID, etc. Event popularity-related attributes are used to reflect the degree of attention, participation, or timeliness of the event, such as the number of claims, remaining inventory, number of visitors, number of shares, popularity rating, time decay factor, recent claim rate, etc.
[0077] For example, the system first detects whether a notification event has occurred by listening to the message queue, receiving business callbacks, or performing scheduled scanning tasks. Upon detecting a notification event, the system parses the associated fields in the event message or event record to obtain the user identifier and the benefit batch identifier. Subsequently, using the user identifier as the query key, the system calls the user center or user profiling service to obtain user identity information and user value characteristic data; simultaneously, using the benefit batch identifier as the query key, it calls the benefit system or activity system to obtain basic information about the benefit batch and event popularity-related attributes. If the event message already carries some user or event information, missing fields are filled in; if there are anomalies or null values, default values can be filled in according to preset rules, or the event can be marked as low-priority. Finally, the system assembles the user information and event information into structured data, which serves as input for subsequent processing steps such as notification strategy matching, notification content generation, reach channel selection, and sending frequency control.
[0078] S102. Based on user information and event information, perform routing processing on the events to be notified so as to allocate the events to the notification queue.
[0079] The notification queue includes at least two queues that are processed in parallel; each queue is configured with different hardware resources.
[0080] For example, routing processing refers to the process of analyzing and judging the notification event according to a pre-set strategy or rule, thereby determining which notification queue it should enter. This routing process is not a simple first-in-first-out (FIFO) approach, but rather combines user identity and value characteristics from user information, as well as rights batch identifiers and popularity attributes from event information, to calculate the event's priority, resource requirements, or business affiliation, ultimately forming the queue selection result.
[0081] The pending notification queue refers to a message queue or task queue used to temporarily store notification events to be sent. In this step, the queue consists of at least two sub-queues that are processed in parallel, and each sub-queue can consume and process events independently.
[0082] For example, after obtaining user and event information, the system calls the routing module to make queue allocation decisions. First, it extracts user identity and value characteristic data from the user information, such as membership level, activity score, and historical spending amount; from the event information, it extracts the benefit batch identifier and event popularity-related attributes, such as popularity score, remaining inventory, and redemption rate. Then, the routing module calculates the comprehensive priority score or category label of the event to be notified according to preset routing rules, such as threshold judgment, weighted scoring, decision trees, and rule engine matching. Simultaneously, it determines whether the event needs to be forcibly entered into a specific queue; for example, important benefit batches or high-value users can be configured with a whitelist to directly access high-priority queues. Afterward, based on the calculation results, it selects the identifier of the target notification queue and writes the message body of the event to be notified into the corresponding queue. Different queues are monitored by different consumer groups, which are deployed on their respective configured hardware resources. For example, consumers in high-priority queues run in containers with more CPU and memory, while consumers in low-priority queues run in resource-constrained containers, thus ensuring that processing capacity matches queue priority.
[0083] S103. For each event to be notified in the notification queue, generate notification information corresponding to the event; and send the notification information to the user terminal so that the user terminal can process the notification information and display it on the user terminal.
[0084] The notification information represents the results of the rights and benefits claim that will be displayed to the user.
[0085] For example, notification information refers to the specific message content generated based on the event to be notified and its associated user information and event information, and ultimately sent to the user. In this step, the notification information represents the rights and benefits claiming result to be displayed to the user.
[0086] The results of claiming benefits refer to the status or outcome data generated after a user participates in claiming benefits, such as successful claim, failed claim, benefits credited to account, prizes issued, coupons added to card wallet, eligibility obtained, etc. It may include specific content such as benefit name, amount, validity period, usage conditions, reason for failure, and reissue prompt.
[0087] The user terminal refers to the terminal-side application or interface that receives and displays notification information, including but not limited to mobile applications, mini-programs, web pages, system notification bars, SMS inboxes, etc., which are capable of parsing, rendering and displaying notification information.
[0088] For example, the system retrieves or receives notification events one by one from the notification queue through a message consumer. For each notification event in the queue, the system first parses the user identifier, benefit batch identifier, and possible user and event information carried in the event. Then, it calls the message generation module or template engine to dynamically generate a complete notification message based on the event type and benefit redemption result data. This notification message includes a title, body, benefit result field, jump link, or operation button, etc. During the generation process, personalization can be combined with user identity and user value characteristics, such as adding exclusive copy or additional benefit descriptions for high-level members. After generation, the system selects the appropriate push channel based on the user's channel preferences or event configuration, such as in-app push, SMS, official account template message, email, etc., and sends the notification message to the corresponding user. After receiving the notification message, the user parses and renders the message, and displays the benefit redemption result to the user in the notification bar, in-app pop-up, message center, or benefit page. After sending, the system can record the sending status and user feedback receipt for subsequent effect statistics and compensation processing.
[0089] This application provides a low-latency asynchronous notification processing method. In response to the detection of a pending notification event, it determines user information representing user identity and value characteristics, and event information representing rights batch identifiers and event popularity attributes. Based on the user information and event information, it routes the pending notification events to at least two parallel queues, each configured with different hardware resources. Then, it generates corresponding notification information for each pending notification event in the queues and sends it to the user terminal for processing and display. This achieves asynchronous notification effects based on differentiated resource scheduling according to user value characteristics and event popularity. Specifically, by introducing user value characteristics and event popularity attributes as routing criteria, high-value users or high-popularity events can be preferentially allocated to queues with more abundant hardware resources. This ensures that notification events of different priorities receive processing capabilities that match their needs, avoiding delays caused by resource contention for high-priority events. Simultaneously, the asynchronous processing architecture of at least two parallel queues allows the generation and sending of notification events to be executed concurrently without waiting for preceding events to complete, thus significantly reducing overall notification latency and improving the timeliness of rights claim results and user experience.
[0090] Figure 2 A flowchart illustrating a low-latency asynchronous notification processing method provided in this application embodiment. Figure 2 ,like Figure 2 As shown, in this embodiment... Figure 1 Based on the embodiments, a low-latency asynchronous notification processing method is described in detail, the method including:
[0091] S201. In response to detecting a pending notification event, determine user information and event information based on the pending notification event.
[0092] For example, a pending notification event refers to a specific business event generated during system operation that needs to trigger a notification to the user, such as a user successfully claiming a coupon, receiving benefits, winning an activity, an order status change, or a points change. This event is the starting point for subsequent notification processing and typically includes at least the user identifier, event type, occurrence time, and the identifier of the associated benefit or business object.
[0093] In one possible implementation, after a user completes the coupon or benefit redemption process on the business side, the business system writes the redemption result data to the database, forming a log record. For example, it inserts a record with a status of "redemption successful" into the redemption record table, or records it in the database operation log. A configured listening mechanism monitors the database log, for example, by capturing database change logs in real time using a database log parsing tool, or by periodically querying for newly added successful redemption records. Once a new record matching the criteria is found in the database log, it indicates that a user has successfully redeemed the coupon. Subsequently, the system extracts key fields from this log record, such as user ID, benefit batch identifier, redemption time, and benefit type, and generates a structured pending notification event. This pending notification event can be placed in an event queue or sent as a message to subsequent processing stages, awaiting notification generation and sending. If no new successful redemption record is found in the database log, the detection module continues listening without generating a pending notification event.
[0094] S202. Determine user rating and event rating based on user information and event information; perform routing processing on the events to be notified based on user rating and event rating to allocate the events to be notified to the notification queue.
[0095] Among them, user rating represents the value of a user; event rating represents the popularity of the event's rights and benefits batch; the notification queue includes a first queue, a second queue, and a third queue; the hardware resources configured for the first queue, the second queue, and the third queue decrease sequentially.
[0096] For example, a user rating is a numerical value or level calculated based on user identity and value characteristics data in user information, using a preset rating model or rules. It is used to characterize the user's value to the platform. The calculation of user ratings can comprehensively consider multiple dimensions such as membership level, historical spending amount, spending frequency, activity level, points balance, lifetime value, and churn risk. The higher the score, the more important the user is or the more worthy of priority contact.
[0097] Event score refers to a numerical value or level calculated using a preset popularity assessment model based on the benefit batch identifier and event popularity-related attributes in the event information. It is used to characterize the popularity or urgency of the benefit batch associated with the event. The calculation of the event score can take into account factors such as the benefit batch redemption rate, remaining inventory, recent redemption rate, number of views and shares, and event countdown. The higher the score, the more attention the benefit receives or the more urgent it is.
[0098] The pending notification queue refers to a message queue or task queue used to store notification events awaiting processing. This step specifically includes a first queue, a second queue, and a third queue, which operate in parallel and independently. The decreasing hardware resources configured for the first, second, and third queues indicate a gradient difference in computing resources such as CPU core count, memory capacity, network bandwidth, and disk I / O among the consumer instances or processing nodes corresponding to the three queues. For example, the first queue is configured with the highest-spec hardware, the second queue with medium-spec hardware, and the third queue with the lowest-spec hardware, thus matching different processing capabilities according to the importance of the event.
[0099] For example, the system first calculates a user score based on user information. This involves extracting fields such as membership level, spending amount in the past 90 days, and activity score from the user profile, weighting and summing them according to preset weights and algorithms, or mapping them to a score from 0 to 100. Simultaneously, the system calculates an event score based on event information. This involves extracting fields such as redemption rate, remaining inventory, redemption rate in the past hour, and popularity score from the benefit batch data, calculating a score from 0 to 100 according to a preset popularity model. Then, the system performs routing processing based on the user score and event score. A common approach is to calculate a comprehensive priority score, for example, by weighting the two scores according to certain weights, or by using a two-dimensional matrix mapping rule to determine the queue based on the region where the combination of user score and event score falls. For example, when both the user score and event score are high, or the comprehensive score exceeds a first threshold, the event to be notified is assigned to the first queue; when the comprehensive score is in the middle range, or the user score and event score are one high and one low, it is assigned to the second queue; when the comprehensive score is below the second threshold, or both are low, it is assigned to the third queue. After allocation, the event is written to the corresponding queue, and the consumer of the corresponding hardware resource performs subsequent notification generation and sending processing.
[0100] In one example, user ratings and event ratings are determined based on user information and event information, including:
[0101] User information is processed based on a preset LTV model to obtain the user score output by the preset LTV model; based on the rights batch identifier in the event information, the number of rights batch redemption requests is determined within a preset sliding window; and the event score is determined based on the number of redemption requests.
[0102] For example, a pre-built LTV model refers to a pre-constructed and trained user lifetime value (LTV) prediction model. It is used to estimate the total value a user can bring to the platform over a future period based on user identity and value characteristics data in user information, and quantifies this value as a user rating. This model can be built based on machine learning algorithms (such as gradient boosting trees, logistic regression, deep learning, etc.) or statistical rules. Inputs include user characteristics such as membership level, historical spending amount, spending frequency, activity level, points balance, and recent behavior sequences. The output is a numerical or graded user rating, with higher ratings indicating greater user value.
[0103] The batch identifier in the event information refers to a code or ID used to uniquely identify a batch of benefit distribution records, such as coupon batch number, activity code, benefit package ID, etc. This identifier can be used to link the redemption flow and real-time statistics of that batch of benefits.
[0104] A preset sliding window refers to a fixed-length time interval that moves forward continuously over time, such as the last minute, the last 5 minutes, or the last hour. It is used to collect real-time metrics within this interval, and the window updates automatically as time progresses.
[0105] The number of claim requests refers to the number of claim operation requests initiated for this batch of benefits within a preset sliding window. This can include the number of times the claim button is clicked, the number of times the claim interface is called, or the number of times the claim is actually successfully claimed, reflecting the real-time popularity of this benefit at the current moment.
[0106] Event score is a value calculated based on popularity indicators such as the number of requests for redemption. It is used to characterize the degree of attention or urgency of the event for that batch of rights and benefits. The higher the score, the higher the popularity.
[0107] For example, the system first obtains the user information corresponding to the event to be notified, extracts all feature fields required by the preset LTV model, and performs necessary cleaning and standardization. Then, the processed feature vector is input into the preset LTV model, which performs inference calculations and outputs the user's score. Simultaneously, the system parses the benefit batch identifier from the event information and passes this identifier to the real-time statistics module or stream processing platform. The real-time statistics module aggregates logs, event tracking points, or API call records based on a preset sliding window, such as the last 5 minutes, to count the number of claim requests for the benefit batch within the window. Afterward, the system converts the number of claim requests into an event score according to preset scoring mapping rules or functions, such as classifying levels according to the range of claim request volume, or generating a score from 0 to 100 using linear normalization, logarithmic transformation, etc. Finally, the system obtains two results: a user score and an event score, for subsequent routing processing.
[0108] In one example, the routing of notification events is performed based on user ratings and event ratings to allocate the notification events to a notification queue, including:
[0109] If it is determined that the user rating is greater than or equal to the first preset threshold, then it is determined that the event to be notified will be assigned to the first queue.
[0110] If it is determined that the user rating is less than the first preset threshold and the event rating is greater than or equal to the second preset threshold, then it is determined that the event to be notified will be assigned to the second queue.
[0111] If it is determined that the user rating is less than the first preset threshold and the event rating is less than the second preset threshold, then it is determined that the event to be notified will be assigned to the third queue.
[0112] For example, the first queue, the second queue, and the third queue refer to three parallel processing queues with decreasing hardware resource configurations, wherein the first queue is configured with the highest hardware resources to process the highest priority events; the second queue is configured with medium hardware resources; and the third queue is configured with the lowest hardware resources to process low priority events.
[0113] For example, after obtaining user ratings and event ratings, the system first compares the user rating with a first preset threshold. If the user rating is greater than or equal to the first preset threshold, the event to be notified is directly assigned to the first queue, regardless of the event rating. If the user rating is less than the first preset threshold, the event rating is further compared with a second preset threshold: if the event rating is greater than or equal to the second preset threshold, the event to be notified is assigned to the second queue; if the event rating is less than the second preset threshold, the event to be notified is assigned to the third queue. This logic can be represented as a two-layer conditional judgment: the first layer prioritizes user ratings, and the second layer uses event ratings as a secondary factor. During execution, the system judges each condition in this order, and if a match is found, the target queue is determined, and the event is written into the storage of the corresponding queue. Simultaneously, the routing result is recorded for subsequent tracing.
[0114] In one possible implementation, if it is determined that the number of events to be notified in the first queue is greater than a third preset threshold, the newly generated events to be notified are assigned to the third queue, and the number of consumer instances in the first queue is increased; if it is determined that the event score of the events to be notified in the third queue is greater than a fourth preset threshold, the existing tasks of the events to be notified in the third queue are migrated to the second queue.
[0115] For example, the system monitors the length of the first queue or the number of events awaiting notification in real time and compares them with a third preset threshold. When the number of events awaiting notification in the first queue exceeds the third preset threshold, the routing module immediately activates an overload protection strategy: newly generated events awaiting notification are no longer written to the first queue according to the original scoring routing rules, but are instead uniformly or selectively allocated to the third queue for temporary storage, thereby cutting off incremental input to the first queue. Simultaneously, the system sends a scaling instruction to the resource scheduling module to scale up the consumer instances in the first queue, for example, by increasing the number of consumer replicas or upgrading the resource configuration of a single instance, to accelerate the processing of existing backlogged tasks in the first queue. After scaling is completed, the consumption capacity of the first queue increases, the number of events awaiting notification gradually falls back to a safe level, and the system can resume normal scoring routing rules.
[0116] On the other hand, the system continuously scans the event scores of each pending event in the third queue and compares the event score of each pending event with a fourth preset threshold. When it finds that the event score of a pending event in the third queue is greater than the fourth preset threshold, it determines that the event requires higher priority processing. Therefore, the event is removed from the third queue and resubmitted to the second queue, where it is handled by the consumer instance. During the migration process, logs such as the original queue position, migration time, and event identifier can be recorded to ensure that tasks are not lost or duplicated.
[0117] S203. Based on the events to be notified in the queue, match the target template corresponding to the events to be notified from the preset template database; generate a notification summary based on the target template and the events to be notified; compress the notification summary to obtain the notification information.
[0118] The notification summary includes the target template identifier and dynamic parameters; the dynamic parameters are used to populate the fields to be populated in the target template.
[0119] For example, the preset template database refers to a pre-built and stored data set containing multiple notification content templates. Each template corresponds to one or a type of notification scenario, such as successful receipt of benefits, reminder of expired benefits, notification of winning an event, etc. The template defines a fixed text structure for the notification and replaceable fields to be filled.
[0120] The target template refers to the template most suitable for the event, matched from a pre-set template database based on the event type, benefit attributes, or channel requirements of the event to be notified. The "notification summary" is a structured, lightweight data representation used to describe the content of a notification; in this step, the notification summary includes two parts: the target template identifier and dynamic parameters.
[0121] The target template identifier uniquely indicates which template to use for notification rendering, such as template number or template name. Dynamic parameters refer to the specific data values to be populated in the fields to be populated in the target template, such as user nickname, coupon amount, validity period, and benefit name.
[0122] Fields to be filled refer to pre-reserved positions in the target template that need to be dynamically replaced. They are usually in the form of placeholders, such as {username}, {coupon amount}, {expiration date}, etc.
[0123] Compression processing refers to encoding, serializing, or compressing notification summaries to reduce the amount of data in the notification information during transmission or storage. For example, methods such as Protobuf, MessagePack, JSON compression, or binary encoding can be used to generate a compact format.
[0124] Notification information refers to the compressed notification data that is ultimately sent to the user terminal or downstream sending module. It can be decompressed and rendered for display on the user terminal.
[0125] For example, the system retrieves a notification event from the notification queue and first parses the event type, benefit batch identifier, and user and benefit-related fields. Then, the system accesses a preset template database and performs template matching based on the event type and scenario rules. For example, it uses the event type as the query key to search for the corresponding template record in the template database. If multiple candidate templates exist, they can be further filtered based on conditions such as channel, benefit category, or user level to ultimately determine a target template. After determining the target template, the system extracts a list of fields to be filled from the target template and fills these fields according to the data carried by the notification event, generating a dynamic parameter set and recording the target template identifier. The target template identifier and dynamic parameters are combined to form a notification digest. Finally, the system compresses the notification digest using a preset serialization protocol or compression algorithm to convert the structured notification digest into a compact binary or string format, obtaining the notification information. This notification information can be written to a sending queue or directly transmitted through a push channel.
[0126] S204. Send the notification information to the user terminal so that the user terminal can process the notification information and display it on the user terminal.
[0127] For example, notification information refers to data generated by the notification system based on the event to be notified and compressed, representing the result of the rights and benefits to be displayed to the user. It may be in binary format, serialized string or structured message body, containing template identifier and dynamic parameters, and can be restored to readable text on the user.
[0128] For example, after generating the notification information, the system selects the corresponding sending channel, such as an app push service, SMS gateway, or email service, based on the reach channel or user preferences configured in the notification event. The system calls the sending interface of the corresponding channel, passing the notification information as the message body, along with the user identifier, device identifier, or contact information. The sending service transmits the notification information to the user's client, where the receiving module listens for and retrieves the message. Subsequently, the user's client processes the notification information: if the notification information is in compressed format, it first performs decompression or deserialization to recover the notification summary; it retrieves the template content locally or on the server based on the target template identifier in the summary; it fills the dynamic parameters in the summary into the fields to be filled in the template to generate a complete notification text; and it performs format adaptation and style rendering according to the user's interface requirements. Finally, the user's client displays the rendered notification content in the appropriate location, such as displaying the title and summary in the system notification bar, or popping up a card indicating successful redemption of benefits within the application, including the benefit name, amount, validity period, and operation buttons. After display, the user's client can send a delivery receipt or user click behavior back to the server for subsequent statistics.
[0129] In one example, the client decompresses the notification information to obtain a notification summary; based on the target template identifier in the notification summary, it matches the corresponding target template from the preset template database; it fills the dynamic field identifier to be filled in the notification summary into the target template to obtain the information to be displayed; it renders the information to be displayed and displays it on the client.
[0130] For example, after receiving a notification from the server, the client first determines the encoding or compression format of the information and calls the corresponding decoder or decompression function to decompress it, restoring the binary or compact text to a notification summary structure. Then, the client reads the target template identifier from the notification summary, searches for and retrieves the corresponding target template content in a preset template database. This template contains fixed text and placeholders for fields to be filled. If the preset template database is located on the server, the client can send a request with the target template identifier to retrieve the template; if it is cached locally, it is read directly from the local database. Next, the client iterates through the dynamic field identifiers and their parameter values in the notification summary, filling the corresponding placeholder positions in the target template with the value corresponding to each identifier, replacing the placeholders to form the complete information to be displayed. During the filling process, format validation, special character escaping, and fallback handling for missing fields can be performed. Finally, the client renders the information to be displayed, setting the style and layout of elements such as the title, body text, buttons, and images according to the notification type and interface specifications. Finally, the rendering results are displayed in the appropriate location on the user's device, such as a summary popping up in the system notification bar or a notification card displayed in the application, and can also be linked to the user's click-to-jump behavior.
[0131] In one possible implementation, a user behavior prediction model is introduced on the user's end. This model learns and predicts the user's historical operational behavior, thereby pre-loading notification templates related to high-frequency user behaviors into the terminal's local cache before notifications arrive. It is understood that the user behavior prediction model referred to here is a lightweight prediction model deployed on the user's end or trained on the server and then distributed to the user's end. Its inputs may include behavioral characteristics such as the types of pages the user frequently visits, frequently clicked menu entries, frequently claimed benefits, historical notification click preferences, and operational habits at different times. The output is a probability distribution of the types of notification templates or specific template identifiers that the user may receive in the future. Based on the model's prediction results, the system pre-downloads and caches notification templates with higher probabilities or higher frequencies in the user's local memory or disk cache. For example, if user A's historical activity on the platform shows that they frequently claim "discount coupons" and have a high click-through rate on discount coupon-related notifications, the user behavior prediction model will determine that the user is likely to receive a "discount coupon claim successful notification" in the future. Therefore, the model will preload the "discount coupon notification template" and its style resources into the user's terminal memory. When the server subsequently sends a discount coupon claim successful notification to user A, the user's terminal can directly retrieve the template from its local cache during the process of decompressing the notification summary and matching the template based on the target template identifier. This eliminates the need to send a template query request to the server or perform a cold start from the disk, thus avoiding potential network round-trip latency and loading time during the initial template parsing. This significantly improves the speed of notification text rendering and display.
[0132] This application provides a low-latency asynchronous notification processing method. Upon detecting a notification event, it first calculates a user score and an event score based on user information representing user identity and value characteristics, and event information representing rights batch identifiers and popularity attributes. Based on these scores, the event is routed to a first queue, a second queue, and a third queue with decreasing hardware resources. This ensures that high-value users and high-popularity events receive more abundant processing resources, preventing massive notifications from queuing and causing congestion in a single channel. Subsequently, a target template is matched from a preset template database. A notification summary is generated using only the target template identifier and dynamic parameters used to fill in the fields to be filled. The summary is then compressed and sent to the user for display, significantly reducing the notification payload size and transmission latency. These methods achieve the beneficial effects of ensuring priority delivery of key notifications through hierarchical queue scheduling and reducing link transmission overhead through templated summaries and compression in high-concurrency rights notification scenarios, thereby reducing overall end-to-end notification latency, improving system throughput, and enhancing user delivery timeliness.
[0133] Figure 3This is a schematic diagram of a low-latency asynchronous notification processing device provided in an embodiment of this application, as shown below. Figure 3 As shown, the low-latency asynchronous notification processing device 30 provided in this embodiment is applied to the server side. The device 30 includes:
[0134] The response module 301 is used to respond to the detection of a pending notification event; and to determine user information and event information based on the pending notification event; wherein the user information represents user identity and user value characteristic data; and the event information represents rights batch identifier and event popularity related attributes.
[0135] The processing module 302 is used to perform routing processing on the notification events based on user information and event information, so as to allocate the notification events to the notification queue; wherein the notification queue includes at least two queues that are processed in parallel; each queue is configured with different hardware resources;
[0136] The generation module 303 is used to generate notification information corresponding to each notification event in the notification queue; and send the notification information to the user terminal so that the user terminal can process the notification information and display it on the user terminal; wherein, the notification information represents the rights and benefits claiming result to be displayed to the user terminal.
[0137] In one possible implementation, the processing module 302 is specifically used for:
[0138] Based on user information and event information, user ratings and event ratings are determined; user ratings represent the value of a user; event ratings represent the popularity of a particular batch of benefits related to an event.
[0139] Based on user ratings and event ratings, the notification events are routed to be assigned to notification queues. The notification queues include a first queue, a second queue, and a third queue. The hardware resources configured for the first queue, the second queue, and the third queue decrease sequentially.
[0140] In one possible implementation, the processing module 302 is further configured to:
[0141] User information is processed based on a pre-defined LTV model to obtain user ratings output by the pre-defined LTV model.
[0142] Based on the rights batch identifier in the event information, the number of rights batch claim requests is determined within a preset sliding window; and the event score is determined based on the number of claim requests.
[0143] In one possible implementation, the processing module 302 is further configured to:
[0144] If it is determined that the user rating is greater than or equal to the first preset threshold, then it is determined that the event to be notified will be assigned to the first queue;
[0145] If it is determined that the user rating is less than the first preset threshold and the event rating is greater than or equal to the second preset threshold, then it is determined that the event to be notified will be assigned to the second queue.
[0146] If it is determined that the user rating is less than the first preset threshold and the event rating is less than the second preset threshold, then it is determined that the event to be notified will be assigned to the third queue.
[0147] In one possible implementation, the generation module 303 is specifically used for:
[0148] Based on the events to be notified in the queue, the target template corresponding to the event to be notified is matched from the preset template database.
[0149] A notification summary is generated based on the target template and the event to be notified; the notification summary includes the target template identifier and dynamic parameters; the dynamic parameters are used to populate the fields to be populated in the target template.
[0150] The notification summary is compressed to obtain the notification information.
[0151] In one possible implementation, the user terminal is used to process the notification information and display it on the user terminal, including:
[0152] The user client decompresses the notification information to obtain a notification summary;
[0153] Based on the target template identifier in the notification summary, the corresponding target template is matched from the preset template database; the dynamic field identifiers to be filled in the notification summary are filled into the target template to obtain the information to be displayed.
[0154] The information to be displayed is rendered and then displayed on the user's device.
[0155] This embodiment provides a low-latency asynchronous notification processing device that can execute the method provided in the above-described method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0156] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the electronic device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus.
[0157] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.
[0158] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0159] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0160] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0161] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0162] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0163] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0164] The aforementioned readable storage medium 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 storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0165] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0166] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0169] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0170] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0171] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A low-latency asynchronous notification processing method, characterized in that, The method is applied to the server side, and the method includes: In response to the detection of a pending notification event; based on the pending notification event, determine user information and event information; wherein, the user information represents user identity and user value characteristic data; the event information represents rights batch identifier and event popularity related attributes; Based on the user information and the event information, the event to be notified is routed to be allocated to a notification queue; wherein, the notification queue includes at least two queues that are processed in parallel; each queue is configured with different hardware resources. For each event to be notified in the notification queue, a notification message corresponding to the event is generated; and the notification message is sent to the user terminal so that the user terminal can process the notification message and display it on the user terminal; wherein, the notification message represents the benefit claim result to be displayed to the user terminal.
2. The method according to claim 1, characterized in that, Based on the user information and the event information, the event to be notified is routed to be assigned to a notification queue, including: Based on the user information and the event information, a user score and an event score are determined; wherein, the user score represents the value of the user; and the event score represents the popularity of the event's rights and benefits batch. Based on the user rating and the event rating, the events to be notified are routed to be assigned to a notification queue; the notification queue includes a first queue, a second queue, and a third queue; the hardware resources configured for the first queue, the second queue, and the third queue decrease sequentially.
3. The method according to claim 2, characterized in that, Based on the user information and the event information, user ratings and event ratings are determined, including: The user information is processed based on a preset LTV model to obtain the user rating output by the preset LTV model; Based on the rights batch identifier in the event information, the number of rights batch claim requests is determined within a preset sliding window; and based on the number of claim requests, the event score is determined.
4. The method according to claim 2, characterized in that, Based on the user rating and the event rating, the pending notification events are routed to be assigned to a pending notification queue, including: If it is determined that the user rating is greater than or equal to a first preset threshold, then it is determined that the event to be notified will be assigned to the first queue; If it is determined that the user score is less than a first preset threshold and the event score is greater than or equal to a second preset threshold, then it is determined that the event to be notified will be assigned to the second queue. If it is determined that the user score is less than a first preset threshold and the event score is less than a second preset threshold, then it is determined that the event to be notified will be assigned to the third queue.
5. The method according to claim 1, characterized in that, For each event to be notified in the notification queue, generate notification information corresponding to the event, including: Based on the events to be notified in the queue, the target template corresponding to the event to be notified is matched from the preset template database. A notification summary is generated based on the target template and the event to be notified; wherein, the notification summary includes the target template identifier and dynamic parameters; the dynamic parameters are used to populate the fields to be populated in the target template; The notification digest is compressed to obtain the notification information.
6. The method according to any one of claims 1-5, characterized in that, The user terminal is used to process the notification information and display it on the user terminal, including: The user terminal decompresses the notification information to obtain a notification digest; Based on the target template identifier in the notification summary, the corresponding target template is matched from the preset template database; the dynamic field identifier to be filled in the notification summary is filled into the target template to obtain the information to be displayed; The information to be displayed is rendered and then displayed on the user's device.
7. A low-latency asynchronous notification processing device, characterized in that, The device is used on a server side, and the device includes: The response module is used to respond to the detection of a pending notification event; and to determine user information and event information based on the pending notification event; wherein the user information represents user identity and user value characteristic data; and the event information represents rights batch identifier and event popularity-related attributes. The processing module is used to perform routing processing on the event to be notified based on the user information and the event information, so as to allocate the event to the notification queue; wherein, the notification queue includes at least two queues for parallel processing; each queue is configured with different hardware resources; The generation module is used to generate notification information corresponding to each notification event in the notification queue; and send the notification information to the user terminal so that the user terminal can process the notification information and display it on the user terminal; wherein, the notification information represents the benefit claim result to be displayed to the user terminal.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.
