Account relationship record processing method and apparatus
Patent Information
- Application Number
- CN202310101279.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-28
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-01-28
AI Technical Summary
[0003]本公开提供一种账户关系记录处理方法、装置,以至少解决相关技术中账户关系记录处理的准确性和效率较低,并且成本较高的问题
[0055]在一些或者相关实施例中,通过获取主播账户对应的第一账户关系记录集合和第二账户关系记录集合,其中,第一账户关系记录集合包括至少一个账户关注记录,第二账户关系记录集合包括在直播过程中针对主播账户所产生的至少一个账户关系变更记录;在扫描到第一账户记录集合中的第一账户关注记录的情况下,获取第一账户关系记录对应的第一记录版本,其中,第一账户关系记录为第一账户记录关系集合中任一账户关注记录;根据第一记录版本,在第二账户关系记录集合中确定与第一账户关系记录对应的第一账户变更记录;根据第一账户关注记录和第一账户变更记录,确定与主播账户对应的目标账户关系记录集合,其中,目标账户关系记录集合用于确定与主播账户具有关注关系的账户的数量信息。因此,通过根据账户关系记录对应的记录版本,确定账户关系记录对应的账户变更记录,可以提高账户关系记录处理的准确性,可以保证账户关系记录的实时性,同时,还可以减少数据重复或者未处理情况,可以提高账户关系记录处理的准确性和效率。另外,还可以降低计算成本,从而可以降低关注账户数据确定的成本。
Smart Images

Figure CN115982193B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to a method and apparatus for processing account relationship records. Background Technology
[0002] With the development of science and technology, the internet has become an indispensable part of people's daily lives. In internet platforms, following is a very basic core function, and each user's account relationship record is important data. Internet platforms need to correctly maintain this data and ensure the real-time nature of these account relationship records. However, current technologies for processing account relationship records suffer from low accuracy and efficiency, and are also costly. Summary of the Invention
[0003] This disclosure provides a method and apparatus for processing account relationship records, to at least solve the problems of low accuracy and efficiency, and high cost in related technologies for processing account relationship records. The technical solution of this disclosure is as follows:
[0004] According to a first aspect of the present disclosure, an account relationship record processing method is provided, comprising:
[0005] Obtain a first account relationship record set and a second account relationship record set corresponding to the streamer's account, wherein the first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast;
[0006] If a first account follow record is found in the first account record set, obtain the first record version corresponding to the first account relationship record, wherein the first account relationship record is any account follow record in the first account record relationship set;
[0007] Based on the first record version, determine the first account change record corresponding to the first account relationship record in the second account relationship record set;
[0008] Based on the first account follow record and the first account change record, a target account relationship record set corresponding to the streamer account is determined, wherein the target account relationship record set is used to determine the number of accounts that have a follow relationship with the streamer account.
[0009] Optionally, after processing the first account change record corresponding to the first account relationship record in the second account relationship record set, the method further includes:
[0010] If the second account relationship record set contains a second account change record corresponding to the first account follow record, discard the second account change record.
[0011] Among them, the second record version corresponding to the second account change record is lower than the first record version.
[0012] Optionally, obtaining the first record version corresponding to the first account relationship record includes:
[0013] Obtain the record update timestamp corresponding to the first account relationship record in the first account relationship record set, and use the record update timestamp as the first record version.
[0014] Optionally, if no first account follow record is found in the first account record set, the method further includes:
[0015] If the change data of the first account follow record is processed in the second account relationship record set, then the first account follow record is discarded;
[0016] Store the change data of the first account's follow records.
[0017] Optionally, when the scanning of the first account follow records in the first account record set is completed, the method further includes:
[0018] If a second account follow record is inserted before the first account follow record in the first account record set, then the log information corresponding to the second account follow record is processed in the second account relationship record set;
[0019] The target account relationship record set is updated based on the attention time point corresponding to the second account attention record in the log information.
[0020] Optionally, processing the log information corresponding to the second account follow record in the second account relationship record set includes:
[0021] Obtain the delay processing time corresponding to the second account's follow record;
[0022] Based on the delay processing duration, log information corresponding to the second account attention record is determined in the second account relationship record set.
[0023] Optionally, before obtaining the first record version corresponding to the first account relationship record when scanning the first account follow record in the first account record set, the method further includes:
[0024] Obtain the record scanning order corresponding to the first account record set;
[0025] According to the record scanning order, at least one account follow record in the first account record set is scanned.
[0026] According to a second aspect of the present disclosure, an account relationship record processing apparatus is provided, comprising:
[0027] The set acquisition unit is configured to acquire a first account relationship record set and a second account relationship record set corresponding to the streamer's account, wherein the first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast.
[0028] The version acquisition unit is configured to acquire the first record version corresponding to the first account relationship record when the first account follow record is scanned in the first account record set, wherein the first account relationship record is any account follow record in the first account record relationship set;
[0029] The record determination unit is configured to perform the following action: determining, based on the first record version, a first account change record corresponding to the first account relationship record in the second account relationship record set;
[0030] The set determination unit is configured to perform the following based on the first account follow record and the first account change record to determine the target account relationship record set corresponding to the anchor account, wherein the target account relationship record set is used to determine the number of accounts that have a follow relationship with the anchor account.
[0031] Optionally, the account relationship record processing device further includes a record discarding unit, configured to perform the following after processing the first account change record corresponding to the first account relationship record in the second account relationship record set:
[0032] The record discarding unit is configured to discard the second account change record if there is a second account change record in the second account relationship record set that corresponds to the first account follow record;
[0033] Among them, the second record version corresponding to the second account change record is lower than the first record version.
[0034] Optionally, the version acquisition unit is configured to, when acquiring the first record version corresponding to the first account relationship record, specifically execute:
[0035] Obtain the record update timestamp corresponding to the first account relationship record in the first account relationship record set, and use the record update timestamp as the first record version.
[0036] Optionally, the account relationship record processing device further includes a record discarding unit and a data storage unit, configured to perform the following when no first account follow record is found in the first account record set:
[0037] The record discarding unit is configured to discard the first account follow record if change data of the first account follow record is processed in the second account relationship record set.
[0038] The data storage unit is configured to store the change data of the first account's follow records.
[0039] Optionally, the account relationship record processing device further includes an information processing unit and a set update unit, configured to perform the following when the first account attention record in the first account record set has been scanned:
[0040] The information processing unit is configured to process the log information corresponding to the second account follow record in the second account relationship record set if a second account follow record is inserted before the first account follow record in the first account record set.
[0041] The set update unit is configured to update the target account relationship record set according to the follow time point corresponding to the follow record of the second account in the log information.
[0042] Optionally, when the information processing unit is configured to process the log information corresponding to the second account attention record in the second account relationship record set, it is specifically configured to perform:
[0043] Obtain the delay processing time corresponding to the second account's follow record;
[0044] Based on the delay processing duration, log information corresponding to the second account attention record is determined in the second account relationship record set.
[0045] Optionally, the account relationship record processing device further includes a sequential acquisition unit and a record scanning unit, configured to perform the following steps before acquiring the first record version corresponding to the first account relationship record when a first account follow record is scanned in the first account record set:
[0046] The sequential acquisition unit is configured to acquire the record scanning order corresponding to the first account record set;
[0047] The record scanning unit is configured to scan at least one account follow record in the first account record set according to the record scanning order.
[0048] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0049] processor;
[0050] Memory used to store the processor's executable instructions;
[0051] The processor is configured to execute the instructions to implement the account relationship record processing method described in any one of the preceding aspects.
[0052] According to a fourth aspect of this application, a storage medium is provided that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the account relationship record processing method described in any one of the preceding aspects.
[0053] According to a fifth aspect of this application, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the preceding aspects.
[0054] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0055] In some or related embodiments, a first account relationship record set and a second account relationship record set corresponding to the streamer's account are obtained. The first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast. If a first account follow record is found in the first account record set, a first record version corresponding to the first account relationship record is obtained, where the first account relationship record is any account follow record in the first account relationship record set. Based on the first record version, a first account change record corresponding to the first account relationship record is determined in the second account relationship record set. Based on the first account follow record and the first account change record, a target account relationship record set corresponding to the streamer's account is determined, where the target account relationship record set is used to determine the number of accounts with a follow relationship to the streamer's account. Therefore, by determining the account change record corresponding to the account relationship record based on the record version corresponding to the account relationship record, the accuracy of account relationship record processing can be improved, the real-time nature of account relationship records can be guaranteed, and data duplication or unprocessed situations can be reduced, thus improving the accuracy and efficiency of account relationship record processing. Furthermore, computational costs can be reduced, thereby reducing the cost of determining follower account data.
[0056] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0057] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0058] Figure 1 This is a background diagram illustrating an account relationship record processing method according to an exemplary embodiment;
[0059] Figure 2 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment;
[0060] Figure 3 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment;
[0061] Figure 4 This is an interactive schematic diagram illustrating an existing module scanning a first set of account records according to an exemplary embodiment;
[0062] Figure 5 This is an interactive flowchart illustrating account relationship record processing according to an exemplary embodiment;
[0063] Figure 6 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment;
[0064] Figure 7 This is an interactive flowchart illustrating account relationship record processing according to an exemplary embodiment;
[0065] Figure 8 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment;
[0066] Figure 9 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment;
[0067] Figure 10 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment;
[0068] Figure 11 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment;
[0069] Figure 12 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment;
[0070] Figure 13 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0071] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0072] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0073] With the development of science and technology and the increasing maturity of internet technology, users' lives and work have become more convenient. For example, internet platforms can provide users with the ability to view their lists of followed users and accounts. The number of accounts followed by each user is important data, and internet platforms need to maintain this data correctly and ensure its real-time accuracy.
[0074] However, the number of followed accounts is typically maintained in a remote dictionary server (Redis), a storage database where data persistence is not guaranteed. When a user's followed accounts remain inactive for an extended period, key expiration issues can occur, and when storage capacity is insufficient, key eviction issues can arise. In other words, the data corresponding to the number of followed accounts may be lost due to various problems.
[0075] At the same time, when the business corresponding to the number of followed accounts is more complex, such as when a pair of relationships in a group of followed accounts contains complex business logic such as intimacy and activity status, the logic for increasing or decreasing the number of followed accounts is very likely to have errors (bugs), which will lead to inaccurate counting of the number of followed accounts.
[0076] In addition, when internet platforms add new statistical metrics, such as defining a new type of relationship called "die-hard fans," and need to keep track of the number of "die-hard fans" for each user, this can also lead to inaccurate counting of the number of accounts followed.
[0077] In summary, an internet platform's account follow count correction solution is needed to accurately maintain the data corresponding to the number of followed accounts and ensure the real-time nature of this data. However, internet platforms typically store follow relationships in sharded databases and tables based on the number of followed accounts. Furthermore, the existing historical data is massive, reaching billions, tens of billions, or even larger scales. Simultaneously, follow account relationships are constantly changing, with new follow relationships being created and disappearing (unfollowing) at any time. In other words, determining the number of followed accounts is not simply a matter of querying the database using Structured Query Language (SQL); it requires considering both existing historical data and frequently changing new data, ensuring accurate and efficient calculations at low cost.
[0078] In related technologies, the following scheme for correcting the number of followed accounts on internet platforms can be adopted to maintain the data corresponding to the number of followed accounts: At the beginning of the business, the details of changes in follower relationships are consumed, and the number of followed accounts is maintained in the non-relational database Redis. Specifically, for each follow message received, the number of followed accounts of the corresponding follower is incremented by one; for each unfollow message received, the number of followed accounts of the corresponding follower is decremented by one.
[0079] However, some internet platforms do not allow maintaining a permanent key in Redis, so they set an expiration time for the number of followed accounts. But in business scenarios, there might be situations where a person's followed account count hasn't been updated for a very long time, causing the data to expire. In this case, a separate scheduled task needs to be written to continuously scan all users and reset the expiration time of each followed account key to prevent it from expiring. Additionally, Redis's dual-datacenter synchronization capability needs to be used for disaster recovery to prevent hardware failures.
[0080] It's easy to understand that because the details of changes in consumer follower relationships have an expiration period, it means that after a period of operation, it may be impossible to obtain all historical details of follower relationship changes, leading to low accuracy in account relationship record processing. Furthermore, as the running time increases, even if all follower relationship change details were available, the volume would be enormous, far exceeding the existing number of follower relationships. Consuming resources from the beginning would be prohibitively expensive, resulting in low efficiency and high cost in account relationship record processing.
[0081] Therefore, it is necessary to introduce existing data, i.e., focus on relational tables, to solve this problem. Figure 1 This is a background diagram illustrating an account relationship record processing method according to an exemplary embodiment. Figure 1As shown, when a streamer starts broadcasting, the number of followers of the streamer in all tables (e.g., table 1000, database 10) is counted in a short time through sharding tasks, summed and written into Redis. Then, during the live broadcast, the binary log of the changes in the relationship between the followers is consumed, and the number of followers is increased or decreased in Redis.
[0082] Specifically, by using sharding tasks to quickly count the number of followers of the streamer's accounts across all tables (e.g., 1000 tables, 10 databases), sum the results, and then write them to Redis, the following 1000 SQL statements can be executed concurrently, and the results can be summed in memory:
[0083] select count(1)from fans_group_follow_status_0where author_id=${author_id}
[0084] select count(1)from fans_group_follow_status_1where author_id=${author_id} ...
[0086] select count(1)from fans_group_follow_status_999where author_id=${author_id}.
[0087] When achieving concurrency through task sharding, this step needs to be completed in the shortest possible time to reduce data errors.
[0088] It's easy to understand that this solution cannot guarantee the accuracy of account relationship record processing. To simplify: suppose at a certain point in time, the existing data in the database (the follow relationship table) is the result of 1000 follow and unfollow actions. Then: the result of the sharded task calculating the existing data is equivalent to consuming the details of these 1000 follow relationship changes sequentially. If the binlog only supplements the change data from the 1001st to the subsequent changes, it will be correct. In reality, the binlog is very likely to supplement the change data from the 998th to the subsequent changes. This means that the data from 998th to 1000th is counted twice. Furthermore, since the number of active follower accounts in a follower group is only used when a streamer goes live, it can be reset at the start of a broadcast, thus limiting the application scenarios of this solution. Secondly, since historical data needs to be recalculated every time a broadcast starts, if the number of streamers broadcasting daily is in the millions, the cost of recalculating historical data for this number of streamers is manageable. However, if this solution is used to refresh the follower account counts for more users, it would require tens or hundreds of times more resources, making the cost too high.
[0089] Figure 2 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment, such as... Figure 2 As shown, this account relationship record processing method can be used in multimedia scenarios and includes the following steps:
[0090] In step S11, the first account relationship record set and the second account relationship record set corresponding to the streamer's account are obtained;
[0091] According to some embodiments, a broadcaster account refers to the account used by a broadcaster to provide internet programs or events to viewers. This broadcaster account is not specifically defined by any single, fixed account. For example, the broadcaster account can change when the broadcaster changes.
[0092] According to some embodiments, the first account relationship record set includes at least one account follow record. For example, the account follow record set corresponding to streamer account A may include account B following streamer account A, account C following streamer account A, etc.
[0093] In some embodiments, the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast. For example, the second account relationship record set may include account D following the streamer.
[0094] It is easy to understand that when an electronic device processes account relationship records, it can obtain the first set of account relationship records and the second set of account relationship records corresponding to the streamer's account.
[0095] In step S12, if the first account follow record is found in the first account record set, the first record version corresponding to the first account relationship record is obtained;
[0096] According to some embodiments, the first account relationship record is any account follow record in the first account record relationship set. The first record version is the data processing version corresponding to the first account relationship record. This first record version does not specifically refer to a fixed version. For example, the first record version can be a tx version.
[0097] It is easy to understand that when an electronic device obtains the first set of account relationship records and the second set of account relationship records corresponding to a streamer's account, and scans the first account follow record in the first set of account records, the electronic device can obtain the first record version corresponding to the first account relationship record.
[0098] In step S13, based on the first record version, the first account change record corresponding to the first account relationship record is determined in the second account relationship record set;
[0099] According to some embodiments, a first account change record refers to an account relationship record that has undergone change, as determined in a second set of account relationship records. This first account change record does not specifically refer to a single, fixed record. For example, the first account change record may change when the second set of account relationship records changes. Similarly, the first account change record may also change when the first set of account relationship records changes.
[0100] It is easy to understand that when an electronic device obtains the first record version corresponding to the first account relationship record, the electronic device can determine the first account change record corresponding to the first account relationship record in the second account relationship record set based on the first record version.
[0101] In step S14, the set of target account relationship records corresponding to the anchor's account is determined based on the first account follow record and the first account change record.
[0102] According to some embodiments, the target account relationship record set is used to determine the number of accounts that have a following relationship with the streamer's account. This number may be, for example, the number of accounts followed by the streamer's account. The target account relationship record set is not specifically a fixed set. For example, the target account relationship record set may change when the streamer's account changes.
[0103] It is easy to understand that when an electronic device obtains the first account change record, it can determine the set of target account relationship records corresponding to the streamer's account based on the first account's follow record and the first account change record.
[0104] In summary, the method provided in this disclosure involves obtaining a first set of account relationship records and a second set of account relationship records corresponding to a broadcaster's account; when a first account follow record is found in the first set of account records, obtaining a first record version corresponding to the first account relationship record; determining a first account change record corresponding to the first account relationship record in the second set of account relationship records based on the first record version; and determining a target set of account relationship records corresponding to the broadcaster's account based on the first account follow record and the first account change record. Therefore, by determining the account change record corresponding to the account relationship record based on the record version, the accuracy of account relationship record processing can be improved, the real-time nature of account relationship records can be guaranteed, and data duplication or unprocessed situations can be reduced, thus improving the accuracy and efficiency of account relationship record processing. Furthermore, the method provided in this disclosure has high universality, increasing the scenarios for account relationship record processing and reducing situations where it can only be used during live broadcasts. Additionally, this disclosure can reduce the computational cost of existing data, thereby reducing the cost of determining follower account data.
[0105] Figure 3 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment, such as... Figure 3 As shown, this account relationship record processing method can be used in multimedia and includes the following steps:
[0106] In step S21, the first account relationship record set and the second account relationship record set corresponding to the streamer's account are obtained;
[0107] According to some embodiments, the first account relationship record set can be determined based on a stock data set. The stock data set is composed of at least one stock data set. Stock data refers to follow relationships. For example, when account B follows streamer account A, the stock data corresponding to streamer account A can be that account B is an account followed by streamer account A, thus determining that the account follow record set includes account B following streamer account A.
[0108] In some embodiments, the second set of account relationship records can be determined based on an incremental data set. The incremental data set is comprised of at least one set of incremental data. Incremental data refers to existing data, i.e., details of changes in the relationships of interest.
[0109] In some embodiments, the existing dataset and the incremental dataset can be stored in a relational database management system (MySQL). For example, the existing dataset can be stored in a first MySQL instance, and the incremental dataset can be stored in a second MySQL instance.
[0110] In some embodiments, the acquisition times of the existing data set and the incremental data set may be the same or different.
[0111] It is easy to understand that when an electronic device processes account relationship records, it can obtain the existing data set and incremental data set corresponding to the streamer's account from MySQL, thereby obtaining the first account relationship record set and the second account relationship record set corresponding to the streamer's account.
[0112] In step S22, the record scanning order corresponding to the first account record set is obtained;
[0113] According to some embodiments, the record scanning order refers to the order in which the first set of account records is scanned. This record scanning order does not specifically refer to a fixed scanning order. The record scanning order includes, but is not limited to, sequential scanning order and reverse scanning order. For example, when a modification instruction for the record scanning order is received, the record scanning order can be changed accordingly.
[0114] It is easy to understand that when the first account relationship record set and the second account relationship record set corresponding to the streamer's account are obtained, the record scanning order corresponding to the first account record set can be obtained.
[0115] In step S23, at least one account follow record in the first account record set is scanned according to the record scanning order;
[0116] According to some embodiments, when scanning at least one account follow record in the first account record set, the stock module can be controlled to use a full scan task to scan at least one account follow record in the first account record set. The running time of this full scan task can reach hours or even days.
[0117] In some embodiments, when the record scanning order is obtained, the stock module can be controlled to scan each account follow record in the first account record set according to the record scanning order, which can reduce the occurrence of record scanning loss, improve the accuracy of record scanning, and improve the accuracy of account relationship record processing.
[0118] It is easy to understand that when the record scanning order corresponding to the first account record set is obtained, at least one account-followed record in the first account record set can be scanned according to the record scanning order. For example, the record scanning order corresponding to the first account record set can be a sequential scanning order, and then the first account record set can be scanned from beginning to end according to the sequential scanning order.
[0119] In step S24, if the first account follow record is found in the first account record set, the record update timestamp corresponding to the first account relationship record in the first account relationship record set is obtained, and the record update timestamp is used as the first record version;
[0120] According to some embodiments, the record update timestamp refers to the timestamp when a change occurs in the first account relationship record set, i.e., when the first account relationship record is updated. This record update timestamp does not specifically refer to a fixed timestamp. For example, the record update timestamp can change when the first account relationship record changes.
[0121] For example, when the electronic device's control module scans the first account follow record in the first account record set, the electronic device can obtain the record update timestamp 1000 corresponding to the first account relationship record. Then, the electronic device can use this record update timestamp 1000 as the first record version 1000.
[0122] It is easy to understand that when the electronic device scans at least one account follow record in the first account record set according to the record scanning order, if the electronic device scans the first account follow record in the first account record set, the electronic device can obtain the record update timestamp corresponding to the first account relationship record in the first account relationship record set, and use the record update timestamp as the first record version.
[0123] In step S25, based on the first record version, the first account change record corresponding to the first account relationship record is determined in the second account relationship record set;
[0124] In some embodiments, when the electronic device obtains the first record version, the electronic device determines the first account change record corresponding to the first account relationship record in the second account relationship record set. Thus, the electronic device can ensure that all account relationship records after the first record version are consumed by the incremental module.
[0125] For example, when an electronic device receives the first processing version 1000, it can ensure that the account relationship records from the 1001st time onwards are consumed by the incremental module.
[0126] It is easy to understand that when an electronic device obtains the first record version, it can determine the first account change record corresponding to the first account relationship record in the second account relationship record set based on the first record version.
[0127] In step S26, if there is a second account change record in the second account relationship record set that corresponds to the first account attention record, the second account change record is discarded;
[0128] According to some embodiments, the second record version corresponding to the second account change record is lower than the first record version. This second account change record does not specifically refer to a fixed piece of data. For example, the second account change record may change when the first record version changes; it may also change when the set of second account relationship records changes.
[0129] For example, when an electronic device obtains the first record version 1000, if there is a second account change record in the second account relationship record set that corresponds to the first account follow record, and the second record version corresponding to the second account change record is less than or equal to 1000, then the electronic device needs to discard the second account change record.
[0130] In some embodiments, Figure 4 This is an interactive diagram illustrating an existing module scanning a first set of account records according to an exemplary embodiment. For example... Figure 4 As shown, if the table scan task at time t retrieves account change records of version tx, and assuming the binary log version of the first account follow record consumed at this time is tn, as long as n > x, no data will be lost. Furthermore, tx can be recorded in Redis. When consuming an account follow record in this binary log, the corresponding version can be compared with tx. If the version is greater than or equal to tx, it means that data will not be recorded duplicately.
[0131] It is easy to understand that when an electronic device obtains the first account change record corresponding to the first account relationship record, if there is a second account change record in the second account relationship record set that corresponds to the first account follow record, the second account change record is discarded.
[0132] In step S27, the set of target account relationship records corresponding to the anchor's account is determined based on the first account follow record and the first account change record.
[0133] According to some embodiments, Figure 5 This is an interactive flowchart illustrating account relationship record processing according to an exemplary embodiment, such as... Figure 5 As shown, the electronic device can control the existing module to slowly scan the main database in reverse order using a table scanning task, changing the number of followed accounts corresponding to the target account relationship record set and recording the record update timestamp of each scanned record. Simultaneously, the electronic device can also consume the first account change records corresponding to the first account's followed record set and determine the relationship between the change time of the first account change record and the record update timestamp. If the change condition is met, the number of followed accounts corresponding to the target account relationship record set is increased or decreased.
[0134] It is easy to understand that when the electronic device acquires the first incremental data, it can determine the number of accounts followed by the streamer's account based on the first row of data and the first incremental data.
[0135] In summary, the method provided in this disclosure obtains a first set of account relationship records and a second set of account relationship records corresponding to the broadcaster's account; obtains the record scanning order corresponding to the first set of account records; and scans at least one account follow record in the first set of account records according to the record scanning order. Therefore, it can reduce the possibility of lost records during scanning, improve the accuracy of record scanning, and enhance the accuracy of account relationship record processing. When a first account follow record is scanned in the first set of account records, the update timestamp corresponding to the first account relationship record in the first set of account relationship records is obtained, and this timestamp is used as the first record version. Based on the first record version, a first account change record corresponding to the first account relationship record is determined in the second set of account relationship records. If a second account change record corresponding to the first account follow record exists in the second set of account relationship records, the second account change record is discarded. Therefore, it can improve the accuracy of account relationship record processing. Based on the first account follow record and the first account change record, a target set of account relationship records corresponding to the broadcaster's account is determined. Therefore, by determining the account change record corresponding to the account relationship record based on the record version, the accuracy of account relationship record processing can be improved, the real-time nature of account relationship records can be guaranteed, and data duplication or unprocessed situations can be reduced, thus improving the accuracy and efficiency of account relationship record processing. Furthermore, the method provided in this disclosure has high versatility, increasing the scenarios in which account relationship record processing can be applied, and reducing situations where it can only be used during live streaming. In addition, this disclosure can reduce the computational cost of existing data, thereby reducing the cost of determining the data of followed accounts.
[0136] Figure 6 This is a flowchart illustrating an account relationship record processing method according to an exemplary embodiment, such as... Figure 6 As shown, this account relationship record processing method can be used in multimedia and includes the following steps:
[0137] In step S31, the first account relationship record set and the second account relationship record set corresponding to the streamer's account are obtained;
[0138] The specific process is as described above and will not be repeated here.
[0139] In step S32, if no first account follow record is found in the first account record set, and if the change data of the first account follow record is processed in the second account relationship record set, then the first account follow record is discarded.
[0140] For example, the first account follow record could be that user B followed streamer account A, i.e., BA TRUE. When the existing module does not scan for the first account follow record in the first account record set, if the incremental module consumes the change data of the first account follow record in the second account relationship record set, i.e., user B unfollowed streamer account A, i.e., B AFALSE, then the incremental module can discard the first account follow record.
[0141] In step S33, the change data of the first account's attention record is stored;
[0142] It is easy to understand that when the first account follow record is discarded, the change data of the first account follow record can be stored. That is, the incremental module can discard BA TRUE and store BA FALSE in the second account record set.
[0143] In step S34, when the first account follow record in the first account record set is scanned, if a second account follow record is inserted before the first account follow record in the first account record set, the log information corresponding to the second account follow record is processed in the second account relationship record set.
[0144] According to some embodiments, when processing log information corresponding to a second account follow record in the second account relationship record set, firstly, the delayed processing duration corresponding to the second account follow record can be obtained. Then, based on the delayed processing duration, the log information corresponding to the second account follow record can be determined in the second account relationship record set. Therefore, the inaccuracy in account relationship record processing caused by consuming binary logs can be reduced, and the accuracy of account relationship record processing can be improved.
[0145] In some embodiments, when the control module finishes scanning the first account follow record in the first account record set, if a second account follow record is inserted before the first account follow record in the first account record set, the incremental module can determine or consume the binary log (binlog) corresponding to the second account follow record to update the number of followed accounts. Therefore, the accuracy of account relationship record processing can be improved, and the number of cases where changes in account relationships corresponding to the second account follow record are not counted can be reduced.
[0146] In some embodiments, the delayed processing duration refers to the extended processing time for the second account follow record. This delayed processing duration is not specifically a fixed duration. For example, the delayed processing duration may change accordingly when a duration modification instruction is received. For example, different delayed processing durations may correspond to different second account follow records. For example, the delayed processing duration may correspond to the data content of the second account follow record.
[0147] In step S35, the target account relationship record set is updated according to the attention time point corresponding to the second account attention record in the log information.
[0148] According to some embodiments, Figure 7 This is an interactive flowchart illustrating account relationship record processing according to an exemplary embodiment, such as... Figure 7 As shown, the historical data repair sharding task can scan the tables in the first MySQL instance in reverse order from the first moment. The historical data repair sharding task can retrieve n records, where n is a positive integer. The task can store the identifiers of these n records in Redis, and Redis can store the min identifier of the latest record, where the min identifier indicates the identifier closest to the current time. The task can also calculate the number of followed accounts and add the number of followed accounts to Redis in batches. The expiration time can be slightly longer than the normal binary log (binlog) latency.
[0149] In some embodiments, such as Figure 7 As shown, the kbus client can obtain the binary log (binlog) from the second MySQL database. Redis can retrieve the identifier of the latest scanned record (the min identifier), and the record update timestamp from the binlog. It can also increment or decrement the number of followed accounts. Records followed by accounts with versions lower than the version at the time of the table scan are discarded. Alternatively, if the binlog consumes changes to a particular account's followed record before the existing module has scanned it, the binlogConsumer can only discard the changes.
[0150] It is easy to understand that when processing the log information corresponding to the second account's follow record in the second account relationship record set, the target account relationship record set can be updated according to the follow time point corresponding to the second account's follow record in the log information.
[0151] In summary, the method provided in this disclosure involves obtaining a first set of account relationship records and a second set of account relationship records corresponding to a broadcaster's account; if no first account follow record is found in the first set of account records, but change data for the first account follow record is processed in the second set of account relationship records, then the first account follow record is discarded; the change data for the first account follow record is stored; if a second account follow record is inserted before the first account follow record in the first set of account records after scanning the first account follow record, then the log information corresponding to the second account follow record is processed in the second set of account relationship records; and the target account relationship record set is updated based on the follow time point corresponding to the second account follow record in the log information. Therefore, by taking into account both existing historical data and frequently changing new data, the calculation can be optimized, improving the accuracy of account relationship record processing. Simultaneously, the computational cost of existing data can be reduced. A small amount of computing resources (e.g., tens of cores) can be used to complete the statistical analysis of all existing data after an hour-level task run, after which the existing task can be taken offline. This is equivalent to only processing the incremental account follow record portion, achieving a minimum resource usage and improving the efficiency of account relationship record processing. Meanwhile, the method provided in this disclosure is highly universal, which can increase the scenarios for processing account relationship records and reduce the situations where it can only be used during live broadcasts.
[0152] Figure 8 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment. (Refer to...) Figure 8 The device 800 includes a set acquisition unit 801, a version acquisition unit 802, a record determination unit 803, and a set determination unit 804.
[0153] The set acquisition unit 801 is configured to acquire the first account relationship record set and the second account relationship record set corresponding to the anchor account. The first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the anchor account during the live broadcast.
[0154] Version acquisition unit 802 is configured to acquire the first record version corresponding to the first account relationship record when the first account follow record is scanned in the first account record set, wherein the first account relationship record is any account follow record in the first account record relationship set;
[0155] Record determination unit 803 is configured to perform the following: determine, based on the first record version, a first account change record corresponding to the first account relationship record in the second account relationship record set;
[0156] The set determination unit 804 is configured to determine the target account relationship record set corresponding to the anchor account based on the first account follow record and the first account change record, wherein the target account relationship record set is used to determine the number of accounts that have a follow relationship with the anchor account.
[0157] According to some embodiments, Figure 9 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment. (Refer to...) Figure 9 The account relationship record processing device 800 further includes a record discarding unit 805, configured to perform the following after processing the first account change record corresponding to the first account relationship record in the second account relationship record set:
[0158] The record discarding unit 805 is configured to discard the second account change record if there is a second account change record in the second account relationship record set that corresponds to the first account attention record.
[0159] Among them, the second record version corresponding to the second account change record is lower than the first record version.
[0160] According to some embodiments, when the version acquisition unit 802 is configured to acquire the first record version corresponding to the first account relationship record, it is specifically configured to perform:
[0161] Get the record update timestamp corresponding to the first account relationship record in the first account relationship record set, and use the record update timestamp as the first record version.
[0162] According to some embodiments, Figure 10 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment. (Refer to...) Figure 10 The account relationship record processing apparatus 800 also includes a record discarding unit 805 and a data storage unit 806, configured to perform the following when no first account attention record is found in the first account record set:
[0163] The record discarding unit 805 is configured to discard the first account attention record if change data of the first account attention record is processed in the second account relationship record set.
[0164] Data storage unit 806 is configured to perform changes to the first account's watchlist records.
[0165] According to some embodiments, Figure 11 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment. (Refer to...) Figure 11The account relationship record processing device 800 further includes an information processing unit 807 and a set update unit 808, configured to perform the following when scanning the first account attention record in the first account record set is complete:
[0166] The information processing unit 807 is configured to process the log information corresponding to the second account attention record in the second account relationship record set if a second account attention record is inserted before the first account attention record in the first account record set.
[0167] Set update unit 808 is configured to update the target account relationship record set based on the follow time point corresponding to the follow record of the second account in the log information.
[0168] According to some embodiments, when the information processing unit 807 is configured to process the log information corresponding to the second account attention record in the second account relationship record set, it is specifically configured to perform:
[0169] Obtain the delay processing time corresponding to the follow-up records of the second account;
[0170] Based on the delay processing duration, determine the log information corresponding to the second account's attention record in the second account relationship record set.
[0171] According to some embodiments, Figure 12 This is a block diagram illustrating an account relationship record processing apparatus according to an exemplary embodiment. (Refer to...) Figure 12 The account relationship record processing device 800 further includes a sequential acquisition unit 809 and a record scanning unit 810, configured to perform the following steps before acquiring the first record version corresponding to the first account relationship record when scanning the first account follow record in the first account record set:
[0172] Sequential acquisition unit 809 is configured to execute the record scanning order corresponding to the first account record set;
[0173] The record scanning unit 810 is configured to perform a scan of at least one account-following record in the first account record set according to the record scanning order.
[0174] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0175] In summary, the apparatus provided in this embodiment acquires a first account relationship record set and a second account relationship record set corresponding to the streamer's account through a set acquisition unit. The first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast. When a first account follow record is detected in the first account record set, a version acquisition unit acquires a first record version corresponding to the first account relationship record, where the first account relationship record is any account follow record in the first account relationship record set. A record determination unit determines a first account change record corresponding to the first account relationship record in the second account relationship record set based on the first record version. The set determination unit determines a target account relationship record set corresponding to the streamer's account based on the first account follow record and the first account change record, where the target account relationship record set is used to determine the number of accounts with a follow relationship to the streamer's account. Therefore, by determining the account change record corresponding to the account relationship record based on the record version, the accuracy of account relationship record processing can be improved, the real-time nature of account relationship records can be guaranteed, and data duplication or unprocessed situations can be reduced, thus improving the accuracy and efficiency of account relationship record processing. Furthermore, the method provided in this disclosure is highly versatile, expanding the scenarios for processing account relationship records and reducing situations where it can only be used during live streaming. Additionally, this disclosure can reduce the computational cost of existing data, thereby lowering the cost of determining the data of followed accounts.
[0176] Figure 13 This is a block diagram illustrating an electronic device 1300 for account relationship record processing according to an exemplary embodiment. For example, the electronic device 1300 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0177] Reference Figure 13 The electronic device 1300 may include one or more of the following components: a processing component 1302, a memory 1304, a power component 1306, a multimedia component 1308, an audio component 1310, an input / output (I / O) interface 1312, a sensor component 1314, and a communication component 1316.
[0178] Processing component 1302 typically controls the overall operation of electronic device 1300, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1302 may include one or more processors 1320 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1302 may include one or more modules to facilitate interaction between processing component 1302 and other components. For example, processing component 1302 may include a multimedia module to facilitate interaction between multimedia component 1308 and processing component 1302.
[0179] Memory 1304 is configured to store various types of data to support the operation of device 1300. Examples of this data include instructions for any application or method operating on electronic device 1300, contact data, phonebook data, messages, pictures, videos, etc. Memory 1304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0180] Power supply component 1306 provides power to various components of electronic device 1300. Power supply component 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1300.
[0181] Multimedia component 1308 includes a screen that provides an output interface between the electronic device 1300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1308 includes a front-facing camera and / or a rear-facing camera. When the device 1300 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0182] Audio component 1310 is configured to output and / or input audio signals. For example, audio component 1310 includes a microphone (MIC) configured to receive external audio signals when electronic device 1300 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1304 or transmitted via communication component 1316. In some embodiments, audio component 1310 also includes a speaker for outputting audio signals.
[0183] I / O interface 1312 provides an interface between processing component 1302 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0184] Sensor assembly 1314 includes one or more sensors for providing state assessments of various aspects of electronic device 1300. For example, sensor assembly 1314 may detect the on / off state of device 1300, the relative positioning of components such as the display and keypad of electronic device 1300, changes in position of electronic device 1300 or a component of electronic device 1300, the presence or absence of user contact with electronic device 1300, the orientation or acceleration / deceleration of electronic device 1300, and temperature changes of electronic device 1300. Sensor assembly 1314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1314 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0185] Communication component 1316 is configured to facilitate wired or wireless communication between electronic device 1300 and other devices. Electronic device 1300 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 1316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1316 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0186] In an exemplary embodiment, the electronic device 1300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0187] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1304 including instructions, which can be executed by a processor 1320 of an electronic device 1300 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0188] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0189] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for processing account relationship records, characterized in that, include: Obtain a first account relationship record set and a second account relationship record set corresponding to the streamer's account. The first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast. The first account relationship record set is determined based on an existing data set, which is composed of at least one existing data set, and the existing data refers to follow relationships. The second account relationship record set is determined based on an incremental data set, which is composed of at least one incremental data set, and the incremental data refers to the details of changes in follow relationships. The existing data set and the incremental data set are stored in different databases. If a first account follow record is found in the first account record set, obtain the first record version corresponding to the first account relationship record, including: Obtain the record update timestamp corresponding to the first account relationship record in the first account relationship record set, and use the record update timestamp as the first record version; Based on the first record version, determine the first account change record corresponding to the first account relationship record in the second account relationship record set, ensuring that all account relationship records after the first record version are consumed by the incremental module; If there is a second account change record in the second account relationship record set that corresponds to the first account follow record, discard the second account change record, wherein the version of the second record corresponding to the second account change record is lower than the version of the first record; Based on the first account's follow records and change records, a set of target account relationship records corresponding to the streamer's account is determined. This set of target account relationship records is used to determine the number of accounts that have a follow relationship with the streamer's account, including: The first account change records corresponding to the first account follow record set are analyzed, and the relationship between the change time of the first account change record and the record update timestamp is determined. If the change conditions are met, the number of follow accounts corresponding to the target account relationship record set is increased or decreased. When the scanning of the first account follow records in the first account record set is completed, the method further includes: If a second account follow record is inserted before the first account follow record in the first account record set, then the log information corresponding to the second account follow record is processed in the second account relationship record set; The target account relationship record set is updated based on the attention time point corresponding to the second account attention record in the log information; The step of processing the log information corresponding to the second account follow record in the second account relationship record set includes: Obtain the delay processing time corresponding to the second account's follow record; Based on the delay processing duration, determine the log information corresponding to the second account attention record in the second account relationship record set; Before obtaining the first record version corresponding to the first account relationship record when the first account follow record is scanned in the first account record set, the process also includes: Obtain the record scanning order corresponding to the first account record set, wherein the record scanning order is a reverse scanning order; Based on the record scanning order, a full scan task is used to scan at least one account follow record in the first account record set.
2. The method according to claim 1, characterized in that, When no first account follow record is found in the first account record set, the method further includes: If the change data of the first account follow record is processed in the second account relationship record set, then the first account follow record is discarded; Store the change data of the first account's follow records.
3. An account relationship record processing device, characterized in that, The apparatus implements the method as described in claim 1, the apparatus comprising: The set acquisition unit is configured to acquire a first account relationship record set and a second account relationship record set corresponding to the streamer's account, wherein the first account relationship record set includes at least one account follow record, and the second account relationship record set includes at least one account relationship change record generated for the streamer's account during the live broadcast. The version acquisition unit is configured to acquire the first record version corresponding to the first account relationship record when the first account follow record is scanned in the first account record set, wherein the first account relationship record is any account follow record in the first account record relationship set; The record determination unit is configured to perform the following action: determining, based on the first record version, a first account change record corresponding to the first account relationship record in the second account relationship record set; The set determination unit is configured to perform the following based on the first account follow record and the first account change record to determine the target account relationship record set corresponding to the anchor account, wherein the target account relationship record set is used to determine the number of accounts that have a follow relationship with the anchor account.
4. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the account relationship record processing method as described in any one of claims 1 to 2.
5. A storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the account relationship record processing method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Data updating method and device
CN105634801A
Method and device for updating associated account information
CN106899624A