Bullet screen display method and device, equipment and storage medium
By dynamically adding a barrage display method to the alternative barrage set based on the video playback progress of the target video, the timestamp and effective duration of the candidate barrage, sorting the alternative barrages according to their preset attributes, and detecting the barrage display methods from the queue in turn, the barrage display effect is optimized, the unresolved barrage display methods in the existing technology are solved, the barrage display effect is improved, the unresolved barrage display problems in the existing technology are solved, and the flexibility and effect of the barrage display are achieved.
Patent Information
- Application Number
- CN202410316798.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-19
- Publication Date
- 2025-09-19
AI Technical Summary
During video playback, when the number of barrages is large, the screen space is limited, making it difficult to achieve a good display effect, which affects the user's viewing experience.
According to the video playback progress of the target video, the target candidate barrage is determined based on the timestamp and effective duration of the candidate barrage, and added to the candidate barrage set. The candidate barrages are sorted based on their preset attributes, and the barrages are taken out of the queue one by one and checked for matching target tracks. If so, they are added to the end of the barrage track for display.
Improved the success rate of barrage display at the end of the queue when preset barrage attribute sorting is used, increased the flexibility of barrage display, and optimized the barrage display effect.
Smart Images

Figure CN120676192A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to methods, devices, equipment, and storage media for displaying bullet comments. Background Art
[0002] At present, the display of barrage is usually supported during video playback. Barrage is an instant comment on the video screen. Compared with the comment method in the comment area, barrage is more closely integrated with the playback time and screen of the video. It can be deposited on the video screen and consumed by users as the playback progresses, meeting the user's social needs for timely interaction.
[0003] However, as the number of video playbacks continues to increase, there may be a large number of barrages posted by users at the same playback time, and the screen space is limited. When the number of barrages is large, it is difficult to obtain a good display effect, which needs to be improved. Summary of the Invention
[0004] The embodiments of the present disclosure provide a bullet screen display method, apparatus, device, and storage medium, which can optimize existing bullet screen display solutions.
[0005] In a first aspect, an embodiment of the present disclosure provides a bullet screen display method, including:
[0006] According to the video playback progress of the target video, based on the timestamps and effective durations of the candidate barrages in the candidate barrage set, a target candidate barrage is determined, and the target candidate barrage is added as a new candidate barrage to the candidate barrage set;
[0007] sorting the candidate barrages in the candidate barrage set based on preset barrage attributes of the candidate barrages to obtain a candidate barrage queue;
[0008] The alternative barrage at the first end is sequentially taken out from the alternative barrage queue as the current alternative barrage, and it is detected whether there is a target barrage track matching the current alternative barrage on the screen. If so, the current alternative barrage is added to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0009] In a second aspect, the embodiments of the present disclosure further provide a bullet screen display device, including:
[0010] A barrage adding module is used to determine a target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set according to the video playback progress of the target video, and add the target candidate barrage as a new candidate barrage to the candidate barrage set;
[0011] a sorting module, configured to sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue;
[0012] The barrage display module is used to sequentially take out the alternative barrage at the first end from the alternative barrage queue as the current alternative barrage, detect whether there is a target barrage track matching the current alternative barrage on the screen, and if so, add the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the barrage display method provided by the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the barrage display method provided by an embodiment of the present disclosure.
[0018] The barrage display scheme provided by the disclosed embodiment determines the target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set according to the video playback progress of the target video, and adds the target candidate barrage as a new alternative barrage to the alternative barrage set. Based on the preset barrage attributes of the alternative barrage in the alternative barrage set, the alternative barrages are sorted to obtain an alternative barrage queue, and the alternative barrage at the first end is taken out from the alternative barrage queue in turn as the current alternative barrage. It is detected whether there is a target barrage track matching the current alternative barrage in the screen. If so, the current alternative barrage is added to the end of the target barrage track to display the current alternative barrage in the target barrage track. By adopting the above technical solution, the success rate of displaying barrages sorted at the end of the queue with preset barrage attributes can be improved, the flexibility of barrage display can be improved, and the barrage display effect can be optimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A flowchart of a bullet screen display method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of another bullet screen display method provided by an embodiment of the present disclosure;
[0022] Figure 3 A schematic structural diagram of a bullet screen display device provided in an embodiment of the present disclosure;
[0023] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0026] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0029] To facilitate understanding of the technical solutions of the embodiments of the present disclosure, the following describes related technologies. In related technologies, when a large number of bullet comments are displayed, they are not filtered. The display of a large number of bullet comments can obstruct the video content, or different bullet comments can overlap, affecting the viewing experience of the video and the bullet comments.
[0030] Figure 1 This is a schematic diagram of a barrage display process provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation where barrage display is performed during video playback. The method can be executed by a barrage display device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal such as a mobile phone, smart watch, tablet computer, and personal digital assistant, or a personal computer (PC) and other devices.
[0031] like Figure 1 As shown, the method includes:
[0032] Step 101: Determine a target candidate barrage according to the video playback progress of the target video and based on the timestamps and effective durations of the candidate barrages in the candidate barrage set, and add the target candidate barrage as a new candidate barrage to the candidate barrage set.
[0033] For example, the target video is the video currently displayed on the screen, specifically the video being played, and the video type is not limited. The video playback progress can specifically be the playback timestamp corresponding to the playback time of the target video. For example, if the target video has played for 10 seconds, the playback timestamp is 10 seconds.
[0034] Exemplarily, the candidate barrage set may include all barrages or part of the barrages posted by users of the target video. If it is a partial barrage, it may be the barrage pre-acquired by the server, or it may be the barrage obtained after filtering according to preset filtering conditions. The specific preset filtering conditions are not limited.
[0035] For example, a barrage in the candidate barrage set is recorded as a candidate barrage. Barrages are generally posted by users during video playback based on the video content and are highly correlated with the video progress. The timestamp of the barrage is the video playback progress corresponding to the time the barrage was posted. The timestamp of the candidate barrage is the video playback progress corresponding to the time the candidate barrage was posted.
[0036] Exemplarily, the barrage is strongly correlated with the video playback progress. In order to ensure the real-time performance of the barrage playback effect, the expected display time of the barrage can be determined based on the barrage timestamp. When the number of barrages is too large, it is impossible to ensure that every barrage is displayed. Therefore, the embodiment of the present disclosure sets the effective duration of the barrage. When the barrage timestamp of a barrage plus the effective duration of the barrage is greater than the video playback progress of the target video, the barrage can be considered to have expired and does not need to be displayed. Exemplarily, according to the video playback progress of the target video, the target candidate barrage is determined from the candidate barrage set based on the timestamp of the candidate barrage in the candidate barrage set and the effective duration of the barrage. For each candidate barrage in the candidate barrage set, the sum of the timestamp of the current candidate barrage and the effective duration of the barrage of the current candidate barrage is calculated to determine whether the sum is less than or equal to the playback timestamp corresponding to the video playback progress. If so, the current candidate barrage is determined as the target candidate barrage.
[0037] Exemplarily, the execution of this step can be periodically triggered by a timer task. For example, this step can be periodically triggered by a timer object (such as CADisplayLink) at a preset frequency, where the preset frequency can be set according to actual needs, such as 1 / 60 Hz or 60 Hz.
[0038] For example, the candidate barrage set can be understood as a set of barrages to be displayed on the screen corresponding to the video playback progress. The barrages in the candidate barrage set are recorded as candidate barrages. Before adding the target candidate barrage as a new candidate barrage to the candidate barrage set, the candidate barrage set may be empty or may already contain undisplayed candidate barrages, without specific limitations.
[0039] Step 102: Sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue.
[0040] Exemplarily, the preset barrage attributes may include barrage length, barrage speed, barrage font, and barrage color, etc. The preset barrage attributes may also be determined based on at least one of the following: the degree of association between the barrage content and the target video, the degree of association between the barrage content and the video content corresponding to the video playback progress, the barrage heat attribute, and the barrage publisher, etc. Optionally, the preset barrage attribute may specifically be a barrage score. The barrage score may be determined based on at least one of the following: the degree of association between the barrage content and the target video (for example, the higher the degree of association, the higher the corresponding barrage score), the degree of association between the barrage content and the video content corresponding to the video playback progress (for example, the higher the degree of association, the higher the corresponding barrage score), the barrage heat attribute (for example, the higher the heat, the higher the corresponding barrage score), and the barrage publisher (such as the score of the barrage posted by the current user is higher than the score of the barrage posted by users other than the current user), wherein the barrage heat attribute may be determined based on the number of likes and the number of replies, etc.
[0041] Exemplarily, the alternative barrages can be sorted based on the attribute values of the preset barrage attributes of the alternative barrages, and the specific sorting method can be set according to actual needs. Optionally, the alternative barrages can be sorted in descending or ascending order based on the barrage scores of the alternative barrages. Optionally, the alternative barrage at the first end of the alternative barrage queue obtained after sorting has the highest barrage score. After sorting, the alternative barrage queue is obtained, and the first end is the head or tail. Taking descending sorting as an example, the barrage with the highest score is at the head of the queue, so the first end is the head.
[0042] Step 103: Take out the alternative barrage at the first end from the alternative barrage queue in turn as the current alternative barrage, and detect whether there is a target barrage track matching the current alternative barrage on the screen. If so, add the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0043] For example, assume that after sorting, the alternative barrage queue contains 5 alternative barrages, which are recorded as barrage a, barrage b, barrage c, barrage d and barrage e, among which barrage a has the highest barrage score. Barrage a is taken out from the alternative barrage queue as the current alternative barrage, and the screen is checked to see whether there is a target barrage track that matches barrage a. If so, barrage a is added to the end of the target barrage track to display the current alternative barrage in the target barrage track, that is, barrage a is displayed after the last barrage being displayed in the target barrage track. Subsequently, since barrage a has been taken out from the alternative barrage queue, barrage b becomes the new alternative barrage at the first end, that is, barrage b is subsequently taken out from the alternative barrage queue as the current alternative barrage, and then the target barrage track corresponding to barrage b is detected.
[0044] In the disclosed embodiments, a bullet screen track is used to represent the trajectory of the bullet screen's sliding display. Generally, bullet screens on the screen are displayed row by row. To facilitate the management of the bullet screen view, each row is recorded as a bullet screen track to manage the bullet screen horizontally. A bullet screen track generally does not have a corresponding view on the screen. Different bullet screen tracks can be distinguished by the distance from the screen edge in the target direction. The target direction is the sliding direction of the bullet screen. For example, if the bullet screen slides horizontally, the target direction is the vertical direction.
[0045] In the disclosed embodiments, the specific method for detecting whether the current candidate barrage matches the barrage track is not limited. For example, whether the current candidate barrage matches the barrage track is determined based on the target barrage attributes of the current candidate barrage, which may include barrage type, barrage identifier, barrage height, barrage length, barrage font, barrage color, barrage speed, and the publisher of the barrage, etc.
[0046] The barrage display method provided by the embodiment of the present disclosure determines the target candidate barrage according to the video playback progress of the target video, based on the timestamp and effective duration of the candidate barrage in the candidate barrage set, and adds the target candidate barrage as a new alternative barrage to the alternative barrage set. Based on the preset barrage attributes of the alternative barrage in the alternative barrage set, the alternative barrages are sorted to obtain an alternative barrage queue, and the alternative barrage at the first end is taken out from the alternative barrage queue in turn as the current alternative barrage. It is detected whether there is a target barrage track matching the current alternative barrage in the screen. If so, the current alternative barrage is added to the end of the target barrage track to display the current alternative barrage in the target barrage track. By adopting the above technical solution, an effective duration is set for candidate barrages. Then, according to the target video's playback progress, new alternative barrages are dynamically added to the candidate barrage set based on the barrage timestamp and effective duration. After sorting based on preset barrage attributes, the barrages at the end of the queue are prioritized and matched to the appropriate barrage track. This improves the success rate of barrages at the end of the queue being displayed, increases the flexibility of barrage display, and optimizes the barrage display effect. If the barrages are sorted by score, the success rate of high-scoring barrages being displayed can be increased.
[0047] In some embodiments, after detecting whether there is a target barrage track that matches the current candidate barrage, the method further includes: if not, storing the current candidate barrage at the second end of the candidate barrage queue, wherein the first end is different from the second end. This provides more opportunities for the candidate barrages that are not currently matched with a suitable barrage track to be displayed on the screen, thereby increasing the probability of the barrage being displayed on the screen.
[0048] For example, for the current candidate barrage, it may be impossible to match a suitable barrage track based on the overall display of the current barrage. If the barrage is directly discarded, it will not be displayed on the screen. However, as time goes by, the overall display of the barrage may change. When it is judged again, it may be possible to match a suitable barrage track. Therefore, the current candidate barrage can be placed back to the second end of the candidate barrage queue, which is different from the first end. For example, it can be taken from the front of the queue and placed back to the back. For candidate barrages with higher preset barrage attributes, it is easier to obtain a second judgment opportunity, thereby further improving the success rate of high-scoring barrages being displayed to a certain extent.
[0049] As in the above example, if there is a target barrage track matching barrage a on the screen, barrage a can be displayed on the target barrage track on the screen, and then barrage a will no longer exist in the alternative barrage queue; if there is no target barrage track matching barrage a on the screen, barrage a can be stored at the end of the alternative barrage queue, and the alternative barrage queue at this time is barrage b, barrage c, barrage d, barrage e and barrage a.
[0050] Optionally, the effective duration of different barrages can be the same or different, and can be set according to actual needs, thereby further improving the flexibility of barrage display.
[0051] Exemplarily, the effective duration of the barrage is related to the preset barrage attributes of the barrage to which it belongs. Optionally, the effective duration of the barrage is positively correlated with the barrage score of the barrage to which it belongs. Thus, a barrage with a high preset barrage attribute can obtain a longer effective duration, thereby further improving the success rate of high-scoring barrages being displayed to a certain extent. The specific positive correlation method is not limited. For example, the effective duration of the barrage can be directly proportional to the preset barrage attributes of the barrage to which it belongs. For another example, a mapping relationship between different preset barrage attribute intervals and the effective duration of the barrage can be pre-established. The larger the maximum value of the preset barrage attribute interval, the longer the corresponding effective duration of the barrage. Specifically, assuming that the preset barrage attribute has a full score of 10 points, it can be divided into [0-3) corresponding to interval 1, [0-3) corresponding to interval 2, and [0-10] corresponding to interval 3. The effective durations of the barrage corresponding to interval 1, interval 2, and interval 3 are 1 second, 2 seconds, and 3 seconds, respectively.
[0052] Exemplarily, the effective duration of the barrage is associated with the publisher of the barrage. The publisher of the barrage can be divided into two categories, the first category is the first user (that is, the current user) who is currently viewing the target video, and the second category is the second user who is different from the first user (that is, other users who publish barrages except the current user). The effective duration of the barrage posted by the first user is longer than the effective duration of the barrage posted by the second user, thereby ensuring that the probability of the current user viewing the barrage posted by himself is improved, meeting the needs of the current user to view the barrage posted by himself. Optionally, the effective duration of the barrage posted by the first user can be infinite, that is, it will not expire.
[0053] Exemplarily, the effective duration of the barrage is positively correlated with the preset barrage attributes of the barrage to which it belongs, and is associated with the publisher of the barrage. For example, for the current barrage, if the publisher is the first user, the effective duration of the barrage is the preset duration; if the publisher is the second user, the effective duration of the barrage is positively correlated with the preset barrage attributes of the barrage to which it belongs.
[0054] In some embodiments, before adding the target candidate barrage as a new alternative barrage to the alternative barrage set, it also includes: when there are undisplayed alternative barrages in the alternative barrage set, according to the video playback progress, based on the timestamp of the undisplayed alternative barrage and the effective duration of the barrage, the expired undisplayed alternative barrage is determined, and the expired undisplayed alternative barrage is deleted from the alternative barrage set. In this way, the expired undisplayed alternative barrage in the alternative barrage set can be deleted in a timely manner, ensuring that the barrages participating in the preset barrage attribute sorting have a high degree of correlation with the video playback progress.
[0055] Exemplarily, before determining the target candidate barrage, or after determining the target candidate barrage, or in the process of determining the target candidate barrage, the operation of deleting expired and undisplayed alternative barrages is synchronously performed, and the deletion operation can also be periodically triggered by a timed task. For the case where the effective duration of the barrage is positively correlated with the preset barrage attributes of the barrage to which it belongs, and / or the effective duration of the barrage is associated with the publisher of the barrage to which it belongs, the effective duration of the barrage corresponding to each undisplayed alternative barrage in the alternative barrage set may be different. Therefore, selective deletion of undisplayed alternative barrages can be achieved based on the effective duration of the barrage, so that barrages with higher preset barrage attributes or barrages published by the current user can have a greater probability of remaining in the alternative barrage set, and participate in the sorting based on the preset barrage attributes together with the new alternative barrages that are about to be added, thereby further improving the success rate of displaying high-scoring barrages.
[0056] As in the previous example, suppose that barrage a didn't match the target barrage track the first time it became the current candidate barrage. After being stored at the end of the candidate barrage queue, it matched the target barrage track the second time it became the current candidate barrage and was displayed. Barrages b and d didn't match the target barrage track the first time they became the current candidate barrage. Barrages c and e matched the target barrage track the first time they became the current candidate barrage and were displayed. Before barrage b becomes the current alternative barrage for the second time, a new round of target candidate barrages is determined, such as barrage f, barrage g and barrage h. Before the new round of target candidate barrages are added to the alternative barrage set, there are undisplayed alternative barrages in the alternative barrage set, barrage b and barrage d. Since the preset barrage attribute of barrage b is higher and the corresponding barrage valid duration is longer, barrage b may not have expired, while the preset barrage attribute of barrage d is lower and the corresponding barrage valid duration is shorter, barrage d may have expired. Therefore, barrage d is deleted from the alternative barrage set, and then barrage f, barrage g and barrage h are added to the alternative barrage set. Then, based on the preset barrage attributes, barrage b, barrage f, barrage g and barrage h are sorted. For example, barrage b, barrage g, barrage f and barrage h are obtained. At this time, barrage b can become the current alternative barrage first and get more opportunities to be displayed on the screen.
[0057] Figure 2 This is a flow chart of another bullet screen display method provided by an embodiment of the present disclosure. The present disclosure embodiment is optimized based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:
[0058] Step 201: Determine a target candidate barrage according to the video playback progress of the target video and based on the timestamps and effective durations of the candidate barrages in the candidate barrage set.
[0059] The effective duration of the barrage is positively correlated with the preset barrage attributes of the barrage, and / or the effective duration of the barrage is associated with the publisher of the barrage.
[0060] Exemplarily, when the target video starts playing, this step can be automatically started, and the timer can be started to periodically determine the target candidate barrage. Specifically, the timer can be a CADisplayLink. When the target video starts playing, the timer is started, and the barrage data distribution and barrage view update are implemented through the timer. The barrage data distribution may include looking for suitable barrage content to add to the screen during the high-frequency callback process of the timer, including from determining the target candidate barrage to adding the current candidate barrage with a matching target barrage track to the end of the target barrage track. The barrage view update includes high-frequency updates to the display position of the barrage view displayed on the screen, such as updating the display position of the barrage at the same frequency as the screen refresh frequency (such as 60Hz), thereby achieving a smooth and silky scrolling effect, and also includes removing the barrage view that has completed the move from the screen. When the timer reaches the time corresponding to the set period, this step can be triggered again.
[0061] Step 202: If there are undisplayed alternative barrages in the alternative barrage set, determine the expired undisplayed alternative barrages based on the timestamp and effective duration of the undisplayed alternative barrages according to the video playback progress, and delete the expired undisplayed alternative barrages from the alternative barrage set.
[0062] Step 203: Add the target candidate barrage as a new candidate barrage to the candidate barrage set.
[0063] Step 204: Sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue.
[0064] The candidate barrage at the first end of the candidate barrage queue obtained after sorting has the highest attribute value of the preset barrage attribute. Optionally, the queue is sorted in descending order, with the first end being the head.
[0065] Step 205: sequentially take out the candidate barrage at the first end from the candidate barrage queue as the current candidate barrage.
[0066] Step 206 : Detect whether there is a target bullet screen track that matches the current candidate bullet screen. If so, execute step 207 ; otherwise, execute step 208 .
[0067] Optionally, this step may include: sequentially traversing each barrage track on the screen, and if no barrage currently being displayed exists in the current barrage track, determining the current barrage track as the target barrage track that matches the current candidate barrage; if all barrage tracks on the screen have barrages currently being displayed, sequentially traversing each barrage track on the screen, and if a preset collision detection method predicts that the last barrage currently being displayed in the current barrage track will not collide with the current candidate barrage, determining the current barrage track as the target barrage track that matches the current candidate barrage. This ensures that barrages on the screen do not collide during movement, thereby improving the barrage display effect.
[0068] For example, in landscape mode, the bullet track can be a horizontal track, and the order of traversal can be from top to bottom. Assuming there are three bullet tracks, first determine whether the top bullet track does not have any bullets currently being displayed. If not, then determine that bullet track as the target bullet track. If so, continue to determine the next two bullet tracks until a target bullet track is found that does not have any bullets currently being displayed, or if all bullet tracks have bullets currently being displayed, then determine the target bullet track based on subsequent collision detection.
[0069] For example, the current alternative barrage is recorded as the first barrage (referred to as barrage A). For a barrage track where a barrage is being displayed, the last barrage being displayed in the barrage track is found and recorded as the second barrage (referred to as barrage B). It is determined whether barrage A can be added after barrage B so that barrage A will not collide with barrage B during the display of barrage A and barrage B.
[0070] For example, the movement speeds of barrage A and barrage B are calculated separately, recorded as the first speed V1 and the second speed V2 respectively. Assume that the total display time of the barrage on the screen is the preset display time T (such as the time difference from the appearance of the first character of the barrage to the disappearance of the last character of the barrage), the screen width is W, the length of barrage A is L1, the length of barrage B is L2, the distance between barrage B and the left edge of the screen is D (assuming the barrage moves from right to left, the distance between the last character of barrage B and the left edge of the screen), and the remaining display time of barrage B on the screen is T1. V1 = (W + L1) / T, V2 = (W + L2) / T. If V1 is greater than or equal to V2, it means that barrage A cannot catch up with barrage B and no collision will occur. If V1 is less than V2, further judgment is required. For example, the minimum distance M between bullet screen A and bullet screen B without collision is calculated, M = T1*(V2-V1). If D is greater than or equal to M, no collision will occur. Otherwise, a collision is predicted and bullet screen A cannot be added to the bullet screen track.
[0071] Step 207 : Add the current candidate barrage to the end of the target barrage track to display the current candidate barrage in the target barrage track, and then execute step 209 .
[0072] Step 208: Store the current candidate barrage into the second end of the candidate barrage queue.
[0073] The first end is different from the second end, for example, the first end is the head and the second end is the tail.
[0074] Step 209 , determine whether the timer is triggered to determine a new target candidate bullet comment. If so, return to step 201 ; otherwise, execute step 210 .
[0075] For example, before taking the next barrage from the alternative barrage queue, it is first determined whether a new target candidate barrage is triggered. If so, a new target candidate barrage is determined, and the timeliness of the undisplayed alternative barrages in the alternative barrage set is judged, and expired alternative barrages are deleted.
[0076] Step 210 : Determine whether there are any remaining candidate bullet comments in the candidate bullet comment queue. If so, execute step 205 ; otherwise, return to execute step 209 .
[0077] Exemplarily, if the reordering is not performed, the process may return to step 205 , retrieve the candidate bullet comment at the head of the queue again, and perform matching on the target bullet comment track.
[0078] In the disclosed embodiment, the process may be terminated when the candidate barrage set is empty or the target video is finished playing.
[0079] The barrage display method provided by the embodiment of the present disclosure sets an effective duration for the barrage, and the effective duration of the barrage is positively correlated with the preset barrage attributes of the barrage, and / or is associated with the publisher of the barrage. According to the video playback progress of the target video, a new alternative barrage is dynamically determined based on the barrage timestamp and the effective duration of the barrage. Before the new alternative barrage is added to the alternative barrage set, the expired barrage that has not been displayed in the alternative barrage set is dynamically deleted based on the barrage timestamp and the effective duration of the barrage. After the new alternative barrage is added to the alternative barrage set, the alternative barrages in the alternative barrage set are sorted in descending order based on the preset barrage attributes, and priority is given to trying to match a suitable barrage track for the barrage with a high score. If the target barrage track is matched, it is displayed. If not, it is put back into the queue to increase the chance of obtaining a secondary match, effectively improve the success rate of displaying high-scoring barrages, improve the flexibility of barrage display, and optimize the barrage display effect.
[0080] In some embodiments, the candidate barrage set is stored locally, and the method further includes: determining whether there is a candidate barrage corresponding to the video playback progress in the candidate barrage set; if not, sending a barrage acquisition request to the server to obtain the barrage within a preset time range, and storing the acquired barrage in the candidate barrage set, wherein the start time of the preset time range is determined according to the video playback progress, and the end time is determined according to the sum of the start time and the preset duration, and the preset duration is greater than the effective duration of the barrage. In this way, it is possible to avoid the situation where all barrages are acquired at once, which easily causes the request to fail, and the barrages are acquired in batches and stored locally. The range of the barrage acquired each time is reasonably determined according to the video playback progress and the preset duration greater than the effective duration of the barrage, which can avoid the instability of the service and the waste of resources caused by frequent network requests.
[0081] Exemplarily, the candidate barrage corresponding to the video playback progress can specifically be data within the range of timestamps obtained by adding the first duration to the timestamp corresponding to the video playback progress, and the first duration is, for example, 1 second. When the target video starts playing, the timer is started, and every second duration (such as 1 second) it is determined whether it is necessary to send a barrage acquisition request to the server to try to pull the barrage data. Each time, n seconds of barrage data are pulled. Assuming n is 32, when pulling for the first time, the video playback progress is recorded as nowTime, nowTime is 0, and barrages from 0 seconds to 32 seconds are pulled and stored in the candidate barrage set. The latest timestamp of the candidate barrages that already exist in the candidate barrage set is recorded as endTime. When the target video plays to 1 second, nowTime is 1. It is determined whether there are candidate barrages within 1 second to 2 seconds in the candidate barrage set. If it exists at this time, then this polling ends. For example, it is determined whether nowTime is less than endTime. If it is less than, it exists. When the target video plays to 32 seconds, determine whether there is a candidate barrage between 32 and 33 seconds in the candidate barrage set. At this time, it does not exist. For example, determine whether nowTime is greater than or equal to endTime. If it is, it does not exist. If it does not exist, send a barrage acquisition request to the server to obtain the barrage between 32 and 64 seconds, that is, the barrage within [nowTime, nextTime), nextTime = nowTime + n, and store the obtained barrage in the candidate barrage set, and modify the new endTime = nextTime.
[0082] In some embodiments, the sending of a barrage acquisition request to the server includes: determining whether the last sent barrage acquisition request was successful; if unsuccessful, sending a barrage acquisition request to the server at target duration intervals until the request is successful, wherein the target duration increases with the number of times the barrage acquisition request is sent. Thus, when it is necessary to send a barrage acquisition request, first determine whether the last sent barrage acquisition request was successful, and dynamically determine the timing of sending the barrage acquisition request based on the judgment result. If the last time was unsuccessful, it indicates that there may be an abnormality in the server. As the number of requests sent increases, the time interval between the two requests is gradually increased, thereby alleviating the pressure on the server and facilitating the server to quickly return to normal.
[0083] Exemplarily, the target duration may increase exponentially with the number of times the barrage acquisition request is sent. For example, the target duration is 2 to the power of m, where m is the number of times the barrage acquisition request is sent, and the specific value may be 0, 1, 2, etc.
[0084] Figure 3 This is a structural diagram of a bullet screen display device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the device includes:
[0085] The barrage adding module 301 is used to determine a target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set according to the video playback progress of the target video, and add the target candidate barrage as a new candidate barrage to the candidate barrage set;
[0086] A sorting module 302 is configured to sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue;
[0087] The barrage display module 303 is used to sequentially take out the alternative barrage at the first end from the alternative barrage queue as the current alternative barrage, detect whether there is a target barrage track matching the current alternative barrage on the screen, and if so, add the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0088] The barrage display device provided by the embodiment of the present disclosure sets an effective duration for the candidate barrage, and then dynamically adds new alternative barrages to the alternative barrage set based on the barrage timestamp and the effective duration of the barrage according to the video playback progress of the target video. After sorting based on the preset barrage attributes, it prioritizes trying to match the end barrage to the appropriate barrage track, thereby improving the success rate of the end barrage being displayed, increasing the flexibility of the barrage display, and optimizing the barrage display effect.
[0089] Optionally, the device may further include: a barrage storage module, which is used to detect whether there is a target barrage track that matches the current alternative barrage, and if not, store the current alternative barrage into the second end of the alternative barrage queue, where the first end is different from the second end.
[0090] Optionally, the effective duration of the barrage is related to the preset barrage attributes of the barrage, and / or the effective duration of the barrage is associated with the publisher of the barrage.
[0091] Optionally, the device also includes: a barrage deletion module, which is used to, before adding the target candidate barrage as a new alternative barrage to the alternative barrage set, also include: in the case that there are undisplayed alternative barrages in the alternative barrage set, according to the video playback progress, determine the expired undisplayed alternative barrage based on the timestamp of the undisplayed alternative barrage and the effective duration of the barrage, and delete the expired undisplayed alternative barrage from the alternative barrage set.
[0092] Optionally, the detection of whether there is a target barrage track in the screen that matches the current alternative barrage includes: traversing each barrage track in the screen in turn, and if there is no barrage being displayed in the current barrage track, determining the current barrage track as the target barrage track that matches the current alternative barrage; if there are barrages being displayed in each barrage track in the screen, traversing each barrage track in the screen in turn, and if it is predicted according to a preset collision detection method that the last barrage being displayed in the current barrage track will not collide with the current alternative barrage, then determining the current barrage track as the target barrage track that matches the current alternative barrage.
[0093] Optionally, the candidate barrage set is stored locally, and the device further includes:
[0094] A candidate barrage judgment module is used to judge whether there is a candidate barrage corresponding to the video playback progress in the candidate barrage set;
[0095] The barrage request module is used to send a barrage acquisition request to the server when the judgment result of the candidate barrage judgment module is no, so as to obtain the barrage within a preset time range, and store the obtained barrage in the candidate barrage set, wherein the starting time of the preset time range is determined according to the video playback progress, and the end time is determined according to the sum of the starting time and the preset duration, and the preset duration is greater than the effective duration of the barrage.
[0096] Optionally, sending a barrage acquisition request to the server includes: determining whether the last barrage acquisition request sent was successful; if not, sending a barrage acquisition request to the server every target duration until the request is successful, wherein the target duration increases with the number of times the barrage acquisition request is sent.
[0097] The barrage display device provided in the embodiments of the present disclosure can execute the barrage display method provided in any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
[0098] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0099] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 4 , which shows an electronic device (eg Figure 4The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0100] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An edit / output (I / O) interface 405 is also connected to the bus 404.
[0101] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0102] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0103] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0104] The electronic device provided by the embodiment of the present disclosure and the barrage display method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0105] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the bullet screen display method provided by the above embodiment is implemented.
[0106] An embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the bullet screen display method provided in the above embodiment.
[0107] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0108] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0109] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0110] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines the target candidate barrage according to the video playback progress of the target video, based on the timestamp and effective duration of the candidate barrage in the candidate barrage set, and adds the target candidate barrage as a new alternative barrage to the alternative barrage set; sorts the alternative barrages based on the preset barrage attributes of the alternative barrages in the alternative barrage set to obtain an alternative barrage queue; sequentially takes out the alternative barrage at the first end from the alternative barrage queue as the current alternative barrage, detects whether there is a target barrage track matching the current alternative barrage on the screen, and if so, adds the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0111] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] The units involved in the embodiments described in the present disclosure can be implemented by software or by hardware. The name of the module does not constitute a limitation on the module itself under certain circumstances. For example, the barrage adding module can also be described as "a module that determines the target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set and adds the target candidate barrage as a new alternative barrage to the alternative barrage set according to the video playback progress of the target video."
[0114] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0115] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] According to one or more embodiments of the present disclosure, a bullet screen display method is provided, including:
[0117] According to the video playback progress of the target video, based on the timestamps and effective durations of the candidate barrages in the candidate barrage set, a target candidate barrage is determined, and the target candidate barrage is added as a new candidate barrage to the candidate barrage set;
[0118] sorting the candidate barrages in the candidate barrage set based on preset barrage attributes of the candidate barrages to obtain a candidate barrage queue;
[0119] The alternative barrage at the first end is sequentially taken out from the alternative barrage queue as the current alternative barrage, and it is detected whether there is a target barrage track matching the current alternative barrage on the screen. If so, the current alternative barrage is added to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0120] After detecting whether there is a target bullet comment track that matches the current candidate bullet comment, the method further includes:
[0121] If not, the current candidate barrage is stored in the second end of the candidate barrage queue, and the first end is different from the second end.
[0122] According to one or more embodiments of the present disclosure, the effective duration of the barrage is related to the preset barrage attributes of the barrage, and / or, the effective duration of the barrage is associated with the publisher of the barrage.
[0123] According to one or more embodiments of the present disclosure, before adding the target candidate barrage as a new candidate barrage to the candidate barrage set, the method further includes:
[0124] In the case that there are undisplayed alternative barrages in the alternative barrage set, according to the video playback progress, the expired undisplayed alternative barrages are determined based on the timestamp and effective duration of the undisplayed alternative barrages, and the expired undisplayed alternative barrages are deleted from the alternative barrage set.
[0125] According to one or more embodiments of the present disclosure, detecting whether there is a target barrage track matching the current candidate barrage on the screen includes:
[0126] Traversing each barrage track on the screen in sequence, if the barrage currently being displayed does not exist in the current barrage track, determining the current barrage track as the target barrage track that matches the current candidate barrage;
[0127] If there are barrages being displayed on each barrage track on the screen, then each barrage track on the screen is traversed in turn. If it is predicted that the last barrage being displayed in the current barrage track will not collide with the current alternative barrage based on the preset collision detection method, then the current barrage track is determined as the target barrage track that matches the current alternative barrage.
[0128] According to one or more embodiments of the present disclosure, the candidate barrage set is stored locally, and the method further includes:
[0129] Determine whether there is a candidate barrage corresponding to the video playback progress in the candidate barrage set;
[0130] If not, a barrage acquisition request is sent to the server to obtain the barrage within the preset time range, and the obtained barrage is stored in the candidate barrage set, wherein the start time of the preset time range is determined according to the video playback progress, and the end time is determined according to the sum of the start time and the preset duration, and the preset duration is greater than the effective duration of the barrage.
[0131] According to one or more embodiments of the present disclosure, the sending of a bullet comment acquisition request to the server includes:
[0132] Determine whether the last sent request to obtain the bullet comment was successful;
[0133] If unsuccessful, a bullet comment acquisition request is sent to the server at target durations until the request is successful, wherein the target duration increases with the number of times the bullet comment acquisition request is sent.
[0134] According to one or more embodiments of the present disclosure, a bullet screen display device is provided, comprising:
[0135] A barrage adding module is used to determine a target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set according to the video playback progress of the target video, and add the target candidate barrage as a new candidate barrage to the candidate barrage set;
[0136] a sorting module, configured to sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue;
[0137] The barrage display module is used to sequentially take out the alternative barrage at the first end from the alternative barrage queue as the current alternative barrage, detect whether there is a target barrage track matching the current alternative barrage on the screen, and if so, add the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
[0138] According to one or more embodiments of the present disclosure, there is provided an electronic device, including:
[0139] one or more processors;
[0140] a storage device for storing one or more programs,
[0141] When the one or more programs are executed by the one or more processors, the one or more processors implement the barrage display method provided by the embodiment of the present disclosure.
[0142] According to one or more embodiments of the present disclosure, a storage medium containing computer-executable instructions is provided. When the computer-executable instructions are executed by a computer processor, they are used to execute the barrage display method provided by the embodiments of the present disclosure.
[0143] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0144] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0145] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A bullet screen display method, characterized in that: include: According to the video playback progress of the target video, based on the timestamps and effective durations of the candidate barrages in the candidate barrage set, a target candidate barrage is determined, and the target candidate barrage is added as a new candidate barrage to the candidate barrage set; sorting the candidate barrages in the candidate barrage set based on preset barrage attributes of the candidate barrages to obtain a candidate barrage queue; The alternative barrage at the first end is sequentially taken out from the alternative barrage queue as the current alternative barrage, and it is detected whether there is a target barrage track matching the current alternative barrage on the screen. If so, the current alternative barrage is added to the end of the target barrage track to display the current alternative barrage in the target barrage track.
2. The method according to claim 1, characterized in that After detecting whether there is a target bullet comment track that matches the current candidate bullet comment, the method further includes: If not, the current candidate barrage is stored in the second end of the candidate barrage queue, and the first end is different from the second end.
3. The method according to claim 1, characterized in that The effective duration of the barrage is related to the preset barrage attributes of the barrage, and / or the effective duration of the barrage is associated with the publisher of the barrage.
4. The method according to claim 1, wherein Before adding the target candidate bullet comment as a new candidate bullet comment to the candidate bullet comment set, the method further includes: In the case that there are undisplayed alternative barrages in the alternative barrage set, according to the video playback progress, the expired undisplayed alternative barrages are determined based on the timestamp and effective duration of the undisplayed alternative barrages, and the expired undisplayed alternative barrages are deleted from the alternative barrage set.
5. The method according to claim 1, wherein The detecting whether there is a target bullet screen track that matches the current candidate bullet screen includes: Traversing each barrage track on the screen in sequence, if the barrage currently being displayed does not exist in the current barrage track, determining the current barrage track as the target barrage track that matches the current candidate barrage; If there are barrages being displayed on each barrage track on the screen, then each barrage track on the screen is traversed in turn. If it is predicted that the last barrage being displayed in the current barrage track will not collide with the current alternative barrage based on the preset collision detection method, then the current barrage track is determined as the target barrage track that matches the current alternative barrage.
6. The method according to any one of claims 1 to 5, characterized in that: The candidate barrage set is stored locally, and the method further includes: Determine whether there is a candidate barrage corresponding to the video playback progress in the candidate barrage set; If not, a barrage acquisition request is sent to the server to obtain the barrage within the preset time range, and the obtained barrage is stored in the candidate barrage set, wherein the start time of the preset time range is determined according to the video playback progress, and the end time is determined according to the sum of the start time and the preset duration, and the preset duration is greater than the effective duration of the barrage.
7. The method according to claim 6, characterized in that The sending of a bullet comment acquisition request to the server includes: Determine whether the last sent request to obtain the bullet comment was successful; If unsuccessful, a bullet comment acquisition request is sent to the server at target durations until the request is successful, wherein the target duration increases with the number of times the bullet comment acquisition request is sent.
8. A bullet screen display device, characterized in that: include: A barrage adding module is used to determine a target candidate barrage based on the timestamp and effective duration of the candidate barrage in the candidate barrage set according to the video playback progress of the target video, and add the target candidate barrage as a new candidate barrage to the candidate barrage set; a sorting module, configured to sort the candidate barrages in the candidate barrage set based on their preset barrage attributes to obtain a candidate barrage queue; The barrage display module is used to sequentially take out the alternative barrage at the first end from the alternative barrage queue as the current alternative barrage, detect whether there is a target barrage track matching the current alternative barrage on the screen, and if so, add the current alternative barrage to the end of the target barrage track to display the current alternative barrage in the target barrage track.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the barrage display method as described in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to execute the bullet screen display method as described in any one of claims 1 to 7.