User interaction record distributed management method, system and equipment and storage medium

By updating and synchronizing user interaction records containing interactive content, sorted values ​​and total interactions in the storage node, the cumbersome problem of interactive record query in the prior art is solved, and a more efficient and flexible query experience is achieved.

CN119513089APending Publication Date: 2025-02-25BIGO TECH PTE LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411532144.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing technology is difficult to support users' complex interactive record query needs, which leads to cumbersome and time-consuming query process and poor user interactive record query experience.

Method used

By receiving an interaction request for consistent hash forwarding based on the first identifier of the interactive object, the interaction record of the interactive object in the current storage node is updated and synchronized to the associated storage node, and the record contains interactive content, interactive sorting values ​​and/ Or total interactions, support query based on this information.

Benefits of technology

It improves the query efficiency and flexibility of user interaction records, supports complex and high-frequency interactive record query needs, and improves the user's interactive record query experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513089A_ABST
    Figure CN119513089A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a user interaction record distributed management method, system and device and a storage medium. According to the technical scheme provided by the embodiment of the invention, the interaction request for consistent hash forwarding based on the first identifier of the interaction object is received, and the interaction request is initiated through the target terminal corresponding to the interaction object; according to the interaction request, an interaction record of an interaction object in the current storage node is updated, the interaction record is synchronized to the associated storage node, and the interaction record comprises interaction content of an interaction type corresponding to the interaction request, an interaction sorting value and / or a total interaction number; and performing consistent hash forwarding of the interaction request to the associated interaction record service node based on the second identifier of the user corresponding to the target terminal, so as to update the associated interaction record based on the interaction request. By adopting the technical means, complex and high-frequency interactive record query requirements can be supported, the query efficiency and flexibility of the user interactive record are improved, and the interactive record query experience of the user is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, system, device and storage medium for distributed management of user interaction records. Background Art

[0002] At present, in the operation scenarios of Internet applications, in order to improve user experience and enhance social interaction between users, a user interaction record function is usually set to help users understand who interacts with them. User interaction records include likes, comments, visitor records, etc. User interaction records are social traces of users with other users and their objects (videos, posts, etc.). When a user interacts with other users or their objects, the client will record this behavior and report it to the server. When the server receives the reported interaction information, it will store it in a specific storage container. Users can view the interaction behaviors between others and themselves through specific interfaces or functions, thereby increasing interaction and stickiness between users.

[0003] However, simply storing user interaction records is difficult to support users' complex query needs. For queries on large-scale interaction records, it takes a long time to query the required user interaction records, and it is difficult to provide a more flexible viewing method. The whole process is cumbersome and inefficient, and the user interaction record query experience is poor. Summary of the invention

[0004] The embodiments of the present application provide a distributed management method, system, device and storage medium for user interaction records, which can improve the query efficiency and flexibility of user interaction records and solve the technical problem that the interaction record query process is cumbersome and time-consuming.

[0005] In a first aspect, an embodiment of the present application provides a method for distributed management of user interaction records, including:

[0006] receiving an interaction request forwarded by consistent hashing based on a first identifier of an interaction object, the interaction request being initiated by a target terminal corresponding to the interaction object;

[0007] Update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node, the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process;

[0008] The interaction request is forwarded to the associated interaction record service node by performing consistent hashing based on the second identifier of the user corresponding to the target terminal, so as to update the associated interaction record based on the interaction request.

[0009] In a second aspect, an embodiment of the present application provides a user interaction record distributed management system, including:

[0010] A receiving module configured to receive an interaction request forwarded by consistent hashing based on a first identifier of an interaction object, the interaction request being initiated by a target terminal corresponding to the interaction object;

[0011] A storage module is configured to update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node, wherein the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process;

[0012] The association module is configured to perform consistent hashing based on the second identifier of the user corresponding to the target terminal and forward the interaction request to the associated interaction record service node to update the associated interaction record based on the interaction request.

[0013] In a third aspect, an embodiment of the present application provides a user interaction record distributed management device, including:

[0014] memory and one or more processors;

[0015] The memory is configured to store one or more programs;

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed management method for user interaction records as described in the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions, when executed by a computer processor, are configured to execute the distributed management method of user interaction records as described in the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the distributed management method of user interaction records as described in the first aspect.

[0019] The embodiment of the present application receives an interaction request forwarded by consistent hashing based on the first identifier of the interaction object, and the interaction request is initiated by the target terminal corresponding to the interaction object; updates the interaction record of the interaction object in the current storage node according to the interaction request, and synchronizes the interaction record to the associated storage node, the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process; forwards the interaction request to the associated interaction record service node by consistent hashing based on the second identifier of the user corresponding to the target terminal, so as to update the associated interaction record based on the interaction request. The above technical means are adopted to query the interaction record based on the interaction content, interaction ranking value and / or total number of interactions of the interaction record by storing the interaction content, interaction ranking value and / or total number of interactions of the interaction record, so as to avoid the situation where the activity record query process is cumbersome and complicated due to a single query condition, support complex and high-frequency interaction record query requirements, improve the query efficiency and flexibility of user interaction records, and thus improve the user's interaction record query experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a flow chart of a distributed management method of user interaction records provided by an embodiment of the present application;

[0021] Figure 2 It is a flow chart of storage and synchronization of interaction records in a computer room in an embodiment of the present application;

[0022] Figure 3 is a flowchart for updating the interaction record in an embodiment of the present application;

[0023] Figure 4 is a query flow chart of the interactive record in the embodiment of the present application;

[0024] Figure 5 This is a flow chart of interactive record query based on specified sorting in the embodiment of the present application;

[0025] Figure 6 It is a structural diagram of a distributed management system for user interaction records provided in an embodiment of the present application;

[0026] Figure 7 It is a structural diagram of a user interaction record distributed management device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0028] The distributed management method of user interaction records provided in this application aims to query interaction records based on interaction content, interaction ranking value and / or total number of interactions, so as to avoid the situation where a single query condition leads to a cumbersome and complicated activity record query process, thereby improving the query efficiency and flexibility of user interaction records.

[0029] With the rapid development and popularization of Internet technology, in order to improve the user experience of Internet applications and enhance social interaction between users, Internet applications generally set up user interaction record functions. The user interaction record function can not only help users understand who interacts with them, but also encourage users to participate in social activities more actively, thereby increasing interaction and stickiness between users. For example: likes, comments, visitor records, etc.

[0030] User interaction records generally refer to the social traces of users with other users and their objects (videos, posts, etc.). When a user interacts with other users or objects of other users, the client will record this behavior and report it to the server. When the server receives the reported interaction information, it will store it in a specific storage container. Users can view the interaction between others and themselves through a specific interface or function.

[0031] In the relevant interaction record management scenarios, the commonly used interaction record systems mainly focus on counting the number of interactions, presenting the specific content of the interactions, and tracking the latest interaction records. However, these systems have exposed the following problems in practice:

[0032] 1. It simply stores interaction records but does not record multi-dimensional interaction record information. It is difficult to support more complex user needs and has poor scalability. For example, in interactive systems that focus on simple interaction counts such as “likes”, traditional methods usually only record user IDs, content IDs, and like counts, and rely on aggregate queries to calculate the total number of likes in real time. Although this method is intuitive, it is difficult to support other analysis needs, such as filtering like records by time dimension, which limits users’ in-depth understanding of interaction trends. Users need to manually filter out the interaction records that meet their needs based on the queried interaction records.

[0033] 2. Service performance faces challenges or bottlenecks in high-frequency query scenarios. For example, the "Comment" function, as an important channel for in-depth communication between users, mainly focuses on displaying specific comment content, and its data volume expands rapidly with the increase in user activity and interaction frequency. When traditional databases process large-scale comment data, especially complex queries involving multi-condition filtering, sorting, and aggregation operations, they often face severe challenges of performance degradation, affecting the instant display of data and user experience. In particular, when processing complex queries (such as multi-condition filtering, sorting, aggregation, etc.), performance bottlenecks are particularly obvious.

[0034] 3. The sorting and viewing methods are limited, and there is a lack of multi-dimensional query and personalized display capabilities. Taking "Visitor Records" as an example, this function focuses on displaying recent visitor information and is usually sorted only by time. This single sorting method not only limits the convenience of users in identifying important visitors (such as repeat visitors), but also makes it difficult to meet users' needs for in-depth analysis of visitor behavior. As the business scale expands and the needs become more complex, the system architecture and database design of a single sorting method will be difficult to cope with future functional expansion and maintenance challenges.

[0035] 4. When business needs require the storage of multiple copies of related interaction records, network jitter may cause service anomalies and data inconsistency. For example, when the system processes interrelated data such as "visitor records" and "browsing records" at the same time, network jitter may cause the "visitor records" to be successfully saved, while the "browsing records" cannot be successfully written due to network problems. This data inconsistency is particularly obvious when users try to view these records, which directly affects the consistency of the user experience.

[0036] Therefore, with the product iteration and user increase of Internet applications, there are more diverse demands on the interactive record system, which needs to record more dimensional information, support more complex functions, and provide more flexible viewing methods. The system not only needs to support high-frequency query performance, but also needs to ensure the consistency of data under distributed read and write requests in complex network environments, which poses certain challenges to the design of distributed interactive record management systems. Based on this, a user interactive record distributed management method, system, device, and storage medium are provided in an embodiment of the present application to improve the query efficiency and flexibility of user interactive records and solve the technical problem that the interactive record query process is cumbersome and time-consuming.

[0037] Example:

[0038] Figure 1 A flowchart of a user interaction record distributed management method provided in an embodiment of the present application is given. The user interaction record distributed management method provided in this embodiment can be executed by a user interaction record distributed management device, which can be implemented by software and / or hardware. The user interaction record distributed management device can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the user interaction record distributed management device can be a computing device such as a server.

[0039] The following description is made by taking the user interaction record distributed management device as an example of the subject of executing the user interaction record distributed management method. Figure 1 The user interaction record distributed management method specifically includes:

[0040] S110: Receive an interaction request that is forwarded by consistent hashing based on a first identifier of an interaction object, where the interaction request is initiated by a target terminal corresponding to the interaction object.

[0041] The user interaction record distributed management method of the present application aims to provide users with richer and multi-dimensional interaction record storage and query, improve the flexibility and scalability of interaction record query, while providing high-frequency viewing performance in distributed scenarios and ensuring the final consistency of data in a distributed system environment.

[0042] Reference Figure 2 The distributed system includes multiple computer rooms. When the user terminal 11 performs interactive business or queries interactive records, it selects the nearest computer room to process the current business service. Each computer room includes business services 12, message middleware 13, front-end services 14, interactive record management service nodes 15 and storage nodes 16. Through multi-region and multi-computer room deployment, each computer room is equipped with several interactive record service nodes, and other business services can also be deployed synchronously. Each computer room has its own storage node and message middleware, and the storage data of different computer rooms will be synchronized with each other.

[0043] Based on the above distributed system, when performing interactive business services or querying interactive records, the user terminal device will be connected to the nearest computer room. The user's query request operation for interactive records will be forwarded to the designated interactive record service node through the front-end service and specific routing forwarding rules for request. The relevant operations of user interactive business will be processed by the business service, and the production message will interact with the front-end service through the message middleware. The front-end service will forward it to the designated interactive record service node for processing through specific routing forwarding rules. The interactive record management service is responsible for managing the user's interactive records, processing the logic of reporting, storing, querying interactive records, and interacting with other business services. There is no main point logic in the interactive record service. When the number of users increases, it can be seamlessly expanded to increase the user request throughput and achieve parallel expansion. Storage nodes such as redis, mysql are responsible for storing user interactive record data and asynchronously synchronizing to storage nodes in other computer rooms to ensure data consistency. The message middleware is responsible for managing the way to report interactive records for consumption by interactive record services. The use of asynchronous processes can reduce service coupling. Business services actually provide business needs for interaction records, such as like services, IM message services, etc.

[0044] Interaction records include recorded information left by users when they are connected through relevant media. Generally speaking, the initiator of the interaction is the user, and the recipient of the interaction can be another user or an object belonging to another user, such as another user's videos, posts, etc.

[0045] Specifically, when a user interacts with a corresponding interactive object, an update process of the interactive record is triggered, the terminal of the current user is defined as the target terminal, the user identifier of the interactive object is defined as the first identifier, and the user identifier of the current user is defined as the second identifier. Figure 3 , the user initiates an interaction request to the interactive object (hereinafter referred to as the interactive object) through the target terminal. The interaction request is received and processed by the business service, and the user's privacy protection policy is checked. If it does not comply, the next step will not be processed. By adopting a strict privacy protection policy, the privacy policy is checked before the interaction record is generated, which greatly protects the user's privacy. After completing the interaction permission check, the business service writes a request to the message middleware, the front-end service subscribes to and consumes the message of the message middleware, and forwards the request to the interaction record service 1 according to the consistent hash of the interaction object identifier, and the interaction record service 1 processes the interaction request.

[0046] Optionally, after receiving the interaction request for consistent hash forwarding based on the first identifier of the interaction object, the method further includes:

[0047] Set a queue lock for interactive requests, and limit interactive requests to a single thread based on the queue lock.

[0048] The interaction record service 1 sets a queue lock based on the interaction object identifier. The queue lock provides a synchronization mechanism that can protect shared resources in concurrent programming. When multiple threads or processes try to access the same resource at the same time, the queue lock can ensure that only one thread or process can access the resource at a time. By setting a queue lock for the interaction request, it can prevent other interaction record services from processing the interaction request at the same time, resulting in redundant and conflicting processing, and ensure the consistency of interaction record processing.

[0049] It is understandable that the identifiers of the interaction initiator (user) and the object being interacted with are unique, ensuring that there will be no duplication and avoiding abnormal status. By means of identifier hash forwarding and queue lock, serial modification of interaction records is achieved, ensuring the uniqueness and mutual exclusivity of tasks issued by the system, avoiding repeated writing of interaction records in concurrent scenarios, avoiding data inconsistency problems caused by parallel modification, and ensuring data consistency. The above process can better write interaction records and distinguish different interaction record services. In actual applications, multiple interaction record services can be the same instance, and multiple interaction record services can be deployed in the same computer room or in different areas of different computer rooms.

[0050] Optionally, after receiving the interaction request for consistent hash forwarding based on the first identifier of the interaction object, the method further includes:

[0051] The target terminal accumulates the number of interactions with the corresponding interactive object within the set time period. When the number of interactions reaches the frequency limit threshold, the interaction request is rejected and a frequency limit prompt is output to the target terminal.

[0052] By checking the number of interactions of the target terminal with the corresponding interactive object within the set time period, the interaction request is discarded when the number of interactions exceeds the frequency, and the interaction frequency is limited. In addition, the time interval from the most recent interaction record can be calculated by checking the time of the most recent interaction record in the memory. If the interaction time interval is less than the specified time, the request is discarded, and the number of recent discarded requests of the user is recorded. However, if the number of discarded requests reaches a certain threshold, a reminder or penalty will be issued. If the interaction time interval is greater than the specified time, the request time of the most recent interaction record is updated. By limiting the frequency of the service memory, it is possible to limit the user's behavior of swiping interaction records while supporting large traffic.

[0053] S120. Update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node. The interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request. The interaction ranking value is determined based on at least one ranking information of the corresponding interaction type. During the query process, the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type.

[0054] Further, based on the received interaction request, when it is determined to update the interaction record, the interaction record service 1 updates the interaction record of the interaction object, obtains the interaction record information of the interaction object from the storage, and updates the total number of interactions, specific content of the interaction, and interaction ranking value of the interaction object.

[0055] Specifically, the storage form of interaction records can be selected as persistent or non-persistent according to actual storage needs. To support complex interaction record query requirements, the interaction record storage data of the interacted user can be divided into one or more types of total interaction number, specific interaction content and interaction ranking value.

[0056] When the business volume is small, the total number of interactions can be obtained by simply counting the specific content of the interaction or the interactive display dimension. Optionally, if the total number of user interactions in the business is small or does not need to be viewed, the total number of interactions does not need to be stored.

[0057] The specific content of the interaction refers to the specific business content recorded during the interaction. It does not need to be sorted. It is necessary to record the ID of the object being interacted with and the ID of the initiator of the interaction (user), specific interaction information, etc. For example, the content of the comment needs to be recorded in "Comments".

[0058] The interaction ranking value refers to the information that needs to be recorded for sorting and displaying interaction records. The interaction ranking value can be a numerical value. When storing, it is sorted by the interaction ranking value to support high-frequency ordered query needs. For example, time information needs to be recorded in comments and visitor records to display content in time order. In addition, the interaction ranking value can also be sorted according to the popularity value of the interaction record, the number of comment likes, and other numerical values. The interaction ranking value can record the ID of the interacted object, the user's ID, and the corresponding ranking value information.

[0059] The above storage design can achieve flexibility and scalability in activity record query, adapt to diverse interactive system requirements, ensure detailed retention of interactive information, integrate the function of quickly querying the total number of interactions, and support returning query results sorted by different dimensions. Taking the "Like" function as an example, by optimizing the storage strategy of the "total number of interactions", the system can respond quickly and provide real-time total number of likes query. When implementing the "Comment" function, the storage advantages of "interaction ranking value" and "specific content of interaction" are fully utilized, allowing users to easily filter and sort according to the order of comment time or the number of comments, greatly improving the user experience.

[0060] Optionally, updating the interaction record of the interactive object in the current storage node according to the interaction request includes:

[0061] In case of updating the total number of interactions of the interactive object, the first identifier is used as the primary key, the total number of interactions is used as the element, and the total number of interactions is stored in the current storage node based on the cardinality estimation algorithm.

[0062] When the total number of interactions is large, a cardinality estimation algorithm (such as but not limited to Hyperloglog) can be used to store the total number of interactions. Hyperloglog uses a smaller space to store numbers and can support higher query performance. User IDs are usually recorded as elements in the "total number of interactions" with "interaction object" as the primary key. By utilizing the characteristics of Hyperloglog, when the amount of data reaches the set threshold, all numbers can be approximately counted by setting the space, while also providing efficient query efficiency.

[0063] Optionally, if the process of recording interaction records is reversible, that is, the user can delete the relevant interaction records, in order to update the total number of interactions, interaction ranking value and other content when deleting the interaction records, it is necessary to record the historical update time, historical deletion times and other information in the specific content of the user interaction, obtain the historical records in the update process, and update them to historical interaction records.

[0064] Among them, if the total number of interactions is recorded in Hyperloglog, due to its characteristics, it does not support deletion of elements. According to business conditions, you can choose to obtain historical interaction records and re-record the "total number of interactions" when the number of historical deletions exceeds a certain threshold.

[0065] Optionally, in the case of a complex network environment, in order to solve service anomalies caused by network problems, the present application also provides a retryable update exception handling strategy. When forwarding the interaction request to the interaction record service by identifier hash, if the connection times out or the interaction record service returns a retryable error (including failure to read data, etc.), the front-end service retries, and the interaction record service continues to update the interaction record. By returning a retryable exception for retrying, common transient network anomaly problems in the network environment can be solved.

[0066] In addition, a non-retryable update exception handling strategy is provided. When the interaction request is forwarded to the interaction record service according to the identifier hash, the interaction record service returns a non-retryable error (including partial failure to write user data, too many retries, etc.), and the interaction record service sends the specific information of the failure to the message middleware. The front-end service delays the consumption of the failed message, re-executes the interaction request processing steps, forwards it to the interaction record service according to the user identifier hash, and performs partial data update operations based on the specific information of the failure. The non-retryable exception is written to the message middleware, and the delay processing function can be implemented through the message middleware to avoid problems caused by network jitter. Error information processing requires idempotent operations to avoid the same exception request being processed multiple times. In addition, it is necessary to pay attention to timing issues according to business conditions. If an unhandled delay error occurs, an alarm strategy can be set for manual intervention.

[0067] S130: Perform consistent hashing based on the second identifier of the user corresponding to the target terminal and forward the interaction request to the associated interaction record service node to update the associated interaction record based on the interaction request.

[0068] Further, refer to Figure 3 After the interaction record service 1 completes the interaction record update, the interaction record service 1 forwards the interaction request to the interaction record service 2 according to the consistent hash of the user identifier. The interaction record service 2 sets a queue lock according to the user identifier, and the interaction record service 2 updates the user's interaction record, and then obtains the user's interaction record information from the storage, and updates the user's "total number of interactions", "specific content of interaction", and "interaction ranking value".

[0069] It is understandable that for a user's interactive operation on an interactive object, multiple interactive records may be generated. For example, if user A likes a video of user B, then for the interactive object user B's video, the interactive record of user B is updated through interactive record service 1. For user A's like operation, the interactive request is forwarded to interactive record service 2 through interactive record service 1, and the interactive record of user A is updated. Optionally, interactive record service 2 can also store the "total number of interactions" with user ID as the primary key and interactive object as the element.

[0070] Furthermore, based on the storage of the above interaction records, when querying the interaction records later, refer to Figure 4, a user initiates a request to query the interaction record. The front-end service receives the request and forwards it to the interaction record service according to the identifier hash of the query object. The interaction record service obtains the interaction record from the storage. The interaction record service initiates a request to the business service to query other information of the interaction record (such as avatar, nickname, etc.). After completing the query, the interaction record service returns the interaction record to the user. By forwarding the user identifier hash and adding a queue lock, the effect of serial acquisition of the interaction record is achieved, which can avoid the problem of data inconsistency caused by modifications and ensure data reading consistency. Optionally, if the business does not have high requirements for data real-time and accuracy, the process of hashing by user identifier can be omitted, thereby shortening the query path, reducing query time, and improving query efficiency.

[0071] Optionally, after storing the total number of interactions based on the cardinality estimation algorithm, the method further includes:

[0072] When querying the total number of interactions in the interaction record, determine the real-time value of the total number of interactions;

[0073] When the real-time value is less than the set threshold, query the corresponding total number of interactions based on the interactive content and / or interactive ranking value;

[0074] When the real-time value is greater than or equal to the set threshold, the corresponding value calculated based on the cardinality estimation algorithm is returned according to the set value precision.

[0075] If the user needs to query the "total number of interactions", they can choose hierarchical query according to the size of the number. First use the Hyperloglog storage corresponding to the "total number of interactions". When the "total number of interactions" is less than a certain value, due to the certain inaccuracy of Hyperloglog statistics, you can directly query the "specific content of interaction" or "interaction ranking value" at this time, calculate the number and return the accurate value. However, if the "total number of interactions" is greater than a certain value, you can directly return the calculated value corresponding to Hyperloglog according to the business situation. When displaying, you can choose to reduce the numerical precision of the display, such as displaying it in "thousands" or "ten thousand". The above-mentioned hierarchical query method can reduce query time, improve service performance, and at the same time improve high accuracy and optimize user experience.

[0076] Optionally, when the user initiates a request, the front-end proxy service receives it, and forwards it to the interactive record service according to the identifier hash of the query object, storage failure or network timeout may occur. In this case, you can retry first. After a certain number of retries fail, the front-end proxy service directly reads the storage and returns the user record to the server to solve the network anomaly between different computer rooms.

[0077] On the other hand, after updating the interaction record of the interaction object in the current storage node according to the interaction request, it also includes:

[0078] Receive a record query request constructed by the query end based on the specified sorting information, determine the corresponding interaction sorting value based on the specified sorting information, extract the corresponding interaction record from the current storage node according to the determined interaction sorting value, and return it to the query end.

[0079] Reference Figure 5 When a user initiates a request to query interaction records by a specified sort, the front-end service receives the request and forwards it to the interaction record service by the identifier hash of the query object. The interaction record service sorts and queries the interaction records from the storage, and obtains the interaction record object ID with the specified sorting method and the specified interaction value range. The interaction record service specifies the interaction record object ID to query the interaction specific information from the storage. The interaction record service initiates a request to the business service to query other business information (such as avatar, nickname, etc.) of the specified interaction record object ID. After completing the interaction record query, the interaction record service returns the interaction record with the specified sorting method to the user.

[0080] Through the ordered storage of "interaction sorting values", the storage layer can support the query structure that quickly returns the specified sorting method. By performing efficient retrieval directly based on the "interaction sorting value" in the storage layer, the heavy operation of loading the full amount of data into the service memory and then sorting it is avoided. This method not only significantly reduces the time for data processing, but also only transmits and processes the necessary amount of data, thereby further improving the overall performance. In addition, due to the reduced processing burden, the system can more easily support larger query volumes, ensuring a stable response speed in high-concurrency scenarios.

[0081] Optionally, the interaction records are stored in sequential pages using the interaction ranking value as a query identifier;

[0082] Determining a corresponding interaction ranking value based on the specified ranking information, extracting a corresponding interaction record from the current storage node according to the determined interaction ranking value and returning it to the query end, including:

[0083] The query identifier is compared based on the specified sorting information, the query page number is located according to the comparison result, and the corresponding interaction records are extracted from the current storage node page by page according to the query page number and returned to the query end.

[0084] The interactive record service node can support paging query in the storage layer by introducing a continuous identifier (such as page number, cursor or timestamp, etc.) as the starting point of the query. The user's client carries the identifier as a parameter every time a query request is initiated. The interactive record service quickly locates the starting position of the data in the storage layer based on this identifier, and then traverses and returns a specified number or range of records as query results. At the same time, the interactive record service returns a new identifier that corresponds to the end of the current query result set as the starting point for the next query. Implementing an efficient paging query mechanism through the storage layer not only optimizes query performance and reduces unnecessary data transmission, but also improves user experience. It allows users to quickly browse and access more data without waiting for all data to be loaded.

[0085] Through the above steps, the user record query and high-frequency interaction record retrieval functions can be optimized, and users can be supported to flexibly choose the sorting method. Taking "visitor records" as an example, this application can not only realize the query record sorting by access time, but also return records by other sorting methods, such as the number of visits. The system can use the number of visitor visits as the "interaction sorting value" when storing, and store the value in order each time a new visitor record is added. On the visitor display page, the user client can specify the starting identifier (the default is 0) and the number of queries. The system responds to the request immediately, quickly locates and returns the specified number of visitor records in the storage layer, and realizes efficient retrieval sorted by page number of visits.

[0086] In the above, by receiving an interaction request forwarded by consistent hashing based on the first identifier of the interaction object, the interaction request is initiated by the target terminal corresponding to the interaction object; according to the interaction request, the interaction record of the interaction object in the current storage node is updated, and the interaction record is synchronized to the associated storage node, the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one sorting information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process; based on the second identifier of the target terminal corresponding to the user, the interaction request is forwarded to the associated interaction record service node by consistent hashing, so as to update the associated interaction record based on the interaction request. By adopting the above technical means, by storing the interaction content, interaction ranking value and / or total number of interactions of the interaction record, the interaction record is queried based on the interaction content, interaction ranking value and / or total number of interactions, so as to avoid the situation where the activity record query process is cumbersome and complicated due to a single query condition, support complex and high-frequency interaction record query needs, improve the query efficiency and flexibility of user interaction records, and thus improve the user's interaction record query experience.

[0087] Based on the above embodiments, Figure 6A schematic diagram of the structure of a distributed management system for user interaction records provided by this application. Figure 6 The user interaction record distributed management system provided in this embodiment specifically includes: a receiving module 21, a storage module 22 and an association module 23.

[0088] The receiving module 21 is configured to receive an interaction request forwarded by consistent hashing based on a first identifier of an interaction object, and the interaction request is initiated by a target terminal corresponding to the interaction object;

[0089] The storage module 22 is configured to update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node, wherein the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, and the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type. During the query process, the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type;

[0090] The association module 23 is configured to perform consistent hashing based on the second identifier of the user corresponding to the target terminal and forward the interaction request to the association interaction record service node to update the association interaction record based on the interaction request.

[0091] Specifically, after receiving the interaction request for consistent hash forwarding based on the first identifier of the interaction object, the method further includes:

[0092] Set a queue lock for interactive requests, and limit interactive requests to a single thread based on the queue lock.

[0093] Before receiving an interaction request for consistent hash forwarding based on a first identifier of an interaction object, the method further includes:

[0094] The target terminal accumulates the number of interactions with the corresponding interactive object within the set time period. When the number of interactions reaches the frequency limit threshold, the interaction request is rejected and a frequency limit prompt is output to the target terminal.

[0095] Specifically, updating the interaction record of the interaction object in the current storage node according to the interaction request includes:

[0096] In case of updating the total number of interactions of the interactive object, the first identifier is used as the primary key, the total number of interactions is used as the element, and the total number of interactions is stored in the current storage node based on the cardinality estimation algorithm.

[0097] Specifically, after storing the total number of interactions based on the cardinality estimation algorithm, it also includes:

[0098] When querying the total number of interactions in the interaction record, determine the real-time value of the total number of interactions;

[0099] When the real-time value is less than the set threshold, query the corresponding total number of interactions based on the interactive content and / or interactive ranking value;

[0100] When the real-time value is greater than or equal to the set threshold, the corresponding value calculated based on the cardinality estimation algorithm is returned according to the set value precision.

[0101] Specifically, after updating the interaction record of the interactive object in the current storage node according to the interaction request, the method further includes:

[0102] Receive a record query request constructed by the query end based on the specified sorting information, determine the corresponding interaction sorting value based on the specified sorting information, extract the corresponding interaction record from the current storage node according to the determined interaction sorting value, and return it to the query end.

[0103] The interaction records are stored in sequential pages using the interaction ranking value as the query identifier;

[0104] Determining a corresponding interaction ranking value based on the specified ranking information, extracting a corresponding interaction record from the current storage node according to the determined interaction ranking value and returning it to the query end, including:

[0105] The query identifier is compared based on the specified sorting information, the query page number is located according to the comparison result, and the corresponding interaction records are extracted from the current storage node page by page according to the query page number and returned to the query end.

[0106] In the above, by receiving an interaction request forwarded by consistent hashing based on the first identifier of the interaction object, the interaction request is initiated by the target terminal corresponding to the interaction object; according to the interaction request, the interaction record of the interaction object in the current storage node is updated, and the interaction record is synchronized to the associated storage node, the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one sorting information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process; based on the second identifier of the target terminal corresponding to the user, the interaction request is forwarded to the associated interaction record service node by consistent hashing, so as to update the associated interaction record based on the interaction request. By adopting the above technical means, by storing the interaction content, interaction ranking value and / or total number of interactions of the interaction record, the interaction record is queried based on the interaction content, interaction ranking value and / or total number of interactions, so as to avoid the situation where the activity record query process is cumbersome and complicated due to a single query condition, support complex and high-frequency interaction record query needs, improve the query efficiency and flexibility of user interaction records, and thus improve the user's interaction record query experience.

[0107] The distributed management system for user interaction records provided in the embodiments of the present application can be configured to execute the distributed management method for user interaction records provided in the above embodiments, and has corresponding functions and beneficial effects.

[0108] Based on the above practical example, the present application embodiment also provides a user interaction record distributed management device, referring to Figure 7 , the user interaction record distributed management device includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The memory, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the user interaction record distributed management method described in any embodiment of the present application (for example, the receiving module, storage module and association module in the user interaction record distributed management system). The communication module is configured to perform data transmission. The processor executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, to implement the above-mentioned user interaction record distributed management method. The input device can be configured to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device may include a display device such as a display screen. The above-mentioned user interaction record distributed management device can be configured to execute the user interaction record distributed management method provided in the above-mentioned embodiment, and has corresponding functions and beneficial effects.

[0109] On the basis of the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are configured to execute a distributed management method for user interaction records when executed by a computer processor, and the storage medium may be any of various types of memory devices or storage devices. Of course, the computer-executable instructions of the computer-readable storage medium provided in the embodiments of the present application are not limited to the distributed management method for user interaction records as described above, and may also execute related operations in the distributed management method for user interaction records provided in any embodiment of the present application.

[0110] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, and includes a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the distributed management method of user interaction records described in each embodiment of the present application.

Claims

1. A distributed management method for user interaction records, characterized in that: include: receiving an interaction request forwarded by consistent hashing based on a first identifier of an interaction object, wherein the interaction request is initiated by a target terminal corresponding to the interaction object; Update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node, wherein the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process; The interaction request is forwarded to an associated interaction record service node by performing consistent hashing based on a second identifier of a user corresponding to the target terminal, so as to update the associated interaction record based on the interaction request.

2. The distributed management method of user interaction records according to claim 1, characterized in that: After receiving the interaction request for consistent hash forwarding based on the first identifier of the interactive object, the method further includes: A queue lock is set for the interactive request, and based on the queue lock, a single thread is limited to process the interactive request.

3. The distributed management method of user interaction records according to claim 1, characterized in that: After receiving the interaction request for consistent hash forwarding based on the first identifier of the interactive object, the method further includes: The number of interactions of the target terminal with respect to the interactive object within a set time period is accumulated, and when the number of interactions reaches a frequency limit threshold, the interaction request is rejected, and a frequency limit prompt is output to the target terminal.

4. The distributed management method of user interaction records according to claim 1, characterized in that: The updating of the interaction record of the interactive object in the current storage node according to the interaction request includes: In case of updating the total number of interactions of the interactive object, the first identifier is used as the primary key, the total number of interactions is used as the element, and the total number of interactions is stored in the current storage node based on a cardinality estimation algorithm.

5. The distributed management method of user interaction records according to claim 4, characterized in that: After storing the total number of interactions based on the cardinality estimation algorithm, the method further includes: In case of querying the total number of interactions of the interaction record, determining a real-time value of the total number of interactions; When the real-time value is less than a set threshold, query the corresponding total number of interactions based on the interactive content and / or the interactive ranking value; When the real-time value is greater than or equal to the set threshold, a corresponding value calculated based on the cardinality estimation algorithm is returned according to the set value accuracy.

6. The distributed management method for user interaction records according to any one of claims 1 to 5, characterized in that: After updating the interaction record of the interactive object in the current storage node according to the interaction request, the method further includes: Receive a record query request constructed by the query end based on specified sorting information, determine the corresponding interaction sorting value based on the specified sorting information, extract the corresponding interaction record from the current storage node according to the determined interaction sorting value and return it to the query end.

7. The distributed management method of user interaction records according to claim 6, characterized in that: The interaction records are stored in sequential pages using the interaction ranking values ​​as query identifiers; The determining the corresponding interaction ranking value based on the specified ranking information, extracting the corresponding interaction record from the current storage node according to the determined interaction ranking value and returning it to the query end, comprises: The query identifier is compared based on the specified sorting information, the query page number is located according to the comparison result, and the corresponding interaction records are extracted page by page from the current storage node in sequence according to the query page number and returned to the query end.

8. A distributed management system for user interaction records, characterized in that: include: A receiving module, configured to receive an interaction request forwarded by consistent hashing based on a first identifier of an interaction object, wherein the interaction request is initiated by a target terminal corresponding to the interaction object; A storage module is configured to update the interaction record of the interactive object in the current storage node according to the interaction request, and synchronize the interaction record to the associated storage node, wherein the interaction record includes the interaction content, interaction ranking value and / or total number of interactions of the interaction type corresponding to the interaction request, the interaction ranking value is determined according to at least one ranking information of the corresponding interaction type, and the interaction record is used to query based on the interaction content, interaction ranking value and / or total number of interactions of the corresponding interaction type during the query process; The association module is configured to perform consistent hashing based on the second identifier of the user corresponding to the target terminal and forward the interaction request to the associated interaction record service node to update the associated interaction record based on the interaction request.

9. A user interaction record distributed management device, characterized in that: include: memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the user interaction record distributed management method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the user interaction record distributed management method according to any one of claims 1-7.

11. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the user interaction record distributed management method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Large data volume paging query method and system based on ID mapping delay association

    CN122489612A

  • A large data volume paging query method and system based on ID mapping delay association

    CN122489612B