Unread content quantity processing method and device and computing equipment

By detecting content operation events and dynamically adjusting the time window length, the acquisition and update of the quantity of unread content is optimized, and the problem of low acquisition efficiency of unread content for multiple objects in the prior art is solved, improving user experience and system performance .

CN119201319APending Publication Date: 2024-12-27SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411311851.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art is inefficient when acquiring the number of unread contents of multiple objects of concern, especially when there are many objects of concern, resulting in poor user experience.

Method used

By detecting content operation events, update the number of unread content in the cache, and summarize the content operation frequency in the preset time window to dynamically adjust the length of the time window, optimize the acquisition and update of the number of unread content, reduce frequent updates of the cache, and improve acquisition Efficiency and accuracy.

Benefits of technology

It improves the efficiency of obtaining the quantity of unread content of high-focused objects, ensures the accuracy of the quantity of unread content, saves system resources, adapts to actual conditions, and avoids delays or frequent updates caused by improper window length setting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201319A_ABST
    Figure CN119201319A_ABST
Patent Text Reader

Abstract

The invention discloses an unread content quantity processing method, an unread content quantity processing device and computing equipment. The method comprises the steps that a content operation event of a first object is detected, a second object is recognized from objects paying attention to the first object, and the number of the objects paying attention to the second object exceeds a preset number threshold value; updating the unread content quantity of the second object recorded in the cache according to the content operation event; receiving an unread content quantity acquisition request of a second object, reading the unread content quantity of the second object from the cache, and feeding back the read unread content quantity to the second object; and receiving a content refreshing request of a second object, and initializing the content unread quantity of the second object in the cache. According to the scheme, the obtaining efficiency of the unread content quantity of the high-attention object can be improved; and after the content refreshing request of the high-attention object is received, the content unread quantity of the object in the cache is initialized, so that the accuracy of the content unread quantity is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, apparatus, computing device, computer storage medium and computer program product for processing the amount of unread content. Background Art

[0002] With the continuous development of science and technology and society, the emergence of various Internet services has greatly enriched people's work and life. Among them, some Internet services provide dynamic display functions, through which the published content of other objects that the object is concerned about (hereinafter referred to as the concerned object) can be displayed to the object. In order to facilitate the object to browse the published content, many Internet services will show the object the number of contents that have not been viewed, that is, the number of unread contents.

[0003] However, the inventors found that the prior art has the following defects during implementation: when obtaining the number of unread contents of an object, the prior art determines the object's follower in real time after receiving the object's viewing request, counts the number of unread contents of each follower, and summarizes the number of unread contents of each follower and returns it to the object end for display. However, when the object has many followers, the efficiency of obtaining the number of unread contents of the object in the prior art is very low, and the object experience is poor. Summary of the invention

[0004] In view of the above problems, the present application is proposed to provide a method, apparatus, computing device, computer storage medium and computer program product for processing the amount of unread content that overcome the above problems or at least partially solve the above problems.

[0005] According to a first aspect of the present application, a method for processing the number of unread contents is provided, comprising:

[0006] A content operation event of a first object is detected, and a second object is identified from objects that pay attention to the first object; wherein the number of objects paying attention to the second object exceeds a preset number threshold;

[0007] updating the number of unread contents of the second object recorded in the cache according to the content operation event;

[0008] receiving a request for obtaining the number of unread contents of the second object, reading the number of unread contents of the second object from the cache, and feeding back the read number of unread contents to the second object;

[0009] A content refresh request for the second object is received, and the unread content count of the second object in the cache is initialized.

[0010] In an optional implementation manner, the cache also records the data reading time of the last reading of the number of unread contents of the second object;

[0011] Then the updating of the number of unread contents of the second object recorded in the cache according to the content operation event includes: obtaining the content publishing time of the content operation event; if the content publishing time is later than or equal to the data reading time of the second object, updating the number of unread contents of the second object according to the content operation event;

[0012] After reading the number of unread contents of the second object from the cache, the method further includes: updating a data reading time of the number of unread contents of the second object in the cache.

[0013] In an optional implementation, the detecting the content operation event of the first object includes: detecting each content operation event of the first object within a preset time window;

[0014] The updating of the unread content quantity of the second object recorded in the cache according to the content operation event includes: after the preset time window ends, updating the unread content quantity of the second object recorded in the cache according to each content operation event detected within the preset time window.

[0015] In an optional implementation, before detecting each content operation event of the first object within a preset time window, the method further includes:

[0016] Calculating a content operation frequency of the first object;

[0017] The window length of the preset time window is determined according to the content operation frequency of the first object.

[0018] In an optional implementation, calculating the content operation frequency of the first object includes:

[0019] Obtaining a content operation frequency function of the first object within a preset time period;

[0020] Dividing the preset time period into a plurality of time periods according to the inflection point of the content operation frequency function;

[0021] For any time period, the content operation frequency of the time period is calculated according to the content operation frequency function;

[0022] Then determining the window length of the preset time window according to the content operation frequency of the first object includes: determining the target time period of the current time, and determining the window length of the preset time window according to the content operation frequency of the first object in the target time period.

[0023] In an optional implementation manner, receiving a request to obtain the number of unread contents of the second object, and reading the number of unread contents of the second object from the cache includes:

[0024] receiving a content refresh request for the second object, and determining a refresh active period of the second object;

[0025] If the current refresh active period is not in progress, the number of unread contents of the second object is read from the cache.

[0026] In an optional implementation manner, updating the number of unread contents of the second object recorded in the cache according to the content operation event includes:

[0027] If the content operation event is of the first type, increasing the number of unread contents of the second object;

[0028] If the content operation event is of the second type, reducing the number of unread contents of the second object;

[0029] The first type includes: publishing type and / or invisible modification to visible type; the second type includes: deletion type and / or visible modification to invisible type.

[0030] According to a second aspect of the present application, a device for processing the number of unread contents is provided, comprising:

[0031] A detection module, configured to detect a content operation event of the first object;

[0032] An object determination module, configured to identify a second object from objects paying attention to the first object; wherein the number of objects paying attention to the second object exceeds a preset number threshold;

[0033] A quantity updating module, configured to update the quantity of unread content of the second object recorded in the cache according to the content operation event;

[0034] a reading module, configured to receive a request for obtaining the number of unread contents of the second object, read the number of unread contents of the second object from the cache, and feed back the read number of unread contents to the second object;

[0035] The initialization module is configured to receive a content refresh request for the second object and initialize the number of unread contents of the second object in the cache.

[0036] In an optional implementation manner, the cache also records the data reading time of the last reading of the number of unread contents of the second object;

[0037] The quantity updating module is used to: obtain the content publishing time of the content operation event; if the content publishing time is later than or equal to the data reading time of the second object, update the unread content quantity of the second object according to the content operation event;

[0038] The reading module is used to update the data reading time of the amount of unread content of the second object in the cache.

[0039] In an optional implementation, the detection module is used to: detect each content operation event of the first object within a preset time window;

[0040] The quantity updating module is used to update the unread content quantity of the second object recorded in the cache according to each content operation event detected within the preset time window after the preset time window ends.

[0041] In an optional implementation, the device further includes: a window determination module, configured to calculate a content operation frequency of the first object; and determine a window length of the preset time window according to the content operation frequency of the first object.

[0042] In an optional implementation, the window determination module is used to: obtain a content operation frequency function of the first object within a preset time period;

[0043] Dividing the preset time period into a plurality of time periods according to the inflection point of the content operation frequency function;

[0044] For any time period, the content operation frequency of the time period is calculated according to the content operation frequency function;

[0045] Then determining the window length of the preset time window according to the content operation frequency of the first object includes: determining the target time period of the current time, and determining the window length of the preset time window according to the content operation frequency of the first object in the target time period.

[0046] In an optional implementation, the reading module is used to: receive a content refresh request of the second object, and determine a refresh active period of the second object;

[0047] If the current refresh active period is not in progress, the number of unread contents of the second object is read from the cache.

[0048] In an optional implementation, the quantity updating module is used to: if the content operation event is of the first type, increase the quantity of unread content of the second object; if the content operation event is of the second type, decrease the quantity of unread content of the second object;

[0049] The first type includes: publishing type and / or invisible modification to visible type; the second type includes: deletion type and / or visible modification to invisible type.

[0050] According to a third aspect of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0051] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the above-mentioned method for processing the number of unread contents.

[0052] According to a fourth aspect of the present application, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned method for processing the number of unread contents.

[0053] According to a fifth aspect of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the above-mentioned method for processing the amount of unread content.

[0054] The embodiment of the present application records the number of unread contents of a high-attention object in a cache, and updates the number of unread contents of the high-attention object in the cache after the first object that the high-attention object pays attention to triggers a corresponding content operation event, so that after receiving a request to obtain the number of unread contents, the number of unread contents can be quickly obtained by directly reading the record of the number of unread contents in the cache, thereby improving the efficiency of obtaining the number of unread contents of the high-attention object; and after receiving a content refresh request for the high-attention object, the number of unread contents of the object in the cache is initialized to ensure the accuracy of the number of unread contents.

[0055] In the embodiment of the present application, the data reading time of the number of unread contents of the second object is recorded in the cache, and whether the content operation event is a valid content operation event is determined according to the chronological relationship between the content publishing time and the data reading time of the published content targeted by the content operation event. The number of unread contents in the cache is updated only according to the valid content operation event, so as to avoid abnormal recording of the same published content multiple times and improve the accuracy of the number of unread contents.

[0056] After the preset time window ends, the embodiment of the present application uniformly updates the number of unread contents of the second object in the cache according to the content operation events of the first object detected within the preset time window, thereby reducing the frequency of changes to the number of unread contents in the cache, improving the processing efficiency of the number of unread contents, and saving system resources.

[0057] The embodiment of the present application determines the window length of the preset time window according to the content operation frequency of the first object, realizes the dynamic determination of the preset time window, and makes the determined window length of the preset dynamic time window compatible with the actual situation of the first object, avoids the delay in updating the number of unread content in the cache caused by setting the window length too long, and avoids the frequent cache update caused by setting the window length too short, thereby improving the rationality of the setting of the preset time window.

[0058] The embodiment of the present application divides the preset time period into multiple time periods according to the inflection point of the content operation frequency function of the first object, ensures that the content operation frequency in each time period has the same characteristics, obtains the content operation frequency of each time period according to the content operation frequency function of each time period, and thus obtains the content operation frequencies of different time periods. When it is necessary to determine the window length of the next preset time window, the window length of the next preset time window is determined according to the content operation frequency of the target time period at the determined time (current time), thereby improving the determination accuracy of the preset time window.

[0059] In an embodiment of the present application, the number of unread contents of the second object is read from the cache during a non-refresh active period of the second object, thereby saving system resources while ensuring the accuracy of obtaining the number of unread contents; and the number of unread contents of the second object is obtained using a preset non-cache algorithm during the refresh active period of the second object, thereby ensuring the accuracy of obtaining the number of unread contents.

[0060] The embodiment of the present application determines whether the content operation event increases or decreases the number of unread contents according to the type of the content operation event, thereby ensuring the calculation accuracy of the number of unread contents.

[0061] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0063] Figure 1 A schematic diagram of an operating environment provided for implementing at least one embodiment of the present application is shown;

[0064] Figure 2 A schematic diagram showing a flow chart of a method for processing the number of unread contents provided in the first embodiment of the present application;

[0065] Figure 3 A schematic flow chart showing a method for processing the number of unread contents provided in the second embodiment of the present application is shown;

[0066] Figure 4 A schematic diagram showing a flow chart of a method for processing the number of unread contents provided in Embodiment 3 of the present application;

[0067] Figure 5 A schematic diagram showing the structure of a device for processing the number of unread contents provided in a fourth embodiment of the present application is shown;

[0068] Figure 6 A schematic diagram of the structure of a computing device provided in Embodiment 5 of the present application is shown. DETAILED DESCRIPTION

[0069] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0070] It should be noted that the object information and object data involved in the embodiments of the present application (such information and data include but are not limited to information and data used for analysis, information and data stored, information and data displayed, etc.) are all authorized or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for selection of authorization or rejection.

[0071] Figure 1 The present invention is applicable to an application environment including, but not limited to, a client 2 , a server 4 , and a network 6 .

[0072] in:

[0073] The server 4 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0074] The server 4 may be configured to communicate with the client 2, etc., via a network 6. The network 6 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 6 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, etc., or wireless links, such as cellular links, satellite links, Wi-Fi links, etc.

[0075] The server 4 can provide storage, reading, downloading, writing, querying, deleting and other services, such as providing static resource download services to clients through multiple domain names.

[0076] Client 2 can be running Windows, Android TM ) or IOS and other operating systems, such as smart phones, tablet devices, laptop computers, virtual reality devices, gaming devices, set-top boxes, car terminals, smart TVs. Based on the above operating systems, various applications, such as browsers, can be run.

[0077] Embodiment 1

[0078] Figure 2 A flowchart of a method for processing the number of unread contents provided in the first embodiment of the present application is shown. The method for processing the number of unread contents provided in the embodiment of the present application can be executed on a server or the like.

[0079] Specifically, Figure 2 As shown, the method comprises the following steps:

[0080] Step S210: detecting a content operation event of a first object, and identifying a second object from objects that pay attention to the first object; wherein the number of objects that pay attention to the second object exceeds a preset number threshold.

[0081] The attention mentioned in this application is specifically content subscription, that is, establishing a content subscription relationship through corresponding operations or strategies, so that the content published by the producer is provided to the subscriber. The operation includes but is not limited to: touching the "Follow" button, touching the "Collect" button, touching the "Like" button, etc.; or, the content subscription relationship established through the corresponding subscription strategy, for example, the system delivers the content published by object A to object B through the corresponding content delivery strategy, thereby establishing a content subscription relationship in which object B follows object A.

[0082] Among them, the first object in this application is the producer or publisher of dynamic content, for example, the first object can be a UP host, or a user who publishes dynamics in social software, etc. The object that follows the first object is the object that subscribes to the content of the first object. This application refers to the object that follows the first object as the third object, that is, the third object can be called the consumer, viewer, or subscriber of the content published by the first object, and the content published by the first object can be provided to the third object for viewing. For example, if object B clicks the "Follow" or "Like" button on the homepage of object A, then when object A is the first object, object B is the third object of object A.

[0083] The present application detects a content operation event of the first object, and the content operation event is an operation event associated with the published content of the first object. Among them, the content operation event includes but is not limited to: content publishing event, content visible status modification event, content deletion event, etc. Among them, the content publishing event refers to the release of dynamic content, the content visible status modification event is to modify the visible status of the published content to adjust the object of the published content, and the content deletion event is to delete the published content, etc. In short, the content operation event in the present application refers to a related event that is associated with the content and can affect the number of unread content of the third object.

[0084] After detecting the content operation event of the first object, the second object is identified from the objects that pay attention to the first object. Specifically, it is determined that at least one third object that pays attention to the first object is determined, and further an object whose number of attention objects exceeds a preset number threshold is identified from the third object, and the object is the second object. That is, the second object pays attention to the first object, and the number of attention objects of the second object exceeds the preset number threshold. Among them, the number of attention objects of the second object is the total number of objects paid attention to by the second object, so the second object is an object with a large number of attention objects among the objects that pay attention to the first object, and this application can be called a high-attention object. Since the number of attention objects of the second object is large, the use of the unread content number acquisition method in the prior art will greatly reduce the acquisition efficiency of the unread content number, so this application optimizes the unread content number processing process for the second object with a large number of attention objects. For other objects whose number of attention objects does not exceed the preset number threshold, the unread content number acquisition method in the prior art can be used. The preset number threshold can be set according to actual conditions, for example, the preset number threshold can be 500 or 200, etc. For example, assuming that the first object A posts a video status, then the objects that follow the first object A are three objects B, C, and D. If among these three objects only the number of objects followed by B exceeds the preset threshold of 200, then only B needs to be subjected to subsequent operations, while C and D can use the processing methods of existing technologies.

[0085] In an optional implementation, the object identifiers (such as object IDs, object names, etc.) of each object whose number of attention objects exceeds a preset number threshold may be pre-stored, for example, a high attention object list is stored, and the object IDs of objects whose number of attention objects exceeds the preset number threshold are recorded in the high attention object list. Also, the subscriber list of each first object may be pre-stored, and the subscriber list may record the object identifiers (such as object IDs, etc.) of each object that follows the first object. Therefore, during the execution of this step, the subscriber list may be consulted first to obtain the object identifiers of each third object that follows the first object, and the high attention object list may be searched to determine the second object that follows the first object. That is, the object identifier of the second object exists in both the subscriber list of the first object and the high attention object list. In the actual implementation process, the high attention object list and the subscriber list of each first object may be updated regularly or irregularly to ensure the accuracy of data processing.

[0086] In an optional implementation, the published content targeted by the content operation event of the first object should be visible to the second object, that is, if the published content targeted by the content operation event of the first object is not visible to an object that follows the first object, then the object will not be included in the second object of the first object this time. Therefore, the second object in this application is an object that follows the first object, the number of objects followed by the second object exceeds the preset number threshold, and the published content targeted by the content operation event of the first object is visible to the second object. For example, object A publishes a dynamic, and objects B, C, and D all follow object A, wherein the dynamic is only visible to B and C, and the number of objects followed by objects C and D exceeds the preset number threshold. After detecting that object A has published the dynamic, the second object identified is only object C, wherein the number of objects followed by object B does not exceed the preset number threshold, so it is not the second object. Although the number of objects followed by object D exceeds the preset number threshold, since the dynamic is not visible to object D, object D will not be identified as the second object.

[0087] Step S220: updating the number of unread contents of the second object recorded in the cache according to the content operation event.

[0088] Different from the prior art, the present application records the number of unread contents of each high-concern object (objects whose number of concerned objects exceeds a preset number threshold) in the cache. Storing the number of unread contents of high-concern objects in the cache can improve the reading efficiency of the number of unread contents and improve the overall operating efficiency of the system.

[0089] After the second object currently focused on the first object is determined in step S210, for each second object determined in step S210, the number of unread contents of each second object is searched in the cache, and the number of unread contents of each second object recorded in the cache is updated according to the content operation event of the first object.

[0090] In an optional implementation, since different content operation events have different effects on the number of unread contents, in this implementation, for any content operation event, the number of unread contents of the second object in the cache is updated according to the event type of the content operation event. Specifically, the number of unread contents of the second object is updated in the following manner: if the content operation event is of the first type, the number of unread contents of the second object is increased; if the content operation event is of the second type, the number of unread contents of the second object is decreased; wherein the first type includes: publishing type and / or invisible modification to visible type; the second type includes: deletion type and / or visible modification to invisible type. Specifically, if the content operation event is of the publishing type and is visible to each second object, it indicates that one unread content of each second object has been added, thereby increasing the number of unread content of each second object of the first object in the cache by 1; if the content operation event is of the invisible to visible type, it indicates that the first object has modified the published content from an invisible state to a visible state, and one unread content of the second object has been added, thereby increasing the number of unread content of the second object by one; if the content operation event is of the deletion type, it indicates that one unread content of each second object has been reduced, thereby decreasing the number of unread content of each second object of the first object in the cache by one; if the content operation event is of the visible to invisible type, it indicates that the first object has modified the published content from a visible state to an invisible state, and one unread content of the second object has been reduced, thereby decreasing the number of unread content of the second object by one.

[0091] In an optional implementation, in order to improve the object experience and simplify the execution process of this method, when the number of unread contents of any object in the cache reaches the unread threshold, the number of unread contents will no longer increase. For example, the unread threshold may be 99, and when the number of unread contents in the cache reaches 99, the number of unread contents will no longer increase.

[0092] Step S230: receiving a request for obtaining the number of unread contents of the second object, reading the number of unread contents of the second object from the cache, and feeding back the read number of unread contents to the second object.

[0093] In the corresponding scenario (such as entering the dynamic display page or home page), a request to obtain the number of unread contents will be triggered. After receiving the request to obtain the number of unread contents, the server determines whether the initiator of the request is a high-attention object whose number of attention objects exceeds a preset threshold. If so, the record in the cache is read. Specifically, when the server determines that the initiator of the request to obtain the number of unread contents is the second object, there is no need to determine the list of each object followed by the second object, the unread data of each attention object, and the aggregation of the unread data. It only needs to read the number of unread contents of the second object from the cache to quickly obtain the number of unread contents of the second object, thereby feeding back the read number of unread contents to the second object and displaying the number of unread contents on the second object.

[0094] If the server determines that the initiator of the request is not a high-attention object after receiving the request for obtaining the number of unread contents, the server can adopt the determination method of the existing technology to determine the various attention objects of the initiator and the number of unread contents of the initiator under each attention object, summarize the number of unread contents of each attention object to obtain the number of unread contents of the initiator, and return it to the initiator.

[0095] Step S240: receiving a content refresh request for the second object, and initializing the number of unread contents of the second object in the cache.

[0096] The second object can trigger a content refresh request through a corresponding trigger operation (such as a downward sliding operation, etc.). After the server receives the content refresh request of the second object, it indicates that the second object has triggered the viewing of unread content. In this step, the unread content count of the second object recorded in the cache is initialized to ensure the accuracy of the unread content count. The initialization process specifically restores the unread content count to the initial state, such as clearing the unread content count to zero, so that the unread content count is restored to zero.

[0097] It can be seen that in the processing method of the number of unread contents provided in the embodiment of the present application, the number of unread contents of the high-attention object is recorded in the cache, and after the first object that the high-attention object pays attention to triggers the corresponding content operation event, the number of unread contents of the high-attention object in the cache is updated, so that after receiving the request to obtain the number of unread contents, the number of unread contents can be directly read from the cache. The record of the number of unread contents can be quickly obtained, thereby improving the efficiency of obtaining the number of unread contents of the high-attention object; and after receiving the content refresh request of the high-attention object, the number of unread contents of the object in the cache is initialized to ensure the accuracy of the number of unread contents.

[0098] Embodiment 2

[0099] Figure 3A flowchart of a method for processing the number of unread contents provided in the second embodiment of the present application is shown. The method for processing the number of unread contents provided in the embodiment of the present application can be executed on a server or the like.

[0100] Specifically, Figure 3 As shown, the method comprises the following steps:

[0101] Step S310: detecting each content operation event of the first object within a preset time window.

[0102] In order to avoid frequent updates of the number of unread content of high-interest objects in the cache, save system resources and improve the overall execution performance of the method, this embodiment aggregates content operation events generated within a period of time, and subsequently uniformly updates the corresponding number of unread content according to the content operation events within a period of time.

[0103] Specifically, in this embodiment, a corresponding preset time window is allocated to the first object, and the window length of the preset time window can be a set value or can be changed dynamically. Each content operation event generated by the first object in the preset time window is detected, and each content operation event in the preset time window is collected.

[0104] Step S320: after the preset time window ends, the number of unread contents of the second object recorded in the cache is updated according to each content operation event detected within the preset time window.

[0105] Before the preset time window ends, after the content operation event of the first object is detected, the number of unread contents in the cache will not be updated, but the detected content operation event will be recorded first. After the preset time window ends, that is, after the end point of the preset time window is reached, the content operation events of the first object recorded in the preset time window will be summarized, and the number of unread contents of the second object in the cache will be updated uniformly, thereby reducing the number of updates to the cache. For example, in the preset time period of 8:10-8:15, content operation events are detected at 8:11 and 8:13 respectively, then the number of unread contents of the second object recorded in the cache will be updated according to the two content operation events at the adjacent time points after 8:15. Among them, the embodiment of the present application is a periodic detection, and the next preset time window is entered after the end of a preset time window, that is, the content operation events in the time period are detected at regular intervals, and the time period is the preset time window.

[0106] In an optional embodiment, in order to avoid record anomalies caused by multiple recordings of the same published content, the cache of this embodiment also records the data reading time of the last reading of the number of unread contents of the second object, and the data reading time can be called the reading position. For any detected content operation event of the first object, the content publishing time of the content operation event is obtained. The content publishing time is not the event occurrence time of the content operation event, but the publishing time of the published content targeted by the content operation event. Furthermore, if the content publishing time is later than or equal to the data reading time of the second object, indicating that the content operation event is valid, the number of unread contents of the second object is updated according to the content operation event; if the content publishing time is earlier than the data reading time of the second object, this content operation event is ignored. For example, object A publishes a certain dynamic at time T1, and sets it to be visible only to itself at the initial stage of publication, so that this dynamic will not affect the record of the number of unread contents of the second object B that follows object A; then, the number of unread contents of the second object B in the cache is read at time T2; further, at time T3, object A modifies the dynamic to be public, that is, the dynamic is visible to the second object B, and a content operation event (invisible modification to visible event) is generated at time T3. However, since the content publishing time T1 of the dynamic corresponding to the content operation event is earlier than the data reading time T2 of the second object, the impact of the content operation time on the number of unread contents of the second object is ignored; if the last data reading time T4 of the second object B is earlier than time T1, the number of unread contents of the second object B in the cache is updated according to the content operation event generated at time T3.

[0107] Further optionally, in the process of updating the number of unread contents of the second object recorded in the cache according to each content operation event detected in the preset time window, firstly select the valid content operation event from each content operation event detected in the preset time window, and the content publishing time of the valid content operation event is later than or equal to the data reading time of the second object. Further, the update value corresponding to the preset time window is determined according to the valid content operation event. When determining the update value, the update value of the valid content operation event is determined according to the event type of each valid content operation event. For example, if it is the first type, the update value of a valid content operation event is +1; if it is the second type, the update value of a valid content operation event is -1. The update value of the preset time window is obtained according to the cumulative result of the update value of each valid content operation time in the preset time window. Therefore, it is only necessary to operate the number of unread contents of the second object in the cache according to the update value of the time window in each time window, which greatly reduces the number of cache operations, improves the processing efficiency of the method, and saves system resources.

[0108] In an optional implementation, the preset time window can be set according to expert experience. For example, every 5 minutes can be used as a preset time window, and the next preset time window is entered after the current 5 minutes, thereby simplifying the processing logic.

[0109] In an optional embodiment, the preset time window is dynamically adjusted according to the different first objects, so as to improve the matching degree between the preset time window and the first object, and improve the rationality of setting the preset time window and the determination accuracy. Specifically, the content operation frequency of different first objects is different. In this embodiment, for any first object, the content operation frequency of the first object is calculated. The content operation frequency can be determined according to the frequency of content operation events generated by the first object in the historical period, and the window length of the preset time window is further determined according to the content operation frequency of the first object. The content operation frequency can specifically be the number of content operation events generated per unit time, and the window length of the preset time window is negatively correlated with the content operation frequency, that is, the higher the content operation frequency, the more frequent the first object's operation on the published content, and the shorter the window length of the preset time window of the first object; conversely, the lower the content operation frequency, the less frequent the first object's operation on the published content, and the longer the window length of the preset time window of the first object.

[0110] Further optionally, the content operation frequency of the same first object in different time periods may be different. In order to further improve the determination accuracy of the preset time window, the preset time period (such as every day) is divided into multiple time periods in this embodiment, and the content operation frequency of the first object in each time period is determined. After the end of the previous preset time window, the next preset time window needs to be determined. At this time, the time period in which the current time is located is determined, which is called the target time period. The next preset time window is determined according to the content operation frequency of the first object in the target time period, which is also the window length of the current preset time window.

[0111] In the specific implementation process, the content operation frequency function of the first object within the preset time period is obtained. The content operation frequency function can be obtained by fitting according to historical data. For example, the average value of the content operation frequency of the first object in each sampling time period (such as every 5 minutes, every 1 minute, etc.) within the preset time period can be determined, and the average value of the content operation frequency of each sampling time period is fitted to obtain the content operation frequency function. The content operation frequency function describes the change trend of the content operation frequency of the first object over time. The preset time period is further divided into multiple time periods according to the inflection point of the content operation frequency function. Specifically, an inflection point recognition algorithm can be used to identify at least one inflection point of the content operation frequency function of the first object, and the preset time period is divided with each inflection point as a dividing point, and multiple time periods are obtained after the division. For any time period, the content operation frequency of the time period is calculated according to the content operation frequency function. For example, the integral value of the content operation frequency in the time period can be calculated, and the ratio of the integral value to the time period length can be calculated. The ratio can be used as the content operation frequency of the time period, and so on.

[0112] Step S330: receiving a request for obtaining the number of unread contents of the second object, reading the number of unread contents of the second object from the cache, and feeding back the read number of unread contents to the second object.

[0113] After reading the unread content quantity of the second object from the cache, the data reading time of the unread content quantity of the second object in the cache is updated, that is, the data reading time of the unread content quantity of the second object in the cache is replaced by the time of reading the unread content quantity of the second object from the cache this time.

[0114] Step S340: receiving a content refresh request for the second object, and initializing the number of unread contents of the second object in the cache.

[0115] It can be seen that in the method for processing the number of unread contents provided in the embodiment of the present application, after the preset time window ends, the number of unread contents of the second object in the cache is uniformly updated according to the content operation event of the first object detected within the preset time window, thereby reducing the frequency of changes to the number of unread contents in the cache, improving the processing efficiency of the number of unread contents, and saving system resources.

[0116] Embodiment 3

[0117] Figure 4 A flowchart of a method for processing the number of unread contents provided in the third embodiment of the present application is shown. The method for processing the number of unread contents provided in the embodiment of the present application can be executed on a server or the like.

[0118] Specifically, Figure 4 As shown, the method comprises the following steps:

[0119] Step S410: receiving a content refresh request of a second object, and determining an active refresh period of the second object.

[0120] The historical refresh data of the second object is obtained, and the refresh active period of the second object is determined according to the historical refresh data of the second object, wherein the refresh active period of the second object refers to the refresh frequency of the second object in the attribute active period being greater than a preset refresh frequency threshold.

[0121] In an optional implementation, the refresh frequency corresponding to each sampling time point in the preset time period can be determined based on the historical refresh data, and then the refresh frequency of the sampling time point is fitted to obtain the refresh frequency function. The preset time period is divided into multiple segments, or the preset time period is divided into multiple segments according to the inflection point of the refresh frequency function, and the average refresh frequency of each segment is calculated respectively. If the average refresh frequency of a segment is greater than the preset refresh frequency threshold, the segment is used as the refresh active period.

[0122] Step S420, determine whether the current time is in the refresh active period; if so, execute step S430; if not, execute step S440.

[0123] After receiving the content refresh request of the second object, it is determined whether the current time is in the refresh active period of the second object. If it is in the refresh active period, step S430 is executed; if it is not in the refresh active period, step S440 is executed.

[0124] Step S430: Acquire the number of unread contents of the second object using a preset non-cache algorithm.

[0125] If the current refresh period is active, if the number of unread contents of the second object in the cache needs to be used to frequently read the cache and update the data reading time of the cache, and if the unread content number update method of step S320 is used, there will be a certain delay. Therefore, it is comprehensively determined that when the current refresh period is active, the number of unread contents of the second object in the cache will not be read, but the number of unread contents of the second object will be obtained by using a preset non-cache algorithm. The preset non-cache algorithm is an algorithm related to the data in the cache that does not use. For example, each focus object of the second object can be determined in real time, the number of unread contents of the second object under each focus object can be determined, and the number of unread contents of the second object under each focus object can be accumulated to obtain the number of unread contents of the second object.

[0126] In addition, since a preset non-cached algorithm is used to obtain the number of unread contents of the second object during the refresh active phase, the number of unread contents of the second object recorded in the cache is no longer updated according to the content operation event of the first object during the refresh active phase, thereby saving system resources. At the end point of the refresh active phase, a real-time calculation method is used to determine each focus object of the second object and the number of unread contents of the second object under each focus object, and the number of unread contents of each focus object is accumulated to obtain the number of unread contents of the second object at the end point, and the number of unread contents of the second object at the end point is assigned to the number of unread contents of the second object in the cache, and the end point is assigned to the data reading time of the number of unread contents of the second object.

[0127] Step S440: Read the number of unread contents of the second object from the cache.

[0128] If the current refresh active period is not in progress, the cache reading method in other embodiments is used to read the number of unread contents of the second object from the cache.

[0129] It can be seen that in the processing method for the number of unread contents provided in the embodiment of the present application, the number of unread contents of the second object is read from the cache during the non-refresh active period of the second object, thereby saving system resources while ensuring the accuracy of obtaining the number of unread contents; and the preset non-cache algorithm is used to obtain the number of unread contents of the second object during the refresh active period of the second object, thereby ensuring the accuracy of obtaining the number of unread contents.

[0130] Embodiment 4

[0131] Figure 5 A schematic diagram of the structure of a device for processing the number of unread contents provided in the fourth embodiment of the present application is shown. Figure 5 As shown, the device 500 includes: a detection module 510, an object determination module 520, a quantity update module 530, a reading module 540, and an initialization module 550.

[0132] A detection module 510, configured to detect a content operation event of a first object;

[0133] An object determination module 520 is configured to identify a second object from objects paying attention to the first object; wherein the number of objects paying attention to the second object exceeds a preset number threshold;

[0134] A quantity updating module 530 is used to update the unread content quantity of the second object recorded in the cache according to the content operation event;

[0135] A reading module 540 is configured to receive a request for obtaining the number of unread contents of the second object, read the number of unread contents of the second object from the cache, and feed back the read number of unread contents to the second object;

[0136] The initialization module 550 is configured to receive a content refresh request for the second object and initialize the number of unread contents of the second object in the cache.

[0137] In an optional implementation manner, the cache also records the data reading time of the last reading of the number of unread contents of the second object;

[0138] The quantity updating module 530 is used to: obtain the content publishing time of the content operation event; if the content publishing time is later than or equal to the data reading time of the second object, update the unread content quantity of the second object according to the content operation event;

[0139] The reading module 540 is used to update the data reading time of the amount of unread content of the second object in the cache.

[0140] In an optional implementation, the detection module 510 is used to: detect each content operation event of the first object within a preset time window;

[0141] The quantity updating module 530 is used to update the quantity of unread content of the second object recorded in the cache according to each content operation event detected within the preset time window after the preset time window ends.

[0142] In an optional implementation, the device further includes: a window determination module (not shown in the figure), configured to calculate the content operation frequency of the first object; and determine the window length of the preset time window according to the content operation frequency of the first object.

[0143] In an optional implementation, the window determination module is used to: obtain a content operation frequency function of the first object within a preset time period;

[0144] Dividing the preset time period into a plurality of time periods according to the inflection point of the content operation frequency function;

[0145] For any time period, the content operation frequency of the time period is calculated according to the content operation frequency function;

[0146] Then determining the window length of the preset time window according to the content operation frequency of the first object includes: determining the target time period of the current time, and determining the window length of the preset time window according to the content operation frequency of the first object in the target time period.

[0147] In an optional implementation, the reading module 540 is configured to: receive a content refresh request for the second object, and determine a refresh active period of the second object;

[0148] If the current refresh active period is not in progress, the number of unread contents of the second object is read from the cache.

[0149] In an optional implementation, the quantity updating module 530 is used to: if the content operation event is of the first type, increase the unread content quantity of the second object; if the content operation event is of the second type, decrease the unread content quantity of the second object;

[0150] The first type includes: publishing type and / or invisible modification to visible type; the second type includes: deletion type and / or visible modification to invisible type.

[0151] It can be seen that in the processing device for the number of unread contents provided in the embodiment of the present application, the number of unread contents of the high-attention object is recorded in the cache, and after the first object that the high-attention object pays attention to triggers the corresponding content operation event, the number of unread contents of the high-attention object in the cache is updated, so that after receiving the request to obtain the number of unread contents, the number of unread contents can be directly read from the cache. The record of the number of unread contents can be quickly obtained, thereby improving the efficiency of obtaining the number of unread contents of the high-attention object; and after receiving the content refresh request of the high-attention object, the number of unread contents of the object in the cache is initialized to ensure the accuracy of the number of unread contents.

[0152] Embodiment 5

[0153] Figure 6 A schematic diagram of the structure of a computing device provided in Embodiment 5 of the present application is shown. The specific embodiments of the present application do not limit the specific implementation of the computing device.

[0154] like Figure 6 As shown, the computing device may include: a processor (processor) 602 , a communication interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .

[0155] The processor 602, the communication interface 604, and the memory 606 communicate with each other via the communication bus 608. The communication interface 604 is used to communicate with other devices such as a client or other server network elements. The processor 602 is used to execute the program 610, which can specifically execute the relevant steps in the above-mentioned processing method embodiment for calculating the number of unread contents of a device.

[0156] Specifically, the program 610 may include program codes, which include computer operation instructions.

[0157] The processor 602 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0158] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The program 610 may be specifically used to enable the processor 602 to perform the operations in the above method embodiment.

[0159] Embodiment 6

[0160] Embodiment 6 of the present application provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction or computer program, which enables a processor to execute operations corresponding to the method for processing the number of unread contents in any of the above method embodiments.

[0161] Embodiment 7

[0162] Embodiment 7 of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to execute operations corresponding to the method for processing the number of unread contents in any of the above method embodiments.

[0163] To summarize, according to the computing device, computer storage medium and computer program product provided in this embodiment, the number of unread content of the high-attention object is recorded in the cache, and after the first object that the high-attention object pays attention to triggers the corresponding content operation event, the number of unread content of the high-attention object in the cache is updated, so that after receiving the request to obtain the number of unread content, the number of unread content can be quickly obtained by directly reading the record of the number of unread content in the cache, thereby improving the efficiency of obtaining the number of unread content of the high-attention object; and after receiving the content refresh request of the high-attention object, the number of unread content of the object in the cache is initialized to ensure the accuracy of the number of unread content.

[0164] The algorithm or display provided here are not inherently related to any specific computer, virtual system or other equipment. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application described here, and the above description of specific languages ​​is to disclose the best mode of implementation of the present application.

[0165] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0166] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0167] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0168] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0169] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0170] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A method for processing the amount of unread content, characterized in that: include: A content operation event of a first object is detected, and a second object is identified from objects that pay attention to the first object; wherein the number of objects paying attention to the second object exceeds a preset number threshold; updating the number of unread contents of the second object recorded in the cache according to the content operation event; receiving a request for obtaining the number of unread contents of the second object, reading the number of unread contents of the second object from the cache, and feeding back the read number of unread contents to the second object; A content refresh request for the second object is received, and the unread content count of the second object in the cache is initialized.

2. The method according to claim 1, characterized in that The cache also records the data reading time of the last reading of the number of unread contents of the second object; Then the updating of the number of unread contents of the second object recorded in the cache according to the content operation event includes: obtaining the content publishing time of the content operation event; if the content publishing time is later than or equal to the data reading time of the second object, updating the number of unread contents of the second object according to the content operation event; After reading the number of unread contents of the second object from the cache, the method further includes: updating a data reading time of the number of unread contents of the second object in the cache.

3. The method according to claim 1 or 2, characterized in that: The detecting the content operation event of the first object comprises: detecting each content operation event of the first object within a preset time window; The updating of the unread content quantity of the second object recorded in the cache according to the content operation event includes: after the preset time window ends, updating the unread content quantity of the second object recorded in the cache according to each content operation event detected within the preset time window.

4. The method according to claim 3, characterized in that Before detecting each content operation event of the first object within a preset time window, the method further includes: Calculating a content operation frequency of the first object; The window length of the preset time window is determined according to the content operation frequency of the first object.

5. The method according to claim 4, characterized in that The calculating the content operation frequency of the first object comprises: Obtaining a content operation frequency function of the first object within a preset time period; Dividing the preset time period into a plurality of time periods according to the inflection point of the content operation frequency function; For any time period, the content operation frequency of the time period is calculated according to the content operation frequency function; Then determining the window length of the preset time window according to the content operation frequency of the first object includes: determining the target time period of the current time, and determining the window length of the preset time window according to the content operation frequency of the first object in the target time period.

6. The method according to any one of claims 1 to 5, characterized in that The receiving a request for obtaining the number of unread contents of the second object and reading the number of unread contents of the second object from the cache comprises: receiving a content refresh request for the second object, and determining a refresh active period of the second object; If the current refresh active period is not in progress, the number of unread contents of the second object is read from the cache.

7. The method according to any one of claims 1 to 6, characterized in that The updating of the number of unread contents of the second object recorded in the cache according to the content operation event includes: If the content operation event is of the first type, increasing the number of unread contents of the second object; If the content operation event is of the second type, reducing the number of unread contents of the second object; The first type includes: publishing type and / or invisible modification to visible type; the second type includes: deletion type and / or visible modification to invisible type.

8. A device for processing the amount of unread content, characterized in that: include: A detection module, configured to detect a content operation event of the first object; An object determination module, configured to identify a second object from objects paying attention to the first object; wherein the number of objects paying attention to the second object exceeds a preset number threshold; A quantity updating module, configured to update the quantity of unread content of the second object recorded in the cache according to the content operation event; a reading module, configured to receive a request for obtaining the number of unread contents of the second object, read the number of unread contents of the second object from the cache, and feed back the read number of unread contents to the second object; The initialization module is configured to receive a content refresh request for the second object and initialize the number of unread contents of the second object in the cache.

9. A computing device, characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method for processing the number of unread contents according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for processing the number of unread contents according to any one of claims 1 to 7.

11. A computer program product, characterized in that The method comprises at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the method for processing the number of unread contents according to any one of claims 1 to 7.