List data updating method, device, electronic device and storage medium

By distributing live event information and virtual resource values ​​in a high-concurrency distributed scenario, and using the affinity thread pool to update the ranking data, the problem of winning streak calculation errors when updating the live PK ranking data is solved and the ranking is improved. Data accuracy and reliability.

CN113157714BActive Publication Date: 2024-09-20BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110477044.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-29
Publication Date
2024-09-20
Estimated Expiration
2041-04-29

AI Technical Summary

Technical Problem

In a high-concurrency distributed scenario, the data update of the live PK list may lead to errors in the calculation of winning streaks, resulting in the accuracy and reliability of the list data not being guaranteed.

Method used

By obtaining the event information and virtual resource values ​​in the live broadcast, distribute them to the data partition corresponding to the live broadcast account ID, and use the affinity thread pool to determine the target virtual resource value based on the virtual resource value and the accumulated virtual resource value, according to the event occurrence List data is updated in order of time points.

Benefits of technology

It avoids the problem of data update concurrency for the same live broadcast account, ensures the accuracy and reliability of the list data, and improves the accuracy of the list data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157714B
    Figure CN113157714B
Patent Text Reader

Abstract

The present disclosure relates to a list data update method, device, electronic device and storage medium, wherein the method obtains event information and corresponding virtual resource values ​​in live broadcast, distributes the event information and corresponding virtual resource values ​​to the data partition corresponding to the live broadcast account identifier, and reads the virtual resource value corresponding to the target event information and the accumulated virtual resource value corresponding to the previous event information from the data partition, thereby using the affinity thread pool corresponding to the live broadcast account identifier, determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value, and updating the list data based on the target virtual resource value. As a result, the event information in the data partition corresponding to the same live broadcast account is processed by the same thread pool, thereby avoiding the concurrency problem of data update of the same live broadcast account, not only ensuring the correctness of the list data, but also improving the reliability of the list data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to Internet technology, and in particular to a list data updating method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of Internet technology, live streaming has become a new social method, and various rankings corresponding to live streaming have also emerged. For example, "anchor popularity list", "audience level list", "live streaming PK list", etc. are all very important ways to increase user stickiness.

[0003] For example, the live PK (Player Killing) list means that the anchors are allowed to perform live PK within a period of time, and then the anchors are ranked according to the amount of gifts they receive or the maximum number of consecutive wins. However, in the high-concurrency distributed scenario, when generating the live PK list, the winning streak may be settled in disorder. For example, if anchor A has won three consecutive PKs, and in a short period of time, he won another PK (i.e., the fourth PK), and soon lost another PK (i.e., the fifth PK). At this time, if the previous winning PK (i.e., the fourth PK) has not been settled, and another settlement node of the distributed system has completed the settlement of the lost PK (i.e., the fifth PK), the winning streak of anchor A will be calculated incorrectly, such as the winning streak "4" will be calculated as "3", resulting in the correctness of the final calculated list cannot be guaranteed, and there is a problem of low reliability of the list data. Summary of the invention

[0004] The present disclosure provides a list data update method, device, electronic device and storage medium to at least solve the problem in the related art that the correctness of the list cannot be guaranteed in high-concurrency scenarios. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a list data updating method is provided, comprising:

[0006] Acquire event information and corresponding virtual resource values ​​in the live broadcast, wherein the event information includes a corresponding event occurrence time point, a processing status of the event information, and a live broadcast account identifier to which the virtual resource value belongs;

[0007] Distributing the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier;

[0008] Reading a virtual resource value corresponding to target event information from the data partition, the target event information being event information in the data partition whose processing status is unprocessed and whose event occurrence time point is the earliest, and reading a cumulative virtual resource value corresponding to a previous event information of the target event information;

[0009] Using an affinity thread pool corresponding to the live broadcast account identifier, and determining a target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value;

[0010] The list data is updated based on the target virtual resource value.

[0011] In one of the embodiments, distributing the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier includes: generating a corresponding data partition according to the live broadcast account identifier; writing the event information and the corresponding virtual resource value into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

[0012] In one of the embodiments, updating the list data based on the target virtual resource value includes: obtaining the target virtual resource value corresponding to each live broadcast account identifier; sorting each live broadcast account identifier according to the size of the target virtual resource value, and using the sorting result as the updated list data.

[0013] In one of the embodiments, determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition based on the virtual resource value and the accumulated virtual resource value includes: obtaining the sum of the accumulated virtual resource value and the virtual resource value, and determining the sum as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

[0014] In one of the embodiments, after determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition, the method further includes: determining the target virtual resource value as the accumulated virtual resource value corresponding to the target event information; and modifying the processing status of the target event information to a processed processing status.

[0015] In one of the embodiments, the reading of the accumulated virtual resource value corresponding to the previous event information of the target event information includes: sorting the event information in the data partition in chronological order of the event occurrence time points; obtaining the processing status corresponding to the previous event information of the target event information; if the processing status corresponding to the previous event information is a processed processing status, obtaining the accumulated virtual resource value corresponding to the previous event information.

[0016] In one of the embodiments, the reading of the cumulative virtual resource value corresponding to the previous event information of the target event information includes: reading the event information with a processing status of processed in the data partition; obtaining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point among the event information with a processing status of processed; and determining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point as the cumulative virtual resource value corresponding to the previous event information of the target event information.

[0017] According to a second aspect of an embodiment of the present disclosure, a list data updating device is provided, including:

[0018] A data acquisition module is configured to acquire event information and corresponding virtual resource values ​​in a live broadcast, wherein the event information includes a corresponding event occurrence time point, a processing status of the event information, and an identifier of a live broadcast account to which the virtual resource value belongs;

[0019] A distribution module, configured to distribute the event information and the corresponding virtual resource value to a data partition corresponding to the live broadcast account identifier;

[0020] A virtual resource value reading module is configured to execute reading of a virtual resource value corresponding to target event information from the data partition, wherein the target event information is event information in the data partition whose processing status is unprocessed and whose event occurrence time point is the earliest, and to read a cumulative virtual resource value corresponding to a previous event information of the target event information;

[0021] a target virtual resource value determination module, using an affinity thread pool corresponding to the live broadcast account identifier, and determining a target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value;

[0022] The list updating module is configured to update the list data based on the target virtual resource value.

[0023] In one of the embodiments, the distribution module is configured to execute: generating a corresponding data partition according to the live broadcast account identifier; writing the event information and the corresponding virtual resource value into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

[0024] In one of the embodiments, the list update module includes: a target virtual resource value acquisition unit, configured to execute acquisition of the target virtual resource value corresponding to each live broadcast account identifier; a sorting unit, configured to execute sorting of each live broadcast account identifier according to the size of the target virtual resource value, and use the sorting result as the updated list data.

[0025] In one of the embodiments, the target virtual resource value determination module is further configured to execute: obtaining the sum of the accumulated virtual resource value and the virtual resource value, and determining the sum as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

[0026] In one of the embodiments, the device also includes a target virtual resource value update module, which is configured to execute: determining the target virtual resource value as the accumulated virtual resource value corresponding to the target event information; and modifying the processing status of the target event information to a processed processing status.

[0027] In one of the embodiments, the virtual resource value reading module is configured to execute: sorting the event information in the data partition in chronological order of the event occurrence time points; obtaining the processing status corresponding to the previous event information of the target event information; if the processing status corresponding to the previous event information is a processed processing status, obtaining the accumulated virtual resource value corresponding to the previous event information.

[0028] In one of the embodiments, the virtual resource value reading module is further configured to execute: reading the event information with a processing status of processed in the data partition; obtaining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point among the event information with a processing status of processed; and determining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point as the cumulative virtual resource value corresponding to the previous event information of the target event information.

[0029] According to a third aspect of an embodiment of the present disclosure, a server is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions so that the server executes the list data updating method described in any one of the embodiments of the first aspect.

[0030] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of a server, the server is enabled to execute the list data updating method described in any one of the embodiments of the first aspect.

[0031] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the program product comprising a computer program, the computer program being stored in a readable storage medium, at least one processor of a device reading and executing the computer program from the readable storage medium, so that the device executes the list data updating method described in any one of the embodiments of the first aspect.

[0032] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: by acquiring the event information and the corresponding virtual resource value in the live broadcast, distributing the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier, and reading the virtual resource value corresponding to the target event information from the data partition, and reading the cumulative virtual resource value corresponding to the previous event information of the target event information, thereby using the affinity thread pool corresponding to the live broadcast account identifier, according to the virtual resource value and the cumulative virtual resource value, determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition, and updating the list data based on the target virtual resource value. As a result, the event information in the data partition corresponding to the same live broadcast account is processed by the same thread pool, thus avoiding the concurrency problem of data update of the same live broadcast account, not only ensuring the correctness of the list data, but also improving the reliability of the list data.

[0033] 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

[0034] 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.

[0035] Figure 1 The figure is a schematic diagram of an application of a traditional list data updating method according to an exemplary embodiment.

[0036] Figure 2 It is a schematic diagram of an application of a traditional list data updating method according to another exemplary embodiment.

[0037] Figure 3 The figure is a flowchart of a method for updating list data according to an exemplary embodiment.

[0038] Figure 4 The figure is a flowchart showing steps of distributing target event information according to an exemplary embodiment.

[0039] Figure 5 The figure is a flowchart showing steps of updating list data according to an exemplary embodiment.

[0040] Figure 6 The figure is a flowchart showing the steps of reading the accumulated virtual resource value according to an exemplary embodiment.

[0041] Figure 7 It is a calculation framework diagram of a list data updating method according to an exemplary embodiment.

[0042] Figure 8The figure is a block diagram of a device for updating list data according to an exemplary embodiment.

[0043] Fig. 9 It is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0044] 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.

[0045] 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.

[0046] Due to the low reliability of list data in traditional technologies, for example, Figure 1 As shown, in traditional technology, the Kafka Event (message event) related to the activity is generally directly monitored through the EventConsumer (event consumption component), and then the points settlement is completed in the thread pool of the EventConsumer. However, since different EventConsumers may complete the settlement at different times, the following situation may occur: If a user generates two events A and B with similar time points, the time point of A is earlier than that of B. However, since A and B may be assigned to two different EventConsumers for consumption and settlement, if the EventConsumer where A is located is stuck, B will be settled before A is settled, resulting in a timing error, which affects the correctness of the final settlement result.

[0047] Based on the above problems, there is currently a common optimization idea. Figure 2As shown in the figure, the settlement of the same user is locked. If a user generates two events A and B with similar time points, the time point of A is earlier than that of B. A and B may also be assigned to two different EventConsumers for consumption and settlement. However, the EventConsumer for settlement A will apply for a distributed lock on the user dimension, resulting in the inability of the EventConsumer for settlement B to settle. B can only unlock after the settlement of A is completed. However, the stability of the distributed lock itself may lead to various high-concurrency problems, such as deadlock, lock timeout, etc., which will seriously affect the settlement performance and reduce availability.

[0048] Based on this, the present disclosure provides a list data update method, such as Figure 3 As shown, this embodiment uses the method applied to a server as an example. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:

[0049] In step S310, event information in the live broadcast and corresponding virtual resource values ​​are obtained.

[0050] Among them, events refer to relevant events that affect the list data. For example, for the live PK list, the event can be the win or loss of the anchor in the live PK process, or the situation where the anchor receives gifts or likes, etc. Specifically, the event information includes the corresponding event occurrence time point, the processing status of the event information, and the live account identifier to which the corresponding virtual resource value belongs. The virtual resource value is an important data used to update the list, which can be converted based on different types of events. For example, for the live PK list, the virtual resource value can be converted based on the number of consecutive wins of the anchor, or it can be converted based on the amount of gifts received by the anchor or the number of likes received, etc., so as to convert various types of events to the same level for list update. The live account identifier to which the virtual resource value belongs refers to which live account the virtual resource belongs to, and the account identifier is a mark used to distinguish different live users. Since the timing is very important in the process of updating the list data, in this embodiment, the event information also includes the time point of occurrence of the corresponding event.

[0051] In step S320, the event information and the corresponding virtual resource value are distributed to the data partition corresponding to the live broadcast account identifier.

[0052] The data partition is a data storage space allocated based on the live broadcast account ID. In this embodiment, in order to avoid the problem that the traditional list update cannot guarantee the execution order in concurrent scenarios, this embodiment distributes the event information according to the corresponding live broadcast account ID, that is, the event information corresponding to the same live broadcast account ID is distributed to the same data partition in the order of the event occurrence time points, thereby ensuring the settlement sequence and preventing concurrent problems from occurring in the data update of the same live broadcast account.

[0053] In step S330, the virtual resource value corresponding to the target event information is read from the data partition, and the accumulated virtual resource value corresponding to the previous event information of the target event information is read.

[0054] Among them, the target event information refers to the event information in the data partition whose processing status is unprocessed and whose event occurs at the earliest time point. Then the previous event information of the target event information refers to the event information whose processing status is processed and whose event occurs at the latest time point, that is, the event information that is finally settled with the event occurrence time point corresponding to the target event information as the dividing line. The accumulated virtual resource value is based on the sum of the virtual resource value corresponding to the event information that is finally settled and the virtual resource value that has been settled in the history of the corresponding live account. Relative to the target event information, the accumulated virtual resource value refers to the sum of the virtual resource values ​​of all settled event information before the target event information, that is, the virtual resource value that has been settled in the history of the live account. In this embodiment, by reading the virtual resource value corresponding to the target event information from the data partition, and reading the accumulated virtual resource value corresponding to the previous event information of the target event information, and settling the target event information through subsequent steps, the settlement timing is guaranteed.

[0055] In step S340, the affinity thread pool corresponding to the live broadcast account identifier is used to determine the target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value.

[0056] Among them, the affinity thread pool is to put the pending tasks (i.e., target event information) of the same live account into the same memory queue according to the order of the delivery thread pool, and each memory queue is consumed by one thread. Therefore, each affinity thread pool corresponds to the respective live account identifier, and since the data partition is also allocated based on the live account identifier, the data partition for the same live account identifier is processed by the corresponding affinity thread pool, while different data partitions are processed by different affinity thread pools. The target virtual resource value refers to the cumulative virtual resource value of the processed event information in the event information corresponding to the same live account identifier. In this embodiment, the affinity thread pool corresponding to the live account identifier is used to process the target event information in the corresponding data partition, that is, each affinity thread pool asynchronously processes the corresponding data partition, so that the event information in the same data partition is converged to the same affinity thread pool for orderly processing. Therefore, the affinity thread pool updates the target virtual resource value of the corresponding live account identifier according to the virtual resource value corresponding to the currently consumed target event information and the cumulative virtual resource value corresponding to the previous event information of the target event information.

[0057] In step S350, the list data is updated based on the target virtual resource value.

[0058] Specifically, the above affinity thread pools asynchronously process the event information in the corresponding data partitions, and update the target virtual resource value of the corresponding live account identifier, so as to sort the live accounts according to the updated target virtual resource value to update the list data.

[0059] The above-mentioned list data updating method obtains the event information and the corresponding virtual resource value in the live broadcast, distributes the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier, and reads the virtual resource value corresponding to the target event information from the data partition, as well as the cumulative virtual resource value corresponding to the previous event information of the target event information, thereby using the affinity thread pool corresponding to the live broadcast account identifier, and determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the cumulative virtual resource value, and updating the list data based on the target virtual resource value. As a result, the event information in the data partition corresponding to the same live broadcast account is processed by the same thread pool, thereby avoiding the concurrency problem of data update of the same live broadcast account, not only ensuring the correctness of the list data, but also improving the reliability of the list data.

[0060] In an exemplary embodiment, if Figure 4 As shown, in step S320, the event information and the corresponding virtual resource value are distributed to the data partition corresponding to the live broadcast account identifier, which can be specifically achieved by the following steps:

[0061] In step S321, a corresponding data partition is generated according to the live broadcast account identifier.

[0062] The data partition is the corresponding data storage space, which has the characteristic of orderly data storage. Specifically, the corresponding data partition is generated based on the live broadcast account identifier, that is, one live broadcast account identifier corresponds to one data partition.

[0063] In step S322, the event information and the corresponding virtual resource value are written into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

[0064] Since the corresponding event information and the corresponding virtual resource values ​​may continuously burst out during the live broadcast process, therefore, when the server obtains the event information and the corresponding virtual resource value, it writes the event information into the data partition corresponding to the live broadcast account identifier according to the chronological order of the corresponding event occurrence time points according to the live broadcast account identifier to which the virtual resource value corresponding to the event information belongs. That is, the event information and the corresponding virtual resource value are partitioned and stored according to the live broadcast account identifier, and the event information and the corresponding virtual resource value of the same live broadcast account are orderly stored in the corresponding data partition, so that the event information and the corresponding virtual resource value corresponding to the same live broadcast account identifier are distributed to the same data partition according to the chronological order of the event occurrence time points, and then consumed in an orderly manner, thereby ensuring that the data update of the same live broadcast account will not have concurrency problems.

[0065] In an exemplary embodiment, if Figure 5 As shown, in step S350, the list data is updated based on the target virtual resource value, which can be specifically implemented by the following steps:

[0066] In step S331, the target virtual resource value corresponding to each live broadcast account identifier is obtained.

[0067] Since each affinity thread pool corresponds to its own live broadcast account ID, and since data partitions are also allocated based on the live broadcast account ID, the data partition with the same live broadcast account ID is processed by the corresponding affinity thread pool, while different data partitions are processed by different affinity thread pools. Based on this, each affinity thread pool asynchronously processes the corresponding data partition, so that the event information in the same data partition is converged to the same affinity thread pool for orderly processing, thereby obtaining the target virtual resource values ​​corresponding to the live broadcast account IDs after processing by each affinity thread pool.

[0068] In step S332, the live broadcast account identifiers are sorted according to the size of the target virtual resource value, and the sorting result is used as the updated list data.

[0069] Since the list data during the live broadcast process is an ordered list obtained by sorting the target virtual resource values ​​of each live broadcast account and after moderate redundancy, after the above steps are used to obtain the target virtual resource value corresponding to each live broadcast account identifier, the target virtual resource value of the corresponding live broadcast account has changed. Therefore, the list needs to be re-sorted and the sorting result is used as the updated list data.

[0070] In the above embodiment, the target virtual resource value corresponding to each live broadcast account identifier is obtained, and then the live broadcast account identifiers are sorted according to the size of the target virtual resource value, and the sorting result is used as the updated list data. Since the event information in the same data partition is converged into the same affinity thread pool for orderly processing, the problem of incorrect list data update caused by concurrency is solved, and the accuracy and reliability of the list data are improved.

[0071] In an exemplary embodiment, if Figure 6 As shown, in step S330, the accumulated virtual resource value corresponding to the previous event information of the target event information is read, which can be specifically implemented by the following steps:

[0072] In step S610, the event information in the data partitions is sorted according to the chronological order of the event occurrence time points.

[0073] Specifically, the event information in the data partition is sorted by the order of the event occurrence time points. Since the time sequence is more important when processing the event information in the data partition, generally speaking, the event that occurs first is processed first. Therefore, in this embodiment, the event information can be sorted according to the order of the event occurrence time points based on the event occurrence time points carried in the event information, so that the event information in the data partition can be processed in the corresponding order, so as to further ensure the processing sequence.

[0074] In step S620, the processing status corresponding to the previous event information of the target event information is obtained.

[0075] Among them, the processing status corresponding to the event information includes the event being in an unprocessed state or a processed state. Among them, the processed state means that when the target virtual resource value of the live broadcast account is updated, the virtual resources of the corresponding event information are taken into account, that is, the virtual resources of the event information have been settled. The unprocessed state means that when the target virtual resource value of the live broadcast account is updated, the virtual resources of the event information have not been taken into account, that is, the virtual resources of the event information have not been settled. The previous event information refers to the previous event information of the earliest unprocessed target event information relative to the time point of the event occurrence in the time sequence. Since the unprocessed target event information is the earliest event information at the time point of the event occurrence, and the event information in the data partition is sorted in the order of the time point of the event occurrence, its previous event information should be processed event information. Based on this, in this embodiment, when the list data is to be updated, the processing status corresponding to the previous event information of the target event information can be obtained based on the target event information currently settled in the data partition to verify its processing status to further ensure the processing sequence.

[0076] In step S630, if the processing status corresponding to the previous event information is a processed processing status, the accumulated virtual resource value corresponding to the previous event information is obtained.

[0077] The accumulated virtual resource value is based on the sum of the virtual resource value corresponding to the event information and the virtual resource value settled in the corresponding live account history. In this embodiment, in order to further improve the timing of settlement, the processing status of the last event information obtained can be verified, that is, the processing status corresponding to the last event information of the target event information is obtained. If the corresponding processing status is a processed status, the verification is passed, so as to further obtain the accumulated virtual resource value corresponding to the last event information.

[0078] In the above embodiment, the event information in the data partition is sorted according to the chronological order of the event occurrence time points, and the processing status corresponding to the previous event information of the target event information is obtained. If the processing status corresponding to the previous event information is a processed processing status, the cumulative virtual resource value corresponding to the previous event information is obtained. Since the event information in the data partition is sorted according to the chronological order of the event occurrence time points, the cumulative virtual resource value corresponding to the previous event information of the target event information can be read in this way, which can ensure the processing timing and thus improve the accuracy of the list data calculation.

[0079] In an exemplary embodiment, the accumulated virtual resource value corresponding to the latest event information in the event information with the processed status can be obtained by reading the event information in the data partition, and the accumulated virtual resource value corresponding to the latest event information in the event information with the processed status can be determined as the accumulated virtual resource value corresponding to the previous event information of the target event information. Since the previous event information refers to the previous event information of the earliest unprocessed target event information in the time sequence relative to the event time point. Since the unprocessed target event information is the earliest target event information at the event time point, its previous event information is the latest event information at the processed time point. Based on this, the present embodiment can sort the processed event information in the data partition according to the order of the event time points, and obtain the latest processed event information at the event time point, that is, obtain the previous processed event information of the earliest unprocessed target event information at the event time point, and then obtain the accumulated virtual resource value corresponding to the event information, that is, obtain the accumulated virtual resource value of the previous processed event information of the earliest unprocessed target event information at the event time point. By reading the accumulated virtual resource value corresponding to the previous event information of the target event information in this way, the processing sequence can also be guaranteed, thereby improving the accuracy of the calculation of the list data.

[0080] In an exemplary embodiment, in step S340, the target virtual resource value of the live broadcast account identifier corresponding to the data partition is determined based on the virtual resource value and the cumulative virtual resource value, specifically including: obtaining the sum of the cumulative virtual resource value and the virtual resource value, and determining the sum as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

[0081] Among them, the target virtual resource value refers to the cumulative virtual resource value of the processed event information corresponding to the same live account identifier. Specifically, by calculating the sum of the virtual resource value of the earliest unprocessed target event information at the time of event occurrence in a certain data partition and the cumulative virtual resource value of the last processed event information, the current target virtual resource value of the corresponding live account identifier is obtained. At the same time, the target virtual resource value is also the cumulative virtual resource value of the earliest unprocessed target event information at the time of the corresponding event occurrence. Since the target event information corresponding to the same live account is processed by the same thread pool, updating the target virtual resource value of the live account in this way improves the accuracy of the list data calculation and ensures that the settlement timing is error-free in a high-concurrency, distributed environment.

[0082] In an exemplary embodiment, in step S640, after the cumulative virtual resource value and the sum of the virtual resource value are determined as the target virtual resource value of the live account identifier corresponding to the data partition, the method further includes: determining the target virtual resource value as the cumulative virtual resource value corresponding to the target event information, and modifying the processing state of the target event information to a processed processing state. In this embodiment, by determining the target virtual resource value obtained by the above calculation as the cumulative virtual resource value corresponding to the target event information, the subsequent update of the target virtual resource value is facilitated, and by modifying the processing state of the target event information, repeated settlement of the target event information is avoided, so as to improve the accuracy of the list data update.

[0083] In an exemplary embodiment, the list data updating method disclosed in the present invention is further described below through a specific embodiment. Figure 7As shown, in this embodiment, a computing framework can be abstracted, including Kafka (an open source message middleware), event consumption components (EventConsumer1, EventConsumer2, EventConsumer...) and scheduled tasks (SettleTask1, SettleTask2) for completing event settlement. Among them, it can be a combination of multiple different EventConsumers and the same SettleTask. For example, each EventConsumer listens to one type of event, so as to realize simultaneous monitoring of multiple types of events, such as gift giving, PK wins and losses, etc. When the target event information (EventA, EventB,...) is generated during the live broadcast process, the high-throughput distributed publish-subscribe message system kafka assigns the Event to the corresponding EventConsumer for consumption according to the event type. EventConsumer extracts the virtual resource value ES corresponding to the Event, and encapsulates ES into Record (settlement record) and writes it into the Record data shard of the MySQL database, wherein the Record data shard is a data shard based on the live broadcast account identifier, thereby ensuring that the Event of the same live broadcast account can be stored in the same data shard. Each SettleTask is assigned a data shard of Record to be settled. In the assigned data shard, SettleTask batch reads the records with unprocessed status, sorts them by event time (to ensure settlement sequence 1), and uses the affinity thread pool to asynchronously process them according to the live account ID (to ensure settlement sequence 2). It also reads the previous record corresponding to the same live account ID, verifies the settlement status of this record (to ensure settlement sequence 3), and takes out SS (settle_score, the accumulated virtual resource value that has been settled). Then, calculate (implemented by the business party) is called based on ES and SS to calculate the newSS (i.e., the target virtual resource value) of this record. AfterCalculate (implemented by the business party) is called to perform business logic processing, such as updating the list data, and updating the status of the record to processed. This ensures that the activity settlement sequence does not go wrong in an extremely high-concurrency, distributed environment, so as to improve the accuracy and reliability of the list data.

[0084] It should be understood that although Figure 1-Figure 7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 7At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0085] Figure 8 FIG. 1 is a block diagram of a list data updating device according to an exemplary embodiment. Figure 8 The device includes a data acquisition module 802, a distribution module 804, a virtual resource value reading module 806, a target virtual resource value determination module 808 and a list updating module 810.

[0086] The data acquisition module 802 is configured to acquire event information and corresponding virtual resource values ​​in the live broadcast, wherein the event information includes a corresponding event occurrence time point, a processing status of the event information, and an identifier of a live broadcast account to which the virtual resource value belongs;

[0087] A distribution module 804 is configured to distribute the event information and the corresponding virtual resource value to a data partition corresponding to the live broadcast account identifier;

[0088] The virtual resource value reading module 806 is configured to execute reading the virtual resource value corresponding to the target event information from the data partition, the target event information being the event information in the data partition whose processing status is unprocessed and whose event occurrence time point is the earliest, and reading the accumulated virtual resource value corresponding to the previous event information of the target event information;

[0089] The target virtual resource value determination module 808 uses the affinity thread pool corresponding to the live broadcast account identifier to determine the target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value;

[0090] The list updating module 810 is configured to update the list data based on the target virtual resource value.

[0091] In an exemplary embodiment, the distribution module is configured to execute: generating a corresponding data partition according to the live broadcast account identifier; writing the event information and the corresponding virtual resource value into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

[0092] In an exemplary embodiment, the list update module includes: a target virtual resource value acquisition unit, configured to execute acquisition of the target virtual resource value corresponding to each live broadcast account identifier; a sorting unit, configured to execute sorting of each live broadcast account identifier according to the size of the target virtual resource value, and use the sorting result as the updated list data.

[0093] In an exemplary embodiment, the target virtual resource value determination module is further configured to execute: obtaining the sum of the accumulated virtual resource value and the virtual resource value, and determining the sum as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

[0094] In an exemplary embodiment, the device also includes a target virtual resource value update module, which is configured to execute: determining the target virtual resource value as the accumulated virtual resource value corresponding to the target event information; and modifying the processing status of the target event information to a processed processing status.

[0095] In an exemplary embodiment, the virtual resource value reading module is configured to execute: sorting the event information in the data partition in chronological order of the event occurrence time points; obtaining the processing status corresponding to the previous event information of the target event information; if the processing status corresponding to the previous event information is a processed processing status, obtaining the accumulated virtual resource value corresponding to the previous event information.

[0096] In an exemplary embodiment, the virtual resource value reading module is further configured to execute: reading event information with a processing status of processed in the data partition; obtaining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point among the event information with a processing status of processed; and determining the cumulative virtual resource value corresponding to the event information with the latest event occurrence time point as the cumulative virtual resource value corresponding to the previous event information of the target event information.

[0097] 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.

[0098] Fig. 9 FIG. 1 is a block diagram of a device S00 for updating list data according to an exemplary embodiment. For example, the device S00 may be a server. Fig. 9The device S00 includes a processing component S20, which further includes one or more processors, and a memory resource represented by a memory S22 for storing instructions executable by the processing component S20, such as an application. The application stored in the memory S22 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component S20 is configured to execute instructions to perform the above-mentioned list data update method.

[0099] The device S00 may also include a power supply component S24 configured to perform power management of the device S00, a wired or wireless network interface S26 configured to connect the device S00 to a network, and an input / output (I / O) interface S28. The device S00 may operate based on an operating system stored in the memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD or the like.

[0100] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory S22 including instructions, and the above instructions can be executed by a processor of the device S00 to complete the above method. The storage medium can be a computer-readable storage medium, for example, 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.

[0101] In an exemplary embodiment, a computer program product is also provided, which includes a computer program stored in a readable storage medium, and at least one processor of a device reads and executes the computer program from the readable storage medium, so that the device executes the list data updating method described in any one of the embodiments of the first aspect.

[0102] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure 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 description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0103] It should be understood that the present disclosure is not limited to the exact structures that have 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 disclosure is limited only by the appended claims.

Claims

1. A list data updating method, characterized in that: The method comprises: Acquire event information and corresponding virtual resource values ​​that affect the live broadcast PK list in the live broadcast PK, wherein the event information includes the corresponding event occurrence time point, the processing status of the event information, and the live broadcast account identifier to which the virtual resource value belongs. The virtual resource value is converted based on different events in the live broadcast PK, and the events include winning streak events, likes events, and virtual gift events in the live broadcast PK; Distributing the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier; Reading a virtual resource value corresponding to target event information from the data partition, the target event information being event information in the data partition with a processing status of unprocessed and the earliest event occurrence time point, and reading a cumulative virtual resource value corresponding to a previous event information of the target event information, the previous event information of the target event information being event information in the data partition with a processing status of processed and the latest event occurrence time point, and the cumulative virtual resource value being the sum of virtual resource values ​​of all processed event information before the target event information in the data partition; Using an affinity thread pool corresponding to the live broadcast account identifier, and determining a target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value; Updating list data based on the target virtual resource value; After determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition, the method further includes: determining the target virtual resource value as the accumulated virtual resource value corresponding to the target event information; and modifying the processing status of the target event information to a processed processing status.

2. The list data updating method according to claim 1, characterized in that: The distributing the event information and the corresponding virtual resource value to the data partition corresponding to the live broadcast account identifier includes: Generate a corresponding data partition according to the live broadcast account identifier; The event information and the corresponding virtual resource value are written into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

3. The list data updating method according to claim 1, characterized in that: The updating of the list data based on the target virtual resource value includes: Obtain the target virtual resource value corresponding to each live broadcast account identifier; The live broadcast account identifiers are sorted according to the size of the target virtual resource value, and the sorting result is used as the updated list data.

4. The list data updating method according to claim 1, characterized in that: The determining, according to the virtual resource value and the accumulated virtual resource value, a target virtual resource value of the live broadcast account identifier corresponding to the data partition comprises: The sum of the accumulated virtual resource value and the virtual resource value is obtained, and the sum is determined as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

5. The list data updating method according to claim 1, characterized in that: The accumulated virtual resource value corresponding to the previous event information of the target event information is read, including: Sorting the event information in the data partitions according to the chronological order of the event occurrence times; Obtaining the processing status corresponding to the previous event information of the target event information; If the processing status corresponding to the previous piece of event information is a processed processing status, the accumulated virtual resource value corresponding to the previous piece of event information is obtained.

6. The list data updating method according to claim 1, characterized in that: The accumulated virtual resource value corresponding to the previous event information of the target event information is read, including: Reading event information with a processed status in the data partition; Obtain the accumulated virtual resource value corresponding to the event information with the latest event occurrence time point among the event information with the processing status of processed; The accumulated virtual resource value corresponding to the event information with the latest event occurrence time point is determined as the accumulated virtual resource value corresponding to the previous event information of the target event information.

7. A list data updating device, characterized in that: include: A data acquisition module is configured to execute acquisition of event information affecting the live broadcast PK list and corresponding virtual resource values ​​in the live broadcast PK, wherein the event information includes a corresponding event occurrence time point, a processing status of the event information, and a live broadcast account identifier to which the virtual resource value belongs, and the virtual resource value is converted based on different events in the live broadcast PK, wherein the events include winning streak events, likes events, and virtual gift events in the live broadcast PK; A distribution module, configured to distribute the event information and the corresponding virtual resource value to a data partition corresponding to the live broadcast account identifier; A virtual resource value reading module is configured to execute reading of a virtual resource value corresponding to target event information from the data partition, wherein the target event information is event information in the data partition whose processing status is unprocessed and whose event occurrence time is the earliest, and to read a cumulative virtual resource value corresponding to a previous event information of the target event information, wherein the previous event information of the target event information is event information in the data partition whose processing status is processed and whose event occurrence time is the latest, and wherein the cumulative virtual resource value is the sum of virtual resource values ​​of all processed event information before the target event information in the data partition; a target virtual resource value determination module, using an affinity thread pool corresponding to the live broadcast account identifier, and determining a target virtual resource value of the live broadcast account identifier corresponding to the data partition according to the virtual resource value and the accumulated virtual resource value; A list updating module, configured to update list data based on the target virtual resource value; The device also includes a target virtual resource value updating module, which is configured to execute: after determining the target virtual resource value of the live broadcast account identifier corresponding to the data partition, determine the target virtual resource value as the accumulated virtual resource value corresponding to the target event information; and modify the processing status of the target event information to a processed processing status.

8. The list data updating device according to claim 7, characterized in that: The distribution module is configured to perform: Generate a corresponding data partition according to the live broadcast account identifier; The event information and the corresponding virtual resource value are written into the data partition corresponding to the live broadcast account identifier in the order of the corresponding event occurrence time points.

9. The list data updating device according to claim 7, characterized in that: The list updating module includes: A target virtual resource value obtaining unit is configured to obtain target virtual resource values ​​corresponding to each live broadcast account identifier; The sorting unit is configured to sort the live broadcast account identifiers according to the size of the target virtual resource value, and use the sorting result as the updated list data.

10. The list data updating device according to claim 7, characterized in that: The target virtual resource value determination module is further configured to execute: The sum of the accumulated virtual resource value and the virtual resource value is obtained, and the sum is determined as the target virtual resource value of the live broadcast account identifier corresponding to the data partition.

11. The list data updating device according to claim 7, characterized in that: The virtual resource value reading module is configured to execute: Sorting the event information in the data partitions according to the chronological order of the event occurrence times; Obtaining the processing status corresponding to the previous event information of the target event information; If the processing status corresponding to the previous piece of event information is a processed processing status, the accumulated virtual resource value corresponding to the previous piece of event information is obtained.

12. The list data updating device according to claim 7, characterized in that: The virtual resource value reading module is further configured to execute: Reading event information with a processed status in the data partition; Obtain the accumulated virtual resource value corresponding to the event information with the latest event occurrence time point among the event information with the processing status of processed; The accumulated virtual resource value corresponding to the event information with the latest event occurrence time point is determined as the accumulated virtual resource value corresponding to the previous event information of the target event information.

13. A server, 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 list data updating method as described in any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the list data updating method as described in any one of claims 1 to 6.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the list data updating method according to any one of claims 1 to 6 is implemented.