Data processing method, device, electronic device and storage medium
By receiving and processing the virtual resource transfer information of the target live broadcast room, storing and broadcasting dynamic data, it solves the problem of high server performance pressure and achieves more efficient data push and processing.
Patent Information
- Application Number
- CN202210698297.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-06-20
AI Technical Summary
In the big anchor challenge scenario, due to the large number of virtual resource transfer users and the high number of viewing users, the server needs to process a large amount of dynamic data on audience lists and challenge scores, resulting in greater performance pressure.
By receiving the virtual resource transfer information in the target live broadcast room, if the target live broadcast room is in the target state, determine the dynamic data information and store it in the database, regularly obtain the dynamic data information of the associated live broadcast room, and broadcast the push information to the terminal through a long connection, reducing The number of times information is sent reduces server pressure.
It effectively reduces the performance pressure of the server, reduces the number of times of sending information to the user terminal, and improves the processing efficiency of the server.
Smart Images

Figure CN115119019B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] For live broadcast challenges, audience rankings and challenge scoring are important mechanisms that are directly related to user experience. Being on the list can bring users a sense of accomplishment and establish a closer user-host relationship. Challenge scoring, as the winning or losing point of the challenge mode, has a significant effect on mobilizing the enthusiasm and participation of both hosts.
[0003] In the scenario of the big anchor challenge, since the number of users transferring virtual resources is large and the number of viewing users is also high, the server needs to process dynamic data information such as the audience list and challenge score, and deliver the audience list and challenge score to each user end, resulting in high performance pressure on the server. Summary of the invention
[0004] The present disclosure provides a data processing method, device, electronic device and storage medium to at least solve the problem of high performance pressure on the server in the related art. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including:
[0006] Receiving virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room;
[0007] If the target live broadcast room is in the target state, then according to the virtual resource transfer information, the dynamic data information corresponding to the target live broadcast room in the target state is determined, and the dynamic data information is stored in the database, and the target state is a state in which at least two live broadcast rooms are in dynamic data information comparison;
[0008] Regularly obtain dynamic data information of the live broadcast room associated with the target state from the database, and determine the push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state;
[0009] The push information is broadcast to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state.
[0010] Optionally, the dynamic data information includes anchor cumulative data and audience cumulative data.
[0011] Optionally, determining, according to the virtual resource transfer information, dynamic data information corresponding to the target live broadcast room in the target state, and storing the dynamic data information in a database includes:
[0012] Determine, according to the virtual resource transfer information, the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state;
[0013] According to the increment of the anchor cumulative data corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database;
[0014] Determine, according to the virtual resource transfer information, an incremental amount of cumulative audience data corresponding to an aggregate account identifier, wherein the aggregate account identifier includes the live broadcast identifier, the state identifier, and a target account identifier corresponding to the first user account;
[0015] According to the increment of the audience cumulative data corresponding to the aggregate account identifier, the audience cumulative data corresponding to the aggregate account identifier is updated in the database.
[0016] Optionally, after determining the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, the method further includes:
[0017] The anchor's accumulated data increment corresponding to the aggregate live broadcast identifier is stored in a cache;
[0018] According to the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database includes:
[0019] When the cache satisfies a preset condition, the accumulated data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database according to the accumulated data increment of the anchor corresponding to the aggregated live broadcast identifier in the cache.
[0020] Optionally, after determining the incremental amount of the audience accumulated data corresponding to the aggregate account identifier according to the virtual resource transfer information, the method further includes:
[0021] Storing the incremental accumulated audience data corresponding to the aggregated account identifier in a cache;
[0022] According to the increment of the audience cumulative data corresponding to the aggregate account identifier, updating the audience cumulative data corresponding to the aggregate account identifier in the database includes:
[0023] When the cache meets a preset condition, the accumulated audience data corresponding to the aggregated account identifier is updated in the database according to the increment of the accumulated audience data corresponding to the aggregated account identifier in the cache.
[0024] Optionally, after determining the incremental amount of the audience accumulated data corresponding to the aggregate account identifier according to the virtual resource transfer information, the method further includes:
[0025] According to the incremental amount of cumulative audience data corresponding to the aggregated account identifier, the first target data corresponding to the aggregated live broadcast identifier is updated in the database, wherein the first target data includes a correspondence between a first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
[0026] Optionally, the accumulated audience data corresponding to the aggregate account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregate live broadcast identifier is stored in the database in the form of an ordered set.
[0027] Optionally, updating the first target data corresponding to the aggregate live broadcast identifier in the database according to the incremental amount of the audience accumulated data corresponding to the aggregate account identifier includes:
[0028] According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database;
[0029] If the first target data fails to be updated, the accumulated audience data corresponding to the aggregate account identifier is queried from the database, and the first target data corresponding to the aggregate live broadcast identifier in the database is updated according to the query result.
[0030] Optionally, periodically acquiring dynamic data information of the live broadcast room associated with the target state from the database, and determining push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state, includes:
[0031] The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor cumulative data and the second target data corresponding to the target state are determined according to the dynamic data information of the live broadcast room associated with the target state, wherein the second target data includes a correspondence between the account identifiers of a second preset number of the largest audience cumulative data and the audience cumulative data, and the second preset number is less than or equal to the first preset number;
[0032] The anchor's accumulated data and the second target data are determined as push information corresponding to the target state.
[0033] Optionally, if the target live broadcast room is in a target state, determining the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, and storing the dynamic data information in a database, including:
[0034] If the target live broadcast room is in the target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information corresponding to the target live broadcast room is stored in the database.
[0035] Optionally, also include:
[0036] When the target live broadcast room is in the target state, if a request for joining the target live broadcast room from a second user account is received, establishing a long connection with a terminal corresponding to the second user account;
[0037] The current push information corresponding to the target state is obtained from the dynamic data information of the database, and the current push information is sent to the terminal corresponding to the second user account through a long connection with the terminal corresponding to the second user account.
[0038] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing device, including:
[0039] A resource information receiving module is configured to receive virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room;
[0040] The dynamic information storage module is configured to determine the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information if the target live broadcast room is in the target state, and store the dynamic data information in a database, wherein the target state is a state in which at least two live broadcast rooms are in dynamic data information comparison;
[0041] A push information determination module is configured to execute periodic acquisition of dynamic data information of the live broadcast room associated with the target state from the database, and determine the push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state;
[0042] The push information broadcast module is configured to execute a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state, and broadcast the push information to each of the terminals.
[0043] Optionally, the dynamic data information includes anchor cumulative data and audience cumulative data.
[0044] Optionally, the dynamic information storage module includes:
[0045] The anchor cumulative data increment determination unit is configured to determine the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state;
[0046] The anchor cumulative data updating unit is configured to execute, according to the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database;
[0047] an audience cumulative data increment determining unit, configured to determine the audience cumulative data increment corresponding to the aggregate account identifier according to the virtual resource transfer information, wherein the aggregate account identifier includes the live broadcast identifier, the state identifier and a target account identifier corresponding to the first user account;
[0048] The audience cumulative data updating unit is configured to execute, in the database, updating the audience cumulative data corresponding to the aggregate account identifier according to the audience cumulative data increment corresponding to the aggregate account identifier.
[0049] Optionally, the dynamic information storage module further includes:
[0050] A first cache unit is configured to execute storing the anchor accumulated data increment corresponding to the aggregate live broadcast identifier into a cache;
[0051] The anchor cumulative data updating unit is configured to execute:
[0052] When the cache satisfies a preset condition, the accumulated data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database according to the accumulated data increment of the anchor corresponding to the aggregated live broadcast identifier in the cache.
[0053] Optionally, the dynamic information storage module further includes:
[0054] A second cache unit is configured to execute storing the incremental accumulated audience data corresponding to the aggregation account identifier into a cache;
[0055] The audience cumulative data updating unit is configured to execute:
[0056] When the cache meets a preset condition, the accumulated audience data corresponding to the aggregated account identifier is updated in the database according to the increment of the accumulated audience data corresponding to the aggregated account identifier in the cache.
[0057] Optionally, the device further comprises:
[0058] The target data updating module is configured to execute the update of the first target data corresponding to the aggregate live broadcast identifier in the database according to the incremental cumulative audience data corresponding to the aggregate account identifier, wherein the first target data includes the correspondence between the first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
[0059] Optionally, the accumulated audience data corresponding to the aggregate account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregate live broadcast identifier is stored in the database in the form of an ordered set.
[0060] Optionally, the target data updating module is configured to execute:
[0061] According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database;
[0062] If the first target data fails to be updated, the accumulated audience data corresponding to the aggregate account identifier is queried from the database, and the first target data corresponding to the aggregate live broadcast identifier in the database is updated according to the query result.
[0063] Optionally, the push information broadcast module is configured to execute:
[0064] The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor cumulative data and the second target data corresponding to the target state are determined according to the dynamic data information of the live broadcast room associated with the target state, wherein the second target data includes a correspondence between the account identifiers of a second preset number of the largest audience cumulative data and the audience cumulative data, and the second preset number is less than or equal to the first preset number;
[0065] The anchor's accumulated data and the second target data are determined as push information corresponding to the target state.
[0066] Optionally, the dynamic information storage module is configured to execute:
[0067] If the target live broadcast room is in the target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information corresponding to the target live broadcast room is stored in the database.
[0068] Optionally, the device further comprises:
[0069] A long connection establishing module is configured to establish a long connection with a terminal corresponding to the second user account when a joining request for the target live broadcast room is received from a second user account when the target live broadcast room is in a target state;
[0070] The push information sending module is configured to obtain the current push information corresponding to the target state from the dynamic data information of the database, and send the current push information to the terminal corresponding to the second user account through a long connection with the terminal corresponding to the second user account.
[0071] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0072] processor;
[0073] a memory for storing instructions executable by the processor;
[0074] The processor is configured to execute the instructions to implement the data processing method as described in the first aspect.
[0075] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer storage medium are executed by a processor of an electronic device, the electronic device can execute the data processing method as described in the first aspect.
[0076] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program or computer instructions, wherein when the computer program or computer instructions are executed by a processor, the data processing method described in the first aspect is implemented.
[0077] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0078] The disclosed embodiment receives virtual resource transfer information of the target live broadcast room from the first user account in the target live broadcast room. If the target live broadcast room is in the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information is stored in a database. The dynamic data information of the live broadcast room associated with the target live broadcast room is obtained from the database at regular intervals, and the push information corresponding to the target state is determined. The push information is broadcast to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state. After the dynamic data information is determined based on the virtual resource transfer information, the dynamic data information is stored in the database, and the push information is obtained from the database at regular intervals and pushed to each terminal associated with the target state in the form of broadcast. Compared with directly sending the dynamic data information to each terminal separately after determining the dynamic data information, the number of times information is sent to the user terminal is reduced, thereby reducing the performance pressure of the server.
[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0081] Figure 1 is a flow chart of a data processing method according to an exemplary embodiment;
[0082] Figure 2 It is an interactive diagram of the challenge information in the target live broadcast room reaching the user end in the embodiment of the present disclosure;
[0083] Figure 3 is a flow chart of a data processing method according to an exemplary embodiment;
[0084] Figure 4 is an interactive diagram of a data processing method in an embodiment of the present disclosure;
[0085] Figure 5 is a block diagram of a data processing device according to an exemplary embodiment;
[0086] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0087] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0088] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0089] Figure 1 is a flow chart of a data processing method according to an exemplary embodiment. Figure 1 As shown, the data processing method is used in electronic devices such as servers, and includes the following steps.
[0090] In step S11, virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room is received.
[0091] The first user account is an account used by a viewer user who has joined the target live broadcast room.
[0092] During the live broadcast of the target live broadcast room, the audience user can use the first user account to send gifts to the anchor user, select the corresponding gift in the terminal corresponding to the first user account, and trigger the gift sending, so that the server receives the virtual resource transfer information of the first user account to the target live broadcast room.
[0093] In step S12, if the target live broadcast room is in the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information is stored in the database. The target state is a state in which at least two live broadcast rooms are in a dynamic data information comparison state.
[0094] The dynamic data information is information that is dynamically changeable in the target live broadcast room, for example, it can be the accumulated data of the anchor user and the accumulated data of the audience user in the live broadcast room. The dynamic data information may include the accumulated data of the anchor and the accumulated data of the audience, and the accumulated data may be points, for example. The database may be a Redis (Remote Dictionary Server, remote dictionary service) database, which is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and providing APIs in multiple languages.
[0095] Query whether the target live broadcast room is in the target state. When the target live broadcast room is in the target state, determine the cumulative data of the anchor and the cumulative data of the audience corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, obtain the dynamic data information corresponding to the target live broadcast room, and store the dynamic data information in the database.
[0096] In an exemplary embodiment, if the target live broadcast room is in a target state, then according to the virtual resource transfer information, the dynamic data information corresponding to the target live broadcast room in the target state is determined, and the dynamic data information is stored in a database, including: if the target live broadcast room is in a target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, then according to the virtual resource transfer information, the dynamic data information corresponding to the target live broadcast room in the target state is determined, and the dynamic data information corresponding to the target live broadcast room is stored in a database.
[0097] In the disclosed embodiment, a bookkeeping module can be used to record virtual resource transfer information, and the information processing module can be used to pull the virtual resource transfer information from the bookkeeping module for processing. When the information processing module pulls the virtual resource transfer information from the bookkeeping module, it is queried from the database whether the target live broadcast room corresponding to the virtual resource transfer information is in the target state. If the target live broadcast room is in the target state, the start time point of the target live broadcast room entering the target state is further queried from the distributed cache system (memcached). If the time point of receiving the virtual resource transfer information is later than the start time point of the target state, it is determined that the virtual resource transfer information is received when the target live broadcast room is in the target state. At this time, according to the virtual resource transfer information, the dynamic data information corresponding to the target live broadcast room in the target state is determined, and the dynamic data information is stored in the database. By determining the dynamic data information corresponding to the target live broadcast room in the target state based on the virtual resource transfer information when the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the accuracy of data recording can be guaranteed.
[0098] In step S13, dynamic data information of the live broadcast room associated with the target state is periodically obtained from the database, and push information corresponding to the target state is determined according to the dynamic data information of the live broadcast room associated with the target state.
[0099] When the target live broadcast room is in the target state, the dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the push information to be sent to the user account in the live broadcast room associated with the target state is determined based on the dynamic data information of the live broadcast room associated with the target state. The push information may include the anchor's cumulative data and the audience ranking data. The live broadcast rooms associated with the target state include the target live broadcast room and other live broadcast rooms in which the dynamic data information of the target live broadcast room is compared.
[0100] A scheduled task can be established, and the dynamic data information of the live broadcast room associated with the target state can be obtained from the database at regular intervals through the scheduled task, and the push information corresponding to the target state can be determined based on the dynamic data information of the live broadcast room associated with the target state.
[0101] When the big anchor is in the target state, there are a large number of audience users and a large number of user accounts that initiate virtual resource transfer information. If the dynamic data information is determined directly based on the virtual resource information and then sent directly to the terminal corresponding to each user account in the live broadcast room associated with the target state, it will cause a large performance pressure on the server. The embodiment of the present disclosure can reduce the performance pressure on the server by storing the dynamic data information in a database and obtaining push information at a regular interval.
[0102] In step S14, the push information is broadcast to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state.
[0103] When the target live broadcast room and other live broadcast rooms are in the target state, a long connection is established with each user terminal in the target live broadcast room, and a long connection is established with each user terminal in other live broadcast rooms participating in the target state, thereby establishing a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state. After the challenge push information is obtained at a regular time, the push information is pushed to the terminal corresponding to each user account in the target state in the form of broadcast through the long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state. In the form of broadcasting, the push information only needs to be sent once, and there is no need to send it separately to the terminal corresponding to each user account, which reduces the number of information transmissions and avoids repeated reading of data from the database, reducing the performance pressure of the server.
[0104] When multiple live broadcast rooms are in the target state, due to the large number of messages, long connections can reduce the performance pressure of the server. If it is a short connection, a connection needs to be established every time a message is sent, which consumes more resources and increases the performance pressure of the server.
[0105] The data processing method provided by this exemplary embodiment receives virtual resource transfer information of the target live broadcast room from the first user account in the target live broadcast room. If the target live broadcast room is in the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information is stored in a database. The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the push information corresponding to the target state is determined. The push information is broadcast to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state. After the dynamic data information is determined based on the virtual resource transfer information, the dynamic data information is stored in the database, and the push information is obtained from the database at regular intervals and pushed to each terminal associated with the target state in the form of broadcast. Compared with directly sending the dynamic data information to each terminal separately after determining the dynamic data information, the number of times information is sent to the user terminal is reduced, thereby reducing the performance pressure of the server.
[0106] On the basis of the above technical solution, the method also includes: when the target live broadcast room is in the target state, if a request to join the target live broadcast room is received from a second user account, a long connection is established with the terminal corresponding to the second user account; the current push information corresponding to the target state is obtained from the dynamic data information of the database, and the current push information is sent to the terminal corresponding to the second user account through the long connection with the terminal corresponding to the second user account.
[0107] Among them, the second user account is an account used by a viewer user who joins the target live broadcast room when the target live broadcast room is in the target state.
[0108] When the target live broadcast room is in the target state, if a request to join the target live broadcast room is received from a second user account, a long connection with the terminal corresponding to the second user account is established, and the current dynamic data information of the live broadcast room associated with the target state is queried from the database. Based on the current dynamic data information, the current push information is determined, and the current push information is sent to the terminal corresponding to the second user account through the long connection with the terminal corresponding to the second user account, so that the audience users who join the target live broadcast room after the target state starts can also perceive the dynamic data information of the target state.
[0109] Figure 2 is an interactive diagram of the dynamic data information in the target live broadcast room reaching the user terminal in the embodiment of the present disclosure, such as Figure 2 As shown, when the target live broadcast room is in the target state, a second user account joins the target live broadcast room. At this time, a long connection with the terminal corresponding to the second user is established, the current dynamic data information is queried from the Redis database, and the current push information is determined based on the current dynamic data information. The current push information is sent to the terminal corresponding to the second user account through the long connection with the terminal corresponding to the second user account; when the user account is in the target live broadcast room, the dynamic data information is periodically queried from the Redis database through a scheduled task, and the push information is determined, and the push information is asynchronously broadcast to the terminal corresponding to each user account through the long connection.
[0110] Figure 3 is a flow chart of a data processing method according to an exemplary embodiment. Figure 3 As shown, the data processing method is used in electronic devices such as servers, and includes the following steps.
[0111] In step S31, virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room is received.
[0112] In step S32, if the target live broadcast room is in the target state, the anchor's cumulative data increment corresponding to the aggregate live broadcast identifier is determined according to the virtual resource transfer information, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state.
[0113] When the target live broadcast room is in the target state, the cumulative data increment corresponding to the anchor of the target live broadcast room to which the virtual resource transfer information is to be transferred is determined according to the cumulative data information corresponding to the virtual resource transfer information, that is, the cumulative data increment of the anchor corresponding to the aggregate live broadcast identifier is determined. For example, a gift corresponds to a certain cumulative data. When the virtual resource transfer information that the first user account transfers the gift to the target live broadcast room is received, the cumulative data increment of the anchor of the target live broadcast room is determined to be the cumulative data corresponding to the gift.
[0114] In step S33, according to the incremental amount of the anchor's accumulated data corresponding to the aggregated live broadcast identifier, the anchor's accumulated data corresponding to the aggregated live broadcast identifier is updated in the database.
[0115] The cumulative data of the anchor corresponding to the aggregate live broadcast identifier can be stored in the database in the form of key-value pairs. After determining the incremental cumulative data of the anchor corresponding to the aggregate live broadcast identifier, the cumulative data of the anchor corresponding to the aggregate live broadcast identifier in the database is increased by the incremental cumulative data of the anchor, thereby refreshing the cumulative data of the anchor corresponding to the aggregate live broadcast identifier in the database.
[0116] In step S34, the incremental amount of audience accumulated data corresponding to the aggregate account identifier is determined according to the virtual resource transfer information, wherein the aggregate account identifier includes the live broadcast identifier, the status identifier and the target account identifier corresponding to the first user account.
[0117] When the target live broadcast room is in the target state, the cumulative data increment corresponding to the viewer user account that transferred out the virtual resource transfer information is determined according to the cumulative data information corresponding to the virtual resource transfer information, that is, the viewer cumulative data increment corresponding to the aggregate account identifier is determined. For example, a gift corresponds to a certain cumulative data. When receiving the virtual resource transfer information that the first user account transfers the gift to the target live broadcast room, the viewer cumulative data increment of the target account identifier corresponding to the first user account is determined to be the cumulative data corresponding to the gift.
[0118] In step S35, the cumulative audience data corresponding to the aggregate account identifier is updated in the database according to the incremental amount of the cumulative audience data corresponding to the aggregate account identifier.
[0119] The accumulated audience data corresponding to the aggregate account identifier may be stored in the database in the form of a key-value pair. After determining the accumulated audience data increment corresponding to the aggregate account identifier, the accumulated audience data corresponding to the aggregate account identifier in the database is increased by the accumulated audience data increment to refresh the accumulated audience data corresponding to the aggregate account identifier in the database.
[0120] The anchor cumulative data and audience cumulative data stored in the database are dynamic data information corresponding to the target state.
[0121] In an exemplary embodiment, after determining the incremental cumulative audience data corresponding to the aggregated account identifier based on the virtual resource transfer information, it also includes: updating the first target data corresponding to the aggregated live broadcast identifier in the database based on the incremental cumulative audience data corresponding to the aggregated account identifier, the first target data including the correspondence between a first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
[0122] Among them, the cumulative audience data corresponding to the aggregated account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregated live broadcast identifier is stored in the database in the form of an ordered set. The first target data is the sorting data of the user account, which is sorted based on the cumulative audience data. When the cumulative audience data corresponding to the aggregated account identifier is stored in the database in the form of a key-value pair, the key name (key) is the aggregated account identifier, and the value (value) is the cumulative audience data; when the first target data corresponding to the aggregated live broadcast identifier is stored in the database in the form of an ordered set (zset), the key name (key) is the aggregated live broadcast identifier, and the field is the first target data, that is, the field is the correspondence between the account identifier and the cumulative audience data. The first preset number is much smaller than the total number of all account identifiers in the target state.
[0123] After determining the incremental audience cumulative data corresponding to the aggregated account identifier, it is also necessary to update the first target data corresponding to the aggregated live broadcast identifier, that is, determine the live broadcast identifier and the status identifier from the aggregated account identifier, and determine the target account identifier, determine the aggregated live broadcast identifier according to the live broadcast identifier and the status identifier, query the corresponding first target data in the database according to the aggregated live broadcast identifier, and update the first target data according to the target account identifier and the incremental audience cumulative data, that is, increase the audience cumulative data corresponding to the target account identifier by the incremental audience cumulative data to obtain the updated audience cumulative data corresponding to the target account identifier, and update the first target data based on the audience cumulative data corresponding to the target account identifier. When the first target data is updated based on the cumulative audience data corresponding to the target account identifier, if the target account identifier exists in the first target data, the account identifiers in the first target data are sorted in descending order according to the cumulative audience data corresponding to all account identifiers in the first target data to obtain the updated first target data; if the target account identifier does not exist in the first target data, the cumulative audience data corresponding to the target account identifier is compared with the cumulative audience data in the first target data; if the cumulative data corresponding to the target account identifier is smaller than the smallest cumulative audience data in the first target data, the first target data does not need to be changed; if the cumulative audience data corresponding to the target account identifier is larger than the cumulative audience data corresponding to one or more account identifiers in the first target data, the target account identifier is inserted before the one or more account identifiers, and the last account identifier in the first target data is removed from the first target data.
[0124] The first target data corresponding to the aggregated live broadcast identifier is stored in the form of an ordered set, and the cumulative audience data corresponding to the aggregated account identifier is stored in the form of a key-value pair, that is, the full amount of cumulative audience data is stored in the form of a key-value pair. In this way, the target data is maintained in a combination of key-value pairs and ordered sets. Only a small amount of cumulative audience data corresponding to account identifiers needs to be stored in the ordered set, rather than orderly storing the cumulative audience data of all account identifiers. This avoids the problem of a large amount of target data caused by a large number of user accounts, reduces the cost of maintaining ordered target data, further reduces the performance pressure of the server, and can also ensure the accuracy of the target data, minimizing the impact of high concurrency on the accuracy of the target data.
[0125] In an exemplary embodiment, the first target data corresponding to the aggregate live broadcast identifier is updated in the database according to the incremental cumulative audience data corresponding to the aggregate account identifier, including: updating the first target data corresponding to the aggregate live broadcast identifier in the database according to the incremental cumulative audience data corresponding to the aggregate account identifier; if the update of the first target data fails, querying the database for the cumulative audience data corresponding to the aggregate account identifier, and updating the first target data corresponding to the aggregate live broadcast identifier in the database according to the query result.
[0126] After determining the incremental amount of audience cumulative data corresponding to the aggregated account identifier, first try to directly update the first target data corresponding to the aggregated live broadcast identifier in the database based on the incremental amount of audience cumulative data corresponding to the aggregated account identifier. If the first target data is updated successfully, it is completed. If the first target data fails to be updated, query the cumulative data of the audience corresponding to the aggregated account identifier from the database, and update the first target data corresponding to the aggregated live broadcast identifier in the database according to the query result. If the update is successful, it is completed. If the update fails, retry to update the first target data corresponding to the aggregated live broadcast identifier in the database based on the incremental amount of audience cumulative data corresponding to the aggregated account identifier. In this way, the data consistency of the first target data stored in the form of an ordered set and the cumulative data of the audience stored in the form of a key-value pair can be guaranteed, and a higher accuracy can be guaranteed when the target data is not locked, and the performance pressure of the server is reduced compared to locking the target data.
[0127] In step S36, dynamic data information of the live broadcast room associated with the target state is periodically obtained from the database, and push information corresponding to the target state is determined according to the dynamic data information of the live broadcast room associated with the target state.
[0128] The anchor cumulative data, audience cumulative data and first target data stored in the database can be used together as dynamic data information.
[0129] In an exemplary embodiment, dynamic data information of the live broadcast room associated with the target state is periodically obtained from the database, and push information corresponding to the target state is determined based on the dynamic data information of the live broadcast room associated with the target state, including: dynamic data information of the live broadcast room associated with the target state is periodically obtained from the database, and the anchor's cumulative data and second target data corresponding to the target state are determined based on the dynamic data information of the live broadcast room associated with the target state, the second target data including a correspondence between a second preset number of account identifiers with the largest number of audience cumulative data and the audience cumulative data, the second preset number being less than or equal to the first preset number; the anchor's cumulative data and the second target data are determined as the push information corresponding to the target state.
[0130] The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor's cumulative data is obtained from the dynamic data information, and the second target data is obtained from the first target data of the dynamic data information. The entire first target data can be used as the second target data, or the correspondence between the second preset number of account identifiers and the audience's cumulative data can be extracted from the first target data as the second target data. The acquired anchor's cumulative data and the second target data are determined as the push information of the target state. The accuracy of the pushed data is ensured by storing more than or equal to the number of data items in the second target data that needs to be sent.
[0131] In step S37, the push information is broadcast to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state.
[0132] The data processing method provided by this exemplary embodiment determines the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier after receiving the virtual resource transfer information, and updates the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier in the database, determines the incremental cumulative data of the audience corresponding to the aggregated account identifier, and updates the cumulative data of the audience corresponding to the aggregated account identifier in the database, thereby realizing the storage of the accumulated data of the anchor and the accumulated data of the audience, and facilitating the regular acquisition of challenge information for push.
[0133] On the basis of the above technical solution, after determining the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, it also includes: storing the anchor cumulative data increment corresponding to the aggregate live broadcast identifier in a cache;
[0134] According to the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier, the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier is updated in the database, including: when the cache meets a preset condition, according to the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier in the cache, the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier is updated in the database.
[0135] The preset condition may be when a timing time is reached, or when the number of data items in the cache reaches a data item number threshold.
[0136] After determining the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier, the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier is stored in the cache, and when the cache meets the preset conditions, the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database. By caching the incremental cumulative data of the anchor corresponding to the aggregated live broadcast identifier and updating the cumulative data of the anchor in the database when the preset conditions are met, the problem of high performance pressure caused by the need to update the cumulative data of the anchor in the database every time virtual resource transfer information is received can be avoided, thereby reducing the performance pressure of the server.
[0137] On the basis of the above technical solution, after determining the incremental amount of audience accumulated data corresponding to the aggregate account identifier according to the virtual resource transfer information, the method further includes: storing the incremental amount of audience accumulated data corresponding to the aggregate account identifier in a cache;
[0138] The method includes updating the accumulated audience data corresponding to the aggregate account identifier in the database according to the accumulated audience data increment corresponding to the aggregate account identifier, comprising: when the cache meets a preset condition, updating the accumulated audience data corresponding to the aggregate account identifier in the database according to the accumulated audience data increment corresponding to the aggregate account identifier in the cache.
[0139] The preset condition may be when a timing time is reached, or when the number of data items in the cache reaches a data item number threshold.
[0140] After determining the incremental amount of audience cumulative data corresponding to the aggregated account identifier, the incremental amount of audience cumulative data corresponding to the aggregated account identifier is stored in the cache, and when the cache meets the preset conditions, the incremental amount of audience cumulative data corresponding to the aggregated account identifier in the cache is updated in the database. By caching the incremental amount of audience cumulative data corresponding to the aggregated account identifier and updating the audience cumulative data in the database when the preset conditions are met, the problem of high performance pressure caused by the need to update the audience cumulative data in the database every time virtual resource transfer information is received can be avoided, thereby reducing the performance pressure of the server.
[0141] Figure 4 is an interactive diagram of a data processing method in a target state in an embodiment of the present disclosure, such as Figure 4 As shown, the method for data processing in the target state includes:
[0142] In step S41, the server receives virtual resource transfer information from the first user account to the target live broadcast room;
[0143] In step S42, the server uses the accounting module to record the virtual resource transfer information;
[0144] In step S43, the information processing module in the server pulls the virtual resource transfer information from the accounting module;
[0145] In step S44, the information processing module queries the Redis database to determine whether the target live broadcast room is in the target state;
[0146] In step S45, the target live broadcast room is in the target state, and the start time point of the target live broadcast room entering the target state is queried from memcached to determine whether the virtual resource transfer information is received when the target state is in place;
[0147] In step S46, the virtual resource transfer information is received when in the target state, and the anchor cumulative data increment corresponding to the aggregate live broadcast identifier is determined and stored in the buffer pool (buffer Trigger);
[0148] In step S47, when the timing or cache pool reaches a threshold, the anchor's cumulative data in the Redis database is refreshed;
[0149] In step S48, the incremental amount of audience accumulated data corresponding to the aggregated account identifier is determined and stored in the cache pool;
[0150] In step S49, an attempt is made to refresh the first target data corresponding to the aggregate live broadcast identifier in the ordered set of the Redis database;
[0151] In step S410, when the first target data corresponding to the aggregate live broadcast identifier in the ordered set fails to be refreshed, the audience cumulative data corresponding to the aggregate account identifier is read from the Redis database;
[0152] In step S411, the first target data in the ordered set is updated according to the accumulated audience data corresponding to the aggregate account identifier.
[0153] The disclosed embodiments can reduce the performance pressure of the server and minimize the impact of high concurrency on the accuracy of target data.
[0154] Figure 5 is a block diagram of a data processing device in a target state according to an exemplary embodiment. Figure 5 The device includes a resource information receiving module 51, a dynamic information storage module 52, a push information determination module 53 and a push information broadcasting module 54.
[0155] The resource information receiving module 51 is configured to receive virtual resource transfer information of the target live broadcast room from a first user account in the target live broadcast room;
[0156] The dynamic information storage module 52 is configured to perform, if the target live broadcast room is in a target state, determining the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, and storing the dynamic data information in a database, wherein the target state is a state in which at least two live broadcast rooms are in dynamic data information comparison;
[0157] The push information determination module 53 is configured to execute periodic acquisition of dynamic data information of the live broadcast room associated with the target state from the database, and determine the push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state;
[0158] The push information broadcast module 54 is configured to execute a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state, and broadcast the challenge push information to each of the terminals.
[0159] Optionally, the dynamic data information includes anchor cumulative data and audience cumulative data.
[0160] Optionally, the dynamic information storage module includes:
[0161] The anchor cumulative data increment determination unit is configured to determine the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state;
[0162] The anchor cumulative data updating unit is configured to execute, according to the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database;
[0163] an audience cumulative data increment determining unit, configured to determine the audience cumulative data increment corresponding to the aggregate account identifier according to the virtual resource transfer information, wherein the aggregate account identifier includes the live broadcast identifier, the state identifier and a target account identifier corresponding to the first user account;
[0164] The audience cumulative data updating unit is configured to execute, in the database, updating the audience cumulative data corresponding to the aggregate account identifier according to the audience cumulative data increment corresponding to the aggregate account identifier.
[0165] Optionally, the dynamic information storage module further includes:
[0166] A first cache unit is configured to execute storing the anchor accumulated data increment corresponding to the aggregate live broadcast identifier into a cache;
[0167] The anchor cumulative data updating unit is configured to execute:
[0168] When the cache satisfies a preset condition, the accumulated data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database according to the accumulated data increment of the anchor corresponding to the aggregated live broadcast identifier in the cache.
[0169] Optionally, the dynamic information storage module further includes:
[0170] A second cache unit is configured to execute storing the incremental accumulated audience data corresponding to the aggregation account identifier into a cache;
[0171] The audience cumulative data updating unit is configured to execute:
[0172] When the cache meets a preset condition, the accumulated audience data corresponding to the aggregated account identifier is updated in the database according to the increment of the accumulated audience data corresponding to the aggregated account identifier in the cache.
[0173] Optionally, the device further comprises:
[0174] The target data updating module is configured to execute the update of the first target data corresponding to the aggregate live broadcast identifier in the database according to the incremental cumulative audience data corresponding to the aggregate account identifier, wherein the first target data includes the correspondence between the first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
[0175] Optionally, the accumulated audience data corresponding to the aggregate account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregate live broadcast identifier is stored in the database in the form of an ordered set.
[0176] Optionally, the target data updating module is configured to execute:
[0177] According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database;
[0178] If the first target data fails to be updated, the accumulated audience data corresponding to the aggregate account identifier is queried from the database, and the first target data corresponding to the aggregate live broadcast identifier in the database is updated according to the query result.
[0179] Optionally, the push information broadcast module is configured to execute:
[0180] The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor cumulative data and the second target data corresponding to the target state are determined according to the dynamic data information of the live broadcast room associated with the target state, wherein the second target data includes a correspondence between the account identifiers of a second preset number of the largest audience cumulative data and the audience cumulative data, and the second preset number is less than or equal to the first preset number;
[0181] The anchor's accumulated data and the second target data are determined as push information corresponding to the target state.
[0182] Optionally, the dynamic information storage module is configured to execute:
[0183] If the target live broadcast room is in the target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information corresponding to the target live broadcast room is stored in the database.
[0184] Optionally, the device further comprises:
[0185] A long connection establishing module is configured to establish a long connection with a terminal corresponding to the second user account when a joining request for the target live broadcast room is received from a second user account when the target live broadcast room is in a target state;
[0186] The push information sending module is configured to obtain the current push information corresponding to the target state from the dynamic data information of the database, and send the current push information to the terminal corresponding to the second user account through a long connection with the terminal corresponding to the second user account.
[0187] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0188] Figure 6 600 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 600 may be provided as a server. Figure 6 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632 for storing instructions, such as applications, that can be executed by the processing component 622. The application stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the above-mentioned data processing method.
[0189] The electronic device 600 may also include a power supply component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input / output (I / O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0190] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 632 including instructions, and the above instructions can be executed by the processing component 622 of the electronic device 600 to complete the above data processing method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0191] In an exemplary embodiment, a computer program product is also provided, including a computer program or a computer instruction, wherein the computer program or the computer instruction implements the above data processing method when executed by a processor.
[0192] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0193] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: include: Receiving virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room; If the target live broadcast room is in the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information is stored in the database, wherein the target state is a state in which at least two live broadcast rooms are in dynamic data information comparison; the dynamic data information includes the anchor's cumulative data and the audience's cumulative data; Regularly obtain dynamic data information of the live broadcast room associated with the target state from the database, and determine the push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state; The push information includes the anchor's cumulative data and the audience ranking data; The live broadcast room associated with the target state includes the target live broadcast room and other live broadcast rooms in which dynamic data information is compared with the target live broadcast room; Broadcasting the push information to each terminal through a long connection with the terminal corresponding to the user account in the live broadcast room associated with the target state; Determining the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, and storing the dynamic data information in a database, including: Determine the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state; after determining the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, it also includes: storing the anchor cumulative data increment corresponding to the aggregate live broadcast identifier in a cache; According to the increment of the anchor cumulative data corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database; Determine, according to the virtual resource transfer information, an incremental amount of cumulative audience data corresponding to the aggregate account identifier, wherein the aggregate account identifier includes the live broadcast identifier, the state identifier, and a target account identifier corresponding to the first user account; after determining the incremental amount of cumulative audience data corresponding to the aggregate account identifier, the method further includes: storing the incremental amount of cumulative audience data corresponding to the aggregate account identifier in a cache; According to the increment of the audience cumulative data corresponding to the aggregate account identifier, the audience cumulative data corresponding to the aggregate account identifier is updated in the database.
2. The method according to claim 1, characterized in that After determining the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, the method further includes: The anchor's accumulated data increment corresponding to the aggregate live broadcast identifier is stored in a cache; According to the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database includes: When the cache satisfies a preset condition, the accumulated data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database according to the accumulated data increment of the anchor corresponding to the aggregated live broadcast identifier in the cache.
3. The method according to claim 1, characterized in that: After determining the incremental amount of audience accumulated data corresponding to the aggregated account identifier according to the virtual resource transfer information, the method further includes: The incremental accumulated data of the audience corresponding to the aggregated account identifier is stored in a cache; According to the increment of the audience cumulative data corresponding to the aggregate account identifier, updating the audience cumulative data corresponding to the aggregate account identifier in the database includes: When the cache meets a preset condition, the accumulated audience data corresponding to the aggregated account identifier is updated in the database according to the increment of the accumulated audience data corresponding to the aggregated account identifier in the cache.
4. The method according to claim 1, characterized in that: After determining the incremental amount of audience accumulated data corresponding to the aggregated account identifier according to the virtual resource transfer information, the method further includes: According to the incremental amount of cumulative audience data corresponding to the aggregated account identifier, the first target data corresponding to the aggregated live broadcast identifier is updated in the database, wherein the first target data includes a correspondence between a first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
5. The method according to claim 4, characterized in that The audience accumulated data corresponding to the aggregate account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregate live broadcast identifier is stored in the database in the form of an ordered set.
6. The method according to claim 4, characterized in that According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database includes: According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database; If the first target data fails to be updated, the accumulated audience data corresponding to the aggregate account identifier is queried from the database, and the first target data corresponding to the aggregate live broadcast identifier in the database is updated according to the query result.
7. The method according to claim 4, characterized in that The method comprises: periodically acquiring dynamic data information of the live broadcast room associated with the target state from the database, and determining push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state, including: The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor cumulative data and the second target data corresponding to the target state are determined according to the dynamic data information of the live broadcast room associated with the target state, wherein the second target data includes a correspondence between the account identifiers of a second preset number of the largest audience cumulative data and the audience cumulative data, and the second preset number is less than or equal to the first preset number; The anchor's accumulated data and the second target data are determined as push information corresponding to the target state.
8. The method according to any one of claims 1 to 7, characterized in that: If the target live broadcast room is in the target state, determining the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, and storing the dynamic data information in a database, including: If the target live broadcast room is in the target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information corresponding to the target live broadcast room is stored in the database.
9. The method according to any one of claims 1 to 7, characterized in that: Also includes: When the target live broadcast room is in the target state, if a request for joining the target live broadcast room from a second user account is received, establishing a long connection with a terminal corresponding to the second user account; The current push information corresponding to the target state is obtained from the dynamic data information of the database, and the current push information is sent to the terminal corresponding to the second user account through a long connection with the terminal corresponding to the second user account.
10. A data processing device, characterized in that: include: A resource information receiving module is configured to receive virtual resource transfer information of a first user account in a target live broadcast room to the target live broadcast room; The dynamic information storage module is configured to execute, if the target live broadcast room is in a target state, determine the dynamic data information corresponding to the target live broadcast room in the target state according to the virtual resource transfer information, and store the dynamic data information in a database, wherein the target state is a state in which at least two live broadcast rooms are in dynamic data information comparison; the dynamic data information includes anchor cumulative data and audience cumulative data; A push information determination module is configured to execute periodic acquisition of dynamic data information of the live broadcast room associated with the target state from the database, and determine the push information corresponding to the target state according to the dynamic data information of the live broadcast room associated with the target state; The push information includes the anchor's cumulative data and the audience ranking data; A push information broadcast module is configured to perform a long connection with a terminal corresponding to a user account in the live broadcast room associated with the target state, and broadcast the push information to each terminal; The dynamic information storage module includes: The anchor cumulative data increment determination unit is configured to determine the anchor cumulative data increment corresponding to the aggregate live broadcast identifier according to the virtual resource transfer information, wherein the aggregate live broadcast identifier includes the live broadcast identifier of the target live broadcast room and the state identifier of the target state; after determining the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, it also includes: storing the anchor cumulative data increment corresponding to the aggregate live broadcast identifier into a cache; The anchor cumulative data updating unit is configured to execute, according to the anchor cumulative data increment corresponding to the aggregate live broadcast identifier, updating the anchor cumulative data corresponding to the aggregate live broadcast identifier in the database; The audience cumulative data increment determination unit is configured to determine the audience cumulative data increment corresponding to the aggregate account identifier according to the virtual resource transfer information, wherein the aggregate account identifier includes the live broadcast identifier, the state identifier and the target account identifier corresponding to the first user account; after determining the audience cumulative data increment corresponding to the aggregate account identifier, it also includes: storing the audience cumulative data increment corresponding to the aggregate account identifier in a cache; The audience cumulative data updating unit is configured to execute, in the database, updating the audience cumulative data corresponding to the aggregate account identifier according to the audience cumulative data increment corresponding to the aggregate account identifier.
11. The device according to claim 10, characterized in that The dynamic information storage module also includes: A first cache unit is configured to execute storing the anchor accumulated data increment corresponding to the aggregate live broadcast identifier into a cache; The anchor cumulative data updating unit is configured to execute: When the cache satisfies a preset condition, the accumulated data of the anchor corresponding to the aggregated live broadcast identifier in the cache is updated in the database according to the accumulated data increment of the anchor corresponding to the aggregated live broadcast identifier in the cache.
12. The device according to claim 10, characterized in that The dynamic information storage module also includes: A second cache unit is configured to execute storing the incremental accumulated audience data corresponding to the aggregation account identifier into a cache; The audience cumulative data updating unit is configured to execute: When the cache meets a preset condition, the accumulated audience data corresponding to the aggregated account identifier is updated in the database according to the increment of the accumulated audience data corresponding to the aggregated account identifier in the cache.
13. The device according to claim 10, characterized in that The device also includes: The target data updating module is configured to execute the update of the first target data corresponding to the aggregate live broadcast identifier in the database according to the incremental cumulative audience data corresponding to the aggregate account identifier, wherein the first target data includes the correspondence between the first preset number of account identifiers with the largest number of cumulative audience data and the cumulative audience data.
14. The device according to claim 13, characterized in that The audience accumulated data corresponding to the aggregate account identifier is stored in the database in the form of a key-value pair, and the first target data corresponding to the aggregate live broadcast identifier is stored in the database in the form of an ordered set.
15. The device according to claim 13, characterized in that The target data update module is configured to execute: According to the incremental amount of the audience accumulated data corresponding to the aggregated account identifier, updating the first target data corresponding to the aggregated live broadcast identifier in the database; If the first target data fails to be updated, the accumulated audience data corresponding to the aggregate account identifier is queried from the database, and the first target data corresponding to the aggregate live broadcast identifier in the database is updated according to the query result.
16. The device according to claim 13, characterized in that The push information broadcast module is configured to execute: The dynamic data information of the live broadcast room associated with the target state is obtained from the database at regular intervals, and the anchor cumulative data and the second target data corresponding to the target state are determined according to the dynamic data information of the live broadcast room associated with the target state, wherein the second target data includes a correspondence between the account identifiers of a second preset number of the largest audience cumulative data and the audience cumulative data, and the second preset number is less than or equal to the first preset number; The anchor's accumulated data and the second target data are determined as push information corresponding to the target state.
17. The device according to any one of claims 10 to 16, characterized in that: The dynamic information storage module is configured to execute: If the target live broadcast room is in the target state, and the time point of receiving the virtual resource transfer information is later than the start time point of the target state, the dynamic data information corresponding to the target live broadcast room in the target state is determined according to the virtual resource transfer information, and the dynamic data information corresponding to the target live broadcast room is stored in the database.
18. The device according to any one of claims 10 to 16, characterized in that: The device also includes: A long connection establishing module is configured to establish a long connection with a terminal corresponding to the second user account when a joining request for the target live broadcast room is received from a second user account when the target live broadcast room is in a target state; The push information sending module is configured to obtain the current push information corresponding to the target state from the dynamic data information of the database, and send the current push information to the terminal corresponding to the second user account through a long connection with the terminal corresponding to the second user account.
19. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data processing method according to any one of claims 1 to 9.
20. A computer-readable storage medium, when instructions in the computer storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method according to any one of claims 1 to 9.
21. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or computer instruction is executed by a processor, the data processing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Interactive special effects display method and device, electronic equipment, server and storage media
CN109525883A
Contribution score generation method and device in live broadcast, electronic equipment and storage medium
CN111182318A
Live broadcast control method and device, electronic equipment and computer readable storage medium
CN111246235A
Live voting method and device and storage medium
CN111327953A
Interactive information display method and device, terminal and storage medium
CN111432266A
