Live broadcast room settlement data processing method, device, electronic device and storage medium
By cached consumption data in the live broadcast room settlement cache database and generated real-time settlement value, the problem of high pressure on settlement data processing in the live broadcast industry is solved, and more efficient settlement data processing and timely display of anchor revenue information is achieved.
Patent Information
- Application Number
- CN202111022204.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-09-01
AI Technical Summary
In the live broadcast industry, the settlement data processing of virtual gifts puts great pressure on the server, causing the server to be unable to process settlement data in a timely manner, and hot issues arise, affecting the timely display and accuracy of the anchor account income information.
By caching consumption data in the settlement cache database, real-time settlement values are generated and updated to the settlement master database, avoiding direct writing consumption data to the settlement master database, reducing read and write load, and improving processing efficiency.
It improves the processing efficiency of settlement data and the real-time and accuracy of anchor account revenue information, and solves the problems of server processing delay and high load.
Smart Images

Figure CN115733996B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for processing settlement data in a live broadcast room. Background Art
[0002] Currently, in the live broadcast industry, viewers will reward and send gifts to their favorite anchors by purchasing virtual gifts in the live broadcast room. After the live broadcast platform settles the payment, part of the consumption amount of these virtual gifts will be transferred to the anchor's account as the anchor's income.
[0003] With the rapid growth of live streaming, the processing of virtual gift settlement data for some live streaming rooms with high virtual gift consumption has placed significant pressure on the server, resulting in inability to process settlement data in a timely manner, or even unresponsiveness, which has become a hot issue. This has resulted in streamers' account income information not being displayed in a timely manner, and income being missed or duplicated. Summary of the Invention
[0004] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for processing settlement data in a live broadcast room to overcome the hot spot problem caused by the server's inability to process settlement data in a timely manner.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing settlement data in a live broadcast room, comprising:
[0006] When the live broadcast room is broadcasting live, the consumption data of at least one preset object corresponding to the cached target live broadcast room is extracted from the settlement cache database; the consumption data of the preset object is the consumption data generated when the user consumes the preset object in the target live broadcast room; based on the consumption data of the at least one preset object, the real-time settlement value of the target live broadcast room is generated; based on the real-time settlement value of the target live broadcast room, the cumulative settlement data of the target live broadcast room stored in the settlement master database is updated; based on the cumulative settlement data, the account corresponding to the target live broadcast room is settled.
[0007] In a second aspect, an embodiment of the present disclosure provides a live broadcast room settlement data processing device, comprising:
[0008] An extraction module is used to extract, from a settlement cache database, consumption data of at least one preset object corresponding to a cached target live broadcast room during live broadcast in the live broadcast room, where the consumption data of the preset object is consumption data generated when a user consumes the preset object in the target live broadcast room;
[0009] A generating module, configured to generate a real-time settlement value for the target live broadcast room based on the consumption data of the at least one preset object;
[0010] An updating module, configured to update the accumulated settlement data of the target live broadcast room stored in the settlement master database according to the real-time settlement value of the target live broadcast room;
[0011] The settlement module is used to settle the account corresponding to the target live broadcast room based on the accumulated settlement data.
[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0013] The memory stores computer-executable instructions;
[0014] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect.
[0017] The live broadcast room settlement data processing method, device, electronic device and storage medium provided in this embodiment extracts the consumption data of at least one preset object corresponding to the cached target live broadcast room from the settlement cache database during the live broadcast of the live broadcast room; the consumption data of the preset object is the consumption data generated when the user consumes the preset object in the target live broadcast room; based on the consumption data of the at least one preset object, a real-time settlement value of the target live broadcast room is generated; based on the real-time settlement value of the target live broadcast room, the cumulative settlement data of the target live broadcast room stored in the settlement master database is updated; based on the cumulative settlement data, the account corresponding to the target live broadcast room is settled. By caching the consumption data in the settlement cache database and generating the real-time settlement value, and then updating the real-time settlement value to the settlement master database, the data queuing problem caused by directly writing the consumption data to the settlement master database is avoided, the read and write load of the settlement master database is reduced, the processing efficiency of the settlement data is improved, and the real-time and accuracy of the display of the host's account income information is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A diagram of an application scenario of the live broadcast room settlement data processing method provided by an embodiment of the present disclosure;
[0020] Figure 2 A schematic diagram of income settlement for a live broadcast room in the prior art;
[0021] Figure 3 Schematic diagram of the process of the live broadcast room settlement data processing method provided by the embodiment of the present disclosure Figure 1 ;
[0022] Figure 4 A schematic diagram of determining accumulated settlement data provided by an embodiment of the present disclosure;
[0023] Figure 5 Schematic diagram of the process of the live broadcast room settlement data processing method provided by the embodiment of the present disclosure Figure 2 ;
[0024] Figure 6 A schematic diagram of caching consumption information into a settlement cache database provided by an embodiment of the present disclosure;
[0025] Figure 7 for Figure 6 Flowchart of the implementation of step S204 in the illustrated embodiment;
[0026] Figure 8 A schematic diagram of determining a first recording interval according to a real-time location field provided in an embodiment of the present disclosure;
[0027] Figure 9 for Figure 6 Flowchart of the implementation of step S206 in the illustrated embodiment;
[0028] Figure 10 A schematic diagram of a process for generating a real-time settlement record provided in an embodiment of the present disclosure;
[0029] Figure 11 A structural block diagram of a live broadcast room settlement data processing device provided by an embodiment of the present disclosure;
[0030] Figure 12 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
[0031] Figure 13A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0033] The following explains the application scenarios of the embodiments of the present disclosure:
[0034] Figure 1 This is an application scenario diagram of the live broadcast room settlement data processing method provided by the embodiment of the present disclosure, such as Figure 1 As shown, the live broadcast room settlement data processing method provided by the embodiment of the present disclosure can be applied to the scenario of live broadcast room income settlement, more specifically, as Figure 1 As shown, the application subject of the method provided by the embodiment of the present disclosure can be a server, which is communicatively connected to a terminal device, wherein the terminal device runs a live broadcast client on the anchor side. When the live broadcast audience consumes in the target live broadcast room (for example, purchases virtual items, gives virtual gifts to the anchor), the server uses the relevant settlement service to settle according to the consumption information, determines the income amount attributable to the anchor, and synchronizes the income amount to the live broadcast client of the terminal device, so that the anchor can view the current account income in real time.
[0035] In the prior art, the server stores and settles the consumption data of the live broadcast room in real time based on the MySQL database. By using the transaction operations supported by the MySQL database, the consumption data and the total income of the target room are guaranteed to be atomic. Figure 2 This is a schematic diagram of the income settlement for the live broadcast room in the prior art, such as Figure 2 As shown, each shard database ( Figure 2 In the figure, shard database A, shard database B, and shard database C are shown. After aggregating consumption information by different dimensions (such as the consumer user dimension), when corresponding consumption information is generated, for the sake of settlement security, the server directly aggregates the consumption information corresponding to each shard database into a record representing the real-time total consumption amount in the settlement master database through transaction operations ( Figure 2The flow record a) is shown in the figure. Then, based on the record, the settlement income of the settlement information table corresponding to the live broadcast room is updated in real time. The settlement income is synchronized to the live broadcast client, that is, the real-time settlement income viewed by the anchor. When the live broadcast room settles the account (for example, when the broadcast is off), the server can directly query the settlement income in the settlement information table, and after calculating based on the sharing rules, transfer the corresponding amount to the account corresponding to the live broadcast room to complete the settlement process. However, in this process, when the server inserts a record representing consumption information into the settlement master database through a transaction operation, the transaction operation will add an exclusive lock to this record to block other services from performing transaction operations on this record. This exclusive lock will not be released until the entire transaction is committed or rolled back. Therefore, if a large amount of consumption information needs to be written to the settlement master database at the same time, for example, when multiple sharded databases need to aggregate data to the same record in a short period of time, they can only be in a waiting state for data queuing, thus causing problems such as high latency and high load when the server processes the settlement data, affecting the processing efficiency of the settlement data.
[0036] The embodiments of the present disclosure provide a method for processing settlement data in a live broadcast room to solve the above problems.
[0037] Figure 3 Schematic diagram of the process of the live broadcast room settlement data processing method provided by the embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a server. The live broadcast room settlement data processing method includes:
[0038] Step S101, when the live broadcast room is broadcasting live, the consumption data of at least one preset object corresponding to the cached target live broadcast room is extracted from the settlement cache database, and the consumption data of the preset object is the consumption data generated when the user consumes the preset object in the target live broadcast room.
[0039] Exemplarily, the settlement cache database is a preset sharded database, which can be run on the server that is the execution subject of the method provided in this embodiment, or can be run in other storage servers, which is not specifically limited here. The order service running in the server generates corresponding consumption information when a user consumes a preset object in the target live broadcast room (for example, giving a virtual gift or purchasing a virtual item). After that, the consumption information of the preset object is converted into the consumption data of the preset object that meets the format of the settlement cache database, and the consumption data of the preset object is cached in the settlement cache database.
[0040] Exemplarily, consumption information is stored in a settlement cache database. Unlike transaction operations, the process of generating consumption data does not require an exclusive lock on each record; instead, it is directly stored in the database. Therefore, consumption data can be stored quickly and efficiently in the settlement cache database. Subsequently, the server extracts the consumption data cached in the settlement cache database to perform subsequent settlement steps. This effectively separates the database storage and computation steps, avoiding the high latency caused by limited write speeds during transaction operations in the main settlement database. Exemplarily, the settlement cache database can be a Redis database.
[0041] Step S102: Generate a real-time settlement value for the target live broadcast room based on consumption data of at least one preset object.
[0042] Exemplarily, after obtaining the consumption data of at least one preset object from the settlement cache database, the consumption data of the at least one preset object is pre-settled. For example, 10 pieces of consumption data are obtained, and the 10 pieces of consumption data are pre-settled to obtain a summary amount, such as 100 yuan. The summary amount is the real-time settlement value of the target live broadcast room. In one possible implementation, the consumption data of at least one preset object is all consumption data within a preset time period, such as all consumption data cached in the settlement cache database from the start time of the live broadcast room to the current time. By summarizing and settling all consumption data within the preset time period, the overall data representing the consumption of the live broadcast room within the preset time period can be determined.
[0043] Step S103: Update the cumulative settlement data of the target live broadcast room stored in the settlement master database according to the real-time settlement value of the target live broadcast room.
[0044] Exemplarily, the main settlement database can be a MySQL database. After obtaining the real-time settlement value, the real-time settlement value is updated (UPDATA) to the cumulative settlement data of the main settlement database in the form of a transaction operation, thereby ensuring the security of the settlement process through transaction operations. The cumulative settlement data is data stored in the main settlement database that represents the current cumulative consumption amount corresponding to the live broadcast room. In one possible implementation, each cumulative settlement data corresponds to a live broadcast room identifier, and the cumulative settlement data records the cumulative consumption amount corresponding to the live broadcast room identifier. The cumulative settlement data of the target live broadcast room can be determined by the live broadcast room identifier of the target live broadcast room.
[0045] Figure 4 A schematic diagram of determining cumulative settlement data provided by an embodiment of the present disclosure is shown as follows: Figure 4As shown, the consumption data includes consumption data a, consumption data b, consumption data c, and other consumption data (not shown in the figure). According to the consumption data in the settlement cache database, according to a certain period or data volume, for example, the newly generated consumption data (i.e., consumption data a, consumption data b, consumption data c) is summarized once every minute, and calculations are performed to generate real-time settlement values. The real-time settlement values are written into the cumulative settlement data in the settlement master database to complete the update process of the cumulative settlement data of the target live broadcast room.
[0046] Step S104: Settle the account corresponding to the target live broadcast room based on the accumulated settlement data.
[0047] Exemplarily, the server settles accounts based on the cumulative consumption amount of the target live broadcast room recorded in the cumulative settlement data of the target live broadcast room at intervals of a preset time, or when it detects that the cumulative settlement data of the target live broadcast room has been updated. For example, the server calculates the share based on the preset sharing rules to determine the income attributable to the anchor. Afterwards, based on the income value, the server calls the account settlement service to add the income value to the account corresponding to the target live broadcast room, thereby completing the settlement process for the account corresponding to the target live broadcast room.
[0048] In this embodiment, during the live broadcast of the live broadcast room, the consumption data of at least one preset object corresponding to the cached target live broadcast room is extracted from the settlement cache database; the consumption data of the preset object is the consumption data generated when the user consumes the preset object in the target live broadcast room; based on the consumption data of the at least one preset object, a real-time settlement value of the target live broadcast room is generated; based on the real-time settlement value of the target live broadcast room, the cumulative settlement data of the target live broadcast room stored in the settlement master database is updated; and based on the cumulative settlement data, the account corresponding to the target live broadcast room is settled. By caching the consumption data in the settlement cache database, generating the real-time settlement value, and then updating the real-time settlement value to the settlement master database, the data queuing problem caused by directly writing the consumption data to the settlement master database is avoided, the read and write load of the settlement master database is reduced, the processing efficiency of the settlement data is improved, and the real-time and accuracy of the display of the host's account income information is improved.
[0049] Figure 5 Schematic diagram of the process of the live broadcast room settlement data processing method provided by the embodiment of the present disclosure Figure 2 In this embodiment Figure 3 Based on the embodiment shown, steps S101-S104 are further refined, and a step of caching consumption data is added. The live broadcast room settlement data processing method includes:
[0050] Step S201: receiving consumption information of a preset object, where the consumption information of the preset object represents consumption data generated when a user purchases the preset object in a target live broadcast room.
[0051] Step S202: converting the consumption information of the preset object into consumption data of the preset object that meets the format of the settlement cache database.
[0052] Step S203: Cache the consumption data of the preset object into the settlement cache database.
[0053] Exemplarily, an order service is running in the server. When a consumption event such as the purchase or gift of virtual items occurs, corresponding consumption information will be generated. More specifically, the consumption information is, for example, the flow of consumption gifts. Afterwards, the server writes the consumption information into the settlement cache database in the form of records. Among them, the collection of all records corresponding to the target live broadcast room in the settlement cache database is the consumption data. In one possible implementation, the settlement cache database is a sharded database, which can be divided based on the dimension of consumer users (such as people who purchase virtual gifts). In this case, the settlement cache database aggregates the consumption information through multiple sharded databases to generate consumption data based on the primary key.
[0054] Figure 6 A schematic diagram of caching consumption information into a settlement cache database provided by an embodiment of the present disclosure, such as Figure 6 As shown in the figure, the consumption information generated by the order service is stored in different shard databases, such as Shard Database A, Shard Database B, and Shard Database C. The consumption information from each shard database is then inserted into the settlement cache database one by one, generating consumption data in the settlement cache database. Unlike transaction operations, this eliminates the need for an exclusive lock on each record; instead, it is directly stored in the database. This allows for fast and efficient storage of consumption information.
[0055] Step S204: determine the first recording interval.
[0056] Exemplarily, after the consumption information is cached in the settlement cache database and the consumption data is generated, it is necessary to summarize and settle the consumption in the current time period based on the consumption data. The consumption data includes multiple records, and the first record interval is information used to determine the records in the settlement cache database for current summary. More specifically, the first record interval can be an identifier, for example, the first record interval = 100, representing the most recent 100 records. The first record interval = [100, 200] represents the records in the settlement cache database with primary keys from 100 to 200. The first record interval can also be implemented in other ways as needed, which will not be repeated here.
[0057] Alternatively, as Figure 7 As shown, step S204 includes two specific implementation steps, S2041 and S2042:
[0058] S2041, obtain the accumulated settlement data in the settlement master database.
[0059] S2042: Determine a first recording interval based on the real-time location field in the accumulated settlement data of the main settlement database.
[0060] Exemplarily, the master settlement database is a database used to record the real-time settlement value of a target livestream. Specifically, the master settlement database stores cumulative settlement data. Consumption information generated by the target livestream is aggregated into the master settlement database at regular intervals. The server periodically reads the cumulative settlement data from the master settlement database, obtains the real-time settlement value, and sends it to the client, allowing the client to display the real-time settlement value corresponding to the target livestream in near real time.
[0061] The first record interval includes a starting point and an ending point, respectively indicating the starting and ending positions of multiple records in the settlement cache database. The accumulated settlement data in the main settlement database includes a real-time location field. The field value of the real-time location field can be used to determine the starting point of the first record interval.
[0062] In one possible implementation, determining the first recording interval based on the real-time location field in the accumulated settlement data of the main settlement database includes: determining a starting point location based on the real-time location field in the accumulated settlement data; and determining the first recording interval based on a preset time interval and / or a preset number of data items and the starting point location. The preset number of data items and the preset time interval may be determined based on the time or identifier of the most recently inserted record in the current cached settlement database.
[0063] Figure 8 A schematic diagram of determining the first record interval based on the real-time location field provided in an embodiment of the present disclosure. The field value corresponding to the real-time location field in the cumulative settlement data represents the end point position of the first record interval corresponding to the previous settlement period, that is, the starting point position of this settlement period. By reading the field value corresponding to the real-time location field in the cumulative settlement data, the starting point position corresponding to the first record interval can be obtained. At the same time, according to the preset time interval, and / or the preset number of data items, the length of the first record interval can be determined by including the corresponding identification information and generation time information in each record in the cached data, and then the end point position of the first record interval can be determined. In a possible implementation method, such as Figure 8 As shown, according to the position of the latest inserted consumption information in the consumption data, the corresponding record identifier is determined, and then the end point position is determined. According to the starting point position and the end point position, the first recording interval can be determined.
[0064] Optionally, after step S204, the method further includes:
[0065] Step S205 , detecting a free storage area in the first recording interval; if a free storage area exists in the first recording interval, writing empty data into the free storage area according to the primary key corresponding to the free storage area.
[0066] For example, after determining the first record interval, the corresponding settlement data in the settlement cache database can be retrieved based on the first record interval. In order to avoid inserting new records corresponding to the settlement information in the first record interval after aggregating the settlement data in the first record interval, resulting in settlement errors, it should be ensured that there is no free storage area in the first record interval. Specifically, the free storage area in the first record interval is detected, and empty records or invalid records are inserted into the free storage area, so that the first record interval remains continuous, avoiding the insertion of new data after the settlement data in the first record interval, resulting in settlement errors.
[0067] Step S206: Based on the preset first record interval, query the consumption data in the first record interval in the settlement cache database to obtain the interval summary value, wherein the aggregation interval is a continuous storage area formed based on the primary key sorting in the settlement cache database; the interval summary value represents the sum of each consumption data in the first record interval in the settlement cache database.
[0068] Alternatively, as Figure 9 As shown, step S206 includes three specific implementation steps: S2061, S2062, and S2063:
[0069] S2061: Obtain the primary key corresponding to the starting point of the first recording interval.
[0070] S2062: Control a data cursor to point to the primary key corresponding to the end point of the first record interval through a preset independent thread, wherein the data cursor is used to indicate a storage location in the settlement master database.
[0071] S2063: Query the consumption data between the primary key corresponding to the starting point of the first record interval and the primary key corresponding to the ending point of the first record interval pointed to by the data cursor, and summarize each consumption data to generate an interval summary value.
[0072] Exemplarily, a data cursor points to a database primary key, is maintained by a pre-set independent thread, and controls its movement to the end point of the first record interval, thereby obtaining consumption data within that interval. After completing the corresponding settlement calculation (described in detail in later embodiments), the data cursor scrolls backward (along the record generation timeline) to determine a new first record interval and obtain consumption information corresponding to the new first record interval. Exemplarily, the data cursor is an implementation of a real-time location field, and the value corresponding to the data cursor is the field value of the real-time location field.
[0073] Step S207: Generate a real-time settlement value for the target live broadcast room based on the interval summary value and the current settlement value corresponding to the first recorded interval.
[0074] Exemplarily, the first recording interval includes a starting point and an ending point. The current settlement value corresponding to the first recording interval is the sum of the consumption data in the aggregated interval preceding the starting point of the first recording interval. The accumulated settlement data in the master settlement database also includes a real-time numerical field, the value of which is derived from the accumulated settlement data of the previous period. The current settlement value corresponding to the first recording interval is determined based on the real-time numerical field in the accumulated settlement data in the master settlement database. Therefore, the current settlement value is the accumulated settlement value corresponding to the consumption data in the recording interval preceding the first recording interval.
[0075] Furthermore, based on the interval summary value corresponding to the first recording interval and the current settlement value corresponding to the first recording interval, the current settlement value of the target live broadcast room, that is, the real-time settlement value, can be determined.
[0076] Step S208: Based on the transaction operation, the real-time settlement value and the end point position of the first record interval corresponding to the real-time settlement value are written into the cumulative settlement data to generate a real-time settlement record, wherein the real-time settlement record includes a real-time numerical field for representing the real-time settlement value and a real-time position field for representing the end point position.
[0077] Figure 10 A schematic diagram of a process for generating a real-time settlement record provided by an embodiment of the present disclosure is shown as follows: Figure 10 As shown, after determining the first record interval in the current settlement cycle, the data in the first record interval is settled, and a real-time settlement value (not 300 in the figure, for example, indicating that the cumulative income of the current target live broadcast room is 300 yuan) is generated and stored in the real-time value field in the real-time settlement record in the cumulative settlement data. At the same time, the end point position of the first record interval (not 58 in the figure, for example, indicating the record identifier in the cached data) is stored in the real-time position field in the real-time settlement record in the cumulative settlement data. More specifically, Figure 10The figure also exemplifies that the accumulated settlement data also includes two real-time settlement records, [200, 42] and [100, 15], which respectively represent two real-time settlement records with a real-time value field of 200 and a real-time location field of 42, and a real-time value field of 100 and a real-time location field of 15. These two records were generated before the real-time settlement record [300, 58] mentioned above, representing settlement records generated within two settlement cycles before the real-time settlement record [300, 58].
[0078] To ensure the security of the settlement process, transactions are used to ensure the synchronization of receiving and writing real-time settlement values into the accumulated settlement data, as well as the generation of real-time settlement records, during the process of determining the settlement value in the master database. Each valid real-time settlement record in the accumulated settlement data includes a real-time location field and a real-time value field. The real-time value field represents the real-time settlement value, while the real-time location field represents the end point.
[0079] Optionally, after step S208, the method further includes:
[0080] S209: Determine the income value based on the preset settlement rules and the real-time settlement records in the accumulated settlement data.
[0081] S210: Send the real-time settlement value and / or income value in the real-time settlement record to the terminal device, so that the terminal device displays the settlement value corresponding to the real-time value field.
[0082] S211, when receiving the settlement request sent by the terminal device, call the account settlement service and add the income value to the account corresponding to the target live broadcast room.
[0083] For example, based on the real-time settlement records in the cumulative settlement data, the accumulated consumption amount in the current target live broadcast room can be determined. For this portion of the consumption amount, according to different settlement rules, a portion of it is attributed to the target live broadcast room as the income of the target live broadcast room, and the other portion may be attributed to the platform or the event party, etc. For example, according to the settlement rules, 50% of the total consumption amount of the live broadcast room is attributed to the anchor, and 50% is attributed to the live broadcast platform. Therefore, according to the preset settlement rules, the server calculates the real-time settlement records at certain time intervals to obtain the amount attributable to the anchor, that is, the income value, and sends this portion of the income data to the terminal device, which is displayed on the terminal device in a near real-time manner, so that the anchor in the target live broadcast room can promptly understand his or her income situation.
[0084] On the other hand, when the anchor applies for settlement, by operating the live broadcast client running in the terminal device, such as clicking the "Settlement" button, or closing the live broadcast stream when going off-air, the terminal device of the live broadcast client will send a settlement request to the server. The server will call the account settlement service based on the settlement request, and transfer the income value determined by the real-time settlement records in the accumulated settlement data to the account corresponding to the target live broadcast room, such as a wallet account, to complete the settlement process of the consumption generated in the live broadcast room.
[0085] Corresponding to the live broadcast room settlement data processing method of the above embodiment, Figure 11 This is a structural block diagram of the live broadcast room settlement data processing device provided by the embodiment of the present disclosure. For the sake of convenience, only the parts related to the embodiment of the present disclosure are shown. Figure 11 , the live broadcast room settlement data processing device 3 includes:
[0086] An extraction module 31 is configured to extract, from a settlement cache database, consumption data of at least one preset object corresponding to a target live broadcast room during live broadcasting in the live broadcast room, where the consumption data of the preset object is consumption data generated when a user consumes the preset object in the target live broadcast room;
[0087] A generating module 32, configured to generate a real-time settlement value of a target live broadcast room based on consumption data of at least one preset object;
[0088] An updating module 33 is configured to update the cumulative settlement data of the target live broadcast room stored in the settlement master database according to the real-time settlement value of the target live broadcast room;
[0089] The settlement module 34 is used to settle the accounts corresponding to the target live broadcast room based on the accumulated settlement data.
[0090] In one embodiment of the present disclosure, before extracting the consumption data of at least one preset object corresponding to the cached target live broadcast room from the settlement cache database, the extraction module 31 is further used to: receive consumption information of the preset object, the consumption information of the preset object representing the consumption data generated when the user purchases the preset object in the target live broadcast room; convert the consumption information of the preset object into the consumption data of the preset object that meets the format of the settlement cache database; and cache the consumption data of the preset object in the settlement cache database.
[0091] In one embodiment of the present disclosure, the generation module 32 is specifically used to: query the consumption data in the first record interval in the settlement cache database according to a preset first record interval, and obtain the interval summary value, wherein the aggregation interval is a continuous storage area formed based on the primary key sorting in the settlement cache database; the interval summary value represents the sum of each consumption data in the first record interval in the settlement cache database; generate the real-time settlement value of the target live broadcast room according to the interval summary value and the current settlement value corresponding to the first record interval, wherein the first record interval includes a starting point position and an ending point position, and the current settlement value corresponding to the first record interval is the sum of each consumption data in the aggregation interval before the starting point position of the first record interval.
[0092] In one embodiment of the present disclosure, the generation module 32 queries the consumption data in the first record interval in the settlement cache database according to the preset first record interval, and when obtaining the interval summary value, it is specifically used to: obtain the primary key corresponding to the starting point position of the first record interval; control the data cursor to point to the primary key corresponding to the ending point position of the first record interval through a preset independent thread, wherein the data cursor is used to indicate the storage location in the settlement master database; query the consumption data between the primary key corresponding to the starting point position of the first record interval and the primary key corresponding to the ending point position of the first record interval pointed by the data cursor, and summarize the consumption data to generate an interval summary value.
[0093] In one embodiment of the present disclosure, the update module 33 is specifically used to: based on transaction operations, write the real-time settlement value and the end point position of the first record interval corresponding to the real-time settlement value into the cumulative settlement data to generate a real-time settlement record, wherein the real-time settlement record includes a real-time numerical field for representing the real-time settlement value and a real-time position field for representing the end point position; the generation module 32 queries the consumption data in the first record interval in the settlement cache database according to the preset first record interval, and before obtaining the interval summary value, is also used to: determine the first record interval according to the real-time position field in the cumulative settlement data of the settlement master database; determine the current settlement value corresponding to the first record interval according to the real-time numerical field in the cumulative settlement data of the settlement master database.
[0094] In one embodiment of the present disclosure, when the generation module 32 determines the first record interval based on the real-time location field in the cumulative settlement data of the settlement master database, it is specifically used to: determine the starting point position based on the real-time location field in the cumulative settlement data; determine the first record interval based on a preset time interval, and / or a preset number of data items, and the starting point position.
[0095] In one embodiment of the present disclosure, the generation module 32 is further configured to: detect an idle storage area in the first recording interval; if an idle storage area exists in the first recording interval, store empty data in the idle storage area according to a primary key corresponding to the idle storage area.
[0096] In one embodiment of the present disclosure, the settlement module 34 is specifically used to: when receiving a settlement request sent by a terminal device, determine the income value according to preset settlement rules and accumulated settlement data; based on the income value, call the account settlement service to add the income value to the account corresponding to the target live broadcast room.
[0097] In one embodiment of the present disclosure, before receiving the settlement request sent by the terminal device, the settlement module 34 is also used to: send the cumulative settlement data and / or income value to the terminal device, so that the terminal device displays the real-time settlement value corresponding to the cumulative settlement data, and / or the real-time income value.
[0098] In one embodiment of the present disclosure, the settlement cache database is a Redis database; and / or the settlement main database is a MySQL database.
[0099] Among them, the extraction module 31, the generation module 32, the update module 33 and the settlement module 34 are connected in sequence. The live broadcast room settlement data processing device 3 provided in this embodiment can implement the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0100] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure is shown in FIG. Figure 12 As shown, the electronic device 4 includes at least one processor 41 and a memory 42;
[0101] Memory 42 stores computer-executable instructions;
[0102] At least one processor 41 executes the computer-executable instructions stored in the memory 42, so that at least one processor 41 performs the following operations: Figure 3-Figure 10 The live broadcast room settlement data processing method in the illustrated embodiment.
[0103] The processor 41 and the memory 42 are connected via a bus 43 .
[0104] For related instructions, please refer to Figure 3-Figure 10 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further details are given here.
[0105] refer to Figure 13, which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 13 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0106] like Figure 13 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0107] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 13 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0108] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0109] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0110] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0111] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0112] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0115] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0116] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] In a first aspect, according to one or more embodiments of the present disclosure, a method for processing settlement data in a live broadcast room is provided, comprising:
[0118] During live broadcast in a live room, consumption data of at least one preset object corresponding to the cached target live room is extracted from the settlement cache database, where the consumption data of the preset object is the consumption data generated when a user consumes the preset object in the target live room; a real-time settlement value of the target live room is generated based on the consumption data of the at least one preset object; the accumulated settlement data of the target live room stored in the settlement master database is updated based on the real-time settlement value of the target live room; and settlement is performed on the account corresponding to the target live room based on the accumulated settlement data.
[0119] According to one or more embodiments of the present disclosure, before extracting the consumption data of at least one preset object corresponding to the cached target live broadcast room from the settlement cache database, it also includes: receiving consumption information of the preset object, the consumption information of the preset object representing the consumption data generated when the user purchases the preset object in the target live broadcast room; converting the consumption information of the preset object into consumption data of the preset object that meets the format of the settlement cache database; and caching the consumption data of the preset object into the settlement cache database.
[0120] According to one or more embodiments of the present disclosure, a real-time settlement value of the target live broadcast room is generated based on the consumption data of the at least one preset object, including: according to a preset first record interval, querying the consumption data in the first record interval in the settlement cache database to obtain an interval summary value, wherein the aggregation interval is a continuous storage area formed based on the primary key sorting in the settlement cache database; the interval summary value represents the sum of each consumption data in the first record interval in the settlement cache database; based on the interval summary value and the current settlement value corresponding to the first record interval, the real-time settlement value of the target live broadcast room is generated, wherein the first record interval includes a starting point position and an ending point position, and the current settlement value corresponding to the first record interval is the sum of each consumption data in the aggregation interval before the starting point position of the first record interval.
[0121] According to one or more embodiments of the present disclosure, based on a preset first record interval, the consumption data in the first record interval in the settlement cache database is queried to obtain an interval summary value, including: obtaining the primary key corresponding to the starting point position of the first record interval; controlling the data cursor to point to the primary key corresponding to the ending point position of the first record interval through a preset independent thread, wherein the data cursor is used to indicate the storage location in the settlement master database; querying the consumption data between the primary key corresponding to the starting point position of the first record interval and the primary key corresponding to the ending point position of the first record interval pointed to by the data cursor, and summarizing each consumption data to generate an interval summary value.
[0122] According to one or more embodiments of the present disclosure, the cumulative settlement data of the target live broadcast room stored in the settlement main database is updated according to the real-time settlement value of the target live broadcast room, including: based on a transaction operation, the real-time settlement value and the end point position of the first record interval corresponding to the real-time settlement value are written into the cumulative settlement data to generate a real-time settlement record, wherein the real-time settlement record includes a real-time numerical field for representing the real-time settlement value and a real-time position field for representing the end point position; before querying the consumption data in the first record interval in the settlement cache database according to the preset first record interval and obtaining the interval summary value, the method also includes: determining the first record interval according to the real-time position field in the cumulative settlement data of the settlement main database; determining the current settlement value corresponding to the first record interval according to the real-time numerical field in the cumulative settlement data of the settlement main database.
[0123] According to one or more embodiments of the present disclosure, the first record interval is determined based on the real-time location field in the accumulated settlement data of the settlement master database, including: determining the starting point position based on the real-time location field in the accumulated settlement data; determining the first record interval based on a preset time interval, and / or a preset number of data items, and the starting point position.
[0124] According to one or more embodiments of the present disclosure, the method further includes: detecting an idle storage area within the first recording interval; if an idle storage area exists within the first recording interval, storing empty data in the idle storage area according to a primary key corresponding to the idle storage area.
[0125] According to one or more embodiments of the present disclosure, settlement is performed for the account corresponding to the target live broadcast room based on the accumulated settlement data, including: when a settlement request sent by a terminal device is received, an income value is determined according to preset settlement rules and the accumulated settlement data; based on the income value, an account settlement service is called to add the income value to the account corresponding to the target live broadcast room.
[0126] According to one or more embodiments of the present disclosure, before receiving the settlement request sent by the terminal device, it also includes: sending the cumulative settlement data and / or income value to the terminal device, so that the terminal device displays the real-time settlement value corresponding to the cumulative settlement data, and / or real-time income value.
[0127] According to one or more embodiments of the present disclosure, the settlement cache database is a Redis database; and / or the settlement main database is a MySQL database.
[0128] In a second aspect, according to one or more embodiments of the present disclosure, a live broadcast room settlement data processing device is provided, comprising:
[0129] An extraction module is used to extract, from a settlement cache database, consumption data of at least one preset object corresponding to a cached target live broadcast room during live broadcast in the live broadcast room, where the consumption data of the preset object is consumption data generated when a user consumes the preset object in the target live broadcast room;
[0130] A generating module, configured to generate a real-time settlement value for the target live broadcast room based on the consumption data of the at least one preset object;
[0131] An updating module, configured to update the accumulated settlement data of the target live broadcast room stored in the settlement master database according to the real-time settlement value of the target live broadcast room;
[0132] The settlement module is used to settle the account corresponding to the target live broadcast room based on the accumulated settlement data.
[0133] According to one or more embodiments of the present disclosure, before extracting the consumption data of at least one preset object corresponding to the cached target live broadcast room from the settlement cache database, the extraction module 31 is further used to: receive consumption information of the preset object, the consumption information of the preset object representing the consumption data generated when the user purchases the preset object in the target live broadcast room; convert the consumption information of the preset object into consumption data of the preset object that meets the format of the settlement cache database; and cache the consumption data of the preset object into the settlement cache database.
[0134] According to one or more embodiments of the present disclosure, the generation module is specifically used to: query the consumption data in the first record interval in the settlement cache database according to a preset first record interval, and obtain an interval summary value, wherein the aggregation interval is a continuous storage area formed based on the primary key sorting in the settlement cache database; the interval summary value represents the sum of each consumption data in the first record interval in the settlement cache database; generate the real-time settlement value of the target live broadcast room according to the interval summary value and the current settlement value corresponding to the first record interval, wherein the first record interval includes a starting point position and an ending point position, and the current settlement value corresponding to the first record interval is the sum of each consumption data in the aggregation interval before the starting point position of the first record interval.
[0135] According to one or more embodiments of the present disclosure, when the generation module queries the consumption data in the first record interval in the settlement cache database according to the preset first record interval and obtains the interval summary value, it is specifically used to: obtain the primary key corresponding to the starting point position of the first record interval; control the data cursor to point to the primary key corresponding to the ending point position of the first record interval through a preset independent thread, wherein the data cursor is used to indicate the storage location in the settlement master database; query the consumption data between the primary key corresponding to the starting point position of the first record interval to the primary key corresponding to the ending point position of the first record interval pointed by the data cursor, and summarize the consumption data to generate an interval summary value.
[0136] According to one or more embodiments of the present disclosure, the update module is specifically used to: based on a transaction operation, write the real-time settlement value and the end point position of the first record interval corresponding to the real-time settlement value into the cumulative settlement data to generate a real-time settlement record, wherein the real-time settlement record includes a real-time numerical field for representing the real-time settlement value and a real-time position field for representing the end point position; before the generation module queries the consumption data in the first record interval in the settlement cache database according to the preset first record interval and obtains the interval summary value, it is also used to: determine the first record interval according to the real-time position field in the cumulative settlement data of the settlement master database; determine the current settlement value corresponding to the first record interval according to the real-time numerical field in the cumulative settlement data of the settlement master database.
[0137] According to one or more embodiments of the present disclosure, when the generation module determines the first record interval based on the real-time location field in the accumulated settlement data of the settlement master database, it is specifically used to: determine the starting point position based on the real-time location field in the accumulated settlement data; determine the first record interval based on a preset time interval, and / or a preset number of data items, and the starting point position.
[0138] According to one or more embodiments of the present disclosure, the generation module is further used to: detect the free storage area in the first recording interval; if there is a free storage area in the first recording interval, then store empty data in the free storage area according to the primary key corresponding to the free storage area.
[0139] According to one or more embodiments of the present disclosure, the settlement module is specifically used to: when receiving a settlement request sent by a terminal device, determine the income value according to preset settlement rules and the accumulated settlement data; based on the income value, call the account settlement service to add the income value to the account corresponding to the target live broadcast room.
[0140] According to one or more embodiments of the present disclosure, before receiving the settlement request sent by the terminal device, the settlement module is also used to: send the cumulative settlement data and / or income value to the terminal device, so that the terminal device displays the real-time settlement value and / or real-time income value corresponding to the cumulative settlement data.
[0141] In one embodiment of the present disclosure, the settlement cache database is a Redis database; and / or the settlement main database is a MySQL database.
[0142] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0143] The memory stores computer-executable instructions;
[0144] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect.
[0145] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0146] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the live broadcast room settlement data processing method described in the first aspect and various possible designs of the first aspect.
[0147] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0148] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0149] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for processing settlement data in a live broadcast room, characterized in that: include: During live broadcast in the live broadcast room, the consumption data of at least one preset object corresponding to the cached target live broadcast room is extracted from the settlement cache database, where the consumption data of the preset object is the consumption data generated when the user consumes the preset object in the target live broadcast room; Generating a real-time settlement value for the target live broadcast room according to the consumption data of the at least one preset object; According to the real-time settlement value of the target live broadcast room, the cumulative settlement data of the target live broadcast room stored in the settlement master database is updated; According to the accumulated settlement data, settlement is performed on the account corresponding to the target live broadcast room.
2. The method according to claim 1, characterized in that Before extracting the consumption data of at least one preset object corresponding to the cached target live broadcast room from the settlement cache database, the method further includes: Receiving consumption information of a preset object, wherein the consumption information of the preset object represents consumption data generated when a user purchases the preset object in a target live broadcast room; Converting the consumption information of the preset object into consumption data of the preset object that meets the format of the settlement cache database; The consumption data of the preset object is cached in the settlement cache database.
3. The method according to claim 1, characterized in that Generating a real-time settlement value of the target live broadcast room according to the consumption data of the at least one preset object includes: According to a preset first recording interval, query the consumption data within the first recording interval in the settlement cache database to obtain an interval summary value, wherein the aggregate interval is a continuous storage area formed based on the primary key sorting in the settlement cache database; the interval summary value represents the sum of each consumption data within the first recording interval in the settlement cache database; The real-time settlement value of the target live broadcast room is generated based on the interval summary value and the current settlement value corresponding to the first recording interval, wherein the first recording interval includes a starting point position and an ending point position, and the current settlement value corresponding to the first recording interval is the sum of the consumption data in the aggregation interval before the starting point position of the first recording interval.
4. The method according to claim 3, characterized in that According to a preset first recording interval, querying the consumption data within the first recording interval in the settlement cache database to obtain an interval summary value includes: Obtaining the primary key corresponding to the starting point position of the first recording interval; Controlling a data cursor to point to a primary key corresponding to an end point of the first record interval through a preset independent thread, wherein the data cursor is used to indicate a storage location in the settlement master database; The consumption data between the primary key corresponding to the starting point of the first recording interval and the primary key corresponding to the ending point of the first recording interval pointed to by the data cursor are queried, and each consumption data is summarized to generate an interval summary value.
5. The method according to claim 3, characterized in that According to the real-time settlement value of the target live broadcast room, the cumulative settlement data of the target live broadcast room stored in the settlement master database is updated, including: Based on the transaction operation, the real-time settlement value and the end point position of the first recording interval corresponding to the real-time settlement value are written into the accumulated settlement data to generate a real-time settlement record, wherein the real-time settlement record includes a real-time value field for representing the real-time settlement value and a real-time position field for representing the end point position; Before querying the consumption data in the first recording interval in the settlement cache database according to the preset first recording interval to obtain the interval summary value, the method further includes: determining the first recording interval according to a real-time position field in the accumulated settlement data of the settlement master database; The current settlement value corresponding to the first record interval is determined according to the real-time numerical value field in the accumulated settlement data of the settlement master database.
6. The method according to claim 5, characterized in that Determining the first recording interval according to the real-time location field in the accumulated settlement data of the settlement master database includes: Determining the starting point location according to the real-time location field in the accumulated settlement data; The first recording interval is determined according to a preset time interval, and / or a preset number of data items, and the starting point position.
7. The method according to claim 3, characterized in that The method further comprises: detecting an idle storage area within the first recording interval; If there is an idle storage area in the first recording interval, empty data is stored in the idle storage area according to the primary key corresponding to the idle storage area.
8. The method according to any one of claims 1 to 7, characterized in that Performing settlement for the account corresponding to the target live broadcast room based on the accumulated settlement data, including: Upon receiving a settlement request sent by the terminal device, determining an income value according to a preset settlement rule and the accumulated settlement data; According to the income value, the account settlement service is called to add the income value to the account corresponding to the target live broadcast room.
9. The method according to claim 8, characterized in that Before receiving the settlement request sent by the terminal device, it also includes: The accumulated settlement data and / or income value are sent to a terminal device so that the terminal device displays a real-time settlement value and / or a real-time income value corresponding to the accumulated settlement data.
10. The method according to any one of claims 1 to 7, characterized in that The settlement cache database is a Redis database; and / or the settlement main database is a MySQL database.
11. A live broadcast room settlement data processing device, characterized in that: include: An extraction module is used to extract, from a settlement cache database, consumption data of at least one preset object corresponding to a cached target live broadcast room during live broadcast in the live broadcast room, where the consumption data of the preset object is consumption data generated when a user consumes the preset object in the target live broadcast room; A generating module, configured to generate a real-time settlement value for the target live broadcast room based on the consumption data of the at least one preset object; An updating module, configured to update the accumulated settlement data of the target live broadcast room stored in the settlement master database according to the real-time settlement value of the target live broadcast room; The settlement module is used to settle the account corresponding to the target live broadcast room based on the accumulated settlement data.
12. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the live broadcast room settlement data processing method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the live broadcast room settlement data processing method as described in any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Live broadcast interaction method and device, server and storage medium
CN111836068A
Information processing method and device for live broadcast room, storage medium and electronic device
CN111970529A