A live broadcast bullet screen refreshing method and device
Patent Information
- Application Number
- CN202211439595.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-11-17
AI Technical Summary
[0003]但是,目前直播的弹幕互动中弹幕刷新方案仍有待优化,以改善用户的观看体验和互动体验
[0055]In this application, when the timer reaches the current refresh time, the current number of bullet comments refreshed and the current animation time are obtained. Based on the current number of bullet comments refreshed, a first bullet comment object is retrieved from the cache pool and rendered. Based on the current animation time, the bullet comment animation corresponding to the rendered first bullet comment object is displayed in the bullet comment display area. Then, it is determined whether an adjustment instruction has been received. If so, at least one of the current refresh time, the current number of bullet comments refreshed, and the current animation time is adjusted based on the adjustment instruction. The process then returns to the previous step of obtaining the current number of bullet comments refreshed and the current animation time when the timer reaches the current refresh time. This process adjusts the current refresh time, the current number of bullet comments refreshed, and the current animation time until the current display effect reaches the set display effect, obtaining high-quality current refresh time, the current number of bullet comments refreshed, and the current animation time. The bullet comments are then refreshed to ensure a more natural and stable refresh, improving the user's viewing and interactive experience.
Smart Images

Figure CN115714887B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video technology, and more specifically, to a method and apparatus for refreshing live stream bullet comments. Background Technology
[0002] Currently, live streaming has been applied to many scenarios and fields. Among them, excellent live streaming content and interactive bullet comments can bring users a very good viewing and interactive experience.
[0003] However, the bullet screen refresh scheme in live streaming still needs to be optimized to improve the user's viewing and interaction experience. Summary of the Invention
[0004] To address the above problems, this application provides the following technical solution:
[0005] A method for refreshing live stream comments includes:
[0006] If the timer reaches the current refresh time, obtain the current number of bullet comments and the current animation time;
[0007] Based on the current number of bullet comments refreshed, obtain the first bullet comment object from the cache pool;
[0008] Render the first bullet screen object, and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time;
[0009] Determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect does not meet the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends.
[0010] If so, based on the adjustment instruction, at least one of the current timed refresh time, the current refreshed number of bullet comments, and the current animation time shall be adjusted, and the process shall return to the step of obtaining the current bullet comment refresh number and the current bullet comment animation time if the timed duration reaches the current timed refresh time.
[0011] If not, obtain a new bullet screen object from the cache pool, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen object in the updated cache pool.
[0012] Optionally, after retrieving the bullet comment object from the cache pool, the following may also be included:
[0013] Determine the remaining space of the cache pool and display the remaining space of the cache pool;
[0014] The adjustment instruction is generated at least when the current display effect does not reach the set display effect, including: the adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold;
[0015] Based on the adjustment instruction, at least one of the following should be adjusted: the current timed refresh time, the current refreshed number of bullet comments, and the current animation time, including:
[0016] Based on the adjustment instruction, at least one of the following is adjusted: the current timed refresh time, the current number of refreshed bullet comments, and the current animation time, as well as the space of the cache pool.
[0017] Optionally, a new bullet screen object is obtained from the cache pool, the cache pool is updated based on the new bullet screen object, and the bullet screen is refreshed based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen objects in the updated cache pool, including:
[0018] Retrieve a new bullet screen object from the cache pool;
[0019] Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit;
[0020] If not, write the new bullet screen object into the cache pool to obtain the updated cache pool;
[0021] If so, based on the discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool;
[0022] If the new timeout period reaches the current timeout refresh time, the second bullet screen object is retrieved from the updated cache pool based on the current number of bullet screen refreshes.
[0023] The second bullet screen object is rendered, and the bullet screen animation corresponding to the rendered second bullet screen object is displayed in the bullet screen display area based on the current animation time.
[0024] Optionally, based on a discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool, including:
[0025] Based on a first-in, first-out (FIFO) strategy, delete at least one bullet screen object that entered the cache pool first.
[0026] Optionally, the method further includes:
[0027] Determine whether the number of rendered bullet screen objects in memory has reached the set rendering threshold;
[0028] If so, delete a set number of rendered bullet screen objects from the memory.
[0029] Optionally, the method further includes:
[0030] If the number of rendered bullet screen objects in memory has not reached the set rendering threshold, determine whether the sum of the number of rendered bullet screen objects in memory and the current bullet screen refresh count reaches the set rendering threshold.
[0031] Based on the current number of bullet comments refreshed and the set rendering quantity threshold, the quantity to be used is determined;
[0032] Delete the number of rendered bullet screen objects to be used from the memory.
[0033] A live stream bullet comment refresh device, comprising:
[0034] The first acquisition module is used to acquire the current number of bullet comments and the current animation time if the timer duration reaches the current timer refresh time.
[0035] The second acquisition module is used to acquire the first bullet screen object from the cache pool based on the current number of bullet screen refreshes;
[0036] The first display module is used to render the first bullet screen object and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time.
[0037] The first determining module is used to determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect has not reached the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends.
[0038] The adjustment module is used to, upon receiving an adjustment instruction, adjust at least one of the current timed refresh time, the current refreshed number of bullet comments, and the current animation time based on the adjustment instruction, and return to execute the step of obtaining the current bullet comment refresh count and the current bullet comment animation time if the timed duration reaches the current timed refresh time;
[0039] The refresh module is used to obtain a new bullet screen object from the cache pool if no adjustment instruction is received, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen objects in the updated cache pool.
[0040] Optionally, the device further includes:
[0041] The second determining module is used to determine the remaining space of the cache pool;
[0042] The second display module is used to display the remaining space of the cache pool;
[0043] The adjustment instruction is generated at least when the current display effect does not reach the set display effect, including: the adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold;
[0044] The adjustment module is specifically used for:
[0045] Based on the adjustment instruction, at least one of the following is adjusted: the current timed refresh time, the current number of refreshed bullet comments, and the current animation time, as well as the space of the cache pool.
[0046] Optionally, the refresh module is specifically used for:
[0047] Retrieve a new bullet screen object from the cache pool;
[0048] Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit;
[0049] If not, write the new bullet screen object into the cache pool to obtain the updated cache pool;
[0050] If so, based on the discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool;
[0051] If the new timeout period reaches the current timeout refresh time, the second bullet screen object is retrieved from the updated cache pool based on the current number of bullet screen refreshes.
[0052] The second bullet screen object is rendered, and the bullet screen animation corresponding to the rendered second bullet screen object is displayed in the bullet screen display area based on the current animation time.
[0053] Optionally, the process by which the refresh module deletes some bullet screen objects from the cache pool based on a discard strategy to obtain an updated cache pool specifically includes:
[0054] Based on a first-in, first-out (FIFO) strategy, delete at least one bullet screen object that entered the cache pool first.
[0055] In this application, when the timer reaches the current refresh time, the current number of bullet comments refreshed and the current animation time are obtained. Based on the current number of bullet comments refreshed, a first bullet comment object is retrieved from the cache pool and rendered. Based on the current animation time, the bullet comment animation corresponding to the rendered first bullet comment object is displayed in the bullet comment display area. Then, it is determined whether an adjustment instruction has been received. If so, at least one of the current refresh time, the current number of bullet comments refreshed, and the current animation time is adjusted based on the adjustment instruction. The process then returns to the previous step of obtaining the current number of bullet comments refreshed and the current animation time when the timer reaches the current refresh time. This process adjusts the current refresh time, the current number of bullet comments refreshed, and the current animation time until the current display effect reaches the set display effect, obtaining high-quality current refresh time, the current number of bullet comments refreshed, and the current animation time. The bullet comments are then refreshed to ensure a more natural and stable refresh, improving the user's viewing and interactive experience. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0057] Figure 1 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 1 of this application;
[0058] Figure 2 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 2 of this application;
[0059] Figure 3 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 3 of this application;
[0060] Figure 4 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 4 of this application;
[0061] Figure 5 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 5 of this application;
[0062] Figure 6 This is a structural schematic diagram of a live streaming bullet screen refresh device provided in this application. Detailed Implementation
[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0064] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0065] Reference Figure 1 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 1 of this application. Figure 1 As shown, the method may include, but is not limited to, the following steps:
[0066] Step S11: If the timer reaches the current refresh time, obtain the current number of bullet comments and the current animation time.
[0067] In this embodiment, a timer mechanism can be set so that whenever the timer duration reaches the current timer refresh time, the current number of bullet comments refreshed and the current animation time are obtained, so that the current number of bullet comments refreshed and the current animation time are obtained once every current timer refresh time.
[0068] In this embodiment, the current timed refresh time can be the initial timed refresh time, or it can be the timed refresh time after adjusting the initial timed refresh time.
[0069] Understandably, if the current refresh interval is shorter, it is less likely to ensure that users can view all the bullet comments in each refresh. If the current refresh interval is longer, it can ensure that users can view all the bullet comments in each refresh, but it may cause the bullet comments cached in the cache pool to be discarded, resulting in some bullet comments not appearing on the screen.
[0070] The current bullet comment refresh count can be understood as the number of bullet comment objects that need to be rendered to the bullet comment display area on the screen each time a refresh occurs. The current bullet comment refresh count can be the initial bullet comment refresh count, or it can be the bullet comment refresh count after adjusting the initial bullet comment refresh count.
[0071] The more bullet comments are refreshed, the greater the overall displacement of the bullet comment objects that need to be rendered each time. When the overall displacement exceeds the height of the bullet comment display area on the screen, some bullet comment objects will not be visible in the bullet comment display area. However, it should be noted that if these bullet comment objects are not deleted from memory, they can be scrolled into the bullet comment display area by swiping the screen.
[0072] The current bullet screen animation time can be understood as the display duration of the bullet screen animation corresponding to the bullet screen object that needs to be displayed each time it is refreshed.
[0073] The longer the current bullet screen animation duration, the slower the bullet screen object moves within the bullet screen display area; the shorter the current bullet screen animation duration, the faster the bullet screen object moves within the bullet screen display area.
[0074] The current bullet screen animation time can be the initial bullet screen animation time, or it can be the bullet screen animation time after adjusting the initial bullet screen animation time.
[0075] Step S12: Based on the current number of bullet comments refreshed, obtain the first bullet comment object from the cache pool.
[0076] In this embodiment, two cache pools can be set up, but are not limited to: one cache pool for storing user-sent bullet comment objects with no maximum cache limit, and another cache pool for storing bullet comment objects sent by other users. User-sent bullet comments are displayed first and are not subject to the discarding policy. Bullet comments sent by other users are sorted according to the time they entered the cache pool and are subject to the discarding policy.
[0077] In this embodiment, the bullet screen objects in the cache pool are issued by the server.
[0078] In this embodiment, a first-in, first-out (FIFO) retrieval strategy can be used, but is not limited to, retrieving the first bullet comment object that entered the cache pool first. The number of first bullet comment objects retrieved is consistent with the current bullet comment refresh count. For example, if the current bullet comment refresh count is 20 and the cache pool contains 30 bullet comment objects, then the 20 first bullet comment objects that entered the cache pool first are retrieved from the 30 bullet comment objects.
[0079] It should be noted that the first bullet comment object to enter the cache pool is not limited to: at the same time, the first bullet comment object to enter the cache pool can also be multiple bullet comment objects that enter the cache pool in chronological order, and these multiple bullet comment objects that enter the cache pool in chronological order must have entered the cache pool earlier than other bullet comment objects.
[0080] Step S13: Render the first bullet screen object and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time.
[0081] The animation for the first rendered bullet comment object can be, but is not limited to, a vertical animation for the bullet comment object. A vertical animation for the bullet comment object causes it to move from top to bottom or from bottom to top.
[0082] Step S14: Determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect does not meet the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends.
[0083] It is understood that the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends is the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area during the time period from the end of the bullet screen animation to the start of the next refresh. For example, if the current timed refresh time is 2 seconds, the current animation time is 0.5 seconds, the refresh start time is 10:00:01, the bullet screen animation lasts from 10:00:01 to 10:00:01:05, and the next refresh start time is 10:00:03, then the duration of the rendered first bullet screen object being statically displayed in the bullet screen display area is 1.5 seconds, that is, the rendered first bullet screen object is statically displayed in the bullet screen display area between 10:00:01:05 and 10:00:03.
[0084] The display settings can include, but are not limited to: the animation effects of the bullet screen animation meet the animation requirements, and the proportion of the number of bullet screen objects statically displayed in the bullet screen display area to the number of bullet screen refreshes is greater than the set proportion threshold.
[0085] If yes, proceed to step S15; otherwise, proceed to step S16.
[0086] Step S15: Based on the adjustment instruction, adjust at least one of the current timed refresh time, the current refreshed bullet screen quantity, and the current animation time, and return to execute step S11.
[0087] It is understood that, after adjusting at least one of the current timed refresh time, the current refreshed number of bullet comments, and the current animation time based on the adjustment instruction, and then returning to execute step S11, at least one of the current timed refresh time, the current refreshed number of bullet comments, and the current bullet comment animation time in step S11 is the adjusted current timed refresh time, the adjusted current refreshed number of bullet comments, or the adjusted current bullet comment animation time.
[0088] Step S16: Obtain a new bullet screen object from the cache pool, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen object in the updated cache pool.
[0089] It is understood that the current timed refresh time, the current number of bullet comments refreshed, and the current bullet comment animation time mentioned in this step may be the current timed refresh time, the current number of bullet comments refreshed, and the current bullet comment animation time without adjustment. Of course, they may also be the adjusted current timed refresh time and / or the adjusted current number of bullet comments refreshed and / or the adjusted current bullet comment animation time.
[0090] In this embodiment, refreshing the bullet comments based on the current timed refresh time, the current number of bullet comments refreshed, the current bullet comment animation time, and the bullet comment objects in the updated cache pool can include, but is not limited to:
[0091] S161. If the timer reaches the current refresh time, obtain the current number of bullet comments and the current animation time.
[0092] S162. Based on the current number of bullet comments refreshed, obtain the second bullet comment object from the updated cache pool.
[0093] This step can be performed in the manner described in step S12, whereby the second bullet screen object is obtained from the updated cache pool based on the current number of bullet screen refreshes, which will not be elaborated here.
[0094] S163. Render the second bullet screen object, and display the bullet screen animation corresponding to the rendered second bullet screen object in the bullet screen display area based on the current animation time.
[0095] This step can be performed in the manner described in step S13, based on the current animation time, by displaying the rendered second bullet screen object corresponding to the bullet screen animation in the bullet screen display area, which will not be elaborated here.
[0096] In this embodiment, when the timer reaches the current refresh time, the current number of bullet comments refreshed and the current animation time are obtained. Based on the current number of bullet comments refreshed, a first bullet comment object is retrieved from the cache pool and rendered. Based on the current animation time, the bullet comment animation corresponding to the rendered first bullet comment object is displayed in the bullet comment display area. Then, it is determined whether an adjustment instruction has been received. If so, at least one of the current refresh time, the current number of bullet comments refreshed, and the current animation time is adjusted based on the adjustment instruction. The process then returns to the previous steps of obtaining the current number of bullet comments refreshed and the current animation time when the timer reaches the current refresh time. This process adjusts the current refresh time, the current number of bullet comments refreshed, and the current animation time until the current display effect reaches the set display effect, obtaining high-quality current refresh time, the current number of bullet comments refreshed, and the current animation time. The bullet comments are then refreshed to ensure a more natural and stable refresh, improving the user's viewing and interactive experience.
[0097] As another optional embodiment of this application, refer to Figure 2 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 2 of this application. This embodiment is mainly an extension of the live stream bullet comment refresh method described in Embodiment 1 above, such as... Figure 2 As shown, the method may include, but is not limited to, the following steps:
[0098] Step S21: If the timer reaches the current refresh time, obtain the current number of bullet comments and the current animation time.
[0099] Step S22: Based on the current number of bullet comments refreshed, obtain the first bullet comment object from the cache pool.
[0100] Step S23: Render the first bullet screen object and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time.
[0101] For detailed procedures of steps S21-S23, please refer to the relevant description of steps S11-S13 in Example 1, which will not be repeated here.
[0102] Step S24: Determine the remaining space of the cache pool and display the remaining space of the cache pool.
[0103] In this embodiment, the difference between the space of the cache pool and the current number of bullet screen refreshes can be used as the remaining space of the cache pool, and the remaining space of the cache pool can be displayed so that users can obtain the remaining space of the cache pool.
[0104] Step S25: Determine whether an adjustment instruction has been received. The adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends.
[0105] If yes, proceed to step S26; otherwise, proceed to step S27.
[0106] Step S26: Based on the adjustment instruction, adjust at least one of the current timed refresh time, the current refresh barrage number, and the current animation time, as well as the space of the cache pool.
[0107] Step S26 is a specific implementation of step S15 in Example 1.
[0108] Step S27: Obtain a new bullet screen object from the cache pool, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen object in the updated cache pool.
[0109] For a detailed description of step S27, please refer to the relevant description of step S16 in Example 1, which will not be repeated here.
[0110] In this embodiment, if the timer reaches the current refresh time, the current number of bullet comments refreshed and the current animation time are obtained. Based on the current number of bullet comments refreshed, a first bullet comment object is retrieved from the cache pool and rendered. Based on the current animation time, the bullet comment animation corresponding to the rendered first bullet comment object is displayed in the bullet comment display area. Then, it is determined whether an adjustment instruction has been received. If so, at least one of the current refresh time, the current number of bullet comments refreshed, and the current animation time, as well as the space in the cache pool, are adjusted based on the adjustment instruction. The process then returns to the previous steps of obtaining the current number of bullet comments refreshed and the current animation time if the timer reaches the current refresh time. This process adjusts the current refresh time, the current number of bullet comments refreshed, and the current animation time until the current display effect reaches the set display effect and the remaining space in the cache pool reaches the set space threshold. This obtains high-quality current refresh time, the current number of bullet comments refreshed, and the current animation time, and then refreshes the bullet comments to ensure a more natural and stable refresh, thus improving the user's viewing and interactive experience.
[0111] As another optional embodiment of this application, refer to Figure 3 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 3 of this application. This embodiment mainly refines step S16 in Embodiment 1 above, such as... Figure 3 As shown, step S16 may include, but is not limited to, the following steps:
[0112] Step S1611: Obtain a new bullet screen object from the cache pool.
[0113] Step S1612: Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit.
[0114] In this embodiment, a maximum limit can be set in conjunction with the refresh scheme. For example, if the optimal timed refresh time is 1 second and the number of bullet comments refreshed in a single refresh is 20, the maximum limit of the cache pool can be set to 30. Each refresh retrieves 20 bullet comment objects from the cache pool for refresh and releases 20 from the cache pool. This ensures that the cache pool has sufficient space while refreshing the maximum number of bullet comment objects.
[0115] If not, proceed to step S163; if yes, proceed to step S164.
[0116] Step S1613: Write the new bullet screen object into the cache pool to obtain the updated cache pool.
[0117] Step S1614: Delete some bullet screen objects from the cache pool based on the discard strategy to obtain the updated cache pool.
[0118] This step may include, but is not limited to, deleting at least one bullet screen object that entered the cache pool first from the cache pool based on a first-in-first-out (FIFO) strategy.
[0119] Step S1615: If the new timing duration reaches the current timed refresh time, obtain the second bullet screen object from the updated cache pool based on the current number of bullet screen refreshes.
[0120] This step can be performed in the manner described in step S12, whereby the second bullet screen object is obtained from the updated cache pool based on the current number of bullet screen refreshes, which will not be elaborated here.
[0121] Step S1616: Render the second bullet screen object. Based on the current animation time, display the bullet screen animation corresponding to the rendered second bullet screen object in the bullet screen display area.
[0122] This step can be performed in the manner described in step S13, based on the current animation time, by displaying the rendered second bullet screen object corresponding to the bullet screen animation in the bullet screen display area, which will not be elaborated here.
[0123] In this embodiment, by determining whether the number of bullet screen objects in the cache pool has reached the maximum limit, if not, the new bullet screen object is written into the cache pool to obtain an updated cache pool; if so, some bullet screen objects are deleted from the cache pool based on a discard policy to obtain an updated cache pool. This ensures that the bullet screen objects refreshed next time are the latest received, guaranteeing the timeliness of the bullet screens, and also prevents the cache from increasing indefinitely and wasting device memory space.
[0124] As another optional embodiment of this application, refer to Figure 4 This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 4 of this application. This embodiment mainly refines step S16 in Embodiment 3 above, such as... Figure 4 As shown, step S16 may include, but is not limited to, the following steps:
[0125] Step S1621: Obtain a new bullet screen object from the cache pool.
[0126] Step S1622: Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit.
[0127] If not, proceed to step S1623; if yes, proceed to step S1624.
[0128] Step S1623: Write the new bullet screen object into the cache pool to obtain the updated cache pool;
[0129] Step S1624: Delete some bullet screen objects from the cache pool based on the discard strategy to obtain the updated cache pool.
[0130] For a detailed description of steps S1621-S1624, please refer to the relevant description of steps S1611-S1614 in Example 3, which will not be repeated here.
[0131] Step S1625: Determine whether the number of rendered bullet screen objects in memory has reached the set rendering threshold.
[0132] The rendering quantity threshold can be set as needed and is not limited in this application. For example, the rendering quantity threshold can be, but is not limited to, 200.
[0133] If so, proceed to step S1626.
[0134] Step S1626: Delete a set number of rendered bullet screen objects from the memory.
[0135] The set quantity can be set as needed and is not limited in this application. For example, in an implementation where the threshold for the number of renderings is set to 200, the set quantity can be, but is not limited to, 100.
[0136] Step S1627: If the new timing duration reaches the current timed refresh time, obtain the second bullet screen object from the updated cache pool based on the current number of bullet screen refreshes.
[0137] Step S1628: Render the second bullet screen object. Based on the current animation time, display the bullet screen animation corresponding to the rendered second bullet screen object in the bullet screen display area.
[0138] In this embodiment, by determining whether the number of rendered bullet screen objects in memory has reached a set rendering threshold, if so, a set number of rendered bullet screen objects are deleted from the memory to free up memory space and save memory resources.
[0139] As another optional embodiment of this application, refer to Figure 5This is a flowchart illustrating a live stream bullet comment refresh method provided in Embodiment 5 of this application. This embodiment mainly refines step S16 in Embodiment 3 above, such as... Figure 5 As shown, step S16 may include, but is not limited to, the following steps:
[0140] Step S1631: Obtain a new bullet screen object from the cache pool.
[0141] Step S1632: Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit.
[0142] If not, proceed to step S1633; if yes, proceed to step S1634.
[0143] Step S1633: Write the new bullet screen object into the cache pool to obtain the updated cache pool;
[0144] Step S1634: Delete some bullet screen objects from the cache pool based on the discard strategy to obtain the updated cache pool.
[0145] For a detailed description of steps S1631-S1634, please refer to the relevant description of steps S1611-S1614 in Example 3, which will not be repeated here.
[0146] Step S1635: Determine whether the number of rendered bullet screen objects in memory has reached the set rendering threshold.
[0147] If yes, proceed to step S1636; otherwise, proceed to step S1637.
[0148] Step S1636: Delete a set number of rendered bullet screen objects from the memory.
[0149] Step S1637: Determine whether the sum of the number of rendered bullet screen objects in the memory and the current number of bullet screen refreshes reaches the set rendering number threshold.
[0150] If so, proceed to step S1638.
[0151] Step S1638: Determine the number of bullet comments to be used based on the current number of bullet comments refreshed and the set rendering number threshold.
[0152] This step may include, but is not limited to, using the difference between the set rendering quantity threshold and the current bullet screen refresh quantity as the quantity to be used.
[0153] Step S1639: Delete the number of rendered bullet screen objects to be used from the memory.
[0154] Step S16310: If the new timing duration reaches the current timed refresh time, obtain the second bullet screen object from the updated cache pool based on the current bullet screen refresh count.
[0155] Step S16311: Render the second bullet screen object. Based on the current animation time, display the bullet screen animation corresponding to the rendered second bullet screen object in the bullet screen display area.
[0156] The following describes the live stream barrage refresh device provided in this application. The live stream barrage refresh device described below can be referred to in correspondence with the live stream barrage refresh method described above.
[0157] Please see Figure 6 The live stream bullet screen refresh device includes: a first acquisition module 100, a second acquisition module 200, a first display module 300, a first confirmation module 400, an adjustment module 500, and a refresh module 600.
[0158] The first acquisition module 100 is used to acquire the current number of bullet comments and the current animation time if the timer duration reaches the current timed refresh time.
[0159] The second acquisition module 200 is used to acquire the first bullet screen object from the cache pool based on the current number of bullet screen refreshes.
[0160] The first display module 300 is used to render the first bullet screen object and, based on the current animation time, display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area.
[0161] The first determining module 400 is used to determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect has not reached the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends.
[0162] The adjustment module 500 is used to, upon receiving an adjustment instruction, adjust at least one of the current timed refresh time, the current refreshed number of bullet comments, and the current animation time based on the adjustment instruction, and return to execute the step of obtaining the current bullet comment refresh count and the current bullet comment animation time if the timed duration reaches the current timed refresh time.
[0163] The refresh module 600 is used to obtain a new bullet screen object from the cache pool if no adjustment instruction is received, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen object in the updated cache pool.
[0164] In this embodiment, the above-mentioned device may further include:
[0165] The second determining module is used to determine the remaining space of the cache pool;
[0166] The second display module is used to display the remaining space of the cache pool;
[0167] The adjustment instruction is generated at least when the current display effect does not reach the set display effect, including: the adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold;
[0168] The adjustment module 500 can be specifically used for:
[0169] Based on the adjustment instruction, at least one of the following is adjusted: the current timed refresh time, the current number of refreshed bullet comments, and the current animation time, as well as the space of the cache pool.
[0170] In this embodiment, the refresh module 600 can be specifically used for:
[0171] Retrieve a new bullet screen object from the cache pool;
[0172] Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit;
[0173] If not, write the new bullet screen object into the cache pool to obtain the updated cache pool;
[0174] If so, based on the discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool;
[0175] If the new timeout period reaches the current timeout refresh time, the second bullet screen object is retrieved from the updated cache pool based on the current number of bullet screen refreshes.
[0176] The second bullet screen object is rendered, and the bullet screen animation corresponding to the rendered second bullet screen object is displayed in the bullet screen display area based on the current animation time.
[0177] The process by which the refresh module 600 deletes a portion of the bullet screen objects from the cache pool based on a discard strategy to obtain an updated cache pool may specifically include:
[0178] Based on a first-in, first-out (FIFO) strategy, delete at least one bullet screen object that entered the cache pool first.
[0179] In this embodiment, the refresh module 600 can also be used for:
[0180] Determine whether the number of rendered bullet screen objects in memory has reached the set rendering threshold;
[0181] If so, delete a set number of rendered bullet screen objects from the memory.
[0182] In this embodiment, the refresh module 600 can also be used for:
[0183] If the number of rendered bullet screen objects in memory has not reached the set rendering threshold, determine whether the sum of the number of rendered bullet screen objects in memory and the current bullet screen refresh count reaches the set rendering threshold.
[0184] Based on the current number of bullet comments refreshed and the set rendering quantity threshold, the quantity to be used is determined;
[0185] Delete the number of rendered bullet screen objects to be used from the memory.
[0186] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0187] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for refreshing live stream comments, characterized in that, include: If the timer reaches the current refresh time, obtain the current number of bullet comments and the current animation time; Based on the current number of bullet comments refreshed, obtain the first bullet comment object from the cache pool; Render the first bullet screen object, and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time; Determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect does not meet the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends. If so, based on the adjustment instruction, at least one of the current timed refresh time, the current number of bullet comments refreshed, and the current animation time shall be adjusted, and the process shall return to the step of obtaining the current number of bullet comments refreshed and the current bullet comment animation time if the timed duration reaches the current timed refresh time. If not, obtain a new bullet screen object from the cache pool, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen object in the updated cache pool.
2. The method according to claim 1, characterized in that, After retrieving the first bullet comment object from the cache pool, the process also includes: Determine the remaining space of the cache pool and display the remaining space of the cache pool; The adjustment instruction is generated at least when the current display effect does not reach the set display effect, including: the adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold; Based on the adjustment instruction, at least one of the following should be adjusted: the current timed refresh time, the current number of bullet comments refreshed, and the current animation time, including: Based on the adjustment instruction, at least one of the following is adjusted: the current timed refresh time, the current number of bullet comments refreshed, and the current animation time, as well as the space of the cache pool.
3. The method according to claim 1, characterized in that, Obtain a new bullet comment object from the cache pool, update the cache pool based on the new bullet comment object, and refresh the bullet comment based on the current timed refresh time, the current number of bullet comments refreshed, the current bullet comment animation time, and the bullet comment objects in the updated cache pool, including: Retrieve a new bullet screen object from the cache pool; Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit; If not, write the new bullet screen object into the cache pool to obtain the updated cache pool; If so, based on the discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool; If the new timeout period reaches the current timeout refresh time, the second bullet screen object is retrieved from the updated cache pool based on the current number of bullet screen refreshes. The second bullet screen object is rendered, and the bullet screen animation corresponding to the rendered second bullet screen object is displayed in the bullet screen display area based on the current animation time.
4. The method according to claim 3, characterized in that, Based on a discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool, including: Based on a first-in, first-out (FIFO) strategy, delete at least one bullet screen object that entered the cache pool first.
5. The method according to claim 3, characterized in that, The method further includes: Determine whether the number of rendered bullet screen objects in memory has reached the set rendering threshold; If so, delete a set number of rendered bullet screen objects from the memory.
6. The method according to claim 5, characterized in that, The method further includes: If the number of rendered bullet screen objects in memory has not reached the set rendering threshold, determine whether the sum of the number of rendered bullet screen objects in memory and the current bullet screen refresh count reaches the set rendering threshold. Based on the current number of bullet comments refreshed and the set rendering quantity threshold, the quantity to be used is determined; Delete the number of rendered bullet screen objects to be used from the memory.
7. A live stream bullet screen refresh device, characterized in that, include: The first acquisition module is used to acquire the current number of bullet comments and the current animation time if the timer duration reaches the current timer refresh time. The second acquisition module is used to acquire the first bullet screen object from the cache pool based on the current number of bullet screen refreshes; The first display module is used to render the first bullet screen object and display the bullet screen animation corresponding to the rendered first bullet screen object in the bullet screen display area based on the current animation time. The first determining module is used to determine whether an adjustment instruction has been received. The adjustment instruction is generated at least when the current display effect has not reached the set display effect. The current display effect includes the display effect corresponding to the bullet screen animation and the effect of the rendered first bullet screen object being statically displayed in the bullet screen display area after the bullet screen animation ends. The adjustment module is used to, upon receiving an adjustment instruction, adjust at least one of the current timed refresh time, the current number of bullet comments refreshed, and the current animation time based on the adjustment instruction, and return to execute the step of obtaining the current number of bullet comments refreshed and the current bullet comment animation time if the timed duration reaches the current timed refresh time; The refresh module is used to obtain a new bullet screen object from the cache pool if no adjustment instruction is received, update the cache pool based on the new bullet screen object, and refresh the bullet screen based on the current timed refresh time, the current number of bullet screen refreshes, the current bullet screen animation time, and the bullet screen objects in the updated cache pool.
8. The apparatus according to claim 7, characterized in that, The device further includes: The second determining module is used to determine the remaining space of the cache pool; The second display module is used to display the remaining space of the cache pool; The adjustment instruction is generated at least when the current display effect does not reach the set display effect, including: the adjustment instruction is generated when the current display effect does not reach the set display effect and the remaining space of the cache pool does not reach the set space threshold; The adjustment module is specifically used for: Based on the adjustment instruction, at least one of the following is adjusted: the current timed refresh time, the current number of bullet comments refreshed, and the current animation time, as well as the space of the cache pool.
9. The apparatus according to claim 7, characterized in that, The refresh module is specifically used for: Retrieve a new bullet screen object from the cache pool; Determine whether the number of bullet screen objects in the cache pool has reached the maximum limit; If not, write the new bullet screen object into the cache pool to obtain the updated cache pool; If so, based on the discard strategy, some bullet screen objects are deleted from the cache pool to obtain an updated cache pool; If the new timeout period reaches the current timeout refresh time, the second bullet screen object is retrieved from the updated cache pool based on the current number of bullet screen refreshes. The second bullet screen object is rendered, and the bullet screen animation corresponding to the rendered second bullet screen object is displayed in the bullet screen display area based on the current animation time.
10. The apparatus according to claim 9, characterized in that, The process by which the refresh module deletes a portion of the bullet screen objects from the cache pool based on a discard strategy to obtain an updated cache pool specifically includes: Based on a first-in, first-out (FIFO) strategy, delete at least one bullet screen object that entered the cache pool first.
Citation Information
Patent Citations
Bullet screen processing method and system based on WeChat applet
CN111031376A
Information pushing and displaying method and device, electronic equipment and storage medium
CN114554271A