Interaction processing method and apparatus, and computing device

By using asynchronous message queue and caching mechanism in the network interactive system, the problem of database performance bottlenecks under high concurrency is solved, efficient user interaction data writing is achieved, and the success rate of users participating in interaction is improved.

CN119557336APending Publication Date: 2025-03-04SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411573498.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In network interaction, when a large number of users participate in the interaction at the same time, the system needs to update the database frequently, which can easily lead to database performance bottlenecks, interface timeout, and user participation in the interaction failure.

Method used

By receiving the user's real-time interactive data, an asynchronous message is generated and delivered to the message queue, and the pending asynchronous message is read from the message queue. If it is an unconsumed state and the asynchronous consumption time is reached, the interaction statistics in the database are updated according to the cached interactive incremental data, and the message is marked as a consumed state.

Benefits of technology

It effectively avoids the write failure of databases due to high concurrency, improves the success rate of users participating in interactions, and ensures the accurate storage of interactive data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557336A_ABST
    Figure CN119557336A_ABST
Patent Text Reader

Abstract

The invention discloses an interaction processing method and device and computing equipment, and the method comprises the steps: receiving real-time interaction data of a user, generating an asynchronous message, and delivering the asynchronous message to a message queue; reading the to-be-processed asynchronous message from the message queue, and if the to-be-processed asynchronous message is in an unconsumed state and the asynchronous consumption time of the to-be-processed asynchronous message is reached, updating interaction statistical data in a database according to the interaction incremental data stored in the cache; and clearing the interactive incremental data, and marking the asynchronous message of which the asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as a consumed state. By means of the mode, the scheme that the interactive incremental data is temporarily stored through the cache and the temporarily stored interactive incremental data is updated to the database in an asynchronous mode is provided, writing failure caused by the fact that the database cannot bear high-concurrency pressure is avoided, the user interactive data can be efficiently and accurately written into the database, and user experience is improved. Therefore, the success rate of user participation in interaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and specifically to an interactive processing method, apparatus, computing device, computer storage medium, and computer program product. Background Art

[0002] Online interaction refers to the process of using Internet technology to allow participants to interact through online platforms. With the popularization of the Internet and the development of technology, online interaction has become a convenient and efficient way of interaction.

[0003] In network interaction, a variety of data needs to be recorded. When many users participate in the interaction at the same time, the system needs to record the interaction data of these users in the database and update the total number of participants and the detailed participation data of the interaction at the same time. Based on this, when there are too many users participating in the interaction at the same time, a large number of data update operations on the database will be triggered, which can easily reach the performance bottleneck of the database, causing the interface to time out, which is manifested as the failure of the user to participate in the interaction. Summary of the invention

[0004] In view of the above problems, the present application is proposed to provide an interactive processing method, apparatus, computing device, computer storage medium and computer program product that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of the present application, an interactive processing method is provided, comprising:

[0006] Receive real-time interactive data from users, generate asynchronous messages and deliver them to the message queue;

[0007] Read the pending asynchronous message from the message queue. If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, update the interaction statistics data in the database according to the interaction incremental data stored in the cache.

[0008] Clear the interactive incremental data, and mark the asynchronous messages whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous messages to be processed as consumed.

[0009] Optionally, after receiving the user's real-time interaction data, the method further includes:

[0010] Determine the user's interaction change operation based on the real-time interaction data and the historical interaction data stored in the cache;

[0011] Update the user's incremental interaction data in the cache based on the interaction change operation;

[0012] Store real-time interactive data in cache.

[0013] Optionally, the incremental interaction data includes incremental count data of each interaction option of the user, and updating the incremental interaction data of the user in the cache according to the interaction change operation further includes:

[0014] If the interactive change operation includes a first operation on a first interactive option, performing an increment count operation on the initial count data of the user on the first interactive option to obtain updated count increment data of the first interactive option;

[0015] If the interactive change operation includes a second operation on the second interactive option, performing a count reduction operation on the initial count data of the user on the second interactive option to obtain updated count increment data of the second interactive option;

[0016] The initial count data is a default state value or count increment data stored in the cache.

[0017] Optionally, the method further comprises:

[0018] If the asynchronous message to be processed is in an unconsumed state and the incremental interaction data stored in the cache meets the preset trigger condition, the interactive statistics data in the database are updated according to the incremental interaction data stored in the cache, and the incremental interaction data is cleared.

[0019] Optionally, the method further comprises:

[0020] Divide multiple consumption times according to preset intervals;

[0021] The asynchronous consumption time of the asynchronous message to be processed includes: the latest consumption time after the delivery time of the asynchronous message to be processed.

[0022] Optionally, marking an asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as a consumed state further includes:

[0023] Update the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed to the flag corresponding to the consumed state;

[0024] After reading the asynchronous message to be processed from the message queue, the method further includes:

[0025] Query the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed, and determine whether the asynchronous message to be processed is in the consumed state according to the query result.

[0026] Optionally, the interaction statistics data include count data of each interaction option; and updating the interaction statistics data in the database according to the interaction incremental data stored in the cache further includes:

[0027] Aggregate the count increment data of each interactive option recorded in the interactive increment data to obtain the count increment aggregate data of the interactive option;

[0028] The count data of the interactive option in the database is aggregated with the count increment summary data to obtain updated count data of the interactive option.

[0029] Optionally, the interactive statistics data include interactive option count data of the user; and updating the interactive statistics data in the database according to the interactive incremental data stored in the cache further includes:

[0030] The count increment data of each user's interactive options recorded in the interactive increment data are aggregated with the interactive option count data of the user in the database to obtain the updated interactive option count data of the user.

[0031] Optionally, the method further comprises:

[0032] The interactive participation data is determined according to the historical interactive data of each user stored in the cache, and the interactive participation data is stored in the cache.

[0033] According to another aspect of the present application, an interactive processing device is provided, comprising:

[0034] A receiving module, used for receiving real-time interactive data of users;

[0035] Message processing module, used to generate asynchronous messages and deliver them to the message queue;

[0036] The consumption module is used to read pending asynchronous messages from the message queue. If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, the interaction statistics in the database are updated according to the incremental interaction data stored in the cache; the incremental interaction data is cleared, and the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the pending asynchronous message is marked as consumed.

[0037] Optionally, the device further comprises:

[0038] The data processing module is used to determine the user's interactive change operation based on the real-time interactive data and the historical interactive data stored in the cache; update the user's interactive incremental data in the cache based on the interactive change operation; and store the real-time interactive data in the cache.

[0039] Optionally, the incremental interaction data includes incremental count data of each interactive option by the user, and the data processing module is further used to:

[0040] If the interactive change operation includes a first operation on a first interactive option, performing an increment count operation on the initial count data of the user on the first interactive option to obtain updated count increment data of the first interactive option;

[0041] If the interactive change operation includes a second operation on the second interactive option, performing a count reduction operation on the initial count data of the user on the second interactive option to obtain updated count increment data of the second interactive option;

[0042] The initial count data is a default state value or count increment data stored in the cache.

[0043] Optionally, the consumption module is further used to: if the asynchronous message to be processed is in an unconsumed state and the incremental interaction data stored in the cache meets a preset trigger condition, update the interaction statistics data in the database according to the incremental interaction data stored in the cache, and clear the incremental interaction data.

[0044] Optionally, the device further comprises:

[0045] The division module is used to divide a plurality of consumption times according to preset intervals; wherein the asynchronous consumption time of the asynchronous message to be processed includes: the most recent consumption time after the delivery time of the asynchronous message to be processed.

[0046] Optionally, the consumption module is further configured to:

[0047] Update the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed to the flag corresponding to the consumed state;

[0048] Query the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed, and determine whether the asynchronous message to be processed is in the consumed state according to the query result.

[0049] Optionally, the interaction statistics include count data for each interaction option; the consumption module is further configured to:

[0050] Aggregate the count increment data of each interactive option recorded in the interactive increment data to obtain the count increment aggregate data of the interactive option;

[0051] The count data of the interactive option in the database is aggregated with the count increment summary data to obtain updated count data of the interactive option.

[0052] Optionally, the interaction statistics data include the user's interaction option count data; the consumption module is further used to: aggregate the count increment data of each user's interaction options recorded in the interaction incremental data with the interaction option count data of the user in the database to obtain the user's updated interaction option count data.

[0053] Optionally, the data processing module is further used to: determine the interactive participation data according to the historical interactive data of each user stored in the cache, and store the interactive participation data in the cache.

[0054] According to another aspect of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0055] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned interactive processing method.

[0056] According to another aspect of the present application, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned interactive processing method.

[0057] According to another aspect of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned interactive processing method.

[0058] According to the interactive processing method, apparatus, computing device, computer storage medium and computer program product provided in the embodiments of the present application, the method includes: receiving real-time interactive data of users, generating asynchronous messages and delivering them to the message queue; reading asynchronous messages to be processed from the message queue, and if the asynchronous messages to be processed are in an unconsumed state and the asynchronous consumption time of the asynchronous messages to be processed is reached, updating the interactive statistical data in the database according to the interactive incremental data stored in the cache; clearing the interactive incremental data, and marking the asynchronous messages whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous messages to be processed as consumed. Through the above method, a solution is provided for temporarily storing interactive incremental data in a cache and updating the temporarily stored interactive incremental data to the database in an asynchronous manner, thereby avoiding write failures caused by the database being unable to bear the pressure of high concurrency, and being able to efficiently and accurately write user interactive data to the database, thereby improving the success rate of user participation in interaction.

[0059] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0061] Figure 1 A schematic diagram of an operating environment according to an embodiment of the present application is shown;

[0062] Figure 2 A flow chart showing an interactive processing method according to an embodiment of the present application is shown;

[0063] Figure 3 A flow chart showing an interactive processing method according to another embodiment of the present application is shown;

[0064] Figure 4 A flow chart showing an interactive processing method according to another embodiment of the present application is shown;

[0065] Figure 5 A schematic diagram of the structure of an interactive processing device according to an embodiment of the present application is shown;

[0066] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0067] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0068] First, the terms involved in one or more embodiments of the present application are explained.

[0069] Message queue: A technology used to implement inter-process communication in a distributed system. It allows multiple processes or services to communicate by sending messages, and can guarantee the order, reliability, and persistence of messages. Producers send messages to message queues, and consumers asynchronously retrieve and process messages from the queue.

[0070] Key-value data structure: A data organization form consisting of a key and a value. The key is a unique identifier used to find the corresponding value. In a key-value data structure, each key corresponds to a value, and the key is usually not repeatable.

[0071] Hash data structure: A data structure based on a hash table that uses a hash function to map keys to locations in the table so that the corresponding values ​​can be quickly accessed. A hash table usually consists of an array and a hash function.

[0072] Figure 1 A schematic diagram of an operating environment for implementing various embodiments of the present application. The present application can be applied to an application environment including, but not limited to, a client 2, a server 4, and a network 6. Among them:

[0073] The server 4 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0074] The server 4 may be configured to communicate with the client 2, etc., via a network 6. The network 6 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 6 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, etc., or wireless links, such as cellular links, satellite links, Wi-Fi links, etc.

[0075] The server 4 can provide storage, reading, downloading, writing, querying, deleting and other services, such as providing static resource download services to clients through multiple domain names.

[0076] Client 2 can be running Windows, Android TM ) or IOS and other operating systems, such as smart phones, tablet devices, laptop computers, virtual reality devices, gaming devices, set-top boxes, car terminals, smart TVs. Based on the above operating systems, various applications, such as browsers, can be run.

[0077] Figure 2 FIG. 1 is a flow chart showing an interactive processing method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0078] Step S201, receiving the user's real-time interactive data, generating an asynchronous message and delivering it to a message queue.

[0079] The interactive activity includes multiple interactive options. The user can select one interactive option or multiple interactive options for interaction. The user's real-time interactive data includes a user ID and an interactive option ID. The interactive option ID corresponds one-to-one to the interactive options in the interactive activity. The interactive option ID can be composed of an interactive activity ID and an interactive option serial number.

[0080] After receiving the user's real-time interactive data, an asynchronous message is generated and delivered to the message queue. The asynchronous message is used to update the data in the database according to the interactive incremental data. Each asynchronous message has a corresponding asynchronous consumption time, and the asynchronous message is consumed in a delayed manner.

[0081] It should be noted that the user information (including but not limited to user terminal information, user account information, etc.) and user data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must 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 refuse.

[0082] Step S202, read the pending asynchronous message from the message queue. If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, update the interactive statistical data in the database according to the interactive incremental data stored in the cache, and clear the interactive incremental data.

[0083] The incremental interaction data includes incremental count data of the user for each interactive option. The incremental count data of the user for the interactive option is determined based on the user's operation on the interactive option. The user's operation on the interactive option includes interactive operation and cancellation of interactive operation.

[0084] Read pending asynchronous messages from the message queue for consumption. Specifically, first detect the status of the pending asynchronous messages and the asynchronous consumption time. If the pending asynchronous messages are in an unconsumed state and the asynchronous consumption time of the pending asynchronous messages has been reached, update the interactive statistics data in the database (including the total number of participants in interactive activities, the number of participants in each interactive option, the user's interactive details data, etc.) according to the interactive incremental data temporarily stored in the cache that has not been written to the database. Among them, reaching the asynchronous consumption time means that the current time is consistent with the asynchronous consumption time or the current time exceeds the asynchronous consumption time.

[0085] Accordingly, if the pending asynchronous message is in the consumed state, there is no need to consume the pending asynchronous message again and the pending asynchronous message is ignored; if the asynchronous consumption time of the pending asynchronous message has not been reached, the pending asynchronous message is delivered back to the message queue.

[0086] The incremental interaction data in the cache is the temporarily stored new interaction data that has not yet been written to the database. When the above conditions are met, the incremental interaction data in the cache will be cleared, and then new incremental interaction data will be recorded based on the received user interaction data. The incremental interaction data in the cache at the current time is determined based on the user interaction data received from the last clearing to the current time.

[0087] Step S203: Mark the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as consumed.

[0088] The function of the pending asynchronous message is to notify consumers that when the asynchronous consumption time of the pending asynchronous message is reached, the interaction statistics in the database will be updated according to the interaction incremental data in the cache. Then, the functions of asynchronous messages with the same asynchronous consumption time are consistent. Based on this, all asynchronous messages with the same asynchronous consumption time as the pending asynchronous message are marked as consumed to avoid repeated consumption of asynchronous messages with the same function, thereby avoiding triggering a large number of data update operations on the database.

[0089] In summary, according to the interactive processing method provided by this embodiment, whenever the user's real-time interactive data is received, a delayed consumption asynchronous message is triggered and delivered to the message queue; the pending asynchronous message in the message queue is read for consumption, and it is determined whether the pending asynchronous message has not been consumed and whether its asynchronous consumption time has been reached. If it has not been consumed and the asynchronous consumption time has been reached, the interactive statistical data in the database is updated according to the incremental interactive data temporarily stored in the cache, so that the incremental interactive data is summarized in the database. Through the above method, a solution is provided for using the cache to temporarily store incremental interactive data and updating the temporarily stored incremental interactive data to the database in an asynchronous manner, so as to avoid write failures caused by the database being unable to bear the pressure of high concurrency, and can efficiently and accurately write user interactive data to the database, thereby improving the success rate of user participation in interaction.

[0090] Figure 3 FIG. 2 is a flow chart showing an interactive processing method according to another embodiment of the present application. Figure 3 As shown, the method comprises the following steps:

[0091] Step S301, receiving the user's real-time interactive data, generating an asynchronous message and delivering it to a message queue.

[0092] After receiving the user's real-time interactive data, one or more corresponding asynchronous messages are generated. The asynchronous message has an asynchronous consumption time. Specifically, the timestamp of the asynchronous consumption time is carried in the asynchronous message. The asynchronous message can also include an interactive option identifier. For example, the format of the asynchronous message is: {"vote_id":222,"index":2,"flush_ts":1783716160}, where "vote_id" is the interactive activity identifier, "index" is the interactive option sequence number, and "flush_ts" is the timestamp corresponding to the asynchronous consumption time. Among them, an asynchronous message only contains one interactive option identifier. When the user's real-time interactive data contains multiple interactive option identifiers, a corresponding number of asynchronous messages are generated.

[0093] The consumption time is a preset time. If multiple consumption times are divided into multiple preset intervals, the asynchronous consumption time of the asynchronous message is the latest consumption time after the delivery time of the asynchronous message. For example, if the consumption time is divided into 10-minute intervals, the delivery time is 2024-01-01 00:01:00, and the next latest consumption time is 2024-01-01 00:10:00, then "flush_ts" will be set to the timestamp corresponding to 2024-01-01 00:10:00.

[0094] In one optional manner, the multiple consumption times are evenly divided according to a preset time interval, that is, the time intervals between any two consumption times are consistent. In another optional manner, the multiple consumption times are divided according to different time intervals for different time periods, for example, different time intervals are used to divide the consumption times for peak time periods and non-peak time periods.

[0095] It can be seen that during the period from the Nth consumption time to the N+1th consumption time, the asynchronous consumption time of the triggered asynchronous messages is the N+1th consumption time, and their function is to notify consumers to update the interaction statistics in the database according to the interaction incremental data when the N+1th consumption time is reached.

[0096] Step S302, determining the user's interactive change operation based on the real-time interactive data and the historical interactive data stored in the cache.

[0097] After receiving the user's real-time interactive data, the user's real-time interactive data will be stored in the cache. In the embodiment of the present application, for the sake of distinction, the interactive data stored in the cache is called historical interactive data. The types of data contained in the historical interactive data and the real-time interactive data are the same, both including user identification and interactive option identification.

[0098] In an optional method, historical interaction data is stored in the cache in a key-value pair structure. For example, the key format is: ${uid}_${vote_id}, and the value format is: {"uid":111,"vote_id":222,"choices":[1,2,4]}, where uid is the user ID, vote_id is the interaction activity ID, and choices is the interaction option sequence number.

[0099] It should be noted that the method of the embodiment of the present application supports users to modify interaction records, but does not support users to cancel interaction records. Users can select interaction options multiple times to interact, and the interaction option selected by the user for the last time is the final interaction result.

[0100] If the user's historical interaction data is not stored in the cache, it indicates that this is the first time for the user to participate in the interaction, and the interaction change operation only includes the first operation on each interaction option recorded in the real-time interaction data, and the first operation is the user's interaction operation on the interaction option. If the user's historical interaction data is stored in the cache, it indicates that this is not the first time for the user to participate in the interaction, then by comparing the real-time interaction data with the historical interaction data, it is determined which options the user has changed the interaction results for, and the interaction change operation includes the first operation on the interaction option and / or the second operation on the interaction option. The first operation and the second operation are opposite operations, the first operation is the user's interaction operation on the interaction option, and the second operation is the user's cancellation of the interaction operation on the interaction option.

[0101] Step S303: updating the user's incremental interaction data in the cache according to the interactive change operation, and storing the real-time interactive data in the cache, wherein the incremental interaction data includes the incremental count data of each interactive option of the user.

[0102] Specifically, if the interactive change operation includes a first operation on a first interactive option, an increase count operation is performed on the user's initial count data of the first interactive option to obtain updated count increment data of the first interactive option; if the interactive change operation includes a second operation on a second interactive option, a decrease count operation is performed on the user's initial count data of the second interactive option to obtain updated count increment data of the second interactive option; wherein the initial count data is a default state value or count increment data stored in the cache.

[0103] The incremental interaction data is temporarily stored in the cache, and the incremental interaction data in the cache is cleared regularly. Therefore, if the period from the last time the user participated in an interaction to the current interaction includes the asynchronous consumption time of asynchronous messages, the cache does not contain the incremental count data of the user for each interaction option during the current interaction, and the initial count data of the interaction option is the default status value; if the period from the last time the user participated in an interaction to the current interaction does not include the asynchronous consumption time of asynchronous messages, the cache contains the incremental count data of the user for each interaction option during the current interaction, and the initial count data of the interaction option is the incremental count data stored in the cache.

[0104] For other interactive options except the interactive option targeted by the interactive change operation, if the count increment data is contained in the cache, the count increment data is kept unchanged; if the count increment data is not contained in the cache, the count increment data is increased in the cache and the value is taken as the default state value.

[0105] When the user's historical interaction data is not stored in the cache, the user's real-time interaction data is stored in the cache through the data addition operation; when the user's historical interaction data is stored in the cache, the real-time interaction data is used to overwrite the historical interaction data through the data overwriting operation. It can be seen that the cache only records the most recent user's real-time interaction data.

[0106] In an optional method, a hash data structure is used to store interactive incremental data. The key in the hash data structure is the interactive activity identifier and the interactive option serial number, the field is the user identifier, and the value is the count incremental data. The combination of a key, a field, and a value constitutes the count incremental data of the user's interactive options. The possible values ​​of the count incremental data are 1 and 0. 1 means that the user has interacted with the interactive option, that is, the result of adding one to the default state value 0; 0 is the default state value, indicating that the user has never interacted with the interactive option or the user interacted with the interactive option first and then canceled the interaction. In this method, the hincrby command is used to directly update the value. When interacting with the interactive option, the value is incremented by one, and when canceling the interaction with the interactive option, the value is subtracted by one. This command needs to be locked for use.

[0107] The specific method of updating the count increment data is described below by a specific example. In this example, when user S first participates in the interaction, he interacts with the interactive options A and B. When user S participates in the interaction again, he interacts with the interactive options A and D. When user S first participates in the interaction, the following interactive data is recorded in the cache: [S, (A, B)]. At this time, the result of the operation of adding one to the default state value is determined as the count increment data of the interactive options A and B, and the default state value is used as the count increment data of the interactive options C and D. Then, the count increment data of user S for each interactive option recorded in the cache is: [A: 1, B: 1, C: 0, D: 0]; when user S participates in the interaction again, on the one hand, the data [S, (A, B)] (corresponding to the real-time interactive data) is used to overwrite the data [S, (A, B)] (corresponding to the historical interactive data) in the cache. On the other hand, based on the real-time interactive data and the historical interactive data, it is determined that the user cancels the interaction with the interactive option B and interacts with the interactive option D. At this time, there will be two situations, and the updated count increment data in the two situations will be different.

[0108] Specifically, in the first case, the period from the first participation in interaction to the second participation in interaction includes the asynchronous consumption time of a certain asynchronous message. During this period, the incremental interaction data was cleared. When the user's incremental interaction data is not stored in the cache when the interaction is participated in again, the incremental count data of each interactive option after update is calculated according to the default state value. The update process is as follows: for interactive options A and C, the default state value is determined as the updated incremental count data; for interactive option B, the result of the default state value subtraction operation is determined as the updated incremental count data; for interactive option D, the result of the default state value addition operation is determined as the updated incremental count data; then the updated incremental count data of each interactive option is: [A: 0, B: -1, C: 0, D: 1].

[0109] In the second case, the period from the first interaction to the second interaction does not include any asynchronous consumption time of asynchronous messages, and the incremental interaction data stored in the cache is not cleared. When the user participates in the interaction again, the incremental interaction data stored in the cache is: [A: 1, B: 1, C: 0, D: 0]. The update process is as follows: for interaction options A and C, keep the stored incremental count data unchanged; for interaction option B, perform a subtraction operation on the stored incremental count data; for interaction option D, perform a plus operation on the stored incremental count data; then the updated incremental count data of each interaction option is: [A: 1; B: 0; C: 0; D: 1].

[0110] Step S304, reading the to-be-processed asynchronous message from the message queue, and detecting whether the to-be-processed asynchronous message is in an unconsumed state.

[0111] If so, execute step S305; if not, ignore the pending asynchronous message, jump to execute step S304, and continue to read new asynchronous messages from the message queue for consumption.

[0112] Step S305, determining whether the asynchronous consumption time of the asynchronous message to be processed has arrived and determining whether the interactive incremental data stored in the cache meets the preset trigger condition.

[0113] If the asynchronous message to be processed is in an unconsumed state, continue to determine whether the asynchronous consumption time has arrived and whether the incremental interactive data meets the preset trigger conditions.

[0114] The consumption time is divided according to the time interval, and the asynchronous consumption time of the asynchronous message to be processed includes: the latest consumption time after the delivery time of the asynchronous message to be processed.

[0115] Among them, the preset trigger condition may be a condition regarding the data volume, such as the data volume of the interactive incremental data stored in the cache exceeds the preset data volume threshold; or, the preset trigger condition may be a condition regarding the number of users, such as the total number of users recorded in the interactive incremental data in the cache exceeds the preset number threshold, that is, determining whether the total number of user identifiers in the interactive incremental data exceeds the preset number threshold.

[0116] If the asynchronous consumption time of the asynchronous message to be processed is reached, step S306 is executed; if the interactive incremental data stored in the cache meets the preset trigger condition, step S307 is executed.

[0117] Step S306, updating the interaction statistics data in the database according to the interaction incremental data stored in the cache; clearing the interaction incremental data, and marking the asynchronous messages whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as consumed.

[0118] If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, the interaction statistics data in the database are updated according to the interaction incremental data in the cache. After the update is completed, the interaction incremental data stored in the cache is cleared.

[0119] In an optional manner, marking an asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as a consumed state further includes: updating the state flag bit corresponding to the asynchronous consumption time of the asynchronous message to be processed to an identifier corresponding to the consumed state. In this embodiment, batch marking of asynchronous messages is achieved by setting the state flag bit of the asynchronous consumption time.

[0120] Accordingly, the specific implementation method for detecting whether the pending asynchronous message is in an unconsumed state is: querying the state flag corresponding to the asynchronous consumption time of the pending asynchronous message, and determining whether the pending asynchronous message is in a consumed state according to the query result.

[0121] In an optional manner, a key-value pair data structure is used to store asynchronous consumption time and status mark bits, where the key is the asynchronous consumption time and the value is the status mark bit. When the status mark bit is marked as 1, it indicates a consumed state, and when the status mark bit is marked as 0, it indicates an unconsumed state.

[0122] In an optional manner, before delivering the asynchronous message to the message queue, the state flag bit corresponding to the asynchronous message is set to an identifier corresponding to the unconsumed state.

[0123] Step S307, updating the interactive statistics data in the database according to the interactive incremental data stored in the cache, and clearing the interactive incremental data.

[0124] If the asynchronous message to be processed is in an unconsumed state and the incremental interaction data stored in the cache meets the preset trigger conditions, the interaction statistics data in the database are updated according to the incremental interaction data in the cache. After the update is completed, the incremental interaction data stored in the cache is cleared.

[0125] In addition, when the asynchronous message to be processed is in an unconsumed state, if both the asynchronous consumption time is reached and the interactive incremental data in the cache meets the preset trigger condition, the message will be processed in the same way as when the asynchronous consumption time is reached. That is, the priority of the processing method when the asynchronous consumption time is reached is higher than the priority of the processing method when the preset trigger condition is met.

[0126] When the pending asynchronous message is in an unconsumed state, if the asynchronous consumption time of the pending asynchronous message has not arrived and the incremental interactive data stored in the cache does not meet the preset trigger condition, the pending asynchronous message will be delivered back to the message queue.

[0127] In an optional manner, the interactive statistics data includes count data of each interactive option; then updating the interactive statistics data in the database according to the interactive incremental data stored in the cache further includes: aggregating the count increment data of each interactive option recorded in the interactive incremental data to obtain the count increment summary data of the interactive option; aggregating the count data of the interactive option in the database with the count increment summary data to obtain the updated count data of the interactive option. For example, for any interactive option recorded in the interactive incremental data, all the corresponding count increment data (i.e., all the values ​​corresponding to the interactive option in the interactive incremental data) are accumulated to obtain the total count increment, and then the total count increment is added to the count value of the interactive option in the database to obtain the updated count value of the interactive option.

[0128] In another optional manner, the interactive statistics data includes the interactive option count data of the user; then updating the interactive statistics data in the database according to the interactive incremental data stored in the cache further includes: summarizing the count increment data of each user's interactive option recorded in the interactive incremental data with the interactive option count data of the user in the database to obtain the updated interactive option count data of the user. Continuing with the above example, in the first case, the count increment data of each interactive option updated when participating in the interaction again is: [A: 0, B: -1, C: 0, D: 1], and the interactive option count data of the user stored in the database is: [A: 1, B: 1, C: 0, D: 0] (updated to the database after the user's first interaction), and the count increment data of each interactive option and the count data in the database are accumulated, and the updated interactive option count data of the user is: [A: 1, B: 0, C: 0, D: 1], and the interactive option count data recorded in the database is consistent with the actual interaction of the user. In the second case mentioned above, the updated count increment data of each interaction option when participating in the interaction again is: [A: 1; B: 0; C: 0; D: 1]. The interaction option count data of the user is not stored in the database. The count increment data of each interaction option is written into the database. The updated interaction option count data in the database is: [A: 1; B: 0; C: 0; D: 1]. At this time, the interaction option count data recorded in the database is consistent with the user's actual interaction situation.

[0129] In an optional manner, the method of this embodiment further includes: determining the interactive participation data based on the historical interactive data of each user stored in the cache, and storing the interactive participation data in the cache. The interactive participation data may include the total number of interactive participants and / or the number of participants for each interactive option. Based on the historical interactive data of each user in the cache, the total number of user identifiers corresponding to the same interactive activity identifier is counted to obtain the total number of participants in the interactive activity, and the total number of user identifiers corresponding to the same interactive activity identifier and interactive option sequence number is counted to obtain the number of participants in the corresponding interactive option.

[0130] In another optional method, a key-value pair data structure is used to store interactive participation data. Specifically, the key format of the total number of interactive participants is: ${vote_id}; value is of int type, which is used to record the total number of interactive participants; the key format of the number of participants in an interactive option is: ${vote_id}_${index}, where index is the interactive option serial number and value is of int type, which is used to record the number of participants.

[0131] In an optional manner, an interaction details page is displayed so that users can understand the real-time interaction situation. The historical interaction data stored in the cache corresponds to the real interaction situation, and the interaction participation data calculated on this basis is consistent with the real participation situation. Based on this, the detailed data required for the interaction details page is calculated based on the historical interaction data and / or interaction participation data of each user stored in the cache, and the interaction details page is displayed.

[0132] In an optional manner, a lock is applied before reading the interactive incremental data in the cache, and a lock is released after clearing the interactive incremental data in the cache, so as to avoid generating new interactive incremental data during the process of reading the cache data and affecting the data accuracy.

[0133] To summarize, according to the interaction processing method provided in this embodiment, whenever the user's real-time interaction data is received, an asynchronous message with an asynchronous consumption time is triggered and delivered to the message queue; the pending asynchronous messages in the message queue are read for consumption, and it is determined whether the pending asynchronous messages have not been consumed and whether their asynchronous consumption time has been reached; if they have not been consumed and the asynchronous consumption time has been reached, the interaction statistics in the database are updated according to the incremental interaction data temporarily stored in the cache, thereby aggregating the incremental interaction data into the database. The concurrent interaction operations of a large number of users are supported through caching, and the incremental interaction data temporarily stored in the cache is dropped into the database through asynchronous messages, while ensuring the user experience and the correct storage of system data, avoiding write failures caused by the database being unable to bear the pressure of high concurrency, thereby improving the success rate of user participation in interaction; further, the interaction details data of interactive activities can be accurately recorded in the database; further, by displaying the interaction details page based on real-time interaction data, users can understand the real-time interaction details data of interactive activities; further, by storing the user's historical interaction data in the cache, the historical interaction data is compared to determine the interaction change operation every time the user participates in the interaction, so that the incremental interaction data can be accurately updated; further, the trigger condition of the data dimension is set, and when the amount of cached incremental interaction data or the number of users reaches a certain value, the database data is updated once to avoid storing too much incremental interaction data in the cache; further, by setting a status mark bit for the asynchronous consumption time, batch marking of asynchronous messages can be achieved.

[0134] Figure 4 A flowchart of an interactive processing method according to another embodiment of the present application is shown. The method of the embodiment of the present application is applied to a voting scenario, such as Figure 4 As shown, the method includes:

[0135] Step S401, receiving real-time voting data of users;

[0136] In the voting scenario, the user votes for or cancels the voting option, and the interactive data is specifically the voting data. The user's real-time voting data includes the user ID and the voting option ID. The voting option ID corresponds to the voting option in the voting activity one by one. The voting option ID can be composed of the voting activity ID and the voting option sequence number.

[0137] Step S402, updating the first data in the cache, where the first data is used to record which voting options the user has selected;

[0138] Step S403, updating the second data in the cache, where the second data is used to record the total number of people who participated in the vote and / or the total number of voters for each option;

[0139] Step S404, updating the third data in the cache, the third data is used to record the voting increment data that has not yet been written into the database, this step needs to be executed with locking;

[0140] The first data and the second data are used to display voting participation and voting statistics to users on the voting details page, and the third data is used to ensure that the voting data of all users are correctly written into the database.

[0141] Step S405, delivering the asynchronous message to the message queue;

[0142] Step S406, reading an asynchronous message from a message queue;

[0143] Step S407, determine whether the asynchronous message has not been consumed; if so, execute step S408; if not, ignore the current asynchronous message, jump to step S406, and continue to read the asynchronous message from the message queue for consumption;

[0144] Step S408, determining whether the asynchronous consumption time has arrived and whether the total number of user identifiers in the third data exceeds a preset number threshold;

[0145] If it is determined that the total number of user identifiers exceeds the preset number threshold, then step S409 to step S413 are executed; if it is determined that the asynchronous consumption time has been reached, then step S414 to step S419 are executed;

[0146] Step S409, locking;

[0147] Step S410, reading third data;

[0148] Step S411, clearing the third data in the cache;

[0149] Step S412, releasing the lock;

[0150] Step S413, updating the database according to the read third data;

[0151] Step S414, locking;

[0152] Step S415, reading third data;

[0153] Step S416, clearing the third data in the cache;

[0154] Step S417, releasing the lock;

[0155] Step S418, updating the database according to the read third data;

[0156] Step S419, updating the status flag of the asynchronous consumption time.

[0157] Figure 5FIG. 1 is a schematic diagram showing the structure of an interactive processing device according to an embodiment of the present application. Figure 5 As shown, the device comprises:

[0158] A receiving module 51, used to receive real-time interactive data from users;

[0159] The message processing module 52 is used to generate asynchronous messages and deliver them to the message queue;

[0160] The consumption module 53 is used to read the pending asynchronous message from the message queue. If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, the interaction statistics data in the database are updated according to the interaction incremental data stored in the cache; the interaction incremental data is cleared, and the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the pending asynchronous message is marked as consumed.

[0161] In an optional manner, the device further comprises:

[0162] The data processing module is used to determine the user's interactive change operation based on the real-time interactive data and the historical interactive data stored in the cache; update the user's interactive incremental data in the cache based on the interactive change operation; and store the real-time interactive data in the cache.

[0163] In an optional manner, the incremental interaction data includes incremental count data of each interactive option by the user, and the data processing module is further used to:

[0164] If the interactive change operation includes a first operation on a first interactive option, performing an increment count operation on the initial count data of the user on the first interactive option to obtain updated count increment data of the first interactive option;

[0165] If the interactive change operation includes a second operation on the second interactive option, performing a count reduction operation on the initial count data of the user on the second interactive option to obtain updated count increment data of the second interactive option;

[0166] The initial count data is a default state value or count increment data stored in the cache.

[0167] In an optional manner, the consumption module 53 is further used to: if the asynchronous message to be processed is in an unconsumed state and the incremental interaction data stored in the cache meets a preset trigger condition, update the interactive statistics data in the database according to the incremental interaction data stored in the cache, and clear the incremental interaction data.

[0168] In an optional manner, the device further comprises:

[0169] The division module is used to divide a plurality of consumption times according to preset intervals; wherein the asynchronous consumption time of the asynchronous message to be processed includes: the most recent consumption time after the delivery time of the asynchronous message to be processed.

[0170] In an optional manner, the consumption module 53 is further used for:

[0171] Update the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed to the flag corresponding to the consumed state;

[0172] Query the status flag corresponding to the asynchronous consumption time of the asynchronous message to be processed, and determine whether the asynchronous message to be processed is in the consumed state according to the query result.

[0173] In an optional manner, the interactive statistics data includes count data of each interactive option; the consumption module 53 is further used to:

[0174] Aggregate the count increment data of each interactive option recorded in the interactive increment data to obtain the count increment aggregate data of the interactive option;

[0175] The count data of the interactive option in the database is aggregated with the count increment summary data to obtain updated count data of the interactive option.

[0176] In an optional manner, the interaction statistics data includes the user's interaction option count data; the consumption module 53 is further used to: aggregate the count increment data of each user's interaction options recorded in the interaction incremental data with the interaction option count data of the user in the database to obtain the user's updated interaction option count data.

[0177] In an optional manner, the data processing module is further used to: determine the interactive participation data according to the historical interactive data of each user stored in the cache, and store the interactive participation data in the cache.

[0178] In summary, according to the interactive processing device provided by this embodiment, whenever the user's real-time interactive data is received, a delayed consumption asynchronous message is triggered and delivered to the message queue; the pending asynchronous message in the message queue is read for consumption, and it is determined whether the pending asynchronous message has not been consumed and whether its asynchronous consumption time has been reached. If it has not been consumed and the asynchronous consumption time has been reached, the interactive statistical data in the database is updated according to the interactive incremental data temporarily stored in the cache, so that the interactive incremental data is summarized in the database. Through the above method, a solution is provided for using the cache to temporarily store the interactive incremental data and updating the temporarily stored interactive incremental data to the database in an asynchronous manner, so as to avoid write failures caused by the database being unable to bear the pressure of high concurrency, and can efficiently and accurately write user interactive data to the database, thereby improving the success rate of user participation in interaction.

[0179] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the interactive processing method in any of the above method embodiments.

[0180] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the interactive processing method in any of the above-mentioned method embodiments.

[0181] Figure 6 A schematic diagram of the structure of an embodiment of a computing device of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.

[0182] like Figure 6 As shown, the computing device may include: a processor (processor) 602 , a communications interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .

[0183] The processor 602, the communication interface 604, and the memory 606 communicate with each other via a communication bus 608. The communication interface 604 is used to communicate with other devices such as a client or other server network elements. The processor 602 is used to execute a program 610, which can specifically execute the relevant steps in the above-mentioned interactive processing method embodiment for a computing device.

[0184] Specifically, the program 610 may include program codes, which include computer operation instructions.

[0185] The processor 602 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0186] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0187] The program 610 can be specifically used to enable the processor 602 to execute the interactive processing method in any of the above-mentioned method embodiments. The specific implementation of each step in the program 610 can refer to the corresponding description in the corresponding steps and units in the interactive processing embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiment, which will not be repeated here.

[0188] The algorithm or display provided here are not inherently related to any specific computer, virtual system or other equipment. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application described here, and the above description of specific languages ​​is to disclose the best mode of implementation of the present application.

[0189] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0190] Similarly, it should be understood that in order to streamline the present application and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present application.

[0191] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0192] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0193] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0194] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. An interactive processing method, comprising: Receive real-time interactive data from users, generate asynchronous messages and deliver them to the message queue; Reading a pending asynchronous message from the message queue, if the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, updating the interaction statistics data in the database according to the interaction incremental data stored in the cache; The interactive incremental data is cleared, and the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed is marked as consumed.

2. The method according to claim 1, wherein: After receiving the real-time interactive data of the user, the method further comprises: Determining the user's interaction change operation according to the real-time interaction data and the historical interaction data stored in the cache; Updating the user's incremental interaction data in a cache according to the interaction change operation; The real-time interactive data is stored in a cache.

3. The method according to claim 2, wherein: The interaction incremental data includes the user's count incremental data for each interaction option, and updating the user's interaction incremental data in the cache according to the interaction change operation further includes: If the interaction change operation includes a first operation on a first interaction option, performing an increment count operation on the initial count data of the user on the first interaction option to obtain updated count increment data of the first interaction option; If the interaction change operation includes a second operation on a second interaction option, performing a count reduction operation on the initial count data of the second interaction option by the user to obtain updated count increment data of the second interaction option; The initial count data is a default state value or count increment data stored in a cache.

4. The method according to any one of claims 1 to 3, wherein: The method further comprises: If the asynchronous message to be processed is in an unconsumed state and the incremental interaction data stored in the cache meets the preset trigger condition, the interactive statistics data in the database are updated according to the incremental interaction data stored in the cache, and the incremental interaction data is cleared.

5. The method according to any one of claims 1 to 4, wherein: The method further comprises: Divide multiple consumption times according to preset intervals; The asynchronous consumption time of the asynchronous message to be processed includes: the latest consumption time after the delivery time of the asynchronous message to be processed.

6. The method according to any one of claims 1 to 5, wherein: The step of marking the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the asynchronous message to be processed as a consumed state further comprises: Update the state flag corresponding to the asynchronous consumption time of the asynchronous message to be processed to the flag corresponding to the consumed state; After reading the asynchronous message to be processed from the message queue, the method further comprises: The state flag corresponding to the asynchronous consumption time of the asynchronous message to be processed is queried, and whether the asynchronous message to be processed is in a consumed state is determined according to the query result.

7. The method according to any one of claims 1 to 6, wherein: The interaction statistics include count data for each interaction option; The updating of the interaction statistics data in the database according to the interaction incremental data stored in the cache further includes: Aggregating the count increment data of each interactive option recorded in the interactive increment data to obtain the count increment aggregate data of the interactive option; The count data of the interactive option in the database is aggregated with the count increment aggregate data to obtain updated count data of the interactive option.

8. The method according to claim 7, wherein: The interactive statistics data include interactive option count data of the user; The updating of the interaction statistics data in the database according to the interaction incremental data stored in the cache further includes: The count increment data of each user's interactive options recorded in the interactive increment data are aggregated with the interactive option count data of the user in the database to obtain the updated interactive option count data of the user.

9. The method according to claim 2, wherein: The method further comprises: The interactive participation data is determined according to the historical interactive data of each user stored in the cache, and the interactive participation data is stored in the cache.

10. An interactive processing device, comprising: A receiving module, used for receiving real-time interactive data of users; Message processing module, used to generate asynchronous messages and deliver them to the message queue; A consumption module is used to read pending asynchronous messages from the message queue. If the pending asynchronous message is in an unconsumed state and the asynchronous consumption time of the pending asynchronous message is reached, the interaction statistics data in the database are updated according to the interaction incremental data stored in the cache; the interaction incremental data is cleared, and the asynchronous message whose asynchronous consumption time is consistent with the asynchronous consumption time of the pending asynchronous message is marked as consumed.

11. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the interactive processing method as described in any one of claims 1-9.

12. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute an operation corresponding to the interactive processing method as described in any one of claims 1-9.

13. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the interactive processing method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Dynamic right and interest distribution method and device based on user contribution value, equipment and medium

    CN120807045A